/* ========== ROOT VARIABLES ========== */
:root {
    --primary: #4F46E5;
    --primary-dark: #3730A3;
    --primary-light: #818CF8;
    --secondary: #10B981;
    --secondary-dark: #059669;
    --danger: #EF4444;
    --warning: #F59E0B;
    --dark: #1F2937;
    --gray-900: #111827;
    --gray-800: #1F2937;
    --gray-700: #374151;
    --gray-600: #4B5563;
    --gray-500: #6B7280;
    --gray-400: #9CA3AF;
    --gray-300: #D1D5DB;
    --gray-200: #E5E7EB;
    --gray-100: #F3F4F6;
    --gray-50: #F9FAFB;
    --white: #FFFFFF;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.1), 0 10px 10px rgba(0,0,0,0.04);
    --shadow-2xl: 0 25px 50px rgba(0,0,0,0.25);
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========== RESET & BASE ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    direction: rtl;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.app-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--gray-50);
    position: relative;
    box-shadow: var(--shadow-2xl);
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar {
    width: 4px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 10px;
}

/* ========== ANIMATIONS ========== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.animate-fadeInUp {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

.animate-fadeInDown {
    animation: fadeInDown 0.5s ease forwards;
}

.animate-scaleIn {
    animation: scaleIn 0.3s ease forwards;
}

.animate-slideInRight {
    animation: slideInRight 0.4s ease forwards;
    opacity: 0;
}

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }

/* ========== HEADER ========== */
.app-header {
    background: var(--white);
    padding: 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(20px);
}

.app-header.admin { 
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
}
.app-header.mayor { 
    background: linear-gradient(135deg, #8E2DE2 0%, #4A00E0 100%);
    color: white;
}
.app-header.citizen { 
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    color: white;
}
.app-header.operator { 
    background: linear-gradient(135deg, #059669 0%, #10B981 100%);
    color: white;
}
.app-header.provider { 
    background: linear-gradient(135deg, #DC2626 0%, #F97316 100%);
    color: white;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-title h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 2px;
}

.header-title p {
    font-size: 12px;
    opacity: 0.85;
}

.header-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    border: 2px solid rgba(255,255,255,0.3);
}

/* ========== WALLET CARD ========== */
.wallet-card {
    background: var(--white);
    margin: 16px;
    padding: 24px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.wallet-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--warning));
}

.wallet-label {
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 8px;
    font-weight: 500;
}

.wallet-amount {
    font-size: 36px;
    font-weight: 800;
    color: var(--gray-900);
    letter-spacing: -0.5px;
}

.wallet-amount span {
    font-size: 16px;
    color: var(--gray-500);
    margin-right: 4px;
}

/* ========== STATS GRID ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 0 16px 16px;
}

.stat-card {
    background: var(--white);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-card .stat-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.stat-card .stat-number {
    font-size: 28px;
    font-weight: 800;
    color: var(--gray-900);
}

.stat-card .stat-label {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 4px;
}

.stat-card.accent-blue { border-top: 3px solid var(--primary); }
.stat-card.accent-green { border-top: 3px solid var(--secondary); }
.stat-card.accent-orange { border-top: 3px solid var(--warning); }
.stat-card.accent-purple { border-top: 3px solid #8B5CF6; }

/* ========== CARDS ========== */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--gray-100);
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-900);
}

/* ========== FORM ELEMENTS ========== */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
    background: var(--white);
    color: var(--gray-900);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-input.error {
    border-color: var(--danger);
    background: #FEF2F2;
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.97);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-warning {
    background: var(--warning);
    color: var(--gray-900);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--gray-300);
    color: var(--gray-700);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-block {
    width: 100%;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 16px;
    border-radius: var(--radius-lg);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
}

/* Ripple effect */
.btn .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    animation: ripple 0.6s linear;
}

/* ========== TABS ========== */
.tabs-container {
    background: var(--white);
    padding: 4px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin: 16px;
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-item {
    flex: 1;
    padding: 10px 16px;
    text-align: center;
    text-decoration: none;
    color: var(--gray-500);
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius);
    transition: var(--transition);
    white-space: nowrap;
    position: relative;
}

.tab-item.active {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.tab-item:hover:not(.active) {
    color: var(--primary);
    background: var(--gray-100);
}

/* ========== SERVICE CARDS ========== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.service-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.service-card .service-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 12px;
}

.service-card .service-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.service-card .service-desc {
    font-size: 11px;
    color: var(--gray-500);
    margin-bottom: 8px;
    line-height: 1.5;
}

.service-card .service-price {
    font-size: 16px;
    font-weight: 800;
    color: var(--primary);
}

.service-card .service-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--secondary);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
}

/* ========== ALERTS ========== */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: fadeInDown 0.3s ease;
}

.alert-success {
    background: #ECFDF5;
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.alert-error {
    background: #FEF2F2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

.alert-warning {
    background: #FFFBEB;
    color: #92400E;
    border: 1px solid #FDE68A;
}

.alert-info {
    background: #EFF6FF;
    color: #1E40AF;
    border: 1px solid #BFDBFE;
}

/* ========== BADGES ========== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.badge-primary { background: #E0E7FF; color: #3730A3; }
.badge-success { background: #D1FAE5; color: #065F46; }
.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-danger { background: #FEE2E2; color: #991B1B; }
.badge-info { background: #DBEAFE; color: #1E40AF; }

/* ========== LIST ITEMS ========== */
.list-item {
    background: var(--white);
    padding: 16px;
    border-radius: var(--radius);
    margin-bottom: 8px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border-right: 3px solid transparent;
}

.list-item:hover {
    box-shadow: var(--shadow-md);
    border-right-color: var(--primary);
}

.list-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.list-item-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--gray-900);
}

.list-item-subtitle {
    font-size: 12px;
    color: var(--gray-500);
}

/* ========== BOTTOM NAVIGATION ========== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    display: flex;
    justify-content: space-around;
    padding: 12px 8px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
    z-index: 1000;
    border-top: 1px solid var(--gray-200);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: var(--gray-400);
    font-size: 10px;
    font-weight: 500;
    transition: var(--transition);
    padding: 6px 12px;
    border-radius: var(--radius);
}

.nav-item .nav-icon {
    font-size: 22px;
    transition: var(--transition);
}

.nav-item.active {
    color: var(--primary);
}

.nav-item.active .nav-icon {
    transform: scale(1.15);
}

.nav-item:hover {
    color: var(--primary);
    background: var(--gray-100);
}

/* ========== MODAL ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 24px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    animation: scaleIn 0.3s ease;
    box-shadow: var(--shadow-2xl);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--gray-100);
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--gray-200);
}

/* ========== QR SCANNER ========== */
.qr-scanner-area {
    background: var(--gray-900);
    border-radius: var(--radius-xl);
    padding: 32px;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-bottom: 16px;
}

.qr-scanner-area video {
    width: 100%;
    border-radius: var(--radius);
}

.qr-scanner-frame {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    border: 3px solid var(--primary);
    border-radius: var(--radius);
    box-shadow: 0 0 0 1000px rgba(0,0,0,0.5);
}

/* ========== SKELETON LOADING ========== */
.skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius);
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
}

.skeleton-title {
    height: 20px;
    width: 60%;
    margin-bottom: 12px;
}

.skeleton-card {
    height: 120px;
    margin-bottom: 12px;
}

/* ========== EMPTY STATE ========== */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--gray-400);
}

.empty-state .empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state .empty-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 8px;
}

.empty-state .empty-desc {
    font-size: 13px;
    color: var(--gray-400);
}

/* ========== PULSE DOT ========== */
.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--secondary);
    display: inline-block;
    position: relative;
}

.pulse-dot::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--secondary);
    animation: pulse 1.5s infinite;
}

/* ========== CONTENT AREA ========== */
.content-area {
    padding: 16px;
    padding-bottom: 100px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 480px) {
    .app-container {
        max-width: 100%;
    }
    
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .wallet-amount {
        font-size: 28px;
    }
}

/* ========== LOGIN PAGE ========== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: var(--white);
    border-radius: var(--radius-2xl);
    padding: 40px 32px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-2xl);
    animation: fadeInUp 0.6s ease;
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo .logo-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin-bottom: 16px;
    box-shadow: 0 10px 30px rgba(79, 70, 229, 0.3);
}

.login-logo h1 {
    font-size: 24px;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.login-logo p {
    font-size: 13px;
    color: var(--gray-500);
}

/* ========== UTILITY ========== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.p-0 { padding: 0; }
.p-2 { padding: 8px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.w-full { width: 100%; }
.hidden { display: none; }
.relative { position: relative; }  
/* ========== QUICK STATS (برای داشبورد شهرداری) ========== */
.quick-stat {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 18px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--gray-100);
}

.quick-stat:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.quick-stat:active {
    transform: scale(0.97);
}

.quick-stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.quick-stat-info {
    flex: 1;
    min-width: 0;
}

.quick-stat-info .qs-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--gray-900);
    line-height: 1.2;
}

.quick-stat-info .qs-label {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 3px;
    font-weight: 500;
}  
