/* ============================================
   Aviation MCQ Test - Stylesheet
   ============================================ */

:root {
    --nav-height: 60px;
    --primary: #0ea5e9;
    --primary-dark: #0284c7;
    --primary-light: #38bdf8;
    --success: #22c55e;
    --success-light: #dcfce7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --warning: #f59e0b;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.1);
    --radius: 12px;
    --radius-lg: 16px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
    min-height: 100vh;
    color: var(--gray-800);
    line-height: 1.6;
}

/* Page Management */
#app {
    position: relative;
    min-height: 100vh;
    /* Offset fixed top navbar so it never overlaps page content */
    padding-top: var(--nav-height);
}

.page {
    display: none;
    min-height: 100vh;
}

.page.active {
    display: block;
}

/* Container */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

/* ============================================
   Home Page
   ============================================ */

/* ============================================
   Navigation Bar
   ============================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--nav-height);
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: white;
}

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

.nav-title {
    font-weight: 700;
    font-size: 1.1rem;
}

.nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.nav-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

.hamburger {
    width: 20px;
    height: 2px;
    background: white;
    position: relative;
    transition: all 0.3s;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 2px;
    background: white;
    left: 0;
    transition: all 0.3s;
}

.hamburger::before {
    top: -6px;
}

.hamburger::after {
    top: 6px;
}

.nav-toggle.active .hamburger {
    background: transparent;
}

.nav-toggle.active .hamburger::before {
    transform: rotate(45deg);
    top: 0;
}

.nav-toggle.active .hamburger::after {
    transform: rotate(-45deg);
    top: 0;
}

.nav-menu {
    position: absolute;
    top: var(--nav-height);
    right: 0;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(10px);
    min-width: 220px;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: none;
}

.nav-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-link:last-child {
    border-bottom: none;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding-left: 25px;
}

.nav-icon {
    font-size: 1.1rem;
}

.nav-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.15);
    margin: 5px 15px;
}

/* Exam options in navbar */
.nav-link.exam-options {
    background: rgba(59, 130, 246, 0.1);
}

.nav-link.exam-options:hover {
    background: rgba(59, 130, 246, 0.2);
}

/* Results hint */
.results-hint {
    color: var(--gray-500);
    font-size: 0.95rem;
    margin-top: 1.5rem;
    text-align: center;
}

/* ============================================
   Home Page
   ============================================ */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    /* #app already adds nav-height padding; keep a little extra spacing */
    padding-top: calc(var(--nav-height) + 20px);
    position: relative;
}

.hero-content {
    background: var(--white);
    padding: 3rem 4rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 600px;
}

.hero h1 {
    font-size: 2.5rem;
    color: var(--gray-900);
    margin-bottom: 1rem;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--gray-500);
    margin-bottom: 2rem;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.stat {
    text-align: center;
}

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

.stat-text {
    font-size: 0.85rem;
    color: var(--gray-500);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

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

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

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

.btn-danger:hover {
    background: #dc2626;
}

.btn-large {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
}

.btn-back {
    background: none;
    border: none;
    color: var(--gray-500);
    font-size: 1rem;
    cursor: pointer;
    padding: 0.5rem;
    margin-bottom: 1rem;
    transition: color 0.2s;
}

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

.arrow {
    transition: transform 0.2s;
}

.btn:hover .arrow {
    transform: translateX(4px);
}

/* ============================================
   Subject Selection
   ============================================ */
#subject-page {
    background: var(--gray-50);
}

#subject-page h2 {
    font-size: 2rem;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: var(--gray-500);
    margin-bottom: 2rem;
}

/* ============================================
   Subject Options (Mock / Practice)
   ============================================ */
#subject-options-page {
    background: var(--gray-50);
}

.mode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.mode-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 2px solid transparent;
}

.mode-card:hover {
    border-color: rgba(14, 165, 233, 0.35);
}

.mode-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.mode-card h3 {
    margin-bottom: 0.25rem;
    color: var(--gray-900);
}

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

.mode-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    text-align: left;
}

.field span {
    font-size: 0.9rem;
    color: var(--gray-700);
    font-weight: 500;
}

.field input {
    padding: 0.75rem 0.9rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 1rem;
    outline: none;
}

.field input:focus {
    border-color: rgba(14, 165, 233, 0.75);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.12);
}

.mode-actions {
    display: flex;
    gap: 0.75rem;
}

.mode-actions .btn {
    flex: 1;
}

/* Timer badge */
.timer-badge {
    background: rgba(239, 68, 68, 0.12);
    color: rgb(239, 68, 68);
    border: 1px solid rgba(239, 68, 68, 0.25);
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.85rem;
}

/* Practice mode tweaks */
#quiz-page.practice-mode .option {
    cursor: pointer;
}

#quiz-page.practice-mode .option:hover {
    border-color: var(--gray-300);
    background: var(--gray-50);
}

#quiz-page.practice-mode .option.correct {
    background: rgba(34, 197, 94, 0.12);
}

#quiz-page.practice-mode .option.wrong {
    background: rgba(239, 68, 68, 0.12);
}

.option.disabled {
    cursor: default;
    opacity: 0.95;
}

.subject-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.subject-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    box-shadow: var(--shadow-sm);
}

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

.subject-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.subject-code {
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.subject-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.subject-count {
    font-size: 0.9rem;
    color: var(--gray-500);
}

/* ============================================
   Quiz Page
   ============================================ */
#quiz-page {
    background: var(--gray-50);
}

.quiz-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1.5rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.quiz-header {
    background: var(--white);
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.quiz-header .btn-back {
    margin-bottom: 0.5rem;
}

.quiz-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: var(--gray-600);
    margin-bottom: 0.75rem;
}

.separator {
    color: var(--gray-300);
}

.progress-bar {
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
}

.question-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    flex: 1;
    box-shadow: var(--shadow);
}

.question-number {
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 1rem;
}

.question-text {
    font-size: 1.2rem;
    color: var(--gray-800);
    line-height: 1.7;
    margin-bottom: 2rem;
}

/* Question Figure (for chart-based questions) */
#figure-container {
    margin-bottom: 1.5rem;
    text-align: center;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1rem;
}

.question-figure {
    max-width: 100%;
    max-height: 400px;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

@media (max-width: 768px) {
    .question-figure {
        max-height: 300px;
    }
}

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

.option {
    padding: 1rem 1.25rem;
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.option:hover {
    border-color: var(--primary);
    background: var(--white);
}

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

.option-marker {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--gray-600);
    flex-shrink: 0;
}

.option.selected .option-marker {
    background: var(--primary);
    color: var(--white);
}

.option-text {
    flex: 1;
    padding-top: 3px;
}

/* Review styles */
.option.correct {
    border-color: var(--success);
    background: var(--success-light);
}

.option.correct .option-marker {
    background: var(--success);
    color: var(--white);
}

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

.option.wrong .option-marker {
    background: var(--danger);
    color: var(--white);
}

.quiz-navigation {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-top: 1.5rem;
    gap: 1rem;
}

.quiz-navigation.mock-mode {
    justify-content: space-between;
}

.quiz-navigation .btn {
    flex: 1 1 180px;
}

/* ============================================
   Results Page
   ============================================ */
#results-page {
    background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
}

#results-page.page.active {
    display: flex;
    align-items: center;
}

.results-container {
    display: flex;
    justify-content: center;
}

.results-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 3rem;
    text-align: center;
    max-width: 500px;
    width: 100%;
    box-shadow: var(--shadow-lg);
}

.results-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.results-card h2 {
    font-size: 1.75rem;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.results-subject {
    color: var(--gray-500);
    margin-bottom: 2rem;
}

.score-display {
    margin-bottom: 2rem;
}

.score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--white);
    box-shadow: var(--shadow-lg);
}

.score-value {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
}

.score-label {
    font-size: 1.25rem;
    opacity: 0.9;
}

.results-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--gray-50);
    border-radius: var(--radius);
}

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

.stat-item .stat-icon {
    display: block;
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.stat-item.correct .stat-icon { color: var(--success); }
.stat-item.wrong .stat-icon { color: var(--danger); }
.stat-item.skipped .stat-icon { color: var(--gray-400); }

.stat-item .stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
}

.stat-item .stat-label {
    font-size: 0.85rem;
    color: var(--gray-500);
}

.results-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* ============================================
   Review Page
   ============================================ */
#review-page {
    background: var(--gray-50);
}

.review-header {
    margin-bottom: 2rem;
}

.review-header h2 {
    font-size: 1.75rem;
    color: var(--gray-900);
}

.review-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.review-item {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.review-item.correct {
    border-left: 4px solid var(--success);
}

.review-item.wrong {
    border-left: 4px solid var(--danger);
}

.review-item.skipped {
    border-left: 4px solid var(--gray-400);
}

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

.review-question-num {
    font-weight: 600;
    color: var(--gray-700);
}

.review-status {
    font-size: 0.85rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

.review-status.correct {
    background: var(--success-light);
    color: var(--success);
}

.review-status.wrong {
    background: var(--danger-light);
    color: var(--danger);
}

.review-status.skipped {
    background: var(--gray-100);
    color: var(--gray-500);
}

.review-question-text {
    color: var(--gray-800);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.review-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.review-option {
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.review-option.correct-answer {
    background: var(--success-light);
    color: var(--success);
    font-weight: 500;
}

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

.review-actions {
    margin-top: 2rem;
    text-align: center;
}

/* ============================================
   Modal
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 400px;
    width: 100%;
    text-align: center;
}

.modal h3 {
    margin-bottom: 1rem;
    color: var(--gray-900);
}

.modal p {
    color: var(--gray-600);
    margin-bottom: 1.5rem;
}

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

/* ============================================
   Chunk Picker Modal
   ============================================ */
.chunk-picker-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    padding: 1rem;
}

.chunk-picker-overlay.active {
    display: flex;
}

.chunk-picker {
    background: var(--white);
    border-radius: var(--radius-lg);
    max-width: 460px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.chunk-picker-header {
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.chunk-picker-header h3 {
    margin: 0;
    color: var(--gray-900);
    font-size: 1.25rem;
}

.chunk-picker-list {
    padding: 1rem;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chunk-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    font-family: inherit;
    font-size: 1rem;
    width: 100%;
}

.chunk-option:hover {
    border-color: var(--primary);
    background: rgba(102, 126, 234, 0.05);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.chunk-option-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.chunk-option-info {
    flex: 1;
}

.chunk-option-name {
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 2px;
}

.chunk-option-detail {
    font-size: 0.85rem;
    color: var(--gray-500);
}

.chunk-option.chunk-all {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08), rgba(118, 75, 162, 0.08));
    border-color: rgba(102, 126, 234, 0.3);
}

.chunk-option.chunk-all:hover {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(118, 75, 162, 0.15));
}

.chunk-picker-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-200);
    text-align: center;
}

/* ============================================
   Loading State
   ============================================ */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ============================================
   Responsive Design
   ============================================ */

/* Tablet (iPad) styles */
@media (max-width: 1024px) {
    .container {
        padding: 1.5rem;
    }
    
    .hero-content {
        padding: 2.5rem 3rem;
        max-width: 90%;
    }
    
    .subject-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1rem;
    }
    
    .mode-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .quiz-container {
        padding: 1rem;
    }
    
    .question-card {
        padding: 1.5rem;
    }
    
    .results-card {
        padding: 2.5rem;
        max-width: 90%;
    }
}

/* Mobile styles */
@media (max-width: 768px) {
    :root {
        --nav-height: 56px;
    }
    
    .navbar {
        padding: 0 15px;
    }
    
    .nav-title {
        font-size: 1rem;
    }
    
    .hero {
        padding: 1rem;
        padding-top: calc(var(--nav-height) + 10px);
    }
    
    .hero-content {
        padding: 1.5rem;
        max-width: 100%;
    }
    
    .hero h1 {
        font-size: 1.75rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .stats {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0.75rem;
    }
    
    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
    }
    
    .btn-large {
        padding: 0.875rem 2rem;
        font-size: 1rem;
    }
    
    /* Subject grid */
    .subject-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .subject-card {
        padding: 1.25rem;
    }
    
    .subject-icon {
        font-size: 2rem;
    }
    
    .subject-name {
        font-size: 1.1rem;
    }
    
    /* Quiz page */
    .quiz-container {
        padding: 0.75rem;
    }
    
    .quiz-header {
        padding: 0.75rem 1rem;
        margin-bottom: 1rem;
    }
    
    .quiz-info {
        flex-wrap: wrap;
        gap: 0.5rem;
        font-size: 0.85rem;
    }
    
    .timer-badge {
        font-size: 0.8rem;
        padding: 0.2rem 0.4rem;
    }
    
    .question-card {
        padding: 1.25rem;
        border-radius: var(--radius);
    }
    
    .question-number {
        font-size: 0.8rem;
    }
    
    .question-text {
        font-size: 1rem;
        margin-bottom: 1.5rem;
        line-height: 1.6;
    }
    
    .option {
        padding: 0.875rem 1rem;
        gap: 0.5rem;
    }
    
    .option-marker {
        width: 24px;
        height: 24px;
        font-size: 0.8rem;
    }
    
    .option-text {
        font-size: 0.95rem;
    }
    
    /* Quiz navigation - stack on mobile */
    .quiz-navigation {
        flex-direction: column;
        gap: 0.75rem;
        margin-top: 1rem;
    }
    
    .quiz-navigation .btn {
        width: 100%;
        flex: none;
        padding: 0.875rem 1rem;
    }
    
    /* Make End Exam less prominent on mobile */
    .quiz-navigation #end-session-btn {
        order: 3;
        background: transparent;
        color: var(--danger);
        border: 1px solid var(--danger);
    }
    
    .quiz-navigation #prev-btn {
        order: 1;
    }
    
    .quiz-navigation #next-btn {
        order: 2;
    }
    
    /* Results page */
    .results-card {
        padding: 1.5rem;
        margin: 0.5rem;
    }
    
    .results-icon {
        font-size: 3rem;
    }
    
    .results-card h2 {
        font-size: 1.5rem;
    }
    
    .score-circle {
        width: 120px;
        height: 120px;
    }
    
    .score-value {
        font-size: 2.5rem;
    }
    
    .score-label {
        font-size: 1rem;
    }
    
    .results-stats {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem;
    }
    
    .stat-item .stat-value {
        font-size: 1.25rem;
    }
    
    /* Modal */
    .modal {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .modal-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .modal-actions .btn {
        width: 100%;
    }
    
    /* Mode cards */
    .mode-card {
        padding: 1.25rem;
    }
    
    .mode-icon {
        font-size: 1.75rem;
    }
    
    .mode-form {
        gap: 0.5rem;
    }
    
    .field input {
        padding: 0.65rem 0.75rem;
        font-size: 0.95rem;
    }
    
    .mode-actions {
        flex-direction: column;
    }
    
    .mode-actions .btn {
        width: 100%;
    }
    
    /* Review page */
    .review-item {
        padding: 1rem;
    }
    
    .review-question-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .review-option {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
    
    /* History page */
    .history-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 1rem;
    }
    
    .history-score {
        text-align: left;
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
}

/* Small mobile styles */
@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.5rem;
    }
    
    .question-text {
        font-size: 0.95rem;
    }
    
    .option {
        padding: 0.75rem;
    }
    
    .option-marker {
        width: 22px;
        height: 22px;
        font-size: 0.75rem;
    }
    
    .option-text {
        font-size: 0.9rem;
    }
    
    .score-circle {
        width: 100px;
        height: 100px;
    }
    
    .score-value {
        font-size: 2rem;
    }
    
    .nav-menu {
        min-width: 100%;
        border-radius: 0;
    }
}

/* ============================================
   Exam History Page
   ============================================ */
#history-page .container {
    padding-top: 80px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.history-item {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

.history-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.history-info h3 {
    font-size: 1.1rem;
    color: var(--gray-800);
    margin-bottom: 5px;
}

.history-info p {
    color: var(--gray-500);
    font-size: 0.9rem;
}

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

.history-score .score {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.history-score .score.good {
    color: var(--success);
}

.history-score .score.bad {
    color: var(--danger);
}

.history-score .date {
    font-size: 0.8rem;
    color: var(--gray-400);
}

.history-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-500);
}

.history-empty .empty-icon {
    font-size: 4rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.history-actions {
    text-align: center;
    margin-top: 20px;
}

