:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --success: #22c55e;
    --error: #ef4444;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
}

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

h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
}

.logout-btn {
    color: var(--text-muted);
    text-decoration: none;
}

.logout-btn:hover {
    color: var(--error);
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.card,
.login-card {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 600px;
}

.login-card {
    text-align: center;
}

.login-card h2 {
    margin-bottom: 1rem;
}

.login-card p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.google-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: #fff;
    border: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s;
}

.google-btn:hover {
    background: #f1f5f9;
}

.google-btn img {
    width: 20px;
    height: 20px;
}

/* Question Interface */
.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.badge {
    background: #e0f2fe;
    color: #0369a1;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

#timer {
    font-family: monospace;
    font-size: 1.25rem;
    color: var(--text-muted);
}

.question-text {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 2rem;
}

.options-grid {
    display: grid;
    gap: 1rem;
}

.option-btn {
    background: #fff;
    border: 2px solid var(--border);
    padding: 1rem;
    border-radius: 0.75rem;
    text-align: left;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text);
}

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

.option-btn.selected {
    border-color: var(--primary);
    background: #eff6ff;
}

.option-btn.correct {
    border-color: var(--success);
    background: #dcfce7;
    color: #14532d;
}

.option-btn.incorrect {
    border-color: var(--error);
    background: #fee2e2;
    color: #7f1d1d;
}

.feedback {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

#feedback-message {
    font-weight: 700;
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

#feedback-details {
    font-size: 0.875rem;
    color: var(--text-muted);
    background: #f8fafc;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.primary-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    font-size: 1rem;
}

.primary-btn:hover {
    background: var(--primary-hover);
}

.stats-bar {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
}

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

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}

footer {
    margin-top: 4rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
}

footer a {
    color: var(--text-muted);
    margin: 0 0.5rem;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Enhanced UI */
.hero-text {
    margin-bottom: 2rem;
    text-align: left;
}

.hero-text h2 {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.125rem;
    color: var(--text);
    margin-bottom: 1.5rem;
}

.features-list {
    list-style: none;
    text-align: left;
    margin-bottom: 2rem;
}

.features-list li {
    margin-bottom: 0.75rem;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Category Selection */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.category-btn {
    background: white;
    border: 2px solid var(--border);
    border-radius: 1rem;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.category-btn:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.category-btn .icon {
    font-size: 2rem;
}

.category-btn .label {
    font-weight: 600;
    color: var(--text);
}

/* Session Nav (Top Bar) */
.session-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: white;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    margin: -2rem -2rem 2rem -2rem;
    /* Negative margin to stretch full width if inside container */
    /* Actually, if we hide main header, we might want this to be fixed top */
}

/* If we hide main header, we need to adjust container padding or make nav fixed */
/* Let's make it simple: sticky within the container, but container has padding */
/* Better: make it look like a header */

.nav-left,
.nav-right {
    flex: 1;
    display: flex;
    align-items: center;
}

.nav-right {
    justify-content: flex-end;
}

.nav-center {
    flex: 0 0 auto;
}

.timer-container {
    font-size: 1.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--primary);
    background: #eff6ff;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
}

#exit-session {
    font-size: 1rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#exit-session:hover {
    color: var(--error);
}

/* Question Header */
.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.q-number {
    font-weight: 600;
    color: var(--text-muted);
}

.q-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    padding: 0.25rem;
    transition: transform 0.2s;
}

.icon-btn:hover {
    transform: scale(1.1);
}

.favorite-btn {
    opacity: 0.5;
    filter: grayscale(100%);
}

.favorite-btn.active {
    opacity: 1;
    filter: none;
}

.report-link {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.report-link:hover {
    color: var(--error);
    text-decoration: underline;
}

.text-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.875rem;
    padding: 0;
}

.text-btn:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* Exam Controls (Next/Prev) */
.exam-controls {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.secondary-btn {
    background: white;
    border: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text);
}

.secondary-btn:hover:not(:disabled) {
    background: #f1f5f9;
    border-color: var(--text-muted);
}

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

/* Exam Navigation Grid */
.exam-navigation {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 0.5rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.nav-btn {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    background: white;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

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

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

.nav-btn.answered {
    background: #eff6ff;
    border-color: var(--primary);
    color: var(--primary);
}

.nav-btn.correct {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.nav-btn.incorrect {
    background: var(--error);
    color: white;
    border-color: var(--error);
}

/* Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

#loading {
    text-align: center;
    padding: 3rem;
}

/* Stats hidden initially */
/* New Dashboard Styles */
.stats-overview h3,
.exam-section h3 {
    margin-bottom: 1rem;
    color: var(--text);
    font-size: 1.25rem;
}

.category-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

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

.stat-card .cat-title {
    font-weight: 700;
    font-size: 1.125rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-card .stats-row {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.stat-pill {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-weight: 600;
}

.stat-pill.green {
    background: #dcfce7;
    color: #166534;
}

.stat-pill.red {
    background: #fee2e2;
    color: #991b1b;
}

.dashboard-divider {
    height: 1px;
    background: var(--border);
    margin: 2rem 0;
}

.exam-buttons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.exam-launch-btn {
    background: white;
    border: 2px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.exam-launch-btn:hover {
    border-color: var(--primary);
    background: #eff6ff;
}

.exam-launch-btn .icon {
    font-size: 2rem;
}

.exam-launch-btn .text {
    font-weight: 600;
    color: var(--text);
}

.exam-launch-btn .sub {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.history-item {
    background: white;
    border: 1px solid var(--border);
    padding: 1rem;
    border-radius: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

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

.history-type {
    font-weight: 600;
}

.history-result {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.result-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 700;
}

.result-badge.apto {
    background: #dcfce7;
    color: #166534;
}

.result-badge.no-apto {
    background: #fee2e2;
    color: #991b1b;
}

.review-btn {
    background: none;
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
}

.review-btn:hover {
    background: #f1f5f9;
    color: var(--primary);
    border-color: var(--primary);
}

.failed-mode-banner {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    padding: 1.5rem;
    border-radius: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.failed-mode-banner h3 {
    margin-bottom: 0.25rem;
    color: #9a3412;
}

.failed-mode-banner p {
    color: #c2410c;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Sub Views */
.sub-view {
    animation: fadeIn 0.3s ease;
}

/* .sub-view.hidden is now covered by global .hidden */

.sub-view-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.back-btn {
    font-size: 1rem;
    color: var(--primary);
    font-weight: 600;
}

/* Mode Grid (Main Menu) */
.mode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.mode-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.mode-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.mode-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.mode-card h3 {
    font-size: 1.25rem;
    color: var(--text);
}

.mode-card p {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Landing Page Styles --- */

/* Header */
.landing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--text);
}

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

.nav-login-btn {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: background 0.2s;
}

.nav-login-btn:hover {
    background: #eff6ff;
}

/* Hero Section */
.hero-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    max-width: 1200px;
    margin: 4rem auto;
    padding: 0 2rem;
}

.hero-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.hero-badge {
    display: inline-block;
    background: #eff6ff;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    width: fit-content;
}

.hero-section h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    color: var(--text);
    font-weight: 800;
}

.hero-section h1 .highlight {
    color: var(--primary);
    background: linear-gradient(120deg, #dbeafe 0%, #eff6ff 100%);
    padding: 0 0.5rem;
    border-radius: 0.5rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 500px;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 1rem;
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--primary);
    color: white;
    padding: 1rem 2rem;
    border-radius: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
    background: var(--primary-hover);
}

.google-cta {
    background: white;
    color: var(--text);
    border: 1px solid var(--border);
}

.google-cta:hover {
    background: #f8fafc;
}

.secondary-cta {
    color: var(--text-muted);
    font-weight: 600;
    text-decoration: none;
}

.secondary-cta:hover {
    color: var(--text);
}

.trust-badges {
    display: flex;
    gap: 1.5rem;
    margin-top: 2rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.hero-image img {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 20px 25px -5px rgba(0, 0, 0, 0.1));
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }

    100% {
        transform: translateY(0px);
    }
}

/* Features Section */
.features-section {
    background: white;
    padding: 6rem 2rem;
    margin-top: 4rem;
}

.section-header {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 4rem;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--text);
}

.section-header p {
    font-size: 1.25rem;
    color: var(--text-muted);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card {
    background: var(--bg);
    padding: 2rem;
    border-radius: 1.5rem;
    transition: transform 0.2s;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    background: white;
    width: fit-content;
    padding: 1rem;
    border-radius: 1rem;
    box-shadow: var(--shadow);
}

.feature-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.feature-card p {
    color: var(--text-muted);
    line-height: 1.6;
}

/* Footer */
.landing-footer {
    background: var(--text);
    color: white;
    padding: 4rem 2rem;
    margin-top: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: white;
}

/* App Header (Logged In) */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

/* Responsive */
@media (max-width: 768px) {

    /* Global Typography & Layout */
    html {
        font-size: 14px;
        /* Base font size reduction */
    }

    .container {
        padding: 1rem;
    }

    h1 {
        font-size: 1.75rem;
    }

    /* Landing Page - Header */
    .landing-header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    /* Landing Page - Hero */
    .hero-section {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3rem;
        margin: 2rem auto;
        padding: 0 1rem;
    }

    .hero-content {
        align-items: center;
    }

    .hero-section h1 {
        font-size: 2.25rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
    }

    .cta-btn {
        width: 100%;
        justify-content: center;
    }

    .trust-badges {
        flex-direction: column;
        gap: 0.5rem;
    }

    /* Landing Page - Features */
    .features-section {
        padding: 4rem 1rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* Landing Page - Footer */
    .landing-footer {
        padding: 3rem 1rem;
        text-align: center;
    }

    .footer-content {
        flex-direction: column;
        gap: 2rem;
    }

    .footer-links {
        flex-direction: column;
        gap: 1rem;
    }

    /* App Interface - Header */
    .app-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .user-info {
        width: 100%;
        justify-content: space-between;
    }

    /* App Interface - Dashboard */
    .mode-grid {
        grid-template-columns: 1fr;
    }

    .exam-buttons-grid {
        grid-template-columns: 1fr;
    }

    /* App Interface - Session */
    .session-nav {
        margin: -1rem -1rem 1rem -1rem;
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .nav-center {
        order: -1;
        width: 100%;
        display: flex;
        justify-content: center;
        margin-bottom: 0.5rem;
    }

    .nav-left,
    .nav-right {
        flex: 1;
    }

    .timer-container {
        font-size: 1.25rem;
        padding: 0.25rem 0.75rem;
    }

    /* Question Header - Mobile */
    .question-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .q-actions {
        width: 100%;
        justify-content: space-between;
    }

    .icon-btn {
        font-size: 2rem;
        /* Larger touch target */
        padding: 0.5rem;
    }

    .report-link {
        font-size: 1rem;
        padding: 0.5rem;
    }

    .question-text {
        font-size: 1.2rem;
        /* Larger text */
        line-height: 1.6;
    }

    .option-btn {
        padding: 1rem;
        font-size: 1.1rem;
        min-height: 60px;
        /* Ensure easy tapping */
    }

    /* Exam Controls - Mobile */
    .exam-controls {
        flex-direction: row;
        /* Keep side by side but larger */
        gap: 1rem;
    }

    .secondary-btn {
        flex: 1;
        padding: 1rem;
        font-size: 1.1rem;
        justify-content: center;
        display: flex;
    }

    /* Exam Navigation Grid - Mobile */
    .exam-navigation {
        grid-template-columns: repeat(auto-fill, minmax(45px, 1fr));
        /* Slightly larger cells */
        gap: 0.75rem;
    }

    .nav-btn {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }

    /* App Interface - Results */
    .stats-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .stat-box {
        width: 100%;
        margin-bottom: 0.5rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem;
        border-radius: 0.5rem;
        background: #f8fafc;
    }

    .stat-box.correct {
        background: #dcfce7;
        color: #166534;
    }

    .stat-box.incorrect {
        background: #fee2e2;
        color: #991b1b;
    }

    .stat-box.blank {
        background: #f1f5f9;
        color: #64748b;
    }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-card {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

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

.modal-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

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

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

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

.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-family: inherit;
    font-size: 1rem;
}

.form-group textarea {
    resize: vertical;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}