/* ==========================================================================
   ECMP AADHAAR EXAM APP — MODERN RESPONSIVE STYLESHEET
   UIDAI Portal Inspired Palette: Deep Navy, Saffron, Emerald, Slate
   ========================================================================== */

:root {
    --primary: #0f4c81;         /* Aadhaar / UIDAI Classic Navy */
    --primary-light: #e8f0fe;
    --primary-dark: #0a2f52;
    --secondary: #e65100;       /* Saffron Accent */
    --secondary-light: #fff3e0;
    --accent: #2563eb;
    
    --success: #16a34a;
    --success-light: #dcfce7;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --warning: #d97706;
    --warning-light: #fef3c7;
    --info: #0284c7;
    --review-purple: #7c3aed;
    --review-light: #f3e8ff;

    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --bg-elevated: #f1f5f9;
    --border: #e2e8f0;
    --border-hover: #cbd5e1;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-light: #94a3b8;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;

    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-devanagari: "Nirmala UI", "Mukta", "Noto Sans Devanagari", sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.font-hindi {
    font-family: var(--font-devanagari);
    font-size: 1.05em;
    line-height: 1.6;
}

.hidden {
    display: none !important;
}

/* --- HEADER & NAVIGATION --- */
.app-header {
    background: #ffffff;
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0.75rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.logo-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #0f4c81, #e65100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.brand-text h1 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

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

.header-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.lang-selector-wrap {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--bg-elevated);
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-size: 0.85rem;
}

.lang-select {
    background: transparent;
    border: none;
    outline: none;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
}

/* --- BUTTONS --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 1.15rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    text-decoration: none;
}

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

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
}
.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-dark);
}

.btn-secondary {
    background-color: var(--bg-elevated);
    color: var(--text-primary);
    border-color: var(--border);
}
.btn-secondary:hover:not(:disabled) {
    background-color: var(--border);
}

.btn-accent {
    background-color: var(--secondary);
    color: #ffffff;
}
.btn-accent:hover:not(:disabled) {
    background-color: #bf360c;
}

.btn-outline {
    background: transparent;
    border-color: var(--border-hover);
    color: var(--text-secondary);
}
.btn-outline:hover:not(:disabled) {
    background-color: var(--bg-elevated);
    color: var(--text-primary);
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}
.btn-danger:hover:not(:disabled) {
    background-color: #b91c1c;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.75rem 1.6rem;
    font-size: 1rem;
    border-radius: var(--radius-md);
}

.btn-icon {
    padding: 0.4rem;
    border-radius: var(--radius-sm);
    background: transparent;
    border: 1px solid var(--border);
    cursor: pointer;
}
.btn-icon:hover {
    background: var(--bg-elevated);
}

/* --- BADGES --- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    letter-spacing: 0.02em;
}

.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-danger  { background: var(--danger-light); color: var(--danger); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-light   { background: var(--bg-elevated); color: var(--text-secondary); }
.badge-l1      { background: #dcfce7; color: #15803d; } /* L1 Easy */
.badge-l2      { background: #fef3c7; color: #b45309; } /* L2 Medium */
.badge-l3      { background: #fee2e2; color: #b91c1c; } /* L3 Hard */

/* --- MAIN CONTAINER --- */
.main-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 4rem 1.25rem;
}

/* --- SPLASH / DISCLAIMER VIEW --- */
.splash-container {
    max-width: 720px;
    margin: 2.5rem auto;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    overflow: hidden;
}

.splash-banner {
    background: linear-gradient(135deg, #0f4c81, #1e3a8a);
    color: white;
    padding: 2.25rem 2rem;
    text-align: center;
}

.splash-banner h2 {
    font-size: 1.6rem;
    margin-top: 0.5rem;
    font-weight: 800;
}

.splash-banner p {
    font-size: 0.95rem;
    opacity: 0.9;
    margin-top: 0.25rem;
}

.disclaimer-card {
    padding: 2rem;
}

.disclaimer-alert {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-left: 5px solid #d97706;
    padding: 1.25rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
}

.disclaimer-alert h4 {
    color: #92400e;
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.disclaimer-alert p {
    font-size: 0.88rem;
    color: #78350f;
    line-height: 1.5;
}

.feature-bullets {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.feature-item {
    background: var(--bg-elevated);
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    font-size: 0.88rem;
}

.feature-item strong {
    display: block;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.splash-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

/* --- HOME SCREEN --- */
.hero-cta-banner {
    background: linear-gradient(135deg, #0f4c81 0%, #1e40af 100%);
    border-radius: var(--radius-lg);
    color: #ffffff;
    padding: 2rem 2.25rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    box-shadow: var(--shadow-md);
}

.hero-content h2 {
    font-size: 1.65rem;
    font-weight: 800;
    line-height: 1.2;
}

.hero-content p {
    font-size: 0.95rem;
    opacity: 0.9;
    margin-top: 0.35rem;
}

.hero-meta-badges {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.75rem;
}

.hero-meta-badge {
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(4px);
    padding: 0.25rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.stats-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.15rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.stat-details .num {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.stat-details .lbl {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 1.25rem;
}

.section-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.chapter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 1.25rem;
}

.chapter-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.chapter-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-hover);
}

.card-header-badge {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.ch-number-badge {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--primary);
    background: var(--primary-light);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
}

.weightage-badge {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--secondary);
    background: var(--secondary-light);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
}

.chapter-title-area {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.ch-icon {
    font-size: 1.5rem;
}

.ch-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.35;
}

.ch-progress-wrap {
    margin-bottom: 1.15rem;
}

.ch-progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

.progress-bar-bg {
    width: 100%;
    height: 7px;
    background: var(--bg-elevated);
    border-radius: 9999px;
    overflow: hidden;
}

.progress-bar-bg.mini {
    height: 5px;
    margin-top: 0.25rem;
}

.progress-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 9999px;
    transition: width 0.3s ease;
}

.progress-bar-fill.fill-good {
    background: var(--success);
}

.chapter-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
}

.chapter-card-actions button {
    flex: 1;
}

/* --- PRACTICE VIEW --- */
.practice-container {
    max-width: 860px;
    margin: 0 auto;
}

.practice-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    margin-bottom: 1.25rem;
}

.practice-question-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}

.question-text-box {
    margin-bottom: 1.75rem;
}

.lang-text.hi {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.lang-text.en {
    font-size: 1.05rem;
    color: var(--text-secondary);
}

.practice-options-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.practice-option-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: 1rem 1.25rem;
    background: var(--bg-elevated);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease-in-out;
}

.practice-option-btn:hover:not(:disabled) {
    border-color: var(--primary);
    background: var(--primary-light);
}

.opt-letter {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--text-primary);
    flex-shrink: 0;
}

.opt-body {
    flex: 1;
    font-size: 0.95rem;
}

.opt-dual {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.opt-hi {
    font-weight: 600;
    color: var(--text-primary);
}

.opt-en {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

/* PRACTICE CLICK COLOR FEEDBACK */
.practice-option-btn.correct {
    background: var(--success-light) !important;
    border-color: var(--success) !important;
}
.practice-option-btn.correct .opt-letter {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.practice-option-btn.wrong {
    background: var(--danger-light) !important;
    border-color: var(--danger) !important;
}
.practice-option-btn.wrong .opt-letter {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

.opt-status-icon {
    font-weight: 800;
    font-size: 1.25rem;
}
.practice-option-btn.correct .opt-status-icon { color: var(--success); }
.practice-option-btn.wrong .opt-status-icon   { color: var(--danger); }

/* EXPLANATION CARD */
.explanation-card {
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-top: 1.5rem;
    animation: fadeIn 0.3s ease;
}

.explanation-card.exp-correct {
    background: var(--success-light);
    border: 1px solid #86efac;
    color: #14532d;
}

.explanation-card.exp-wrong {
    background: var(--danger-light);
    border: 1px solid #fca5a5;
    color: #7f1d1d;
}

.exp-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.exp-content {
    font-size: 0.9rem;
    line-height: 1.5;
}

.practice-nav-bar {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

/* --- EXAM MODE VIEW (NSEIT SIMULATION) --- */
.exam-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.5rem;
}

.exam-top-sticky {
    position: sticky;
    top: 65px;
    z-index: 40;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.75rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.timer-badge {
    font-family: monospace;
    font-size: 1.3rem;
    font-weight: 800;
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-sm);
    letter-spacing: 0.05em;
}

.timer-badge.normal {
    background: var(--primary-light);
    color: var(--primary);
}

.timer-badge.warning {
    background: var(--warning-light);
    color: var(--warning);
}

.timer-badge.urgent-pulse {
    background: var(--danger);
    color: #ffffff;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.exam-question-sheet {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    min-height: 480px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.exam-options-group {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin: 1.5rem 0;
}

.exam-option-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: var(--bg-elevated);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.9rem 1.15rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.exam-option-item:hover {
    border-color: var(--accent);
}

.exam-option-item.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}

.exam-option-item input[type="radio"] {
    display: none;
}

.opt-letter-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: white;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.exam-option-item.selected .opt-letter-circle {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.exam-actions-bar {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

/* PALETTE SIDEBAR */
.exam-palette-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 65px;
    max-height: calc(100vh - 85px);
    display: flex;
    flex-direction: column;
}

.palette-legend {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
    font-size: 0.78rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.legend-dot {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    display: inline-block;
    flex-shrink: 0;
}

.legend-dot.answered { background: var(--success); }
.legend-dot.not-answered { background: var(--danger); }
.legend-dot.review { background: var(--review-purple); }
.legend-dot.answered-review { background: var(--review-purple); border: 2px solid var(--success); }
.legend-dot.not-visited { background: #cbd5e1; }

.palette-scroll-area {
    overflow-y: auto;
    flex: 1;
    margin-bottom: 1rem;
    padding-right: 0.25rem;
}

.palette-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.45rem;
}

.palette-btn {
    height: 38px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.1s ease;
}

.palette-btn.current {
    box-shadow: 0 0 0 2px #000, 0 0 0 4px var(--primary);
}

.palette-btn.not-visited {
    background: #e2e8f0;
    color: var(--text-secondary);
}

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

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

.palette-btn.review {
    background: var(--review-purple);
    color: white;
}

.palette-btn.answered-review {
    background: var(--review-purple);
    color: white;
    border: 2px solid var(--success);
}

.palette-submit-btn {
    width: 100%;
}

/* --- RESULT VIEW --- */
.result-container {
    max-width: 900px;
    margin: 0 auto;
}

.result-hero-card {
    text-align: center;
    padding: 2.5rem 2rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    color: white;
}

.result-hero-card.pass {
    background: linear-gradient(135deg, #16a34a, #059669);
    box-shadow: 0 10px 20px rgba(22, 163, 74, 0.2);
}

.result-hero-card.fail {
    background: linear-gradient(135deg, #ea580c, #dc2626);
    box-shadow: 0 10px 20px rgba(220, 38, 38, 0.2);
}

.result-badge-icon {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
}

.result-headline {
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.result-sub {
    font-size: 1rem;
    opacity: 0.95;
    margin-top: 0.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.result-metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.result-metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    text-align: center;
}

.result-metric-card .num {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
}

.result-metric-card .lbl {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-top: 0.25rem;
}

.breakdown-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.data-table th, .data-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    background: var(--bg-elevated);
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
}

.result-action-bar {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* --- REVIEW MODE --- */
.review-container {
    max-width: 900px;
    margin: 0 auto;
}

.review-filter-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: var(--bg-card);
    padding: 0.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.review-filter-btn {
    flex: 1;
    padding: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
}

.review-filter-btn.active {
    background: var(--primary);
    color: white;
}

.review-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.review-card.correct { border-left: 5px solid var(--success); }
.review-card.incorrect { border-left: 5px solid var(--danger); }
.review-card.unattempted { border-left: 5px solid #94a3b8; }

.review-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.review-question-text {
    font-size: 1.05rem;
    margin-bottom: 1.25rem;
}

.review-options-grid {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
}

.review-option-pill {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    font-size: 0.9rem;
}

.review-option-pill.correct-opt {
    background: var(--success-light);
    border-color: var(--success);
}

.review-option-pill.wrong-opt {
    background: var(--danger-light);
    border-color: var(--danger);
}

.tag-badge {
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 9999px;
}
.tag-badge.tag-correct { background: var(--success); color: white; }
.tag-badge.tag-wrong { background: var(--danger); color: white; }

.review-explanation-box {
    background: #f8fafc;
    border-top: 1px dashed var(--border);
    padding-top: 1rem;
    font-size: 0.88rem;
    color: var(--text-secondary);
}

/* --- ADMIN PANEL VIEW --- */
.admin-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 1.5rem;
}

.admin-sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    height: fit-content;
}

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: left;
    margin-bottom: 0.25rem;
    transition: all 0.15s ease;
}

.admin-nav-item:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

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

.admin-pane {
    display: none;
}
.admin-pane.active {
    display: block;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    background: #ffffff;
    transition: border-color 0.15s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 76, 129, 0.15);
}

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

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.csv-drop-zone {
    border: 2px dashed var(--border-hover);
    border-radius: var(--radius-md);
    padding: 2.5rem 1.5rem;
    text-align: center;
    background: var(--bg-elevated);
    cursor: pointer;
    transition: all 0.2s ease;
}

.csv-drop-zone:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

/* --- MODALS & OVERLAYS --- */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 1rem;
}

.modal-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 680px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalIn 0.2s ease;
}

.modal-card.modal-sm {
    max-width: 440px;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    background: var(--bg-elevated);
}

/* TOASTS */
.toast-message {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #1e293b;
    color: white;
    padding: 0.85rem 1.35rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 150;
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 0;
    transform: translateY(15px);
    transition: all 0.25s ease;
}

.toast-message.visible {
    opacity: 1;
    transform: translateY(0);
}

.toast-message.toast-success { background: #15803d; }
.toast-message.toast-error   { background: #b91c1c; }
.toast-message.toast-warning { background: #b45309; }

/* LOADING OVERLAY */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(2px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 200;
    gap: 1rem;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--primary-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

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

/* RESPONSIVE DESIGN */
@media (max-width: 900px) {
    .exam-layout {
        grid-template-columns: 1fr;
    }
    .exam-palette-card {
        position: static;
        max-height: none;
    }
    .admin-layout {
        grid-template-columns: 1fr;
    }
    .stats-summary-grid {
        grid-template-columns: 1fr 1fr;
    }
    .result-metrics-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .header-inner {
        flex-direction: column;
        align-items: flex-start;
    }
    .header-controls {
        width: 100%;
        justify-content: space-between;
    }
    .hero-cta-banner {
        flex-direction: column;
        align-items: flex-start;
    }
    .stats-summary-grid {
        grid-template-columns: 1fr;
    }
    .chapter-grid {
        grid-template-columns: 1fr;
    }
    .form-grid-2, .form-grid-4 {
        grid-template-columns: 1fr;
    }
}
