/* ============================================
   Padhai App — Professional Dark Theme
   ============================================ */

:root {
    --primary: #6366F1;
    --primary-dark: #4F46E5;
    --primary-light: #A5B4FC;
    --accent: #06B6D4;
    --accent-light: #67E8F9;
    --success: #10B981;
    --success-dark: #059669;
    --warning: #F59E0B;
    --danger: #EF4444;
    --bg: #030712;
    --bg-subtle: #0A0F1E;
    --bg-card: #111827;
    --bg-card-hover: #1F2937;
    --bg-input: #0F172A;
    --text: #F9FAFB;
    --text-secondary: #D1D5DB;
    --text-muted: #9CA3AF;
    --text-dim: #6B7280;
    --border: rgba(255,255,255,0.06);
    --border-hover: rgba(255,255,255,0.12);
    --gradient-primary: linear-gradient(135deg, #6366F1 0%, #818CF8 100%);
    --gradient-accent: linear-gradient(135deg, #06B6D4 0%, #10B981 100%);
    --gradient-warm: linear-gradient(135deg, #F59E0B 0%, #EF4444 100%);
    --gradient-success: linear-gradient(135deg, #10B981 0%, #34D399 100%);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --shadow: 0 4px 24px rgba(0,0,0,0.4);
    --nav-height: 64px;
    --top-bar-height: 56px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

[lang="hi"] body, .lang-hi {
    font-family: 'Noto Sans Devanagari', 'Inter', sans-serif;
}

/* ============================================
   TOP BAR
   ============================================ */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--top-bar-height);
    background: rgba(3, 7, 18, 0.9);
    backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 100;
}

.top-bar.hidden { display: none; }

.logo-small {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    background: linear-gradient(135deg, #818CF8, #67E8F9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.top-xp {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--warning);
    font-size: 0.8rem;
    font-weight: 600;
}

.top-streak {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--danger);
}

.streak-fire { font-size: 1rem; }

/* ============================================
   BOTTOM NAVIGATION
   ============================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: rgba(3, 7, 18, 0.95);
    backdrop-filter: blur(24px) saturate(180%);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav.hidden { display: none; }

.nav-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 12px;
    text-decoration: none;
    color: var(--text-dim);
    font-size: 0.65rem;
    font-weight: 500;
    transition: all 0.2s;
    min-width: 56px;
    min-height: 44px;
    justify-content: center;
    letter-spacing: 0.01em;
}

.nav-tab.active { color: var(--primary-light); }
.nav-tab svg { transition: transform 0.2s; }
.nav-tab.active svg { transform: scale(1.1); }

/* ============================================
   MAIN CONTENT
   ============================================ */
.app-content {
    min-height: 100vh;
    padding-bottom: calc(var(--nav-height) + 16px);
}

.app-content.with-topbar {
    padding-top: var(--top-bar-height);
}

.page {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px 16px;
}

.page-wide { max-width: 600px; }

/* ============================================
   AUTH PAGES
   ============================================ */
.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    position: relative;
}

.auth-page::before {
    content: '';
    position: absolute;
    top: -20%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99,102,241,0.08) 0%, transparent 70%);
    pointer-events: none;
}

.auth-logo {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #818CF8, #67E8F9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 6px;
    letter-spacing: -0.03em;
    position: relative;
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 28px;
    position: relative;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 32px 28px;
    position: relative;
}

.auth-card h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 24px;
    text-align: center;
    letter-spacing: -0.02em;
}

/* Role Selection */
.role-selector {
    display: flex;
    gap: 4px;
    background: rgba(255,255,255,0.03);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.role-option {
    flex: 1;
    padding: 10px 12px;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.role-option.active {
    background: var(--primary-dark);
    color: white;
    box-shadow: 0 2px 8px rgba(99,102,241,0.25);
}

.teacher-fields { display: none; }
.teacher-fields.show { display: block; }

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.form-input {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.form-input:focus { border-color: var(--primary); }
.form-input::placeholder { color: var(--text-dim); }

.form-select {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%236B7280' stroke-width='2'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    cursor: pointer;
}

.form-select:focus { border-color: var(--primary); }

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

.auth-error {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--danger);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: 16px;
    display: none;
}

.auth-error.show { display: block; }

.auth-switch {
    text-align: center;
    margin-top: 20px;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.auth-switch a {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 600;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    min-height: 44px;
    min-width: 44px;
    letter-spacing: -0.01em;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border-hover);
}

.btn-secondary:hover { background: var(--bg-card-hover); }

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

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

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-hover);
}

.btn-outline:hover {
    background: rgba(255,255,255,0.03);
    border-color: var(--primary-light);
    color: var(--text);
}

.btn-full { width: 100%; }

.btn-sm {
    padding: 8px 14px;
    font-size: 0.8rem;
    min-height: 36px;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 1rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all 0.2s;
}

.card:hover { border-color: var(--border-hover); }
.card-clickable { cursor: pointer; }
.card-clickable:active { transform: scale(0.98); }

/* ============================================
   DASHBOARD
   ============================================ */
.greeting { margin-bottom: 24px; }

.greeting h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.greeting p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Streak Card */
.streak-card {
    background: linear-gradient(135deg, rgba(239,68,68,0.08), rgba(245,158,11,0.08));
    border: 1px solid rgba(239,68,68,0.12);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.streak-number {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2.75rem;
    font-weight: 800;
    line-height: 1;
    background: var(--gradient-warm);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.streak-info h3 { font-size: 0.95rem; font-weight: 600; }
.streak-info p { font-size: 0.8rem; color: var(--text-muted); }

.streak-freeze-badge {
    margin-left: auto;
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.2);
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 0.7rem;
    color: var(--accent);
    white-space: nowrap;
}

/* XP & Level */
.xp-card {
    background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(6,182,212,0.05));
    border: 1px solid rgba(99,102,241,0.12);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
}

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

.xp-level {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
}

.xp-total {
    font-size: 0.8rem;
    color: var(--warning);
    font-weight: 600;
}

.xp-bar {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.06);
    border-radius: 3px;
    overflow: hidden;
}

.xp-bar-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.xp-bar-label {
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-top: 6px;
    text-align: right;
}

/* Daily Missions */
.missions-card { margin-bottom: 16px; }

.missions-card h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mission-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
}

.mission-item:last-child { border-bottom: none; }

.mission-check {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.7rem;
}

.mission-check.done {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.mission-text { flex: 1; font-size: 0.85rem; }
.mission-text.done { text-decoration: line-through; color: var(--text-dim); }

.mission-xp {
    font-size: 0.7rem;
    color: var(--warning);
    font-weight: 600;
    white-space: nowrap;
}

/* Weak Topics */
.weak-topics { margin-bottom: 16px; }

.weak-topics h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--danger);
}

.weak-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.weak-item:last-child { border-bottom: none; }
.weak-item-info { flex: 1; }
.weak-item-info h4 { font-size: 0.85rem; font-weight: 500; }
.weak-item-info p { font-size: 0.7rem; color: var(--text-dim); }

.weak-pct {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--danger);
    margin-right: 12px;
}

/* Subject Cards */
.subject-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.subject-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 16px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.subject-card:hover { border-color: var(--border-hover); }
.subject-card:active { transform: scale(0.97); }

.subject-icon { font-size: 1.8rem; margin-bottom: 8px; }
.subject-card h4 { font-size: 0.9rem; font-weight: 600; margin-bottom: 4px; }

.subject-card .subject-progress-text {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.subject-mastery-bar {
    width: 100%;
    height: 5px;
    background: rgba(255,255,255,0.06);
    border-radius: 3px;
    overflow: hidden;
}

.subject-mastery-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s;
}

.mastery-red { background: var(--danger); }
.mastery-yellow { background: var(--warning); }
.mastery-green { background: var(--success); }

/* Leaderboard Preview */
.lb-preview { margin-bottom: 16px; }
.lb-preview h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 12px; }

.lb-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.lb-row:last-child { border-bottom: none; }

.lb-rank {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.lb-rank-1 { background: linear-gradient(135deg, #F59E0B, #D97706); color: #000; }
.lb-rank-2 { background: linear-gradient(135deg, #94A3B8, #64748B); color: #000; }
.lb-rank-3 { background: linear-gradient(135deg, #CD7F32, #A0522D); color: white; }
.lb-rank-default { background: var(--bg-card-hover); color: var(--text-muted); }

.lb-name { flex: 1; font-size: 0.85rem; font-weight: 500; }
.lb-xp { font-size: 0.75rem; color: var(--warning); font-weight: 600; }

.lb-user-row {
    background: rgba(99, 102, 241, 0.06);
    border-radius: var(--radius-sm);
    padding: 10px 12px !important;
    margin-top: 8px;
}

/* ============================================
   SUBJECT VIEW
   ============================================ */
.page-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.back-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
}

.back-btn:hover { border-color: var(--border-hover); }
.back-btn:active { transform: scale(0.95); }

.page-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.subject-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.06);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}

.subject-progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 3px;
    transition: width 0.5s;
}

.subject-progress-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.chapter-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chapter-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: inherit;
}

.chapter-item:hover { border-color: var(--border-hover); }
.chapter-item:active { transform: scale(0.98); }
.chapter-item.locked { opacity: 0.4; cursor: not-allowed; }
.chapter-item.locked:active { transform: none; }

.chapter-num {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(99,102,241,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary-light);
    flex-shrink: 0;
}

.chapter-item.locked .chapter-num {
    background: rgba(107,114,128,0.15);
    color: var(--text-dim);
}

.chapter-info { flex: 1; min-width: 0; }
.chapter-info h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chapter-info p { font-size: 0.7rem; color: var(--text-muted); }

.chapter-mastery { font-size: 0.85rem; font-weight: 700; flex-shrink: 0; }
.chapter-lock-icon { color: var(--text-dim); flex-shrink: 0; }

/* ============================================
   CHAPTER LEARNING
   ============================================ */
.chapter-tabs {
    display: flex;
    gap: 4px;
    background: rgba(255,255,255,0.03);
    border-radius: var(--radius);
    padding: 4px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.chapter-tab {
    flex: 1;
    padding: 10px 8px;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px;
    font-family: inherit;
}

.chapter-tab.active {
    background: var(--primary-dark);
    color: white;
    box-shadow: 0 2px 8px rgba(99,102,241,0.25);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Theory */
.theory-content {
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.theory-content h1, .theory-content h2, .theory-content h3 {
    font-family: 'Space Grotesk', sans-serif;
    margin: 24px 0 12px;
    color: var(--text);
}

.theory-content h2 { font-size: 1.25rem; }
.theory-content h3 { font-size: 1.05rem; }
.theory-content p { margin-bottom: 16px; }
.theory-content ul, .theory-content ol { margin-bottom: 16px; padding-left: 20px; }
.theory-content li { margin-bottom: 8px; }

.theory-content code {
    background: rgba(99,102,241,0.1);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.9em;
}

.theory-content pre {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    overflow-x: auto;
    margin-bottom: 16px;
}

.reading-time { font-size: 0.75rem; color: var(--text-dim); margin-bottom: 16px; }
.mark-read-btn { margin-top: 24px; }

/* Formulae */
.formula-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
}

.formula-title { font-size: 0.8rem; font-weight: 600; margin-bottom: 10px; color: var(--text-muted); }
.formula-body { font-size: 1.05rem; margin-bottom: 12px; overflow-x: auto; }
.formula-actions { display: flex; gap: 8px; }

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

.practice-count { font-size: 0.8rem; color: var(--text-muted); }

.difficulty-filter { display: flex; gap: 4px; }

.diff-btn {
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 600;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    font-family: inherit;
    min-height: 32px;
    transition: all 0.2s;
}

.diff-btn.active {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: white;
}

.question-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
}

.question-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.question-tag {
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 0.65rem;
    font-weight: 600;
    background: rgba(99,102,241,0.06);
    color: var(--primary-light);
    border: 1px solid rgba(99,102,241,0.12);
}

.question-tag.easy { background: rgba(16,185,129,0.06); color: var(--success); border-color: rgba(16,185,129,0.12); }
.question-tag.medium { background: rgba(245,158,11,0.06); color: var(--warning); border-color: rgba(245,158,11,0.12); }
.question-tag.hard { background: rgba(239,68,68,0.06); color: var(--danger); border-color: rgba(239,68,68,0.12); }

.question-text { font-size: 0.95rem; line-height: 1.7; margin-bottom: 16px; }

.option-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }

.option-btn {
    width: 100%;
    padding: 13px 16px;
    background: var(--bg-input);
    border: 1.5px solid var(--border-hover);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.9rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    line-height: 1.5;
    min-height: 48px;
}

.option-btn:active { transform: scale(0.98); }
.option-btn.selected { border-color: var(--primary); background: rgba(99,102,241,0.06); }

.option-btn.correct {
    border-color: var(--success);
    background: rgba(16,185,129,0.08);
    animation: correctFlash 0.5s ease;
}

.option-btn.wrong {
    border-color: var(--danger);
    background: rgba(239,68,68,0.08);
    animation: wrongFlash 0.5s ease;
}

@keyframes correctFlash {
    0%, 100% { background: rgba(16,185,129,0.08); }
    50% { background: rgba(16,185,129,0.2); }
}

@keyframes wrongFlash {
    0%, 100% { background: rgba(239,68,68,0.08); }
    50% { background: rgba(239,68,68,0.2); }
}

.solution-box {
    background: rgba(16,185,129,0.04);
    border: 1px solid rgba(16,185,129,0.12);
    border-radius: var(--radius);
    padding: 16px;
    margin-top: 16px;
}

.solution-box h4 { color: var(--success); font-size: 0.8rem; margin-bottom: 8px; }
.solution-box .solution-content { font-size: 0.85rem; line-height: 1.7; color: var(--text-muted); }

.error-analysis {
    background: rgba(245,158,11,0.04);
    border: 1px solid rgba(245,158,11,0.12);
    border-radius: var(--radius);
    padding: 16px;
    margin-top: 12px;
}

.error-analysis h4 { color: var(--warning); font-size: 0.8rem; margin-bottom: 10px; }
.error-tags { display: flex; flex-wrap: wrap; gap: 8px; }

.error-tag-btn {
    padding: 8px 14px;
    border-radius: 100px;
    font-size: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.error-tag-btn:hover, .error-tag-btn.selected {
    background: rgba(245,158,11,0.1);
    border-color: var(--warning);
    color: var(--warning);
}

.practice-progress {
    width: 100%;
    height: 3px;
    background: rgba(255,255,255,0.06);
    border-radius: 2px;
    margin-bottom: 16px;
    overflow: hidden;
}

.practice-progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 2px;
    transition: width 0.3s;
}

/* Test Mode */
.test-timer {
    position: sticky;
    top: var(--top-bar-height);
    background: var(--bg);
    padding: 12px 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}

.timer-display {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
}

.timer-display.warning { color: var(--warning); }
.timer-display.danger { color: var(--danger); }
.test-question-count { font-size: 0.8rem; color: var(--text-muted); }

.test-question-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 16px;
}

.test-q-dot {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
}

.test-q-dot.current { border-color: var(--primary); color: var(--primary-light); }
.test-q-dot.answered { background: rgba(99,102,241,0.12); border-color: var(--primary); color: var(--primary-light); }

/* Scorecard */
.scorecard {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 36px 24px;
    text-align: center;
    margin-bottom: 16px;
}

.scorecard-score {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 8px;
}

.scorecard-score.pass {
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.scorecard-score.fail {
    background: var(--gradient-warm);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.scorecard-chapter { font-size: 1.05rem; font-weight: 600; margin-bottom: 4px; }
.scorecard-details { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 24px; }

.scorecard-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.scorecard-stat { text-align: center; }

.scorecard-stat-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
}

.scorecard-stat-label {
    font-size: 0.65rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.scorecard-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.whatsapp-btn { background: #25D366; color: white; }
.whatsapp-btn:hover { background: #20BD5A; }

/* ============================================
   CHALLENGE MODE
   ============================================ */
.challenge-hero { text-align: center; padding: 40px 16px; }

.challenge-hero h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.challenge-hero .challenger-score {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2.75rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.challenge-hero p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 24px; }

.challenge-comparison {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 16px;
    align-items: center;
    text-align: center;
    margin-bottom: 24px;
}

.challenge-player {
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.challenge-player h4 { font-size: 0.8rem; margin-bottom: 8px; color: var(--text-muted); }
.challenge-player .score { font-family: 'Space Grotesk', sans-serif; font-size: 1.8rem; font-weight: 800; }
.challenge-vs { font-family: 'Space Grotesk', sans-serif; font-size: 1.1rem; font-weight: 700; color: var(--text-dim); }

/* ============================================
   LEADERBOARD
   ============================================ */
.lb-tabs {
    display: flex;
    gap: 4px;
    background: rgba(255,255,255,0.03);
    border-radius: var(--radius);
    padding: 4px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.lb-tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    min-height: 44px;
}

.lb-tab.active { background: var(--primary-dark); color: white; }

.lb-full-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius);
    margin-bottom: 4px;
    transition: background 0.2s;
}

.lb-full-row:nth-child(even) { background: rgba(255,255,255,0.02); }

.lb-full-row.me {
    background: rgba(99,102,241,0.06);
    border: 1px solid rgba(99,102,241,0.15);
}

.lb-full-rank {
    width: 32px;
    text-align: center;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
    flex-shrink: 0;
}

.lb-full-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.lb-full-info { flex: 1; min-width: 0; }

.lb-full-name {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lb-full-meta { font-size: 0.65rem; color: var(--text-dim); }
.lb-full-xp { font-size: 0.85rem; font-weight: 700; color: var(--warning); flex-shrink: 0; }
.lb-full-streak { font-size: 0.75rem; color: var(--text-dim); flex-shrink: 0; }

/* ============================================
   REVISION / SPACED REPETITION
   ============================================ */
.revise-header { text-align: center; margin-bottom: 24px; }

.revise-due-count {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2.75rem;
    font-weight: 800;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.revise-due-label { font-size: 0.85rem; color: var(--text-muted); }

.flashcard {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    min-height: 240px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    margin-bottom: 16px;
}

.flashcard:active { transform: scale(0.98); }
.flashcard-front { font-size: 1.05rem; line-height: 1.7; }

.flashcard-back {
    display: none;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-muted);
}

.flashcard.flipped .flashcard-front { display: none; }
.flashcard.flipped .flashcard-back { display: block; }
.flashcard-hint { position: absolute; bottom: 12px; font-size: 0.7rem; color: var(--text-dim); }

.revise-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.revise-progress-text { text-align: center; font-size: 0.8rem; color: var(--text-muted); }

.leitner-boxes { display: flex; gap: 8px; margin-bottom: 20px; }

.leitner-box {
    flex: 1;
    text-align: center;
    padding: 10px 4px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.leitner-box-num { font-family: 'Space Grotesk', sans-serif; font-size: 1.15rem; font-weight: 700; }
.leitner-box-label { font-size: 0.55rem; color: var(--text-dim); text-transform: uppercase; }

/* ============================================
   PROFILE
   ============================================ */
.profile-header { text-align: center; padding: 20px 0; margin-bottom: 20px; }

.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 auto 12px;
}

.profile-name {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.profile-meta { font-size: 0.8rem; color: var(--text-muted); }

.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 24px;
}

.profile-stat {
    text-align: center;
    padding: 14px 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.profile-stat-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
}

.profile-stat-label { font-size: 0.65rem; color: var(--text-dim); margin-top: 2px; }

/* Badges */
.badges-section h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 12px; }

.badges-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 24px;
}

.badge-card {
    text-align: center;
    padding: 14px 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.2s;
}

.badge-card.earned {
    border-color: rgba(99,102,241,0.2);
    background: rgba(99,102,241,0.04);
}

.badge-card.locked { opacity: 0.35; }
.badge-icon { font-size: 1.6rem; margin-bottom: 6px; }
.badge-name { font-size: 0.65rem; font-weight: 600; }
.badge-desc { font-size: 0.55rem; color: var(--text-dim); margin-top: 2px; }

/* Error Pattern Chart */
.error-chart-container { margin-bottom: 24px; }
.error-chart-container h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 12px; }

.error-legend { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.error-legend-item { display: flex; align-items: center; gap: 6px; font-size: 0.75rem; color: var(--text-muted); }
.error-dot { width: 8px; height: 8px; border-radius: 50%; }

.cert-btn { margin-bottom: 24px; }

.logout-section {
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

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

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

.skeleton-text { height: 14px; margin-bottom: 8px; width: 100%; }
.skeleton-text.short { width: 60%; }
.skeleton-text.shorter { width: 40%; }
.skeleton-card { height: 100px; margin-bottom: 12px; }
.skeleton-circle { width: 60px; height: 60px; border-radius: 50%; }

/* ============================================
   CONFETTI
   ============================================ */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -10px;
    animation: confettiFall 3s ease-out forwards;
}

@keyframes confettiFall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
    position: fixed;
    top: calc(var(--top-bar-height) + 8px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: calc(100% - 32px);
    max-width: 400px;
    pointer-events: none;
}

.toast {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    pointer-events: auto;
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(12px);
}

.toast-success { background: rgba(16,185,129,0.9); color: white; }
.toast-error { background: rgba(239,68,68,0.9); color: white; }
.toast-xp { background: rgba(245,158,11,0.9); color: #000; }
.toast-info { background: rgba(99,102,241,0.9); color: white; }

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

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

/* ============================================
   XP POPUP
   ============================================ */
.xp-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--warning);
    z-index: 150;
    pointer-events: none;
    animation: xpPop 1s ease forwards;
}

@keyframes xpPop {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    30% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    60% { transform: translate(-50%, -60%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -80%) scale(0.8); opacity: 0; }
}

/* ============================================
   CELEBRATION
   ============================================ */
.celebration-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(3,7,18,0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    animation: fadeIn 0.3s ease;
}

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

.celebration-content { text-align: center; animation: bounceIn 0.5s ease; }

@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); opacity: 1; }
}

.celebration-emoji { font-size: 3.5rem; margin-bottom: 16px; }

.celebration-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.6rem;
    font-weight: 800;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.celebration-sub { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 24px; }

/* ============================================
   EMPTY STATES
   ============================================ */
.empty-state { text-align: center; padding: 48px 16px; }
.empty-state-icon { font-size: 2.5rem; margin-bottom: 12px; opacity: 0.4; }
.empty-state h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: 8px; }
.empty-state p { color: var(--text-muted); font-size: 0.85rem; max-width: 280px; margin: 0 auto; }

/* ============================================
   UTILITIES
   ============================================ */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-dim { color: var(--text-dim); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.gap-8 { gap: 8px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }

.section-title { font-size: 0.95rem; font-weight: 700; margin-bottom: 12px; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (min-width: 768px) {
    .page { max-width: 560px; padding: 24px; }
    .subject-grid { grid-template-columns: repeat(4, 1fr); }
    .badges-grid { grid-template-columns: repeat(4, 1fr); }
    .profile-stats-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ============================================
   COOKIE CONSENT BANNER
   ============================================ */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    z-index: 1000;
    animation: slideUp 0.3s ease;
}

.cookie-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.cookie-text a {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 600;
}

.cookie-actions {
    flex-shrink: 0;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@media (max-width: 480px) {
    .cookie-banner {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
}

/* ============================================
   Diagnostic Placement Test Styles
   ============================================ */

.diagnostic-intro {
    text-align: center;
    padding: 20px 0;
    max-width: 420px;
    margin: 0 auto;
}

.diagnostic-icon-wrap {
    position: relative;
    display: inline-block;
    margin-bottom: 20px;
}

.diagnostic-icon {
    font-size: 3.5rem;
    position: relative;
    z-index: 2;
}

.diagnostic-pulse {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 80px; height: 80px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.08);
    animation: diagPulse 2s ease-in-out infinite;
}

@keyframes diagPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; }
    50% { transform: translate(-50%, -50%) scale(1.3); opacity: 0; }
}

.diagnostic-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 20px 0;
}

.diagnostic-info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--bg-soft, #F8FAFC);
    border: 1px solid var(--border, #E2E8F0);
    border-radius: 12px;
    text-align: left;
}

.diagnostic-info-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.diagnostic-info-label {
    font-size: 0.7rem;
    color: var(--text-dim, #94A3B8);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.diagnostic-info-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text, #0F172A);
}

.diagnostic-loading-spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--border, #E2E8F0);
    border-top: 3px solid var(--primary, #6366F1);
    border-radius: 50%;
    animation: diagSpin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes diagSpin {
    to { transform: rotate(360deg); }
}

/* Diagnostic question screen */
.diagnostic-header {
    margin-bottom: 20px;
}

.diagnostic-progress-wrap {
    margin-bottom: 12px;
}

.diagnostic-progress-bar {
    height: 6px;
    background: var(--bg-muted, #F1F5F9);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.diagnostic-progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}

.diagnostic-progress-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
}

.diagnostic-timer {
    font-family: 'Space Grotesk', monospace;
    font-weight: 600;
    color: var(--accent, #0EA5E9);
}

.diagnostic-subject-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.diagnostic-question-card {
    background: var(--bg, #fff);
    border: 1px solid var(--border, #E2E8F0);
    border-radius: 16px;
    padding: 24px 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.diagnostic-q-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.diagnostic-diff-badge {
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.diagnostic-diff-badge.easy { background: #D1FAE5; color: #059669; }
.diagnostic-diff-badge.medium { background: #FEF3C7; color: #D97706; }
.diagnostic-diff-badge.hard { background: #FEE2E2; color: #EF4444; }

.diagnostic-topic {
    font-size: 0.75rem;
    color: var(--text-dim, #94A3B8);
}

.diagnostic-q-text {
    font-size: 1rem;
    line-height: 1.65;
    color: var(--text, #0F172A);
    margin-bottom: 20px;
    font-weight: 500;
}

.diagnostic-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.diagnostic-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-soft, #F8FAFC);
    border: 1.5px solid var(--border, #E2E8F0);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    width: 100%;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text, #0F172A);
}

.diagnostic-option:hover {
    border-color: var(--primary, #6366F1);
    background: rgba(99, 102, 241, 0.04);
}

.diagnostic-option.selected {
    border-color: var(--primary, #6366F1);
    background: rgba(99, 102, 241, 0.08);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.diagnostic-option.correct-flash {
    border-color: var(--success, #059669);
    background: rgba(5, 150, 105, 0.1);
}

.diagnostic-option.wrong-flash {
    border-color: #EF4444;
    background: rgba(239, 68, 68, 0.08);
}

.diagnostic-option.loading {
    opacity: 0.7;
}

.diagnostic-option-letter {
    width: 28px; height: 28px;
    border-radius: 8px;
    background: var(--bg-muted, #F1F5F9);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.8rem;
    color: var(--text-muted, #64748B);
    flex-shrink: 0;
}

.diagnostic-option.selected .diagnostic-option-letter {
    background: var(--primary, #6366F1);
    color: #fff;
}

.diagnostic-option-text {
    flex: 1;
    line-height: 1.5;
}

/* Diagnostic results */
.diagnostic-results {
    max-width: 460px;
    margin: 0 auto;
    padding: 10px 0;
}

.diagnostic-score-section {
    text-align: center;
    margin-bottom: 28px;
}

.diagnostic-score-circle {
    position: relative;
    width: 120px; height: 120px;
    margin: 0 auto;
}

.diagnostic-score-ring {
    width: 100%; height: 100%;
}

.diagnostic-score-ring-fill {
    transition: stroke-dashoffset 1.5s ease;
}

.diagnostic-score-value {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -60%);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    color: var(--text, #0F172A);
}

.diagnostic-score-label {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, 50%);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-dim, #94A3B8);
    font-weight: 600;
}

.diagnostic-section {
    margin-bottom: 24px;
}

.diagnostic-section-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 14px;
    color: var(--text, #0F172A);
}

.diagnostic-strengths {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.diagnostic-strength-item {
    padding: 14px;
    background: var(--bg-soft, #F8FAFC);
    border: 1px solid var(--border, #E2E8F0);
    border-radius: 12px;
}

.diagnostic-strength-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.diagnostic-strength-icon {
    font-size: 1.2rem;
}

.diagnostic-strength-name {
    flex: 1;
    font-weight: 600;
    font-size: 0.9rem;
}

.diagnostic-strength-score {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
}

.diagnostic-strength-bar {
    height: 6px;
    background: var(--bg-muted, #F1F5F9);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.diagnostic-strength-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 1s ease;
}

.diagnostic-strength-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.diagnostic-level-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.diagnostic-level-badge.strong { background: #D1FAE5; color: #059669; }
.diagnostic-level-badge.developing { background: #FEF3C7; color: #D97706; }
.diagnostic-level-badge.needs-work { background: #FEE2E2; color: #EF4444; }

.diagnostic-gaps {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.diagnostic-gap-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-soft, #F8FAFC);
    border: 1px solid var(--border, #E2E8F0);
    border-radius: 10px;
}

.diagnostic-gap-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.diagnostic-gap-info {
    flex: 1;
}

.diagnostic-gap-topic {
    font-size: 0.85rem;
    font-weight: 600;
    display: block;
    color: var(--text, #0F172A);
}

.diagnostic-gap-subject {
    font-size: 0.72rem;
    color: var(--text-dim, #94A3B8);
}

.diagnostic-gap-pct {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    color: #EF4444;
}

.diagnostic-cta-card {
    padding: 24px;
    background: linear-gradient(135deg, rgba(99,102,241,0.06), rgba(6,182,212,0.04));
    border: 1px solid rgba(99,102,241,0.12);
    border-radius: 16px;
    text-align: center;
}


/* ============================================
   Daily Challenge Styles
   ============================================ */

.dc-intro {
    text-align: center;
    padding: 20px 0;
    max-width: 420px;
    margin: 0 auto;
}

.dc-intro-badge {
    display: inline-block;
    padding: 4px 14px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--primary, #6366F1);
    margin-bottom: 12px;
}

.dc-streak-badge {
    display: inline-block;
    padding: 4px 14px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.15);
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #D97706;
    margin-bottom: 12px;
}

.dc-intro-icon {
    font-size: 3.5rem;
    margin-bottom: 12px;
}

.dc-info-row {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin: 16px 0;
}

.dc-info-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-muted, #64748B);
    font-weight: 500;
}

.dc-info-icon {
    font-size: 1rem;
}

.dc-subjects-row {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.dc-subject-tag {
    padding: 3px 10px;
    background: var(--bg-muted, #F1F5F9);
    border: 1px solid var(--border, #E2E8F0);
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted, #64748B);
}

/* Challenge question screen */
.dc-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    gap: 16px;
}

.dc-timer-wrap {
    flex: 1;
}

.dc-timer {
    font-family: 'Space Grotesk', monospace;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--success, #059669);
    margin-bottom: 6px;
}

.dc-timer-bar {
    height: 4px;
    background: var(--bg-muted, #F1F5F9);
    border-radius: 2px;
    overflow: hidden;
}

.dc-timer-fill {
    height: 100%;
    background: var(--success, #059669);
    border-radius: 2px;
    transition: width 1s linear;
}

.dc-progress-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-muted, #64748B);
    padding-top: 2px;
}

.dc-q-subject {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 14px;
}

.dc-question-card {
    background: var(--bg, #fff);
    border: 1px solid var(--border, #E2E8F0);
    border-radius: 16px;
    padding: 22px 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    margin-bottom: 16px;
}

.dc-q-text {
    font-size: 1rem;
    line-height: 1.65;
    color: var(--text, #0F172A);
    margin-bottom: 18px;
    font-weight: 500;
}

.dc-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dc-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    background: var(--bg-soft, #F8FAFC);
    border: 1.5px solid var(--border, #E2E8F0);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    width: 100%;
    font-family: inherit;
    font-size: 0.88rem;
    color: var(--text, #0F172A);
}

.dc-option:hover {
    border-color: var(--primary, #6366F1);
    background: rgba(99, 102, 241, 0.04);
}

.dc-option.selected {
    border-color: var(--primary, #6366F1);
    background: rgba(99, 102, 241, 0.08);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.dc-option-letter {
    width: 26px; height: 26px;
    border-radius: 8px;
    background: var(--bg-muted, #F1F5F9);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.78rem;
    color: var(--text-muted, #64748B);
    flex-shrink: 0;
}

.dc-option.selected .dc-option-letter {
    background: var(--primary, #6366F1);
    color: #fff;
}

.dc-option-text {
    flex: 1;
    line-height: 1.5;
}

.dc-nav {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 16px;
}

.dc-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.dc-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--bg-muted, #F1F5F9);
    border: 1.5px solid var(--border, #E2E8F0);
    cursor: pointer;
    transition: all 0.2s;
}

.dc-dot.active {
    background: var(--primary, #6366F1);
    border-color: var(--primary, #6366F1);
    transform: scale(1.2);
}

.dc-dot.answered {
    background: var(--success, #059669);
    border-color: var(--success, #059669);
}

/* Challenge results */
.dc-result {
    text-align: center;
    padding: 20px 0;
    max-width: 420px;
    margin: 0 auto;
}

.dc-result-emoji {
    font-size: 3.5rem;
    margin-bottom: 8px;
}

.dc-result-streak {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.15);
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #D97706;
    margin: 8px 0 16px;
}

.dc-result-score-wrap {
    margin: 16px 0;
}

.dc-result-big-score {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--text, #0F172A);
    line-height: 1;
}

.dc-result-big-score span {
    font-size: 1.2rem;
    color: var(--text-dim, #94A3B8);
    font-weight: 600;
}

.dc-result-time {
    font-size: 0.85rem;
    color: var(--text-muted, #64748B);
    margin-top: 4px;
}

.dc-result-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin: 20px 0;
    padding: 16px;
    background: var(--bg-soft, #F8FAFC);
    border: 1px solid var(--border, #E2E8F0);
    border-radius: 12px;
}

.dc-result-stat {
    text-align: center;
}

.dc-result-stat-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary, #6366F1);
}

.dc-result-stat-label {
    font-size: 0.7rem;
    color: var(--text-dim, #94A3B8);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    margin-top: 2px;
}

/* Leaderboard */
.dc-leaderboard {
    max-width: 460px;
    margin: 0 auto;
    padding: 10px 0;
}

.dc-lb-your-rank {
    padding: 10px 16px;
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.12);
    border-radius: 10px;
    font-size: 0.88rem;
    color: var(--text, #0F172A);
    margin-bottom: 16px;
    text-align: center;
}

.dc-lb-list {
    background: var(--bg, #fff);
    border: 1px solid var(--border, #E2E8F0);
    border-radius: 14px;
    overflow: hidden;
}

.dc-lb-header {
    display: grid;
    grid-template-columns: 50px 1fr 60px 60px;
    padding: 10px 14px;
    background: var(--bg-muted, #F1F5F9);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-dim, #94A3B8);
}

.dc-lb-row {
    display: grid;
    grid-template-columns: 50px 1fr 60px 60px;
    padding: 11px 14px;
    border-bottom: 1px solid var(--border-light, #F1F5F9);
    font-size: 0.85rem;
    align-items: center;
}

.dc-lb-row:last-child { border-bottom: none; }
.dc-lb-row.you { background: rgba(99, 102, 241, 0.04); }

.dc-lb-rank { font-weight: 700; font-size: 0.9rem; }
.dc-lb-name { font-weight: 500; color: var(--text, #0F172A); }
.dc-lb-score { font-family: 'Space Grotesk', sans-serif; font-weight: 700; text-align: center; }
.dc-lb-time { font-size: 0.78rem; color: var(--text-dim, #94A3B8); text-align: center; }

.dc-countdown {
    font-size: 0.85rem;
    color: var(--text-muted, #64748B);
    margin: 12px 0;
}

/* Dashboard card for daily challenge */
.dc-dashboard-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 16px;
    background: linear-gradient(135deg, rgba(99,102,241,0.06), rgba(245,158,11,0.04));
    border: 1px solid rgba(99,102,241,0.12);
    border-radius: 14px;
    margin-bottom: 16px;
    text-decoration: none;
    color: var(--text, #0F172A);
    transition: all 0.2s;
}

.dc-dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99,102,241,0.1);
}

.dc-dashboard-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.dc-dashboard-info {
    flex: 1;
}

.dc-dashboard-info h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.dc-dashboard-info p {
    font-size: 0.8rem;
    color: var(--text-muted, #64748B);
}

.dc-dashboard-arrow {
    font-size: 1.2rem;
    color: var(--primary, #6366F1);
    font-weight: 700;
}

/* ============================================
   MOCK TEST SYSTEM
   ============================================ */

/* -- Selection Screen -- */
.mock-test-types {
    display: flex; flex-direction: column; gap: 10px;
    margin-bottom: 20px;
}
.mock-type-card {
    display: flex; align-items: center; gap: 14px;
    padding: 16px; background: var(--bg-card);
    border: 2px solid var(--border); border-radius: var(--radius);
    cursor: pointer; transition: all 0.2s;
}
.mock-type-card:hover { border-color: var(--border-hover); background: var(--bg-card-hover); }
.mock-type-card.selected { border-color: var(--primary); background: rgba(99,102,241,0.08); }
.mock-type-icon { font-size: 2rem; flex-shrink: 0; }
.mock-type-info h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 2px; }
.mock-type-info p { font-size: 0.8rem; color: var(--text-muted); margin: 0; }
.mock-type-meta { font-size: 0.75rem; color: var(--text-dim); margin-top: 4px; }

.mock-config-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 20px;
    margin-bottom: 24px;
}
.mock-config-card h3 { font-size: 1rem; font-weight: 700; }

/* -- Test Container -- */
.mock-test-container {
    display: flex; flex-direction: column;
    height: 100vh; height: 100dvh;
    background: var(--bg);
}
.mock-test-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px; background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 50;
}
.mock-test-header-left { display: flex; align-items: center; gap: 10px; }
.mock-test-title { font-weight: 700; font-size: 0.95rem; }
.mock-test-badge {
    font-size: 0.7rem; padding: 3px 10px;
    background: rgba(99,102,241,0.15); color: var(--primary-light);
    border-radius: 100px; font-weight: 600; text-transform: capitalize;
}
.mock-test-header-right { display: flex; align-items: center; gap: 10px; }

.mock-timer {
    display: flex; align-items: center; gap: 6px;
    font-weight: 700; font-size: 1rem;
    font-variant-numeric: tabular-nums;
    padding: 6px 14px; background: rgba(16,185,129,0.1);
    color: var(--success); border-radius: var(--radius-sm);
}
.mock-timer.timer-warning { background: rgba(245,158,11,0.15); color: var(--warning); }
.mock-timer.timer-critical { background: rgba(239,68,68,0.15); color: var(--danger); animation: timerPulse 1s infinite; }
@keyframes timerPulse { 0%,100%{opacity:1} 50%{opacity:0.6} }

.mock-test-body {
    display: flex; flex: 1; overflow: hidden;
}

/* -- Question Panel -- */
.mock-question-panel {
    flex: 1; padding: 20px; overflow-y: auto;
}
.mock-question-meta {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 16px; flex-wrap: wrap;
    font-size: 0.8rem; color: var(--text-muted);
}
.mock-diff-badge {
    padding: 2px 10px; border-radius: 100px;
    font-size: 0.7rem; font-weight: 600;
}
.mock-diff-badge.diff-1, .mock-diff-badge.diff-2 { background: rgba(16,185,129,0.15); color: #34D399; }
.mock-diff-badge.diff-3 { background: rgba(245,158,11,0.15); color: #FBBF24; }
.mock-diff-badge.diff-4 { background: rgba(249,115,22,0.15); color: #FB923C; }
.mock-diff-badge.diff-5 { background: rgba(239,68,68,0.15); color: #F87171; }
.mock-topic-badge {
    padding: 2px 10px; border-radius: 100px;
    font-size: 0.7rem; font-weight: 600;
    background: rgba(6,182,212,0.12); color: var(--accent-light);
}
.mock-review-badge {
    padding: 2px 10px; border-radius: 100px;
    font-size: 0.7rem; font-weight: 600;
    background: rgba(245,158,11,0.15); color: var(--warning);
}

.mock-question-text {
    font-size: 1rem; line-height: 1.7;
    margin-bottom: 20px; color: var(--text);
}
.mock-question-text img { max-width: 100%; border-radius: 8px; }

.mock-options {
    display: flex; flex-direction: column; gap: 10px;
}
.mock-option {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 14px 16px; background: var(--bg-card);
    border: 2px solid var(--border); border-radius: var(--radius);
    cursor: pointer; transition: all 0.15s;
    font-size: 0.9rem; color: var(--text);
}
.mock-option:hover { border-color: var(--border-hover); background: var(--bg-card-hover); }
.mock-option.selected { border-color: var(--primary); background: rgba(99,102,241,0.1); }
.mock-option-letter {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--bg-subtle); display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.8rem; flex-shrink: 0;
    color: var(--text-muted);
}
.mock-option.selected .mock-option-letter {
    background: var(--primary); color: #fff;
}
.mock-option-text { padding-top: 3px; line-height: 1.5; }

/* -- Navigation Sidebar -- */
.mock-nav-sidebar {
    width: 200px; padding: 16px;
    background: var(--bg-card); border-left: 1px solid var(--border);
    overflow-y: auto; flex-shrink: 0;
}
.mock-nav-title { font-weight: 700; font-size: 0.85rem; margin-bottom: 12px; }
.mock-nav-grid {
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px;
    margin-bottom: 16px;
}
.mock-nav-dot {
    width: 100%; aspect-ratio: 1; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem; font-weight: 600; cursor: pointer;
    background: var(--bg-subtle); border: 1px solid var(--border);
    color: var(--text-dim); transition: all 0.15s;
}
.mock-nav-dot:hover { border-color: var(--border-hover); }
.mock-nav-dot.current { background: var(--primary); color: #fff; border-color: var(--primary); }
.mock-nav-dot.answered { background: rgba(16,185,129,0.2); color: var(--success); border-color: rgba(16,185,129,0.3); }
.mock-nav-dot.review { border-color: var(--warning); box-shadow: 0 0 0 2px rgba(245,158,11,0.3); }
.mock-nav-dot.answered.review { background: rgba(245,158,11,0.2); color: var(--warning); }

.mock-nav-legend {
    display: flex; flex-direction: column; gap: 6px;
    font-size: 0.7rem; color: var(--text-dim);
}
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-dot {
    width: 12px; height: 12px; border-radius: 3px;
    border: 1px solid var(--border); background: var(--bg-subtle);
}
.legend-dot.current { background: var(--primary); border-color: var(--primary); }
.legend-dot.answered { background: rgba(16,185,129,0.3); border-color: rgba(16,185,129,0.4); }
.legend-dot.review { border-color: var(--warning); box-shadow: 0 0 0 2px rgba(245,158,11,0.3); }
.legend-dot.unanswered { background: var(--bg-subtle); }

/* -- Bottom Controls -- */
.mock-test-controls {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px; background: var(--bg-card);
    border-top: 1px solid var(--border); gap: 10px;
}
.mock-test-controls .btn { flex: 1; justify-content: center; }
.btn-warning-active { border-color: var(--warning) !important; color: var(--warning) !important; }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }

/* -- Mobile Nav Toggle -- */
.mock-mobile-nav-toggle {
    display: none; position: fixed; bottom: 80px; right: 16px;
    z-index: 40; padding: 10px 16px; border-radius: 100px;
    background: var(--primary); color: #fff; border: none;
    font-weight: 600; font-size: 0.8rem; cursor: pointer;
    box-shadow: 0 4px 12px rgba(99,102,241,0.4);
}

/* -- Results Screen -- */
.mock-results-page { padding-bottom: 40px; }
.mock-auto-submit-banner {
    background: rgba(245,158,11,0.15); color: var(--warning);
    padding: 12px 16px; border-radius: var(--radius);
    text-align: center; font-weight: 600; font-size: 0.85rem;
    margin-bottom: 20px;
}
.mock-results-hero {
    text-align: center; padding: 32px 16px; margin-bottom: 24px;
}
.mock-results-grade {
    width: 80px; height: 80px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem; font-weight: 800; margin: 0 auto 12px;
    font-family: 'Space Grotesk', 'Inter', sans-serif;
}
.mock-results-grade.success { background: rgba(16,185,129,0.15); color: var(--success); }
.mock-results-grade.warning { background: rgba(245,158,11,0.15); color: var(--warning); }
.mock-results-grade.danger { background: rgba(239,68,68,0.15); color: var(--danger); }
.mock-results-hero h2 { font-size: 1.3rem; margin-bottom: 8px; }
.mock-results-score { color: var(--text-muted); }
.score-big { font-size: 2.5rem; font-weight: 800; color: var(--text); display: block; font-family: 'Space Grotesk', sans-serif; }
.score-detail { font-size: 0.85rem; }

.mock-stats-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
    margin-bottom: 24px;
}
.mock-stat-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px; text-align: center;
}
.mock-stat-value { font-size: 1.3rem; font-weight: 800; color: var(--text); font-family: 'Space Grotesk', sans-serif; }
.mock-stat-label { font-size: 0.7rem; color: var(--text-dim); margin-top: 2px; }

.mock-analysis-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 20px;
    margin-bottom: 16px;
}
.mock-analysis-card h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 16px; }
.analysis-rows { display: flex; flex-direction: column; gap: 12px; }
.analysis-row {
    display: grid; grid-template-columns: 120px 1fr 80px;
    align-items: center; gap: 10px;
}
.analysis-label { font-size: 0.8rem; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.analysis-bar-wrap { height: 8px; background: var(--bg-subtle); border-radius: 4px; overflow: hidden; }
.analysis-bar { height: 100%; border-radius: 4px; transition: width 0.5s ease; min-width: 2px; }
.analysis-value { font-size: 0.75rem; color: var(--text-muted); text-align: right; }

.mock-results-actions {
    display: flex; flex-direction: column; gap: 10px;
    margin-top: 24px;
}
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }

/* -- Review Mode -- */
.mock-review-page { padding-bottom: 40px; }
.mock-review-nav {
    display: flex; flex-wrap: wrap; gap: 6px;
    margin-bottom: 20px; padding: 12px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius);
}
.mock-review-dot {
    width: 32px; height: 32px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; font-weight: 600; text-decoration: none;
    background: var(--bg-subtle); color: var(--text-dim);
    border: 1px solid var(--border);
}
.mock-review-dot.correct { background: rgba(16,185,129,0.2); color: var(--success); border-color: rgba(16,185,129,0.3); }
.mock-review-dot.wrong { background: rgba(239,68,68,0.2); color: var(--danger); border-color: rgba(239,68,68,0.3); }
.mock-review-dot.skipped { background: var(--bg-subtle); color: var(--text-dim); }

.mock-review-question {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 20px;
    margin-bottom: 12px; scroll-margin-top: 20px;
}
.mock-review-question.correct { border-left: 3px solid var(--success); }
.mock-review-question.wrong { border-left: 3px solid var(--danger); }
.mock-review-question.skipped { border-left: 3px solid var(--text-dim); }
.mock-review-header {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 12px; flex-wrap: wrap;
}
.mock-review-num { font-weight: 700; font-size: 0.9rem; }

.mock-review-options { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.mock-review-option {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 10px 14px; border-radius: var(--radius-sm);
    background: var(--bg-subtle); font-size: 0.85rem;
    border: 1px solid transparent;
}
.mock-review-option.correct-answer { background: rgba(16,185,129,0.1); border-color: rgba(16,185,129,0.3); color: var(--success); }
.mock-review-option.wrong-answer { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.3); color: var(--danger); }

.mock-solution {
    margin-top: 12px; border-top: 1px solid var(--border); padding-top: 12px;
}
.mock-solution summary {
    cursor: pointer; font-weight: 600; font-size: 0.85rem;
    color: var(--primary-light); padding: 4px 0;
}
.mock-solution-body { margin-top: 10px; font-size: 0.85rem; line-height: 1.7; color: var(--text-secondary); }
.mock-solution-body img { max-width: 100%; border-radius: 8px; }

/* -- History -- */
.mock-history-section { margin-top: 8px; }
.mock-history-section h3 { font-size: 1rem; font-weight: 700; margin-bottom: 12px; }
.mock-history-list { display: flex; flex-direction: column; gap: 8px; }
.mock-history-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 16px; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: var(--radius);
    cursor: pointer; transition: background 0.15s;
}
.mock-history-item:hover { background: var(--bg-card-hover); }
.mock-history-type { font-weight: 600; font-size: 0.85rem; }
.mock-history-subject { font-size: 0.8rem; color: var(--text-muted); }
.mock-history-date { font-size: 0.7rem; color: var(--text-dim); margin-top: 2px; }
.mock-history-right { text-align: right; }
.mock-history-score { font-size: 1.1rem; font-weight: 800; font-family: 'Space Grotesk', sans-serif; }
.mock-history-detail { font-size: 0.7rem; color: var(--text-dim); }

/* -- Responsive -- */
@media (max-width: 768px) {
    .mock-nav-sidebar {
        position: fixed; top: 0; right: -260px; bottom: 0;
        width: 240px; z-index: 60;
        transition: right 0.3s ease; box-shadow: -4px 0 20px rgba(0,0,0,0.5);
    }
    .mock-nav-sidebar.open { right: 0; }
    .mock-nav-sidebar #sidebarToggleBtn { display: block !important; margin-top: 12px; }
    .mock-mobile-nav-toggle { display: block; }
    .mock-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .analysis-row { grid-template-columns: 80px 1fr 70px; }
    .analysis-label { font-size: 0.7rem; }
}
@media (max-width: 480px) {
    .mock-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .mock-test-controls { padding: 10px 12px; }
    .mock-test-controls .btn { font-size: 0.8rem; padding: 10px 8px; }
}
