/* ==========================================================================
   DESIGN SYSTEM & MODERN STYLING FOR EDTECH PLATFORM
   ========================================================================== */

:root {
    --bg-dark: #070d19;
    --bg-darker: #030712;
    --card-bg: rgba(15, 23, 42, 0.55);
    --card-border: rgba(255, 255, 255, 0.07);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #818cf8;
    --accent-glow: rgba(129, 140, 248, 0.25);
    --primary: #6366f1;
    --success: #10b981;
    --danger: #f43f5e;
    --warning: #f59e0b;
    --info: #06b6d4;
    --font-main: 'Outfit', sans-serif;
    --font-heading: 'Plus Jakarta Sans', sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-darker);
    color: var(--text-primary);
    font-family: var(--font-main);
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* Background Glows */
.bg-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(140px);
    z-index: -1;
    opacity: 0.45;
    pointer-events: none;
}

.bg-glow-1 {
    top: -100px;
    left: -100px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.2) 0%, rgba(0,0,0,0) 70%);
}

.bg-glow-2 {
    bottom: -150px;
    right: -100px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.2) 0%, rgba(0,0,0,0) 70%);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-darker);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Layout Container */
.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
}

.hidden {
    display: none !important;
}

.text-center { text-align: center; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.accent { color: var(--accent); }
.gradient-text {
    background: linear-gradient(135deg, var(--accent), var(--info));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Glassmorphism Card Style */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 2rem;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    transition: var(--transition);
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 15px 35px -8px rgba(0, 0, 0, 0.6);
}

/* App Header */
header {
    background: rgba(7, 13, 25, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: 0.5px;
}

.logo-icon {
    font-size: 1.6rem;
    filter: drop-shadow(0 0 8px var(--accent));
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.role-badge {
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--accent);
    padding: 0.25rem 0.75rem;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.username {
    font-weight: 500;
    color: var(--text-primary);
}

/* Screens */
.screen {
    animation: fadeIn 0.4s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Buttons */
.btn {
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.75rem 1.75rem;
    border-radius: 12px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #4f46e5 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-success {
    background: var(--success);
    color: #fff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    box-shadow: 0 4px 12px rgba(244, 63, 94, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(244, 63, 94, 0.4);
}

.btn-sm {
    padding: 0.45rem 1rem;
    font-size: 0.8rem;
    border-radius: 8px;
}

.btn-block {
    width: 100%;
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

input[type="text"], input[type="password"], input[type="number"], select, textarea {
    width: 100%;
    padding: 0.85rem 1.1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.95rem;
    transition: var(--transition);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

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

/* 1. Login Screen Spec */
.login-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 100px);
    padding: 2rem 1rem;
    max-width: 450px;
    margin: 0 auto;
}

.logo-large {
    font-size: 3rem;
    background: rgba(99, 102, 241, 0.15);
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    border: 1px solid rgba(99, 102, 241, 0.3);
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 0 15px rgba(99, 102, 241, 0.3));
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.login-card {
    width: 100%;
}

.login-footer {
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 1.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.demo-creds {
    margin-top: 0.75rem;
    background: rgba(0, 0, 0, 0.25);
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.demo-creds code {
    color: var(--accent);
    font-weight: 600;
}

.alert {
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    border: 1px solid transparent;
}

.alert-danger {
    background: rgba(244, 63, 94, 0.1);
    border-color: rgba(244, 63, 94, 0.25);
    color: #fda4af;
}

/* 2. Welcome Banner */
.welcome-banner {
    margin-bottom: 2.5rem;
}

.welcome-banner h1 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.welcome-banner p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* 3. Dashboard Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.col-span-2 {
    grid-column: span 2;
}

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

.card-header h2 {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.3rem;
}

.indicator-live {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--success);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: pulse 2s infinite;
}

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

/* Tables */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th, td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

th {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    font-size: 0.95rem;
}

.exam-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Stat Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
}

.stat-icon {
    font-size: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon.purple { background: rgba(99, 102, 241, 0.12); color: var(--accent); }
.stat-icon.green { background: rgba(16, 185, 129, 0.12); color: var(--success); }
.stat-icon.blue { background: rgba(6, 182, 212, 0.12); color: var(--info); }

.stat-content h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-content p {
    font-size: 1.8rem;
    font-weight: 700;
    font-family: var(--font-heading);
}

/* Results History Panel */
.result-history-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.result-history-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-history-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.result-history-info span {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.result-history-score {
    text-align: right;
}

.result-history-score strong {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
}

/* Form compact */
.form-compact {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-compact .form-group {
    margin-bottom: 0;
}

/* 4. Live Exam Engine Layout */
.full-screen {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #060a13;
}

.exam-engine-header {
    background: #0b1325;
    border-bottom: 2px solid rgba(255, 255, 255, 0.08);
    padding: 0.8rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.exam-meta h2 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
}

.exam-tag {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: rgba(255,255,255,0.06);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
}

.exam-section-tabs {
    display: flex;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.3rem;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.04);
}

.section-tab {
    padding: 0.45rem 1.25rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
}

.section-tab.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

.exam-timer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.3);
    padding: 0.45rem 1.25rem;
    border-radius: 10px;
}

.timer-clock {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.2rem;
    color: #fca5a5;
    letter-spacing: 0.5px;
}

.exam-container-split {
    display: grid;
    grid-template-columns: 1fr 340px;
    flex-grow: 1;
    overflow: hidden;
}

.exam-question-area {
    padding: 2.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: #090f1d;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

.question-number-badge {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent);
}

.question-score-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.marks-plus { color: var(--success); background: rgba(16,185,129,0.1); padding: 0.2rem 0.5rem; border-radius: 4px; }
.marks-minus { color: var(--danger); background: rgba(244,63,94,0.1); padding: 0.2rem 0.5rem; border-radius: 4px; }

.question-body {
    flex-grow: 1;
    margin-bottom: 3rem;
}

.question-text {
    font-size: 1.2rem;
    line-height: 1.7;
    margin-bottom: 2.5rem;
    color: var(--text-primary);
    white-space: pre-line;
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.option-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 1.1rem 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.option-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
}

.option-item.selected {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.15);
}

.option-marker {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
}

.option-item.selected .option-marker {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.question-actions-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 1.5rem;
}

.nav-arrows {
    display: flex;
    gap: 0.75rem;
}

/* Sidebar navigation */
.exam-palette-sidebar {
    background: #0a1120;
    border-left: 2px solid rgba(255, 255, 255, 0.08);
    padding: 1.8rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow-y: auto;
}

.exam-palette-sidebar h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.palette-btn {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.palette-btn:hover {
    border-color: rgba(255,255,255,0.3);
    color: #fff;
}

.palette-btn.active {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.palette-btn.answered {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}

.palette-btn.marked-review {
    background: var(--warning);
    border-color: var(--warning);
    color: #fff;
}

.palette-btn.visited-unanswered {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

.palette-legend {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: rgba(0,0,0,0.2);
    padding: 1rem;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.03);
    margin-bottom: 2rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.legend-item .badge {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.badge-answered { background: var(--success); }
.badge-review { background: var(--warning); }
.badge-unvisited { background: var(--danger); }

.sidebar-actions {
    margin-top: auto;
}

/* 5. Result Viewer Screen */
.result-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.result-header h1 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 700;
}

.result-header p {
    color: var(--text-secondary);
}

.result-summary-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.result-badge-container {
    position: relative;
    margin-bottom: 2rem;
}

.result-percentage-ring {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: 8px solid rgba(99, 102, 241, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    font-weight: 700;
    font-family: var(--font-heading);
    color: #fff;
    box-shadow: 0 0 25px var(--accent-glow);
    background: linear-gradient(135deg, rgba(99,102,241,0.05), rgba(6,182,212,0.05));
    border-top-color: var(--accent); /* will be styled dynamically via JS */
}

.status-pill {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--success);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.3rem 0.9rem;
    border-radius: 30px;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
    letter-spacing: 0.5px;
}

.status-pill.failed {
    background: var(--danger);
    box-shadow: 0 4px 10px rgba(244, 63, 94, 0.3);
}

.result-summary-card h2 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    margin-bottom: 0.2rem;
}

.candidate-meta {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 2rem;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    width: 100%;
    margin-bottom: 2rem;
}

.metric {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    padding: 0.75rem;
    text-align: center;
}

.metric span {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.metric strong {
    font-size: 1.05rem;
    font-weight: 700;
}

/* Sections progress visual */
.sections-progress-list {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.section-progress-item {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.section-progress-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 500;
}

.section-progress-meta span {
    color: var(--text-secondary);
}

.section-progress-bar-wrapper {
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
}

.section-progress-bar {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--accent) 0%, var(--info) 100%);
    width: 0%; /* Dynamic */
    transition: width 1s ease-out;
}

/* 6. Modal Dialogs */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(3, 7, 18, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    width: 100%;
    max-width: 650px;
    animation: zoomIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

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

.modal-header h2 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
}

.close-btn {
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
}

.close-btn:hover {
    color: #fff;
}

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

/* Admin Grid Layout override */
.admin-grid {
    margin-top: 2rem;
}

/* compact tables in analytics details */
.analytics-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 2rem;
    margin-top: 2.5rem;
    animation: fadeIn 0.4s ease-out;
}

.analytics-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.analytic-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    padding: 1rem;
    border-radius: 12px;
}

.analytic-item span {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.analytic-item strong {
    font-size: 1.2rem;
    font-weight: 700;
    font-family: var(--font-heading);
}

/* Responsiveness adjustments */
@media (max-width: 900px) {
    .dashboard-grid, .stats-grid, .form-row, .analytics-grid {
        grid-template-columns: 1fr;
    }
    .col-span-2 {
        grid-column: span 1;
    }
    .exam-container-split {
        grid-template-columns: 1fr;
        height: auto;
    }
    .exam-palette-sidebar {
        border-left: none;
        border-top: 2px solid rgba(255, 255, 255, 0.08);
        height: auto;
    }
}

/* Analysis/Review mode styling */
.option-item.correct-option {
    border-color: var(--success) !important;
    background: rgba(16, 185, 129, 0.12) !important;
}

.option-item.correct-option .option-marker {
    background: var(--success) !important;
    border-color: var(--success) !important;
    color: #fff !important;
}

.option-item.incorrect-option {
    border-color: var(--danger) !important;
    background: rgba(244, 63, 94, 0.12) !important;
}

.option-item.incorrect-option .option-marker {
    background: var(--danger) !important;
    border-color: var(--danger) !important;
    color: #fff !important;
}

.explanation-box {
    margin-top: 2rem;
    padding: 1.5rem !important;
    background: rgba(255, 255, 255, 0.03) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    border-left: 4px solid var(--accent) !important;
    border-radius: 12px !important;
}

.explanation-box h4 {
    font-family: var(--font-heading);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.explanation-box p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
    white-space: pre-line;
}

.palette-btn.analysis-correct {
    background: var(--success) !important;
    border-color: var(--success) !important;
    color: #fff !important;
}

.palette-btn.analysis-wrong {
    background: var(--danger) !important;
    border-color: var(--danger) !important;
    color: #fff !important;
}

.palette-btn.analysis-skipped {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    color: var(--text-secondary) !important;
}

/* UPSC Premium Statement & Explanation Formatting */
.statement-title, .assertion-title, .reason-title {
    color: var(--accent);
    font-weight: 700;
    display: inline-block;
    margin-top: 0.5rem;
}

.list-number {
    color: var(--accent);
    font-weight: 600;
}

.final-question {
    font-weight: 700;
    color: #fff;
    border-left: 3px solid var(--accent);
    padding-left: 0.75rem;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    display: block;
}

.statement-eval {
    color: var(--accent);
    font-weight: 600;
    display: inline-block;
    margin-top: 0.5rem;
}

.explanation-transition, .explanation-conclusion {
    color: #fff;
    font-weight: 700;
}

.explanation-contradict {
    color: var(--danger);
    font-weight: 600;
}

.explanation-support {
    color: var(--success);
    font-weight: 600;
}

/* Premium Mobile Responsiveness (Screens under 600px) */
@media (max-width: 600px) {
    body {
        font-size: 0.95rem;
    }
    
    .container {
        padding: 0.75rem !important;
    }
    
    /* Main Header Layout */
    .main-header {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem !important;
        text-align: center;
    }
    
    .header-user-info {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
        width: 100%;
    }
    
    /* Dashboard Buttons & Tables */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-top: 1rem;
    }
    
    table {
        min-width: 500px; /* Force horizontal scroll for data table instead of squeezing columns */
    }
    
    /* Exam Container & Layout Split */
    .exam-container-split {
        height: auto;
        display: flex;
        flex-direction: column-reverse; /* Put palette/timer above questions on mobile for quick access */
    }
    
    .exam-main-panel {
        padding: 1.25rem !important;
        overflow-y: visible;
    }
    
    .exam-palette-sidebar {
        width: 100% !important;
        height: auto !important;
        padding: 1.25rem !important;
        border-top: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }
    
    /* Question and Options */
    .question-text {
        font-size: 1.05rem !important;
        line-height: 1.6;
        margin-bottom: 1.75rem;
    }
    
    .option-item {
        padding: 0.85rem 1rem !important;
        border-radius: 10px;
    }
    
    .option-marker {
        width: 28px !important;
        height: 28px !important;
        font-size: 0.85rem !important;
    }
    
    /* Palette Grid */
    #exam-palette-grid {
        grid-template-columns: repeat(6, 1fr) !important; /* Nice compact columns on mobile */
        gap: 0.4rem !important;
        max-height: 200px;
        overflow-y: auto;
    }
    
    .palette-btn {
        height: 38px !important;
        font-size: 0.85rem !important;
        border-radius: 8px !important;
    }
    
    /* Exam Header and Timer */
    .exam-header {
        padding: 0.85rem 1rem !important;
        flex-direction: column;
        gap: 0.6rem;
        align-items: flex-start;
    }
    
    .exam-timer {
        align-self: flex-end;
        padding: 0.4rem 0.8rem !important;
        border-radius: 8px !important;
    }
    
    /* Result Screen Ring */
    .result-ring-container {
        width: 130px !important;
        height: 130px !important;
    }
    
    .result-score-inner h2 {
        font-size: 1.5rem !important;
    }
    
    /* Navigation Footer and Arrows */
    .question-actions-footer {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem !important;
    }
    
    .nav-arrows {
        width: 100%;
        justify-content: space-between;
    }
    
    .nav-arrows button {
        flex: 1;
        justify-content: center;
    }
    
    .question-actions-footer button {
        width: 100%;
        justify-content: center;
    }
    
    .explanation-box {
        padding: 1.1rem !important;
        border-radius: 10px;
    }
    
    .explanation-box h4 {
        font-size: 0.95rem;
    }
    
    .explanation-box p {
        font-size: 0.85rem;
    }
}
