/* ==================== CSS O'ZGARUVCHILARI ==================== */
:root {
    --bg-primary: #fafbfc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f0f2f5;
    --text-primary: #1a1a2e;
    --text-secondary: #5a5d7a;
    --text-muted: #8b8fa3;
    --accent: #7c3aed;
    --accent-light: #a78bfa;
    --accent-dark: #5b21b6;
    --accent-gradient: linear-gradient(135deg, #7c3aed 0%, #a855f7 50%, #6366f1 100%);
    --card-bg: #ffffff;
    --card-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 8px 40px rgba(0,0,0,0.06);
    --card-shadow-hover: 0 4px 12px rgba(0,0,0,0.08), 0 16px 60px rgba(0,0,0,0.1);
    --border: #e2e5ea;
    --border-light: #f0f2f5;
    --input-bg: #f8f9fb;
    --input-focus: #ffffff;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-primary: #0f1119;
    --bg-secondary: #1a1d2e;
    --bg-tertiary: #242840;
    --text-primary: #e4e7f0;
    --text-secondary: #a0a5c0;
    --text-muted: #6b7094;
    --accent: #8b5cf6;
    --accent-light: #a78bfa;
    --accent-dark: #7c3aed;
    --accent-gradient: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 50%, #818cf8 100%);
    --card-bg: #1a1d2e;
    --card-shadow: 0 1px 3px rgba(0,0,0,0.2), 0 8px 40px rgba(0,0,0,0.3);
    --card-shadow-hover: 0 4px 12px rgba(0,0,0,0.3), 0 16px 60px rgba(0,0,0,0.4);
    --border: #2a2f45;
    --border-light: #1f2438;
    --input-bg: #242840;
    --input-focus: #2a2f45;
}

/* ==================== RESET ==================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, 'Helvetica Neue', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: background-color var(--transition), color var(--transition);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ==================== FON DEKORATSIYALARI ==================== */
.bg-decoration {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bg-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
    animation: floatShape 20s ease-in-out infinite;
}

.bg-shape-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-light) 0%, transparent 70%);
    top: -200px;
    right: -150px;
    opacity: 0.15;
}

.bg-shape-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #6366f1 0%, transparent 70%);
    bottom: -200px;
    left: -150px;
    opacity: 0.1;
    animation-delay: -10s;
}

@keyframes floatShape {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.05); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* ==================== HEADER ==================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: all var(--transition);
}

.header-inner {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 24px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.site-logo {
    text-decoration: none;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.header-nav {
    display: flex;
    gap: 6px;
}

.nav-link {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-secondary);
    transition: all var(--transition);
}

.nav-link:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-link.active {
    background: var(--accent);
    color: #ffffff;
}

.user-balance-header {
    background: var(--accent-gradient);
    color: #ffffff;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
}

.theme-switch {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-tertiary);
    cursor: pointer;
    transition: all var(--transition);
    color: var(--text-primary);
    text-decoration: none;
}

.theme-switch:hover {
    border-color: var(--accent);
    transform: scale(1.05);
}

/* ==================== TUGMALAR ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    text-decoration: none;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent-gradient);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.4);
}

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

.btn-outline:hover {
    background: var(--accent);
    color: #ffffff;
    transform: translateY(-2px);
}

.btn-success {
    background: var(--success);
    color: #ffffff;
}

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

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 17px;
}

.btn-logout {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    color: var(--danger);
    border: 1px solid var(--danger);
    transition: all var(--transition);
}

.btn-logout:hover {
    background: var(--danger);
    color: #ffffff;
}

/* ==================== ASOSIY KONTENT ==================== */
.main-content {
    position: relative;
    z-index: 1;
    max-width: 1300px;
    margin: 0 auto;
    padding: 32px 24px;
    min-height: calc(100vh - 200px);
}

/* ==================== KARTALAR ==================== */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 28px;
    border: 1px solid var(--border);
    box-shadow: var(--card-shadow);
    transition: all var(--transition);
}

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

.card-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

.card-header h2 {
    font-size: 22px;
    font-weight: 700;
}

.card-header p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
}

/* ==================== STAT KARTALAR ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border);
    box-shadow: var(--card-shadow);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent-gradient);
}

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

.stat-value {
    font-size: 36px;
    font-weight: 900;
    letter-spacing: -1px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 6px;
}

/* ==================== FORMA ELEMENTLARI ==================== */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 6px;
    color: var(--text-primary);
    letter-spacing: 0.3px;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    background: var(--input-bg);
    color: var(--text-primary);
    transition: all var(--transition);
    outline: none;
    font-family: inherit;
}

.form-input:focus {
    border-color: var(--accent);
    background: var(--input-focus);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.08);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ==================== ALERT XABARLAR ==================== */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 500;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

[data-theme="dark"] .alert-error {
    background: #2d1b1b;
    color: #fca5a5;
    border-color: #4a1d1d;
}

[data-theme="dark"] .alert-success {
    background: #1b2d1f;
    color: #86efac;
    border-color: #1d4a28;
}

/* ==================== FAB TUGMALAR ==================== */
.support-fab,
.developer-fab {
    position: fixed;
    z-index: 99;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--card-shadow);
    transition: all var(--transition);
    cursor: pointer;
    text-decoration: none;
}

.support-fab {
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    background: var(--accent-gradient);
    color: #ffffff;
}

.support-fab:hover {
    transform: scale(1.1);
    box-shadow: var(--card-shadow-hover);
}

.developer-fab {
    bottom: 90px;
    right: 24px;
    width: 42px;
    height: 42px;
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border);
    font-size: 12px;
}

.developer-fab:hover {
    border-color: var(--accent);
    transform: scale(1.1);
}

/* ==================== FOOTER ==================== */
.site-footer {
    position: relative;
    z-index: 1;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 18px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.footer-inner {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ==================== AUTH SAHIFALAR ==================== */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    z-index: 1;
}

.auth-card {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border);
    width: 100%;
    max-width: 460px;
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header .site-logo {
    font-size: 28px;
    margin-bottom: 8px;
    display: block;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ==================== MASALA JADVALI ==================== */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
}

th, td {
    padding: 14px 18px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
}

th {
    background: var(--bg-tertiary);
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: var(--bg-tertiary);
}

/* ==================== MODAL ==================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    backdrop-filter: blur(4px);
}

.modal {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    padding: 32px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 25px 80px rgba(0,0,0,0.2);
    border: 1px solid var(--border);
}

.modal h3 {
    font-size: 20px;
    margin-bottom: 16px;
}

/* ==================== MOBIL MOSLASHUV ==================== */
@media (max-width: 768px) {
    .header-inner {
        height: auto;
        flex-wrap: wrap;
        padding: 12px 16px;
        gap: 10px;
    }
    
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .header-nav {
        width: 100%;
        overflow-x: auto;
        gap: 4px;
        padding-bottom: 4px;
    }
    
    .nav-link {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .main-content {
        padding: 20px 12px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .auth-card {
        padding: 24px;
    }
    
    .card {
        padding: 18px;
    }
    
    .support-fab {
        bottom: 16px;
        right: 16px;
        width: 48px;
        height: 48px;
    }
    
    .developer-fab {
        bottom: 72px;
        right: 16px;
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .btn {
        padding: 10px 18px;
        font-size: 13px;
    }
    
    table {
        font-size: 12px;
    }
    
    th, td {
        padding: 10px 12px;
    }
}