/* ============================================
   EXAM PAGE STYLES
   Dedicated CSS for sample exam functionality
   ============================================ */

/* --- EXAM PAGE BASE --- */
.exam-page,
body.exam-page,
html:not([data-theme="dark"]) body.exam-page {
    background: #0F172A !important;
    min-height: 100vh;
    font-family: var(--font-main);
    color: #f1f5f9;
}

/* --- EXAM TIMER BADGE (ALWAYS VISIBLE) --- */
.exam-timer-badge {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(40, 167, 69, 0.95);
    color: white;
    border: 2px solid #28a745;
    border-radius: 20px;
    padding: 0.5rem 1rem;
    font-weight: 700;
    font-size: 1rem;
    font-family: 'Courier New', monospace;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    z-index: 1002;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.3s ease;
}

.exam-timer-badge.warning {
    background: rgba(255, 193, 7, 0.95);
    border-color: #ffc107;
    color: #856404;
}

.exam-timer-badge.danger {
    background: rgba(220, 53, 69, 0.95);
    border-color: #dc3545;
    color: white;
    animation: timerPulse 1s infinite;
}

@keyframes timerPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.exam-timer-badge .timer-icon {
    font-size: 1.1rem;
}

.exam-timer-badge .timer-text {
    color: inherit;
    text-shadow: none;
}

/* Mobile timer badge */
@media (max-width: 768px) {
    .exam-timer-badge {
        top: 10px;
        right: 10px;
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
        border-radius: 15px;
    }

    .exam-timer-badge .timer-icon {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .exam-timer-badge {
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
        border-radius: 12px;
    }

    .exam-timer-badge .timer-icon {
        font-size: 0.9rem;
    }
}

/* --- EXAM CONTAINER --- */

/* Hide header on exam page for maximum screen real estate */
body.exam-page .header {
    display: none !important;
}

/* --- MOBILE EXAM HEADER BASE STYLES --- */
/* Base styles outside media query to ensure they always apply */
.mobile-exam-header {
    display: none; /* Hidden by default (desktop) */
}

@media (max-width: 768px) {
    .mobile-exam-header {
        display: flex !important;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 48px;
        background: #1a3a5c;
        z-index: 10005;
        align-items: center;
        justify-content: space-between;
        padding: 0 0.75rem;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    }
}

/* --- CBR-STYLE EXAM HEADER --- */
.cbr-exam-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 52px;
    padding: 0 1.5rem;
    background: #1a3a5c;
    color: #fff;
    font-family: var(--font-main);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

html:not([data-theme="dark"]) .cbr-exam-header,
[data-theme="light"] .cbr-exam-header {
    background: #1a3a5c;
}

/* Left: exam label */
.cbr-header-left {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.15rem;
    min-width: 0;
    color: white;
}

.cbr-exam-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    opacity: 0.95;
    font-weight: 700;
    color: white;
    white-space: nowrap;
}

.cbr-exam-number {
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    opacity: 1;
    font-size: 0.8rem;
    color: white;
    font-family: 'Courier New', monospace;
}

.cbr-exam-title {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.9;
    color: white;
}

/* Center: timer */
.cbr-header-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.cbr-timer-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.15;
    transition: color 0.3s ease;
}

.cbr-timer-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    opacity: 0.9;
    font-weight: 700;
    color: white;
}

.cbr-timer-value {
    font-size: 1.15rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.05em;
    color: white;
}

.cbr-timer-section.warning .cbr-timer-value {
    color: #ffc107;
}

.cbr-timer-section.danger .cbr-timer-value {
    color: #ff4444;
    animation: timerPulse 1s infinite;
}

/* Right: action buttons */
.cbr-header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cbr-header-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: white;
    padding: 0.4rem 0.9rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cbr-header-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-color: rgba(255, 255, 255, 0.4);
}

.cbr-header-btn i {
    font-size: 0.9rem;
}

.cbr-header-btn span {
    display: inline;
}

/* Markeren active state */
.cbr-mark-btn.active {
    background: rgba(255, 193, 7, 0.25);
    border-color: #ffc107;
    color: #ffc107;
}

.cbr-mark-btn.active i {
    color: #ffc107;
    font-weight: 700;
}

/* Push content down to clear fixed header */
@media (min-width: 769px) {
    body.exam-page .sample-exam-container {
        padding-top: 56px !important;
    }
}

/* Overview modal legend */
.overview-modal-legend {
    display: flex;
    gap: 1.2rem;
    justify-content: center;
    padding: 0.75rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.8rem;
    color: var(--color-text-dim);
}

html:not([data-theme="dark"]) .overview-modal-legend,
[data-theme="light"] .overview-modal-legend {
    border-top-color: #eee;
}

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

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

.legend-dot.current {
    background: var(--color-accent, #0284c7);
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.3);
}

.legend-dot.answered {
    background: #28a745;
}

.legend-dot.marked {
    background: #f0ad4e;
}

/* Marked state on question dots */
.question-dot.marked {
    border-color: #f0ad4e !important;
    box-shadow: inset 0 0 0 2px #f0ad4e;
}

.question-dot.marked::after {
    content: '\f024';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 0.55rem;
    color: #f0ad4e;
    background: var(--color-primary, #1a1a2e);
    border-radius: 50%;
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

html:not([data-theme="dark"]) .question-dot.marked::after,
[data-theme="light"] .question-dot.marked::after {
    background: #fff;
}

/* Hide CBR header on mobile (mobile has its own header) */
@media (max-width: 768px) {
    .cbr-exam-header {
        display: none;
    }
    body.exam-page .sample-exam-container {
        padding-top: 0 !important;
    }
}

.sample-exam-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0;
    margin-top: 0 !important;
    padding-top: 0 !important;
    overflow-x: hidden;
}

.sample-exam-container.results-view {
    max-width: 1200px;
    background: var(--color-primary);
    background-image: var(--gradient-primary);
    padding: 2rem;
    border-radius: var(--radius-lg);
    margin: 1rem auto;
}

/* --- EXAM HEADER --- */
/* --- EXAM HEADER --- */
.exam-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem;

    /* Dark Mode Default */
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);

    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    margin-top: 1rem;
}

html:not([data-theme="dark"]) .exam-header,
[data-theme="light"] .exam-header {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.exam-header h1 {
    font-size: 3rem;
    color: var(--color-text-main);
    margin-bottom: 1rem;
    font-weight: 700;
    text-shadow: none;
}

html:not([data-theme="dark"]) .exam-header h1,
[data-theme="light"] .exam-header h1 {
    color: #333;
}

.exam-header p {
    font-size: 1.3rem;
    color: var(--color-text-dim);
    margin-bottom: 0;
}

html:not([data-theme="dark"]) .exam-header p,
[data-theme="light"] .exam-header p {
    color: #666;
}

/* --- WELCOME MESSAGE --- */
.welcome-message {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 1.5rem 2rem;
    border-radius: 15px;
    margin: 2rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.3);
}

/* --- EXAM INTRODUCTION --- */
/* --- EXAM INTRODUCTION --- */
.exam-intro {
    /* Dark Mode Default */
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);

    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    margin-top: 0;
}

html:not([data-theme="dark"]) .exam-intro,
[data-theme="light"] .exam-intro {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.exam-intro h2 {
    color: var(--color-text-main);
    font-size: 2.2rem;
    margin-bottom: 2rem;
    text-align: center;
    font-weight: 700;
}

html:not([data-theme="dark"]) .exam-intro h2,
[data-theme="light"] .exam-intro h2 {
    color: #333;
}

.intro-content {
    margin-bottom: 3rem;
}

.intro-list h3 {
    color: var(--color-accent);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.intro-list ul {
    list-style: none;
    padding: 0;
}

.intro-list li {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(2, 132, 199, 0.05);
    border-radius: 12px;
    border-left: 4px solid var(--color-accent);
}

.intro-list li i {
    color: var(--color-accent);
    font-size: 1.3rem;
    margin-top: 0.2rem;
    flex-shrink: 0;
}

.intro-list li span {
    color: var(--color-text-main);
    line-height: 1.6;
    font-size: 1rem;
}

html:not([data-theme="dark"]) .intro-list li span,
[data-theme="light"] .intro-list li span {
    color: #333;
}

/* --- TIMER INFO BOX --- */
.timer-info {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    padding: 2rem;
    border-radius: 15px;
    margin: 2rem 0;
    text-align: center;
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.3);
}

.timer-info h4 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.timer-info p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin: 0;
}

/* --- START EXAM SECTION --- */
.start-exam-section {
    text-align: center;
    margin-top: 3rem;
}

/* --- EXAM CONTENT LAYOUT --- */
/* --- EXAM CONTENT LAYOUT --- */
.exam-content {
    /* Dark Mode / Default Style */
    background: rgba(255, 255, 255, 0.05);
    /* Glass */
    border-radius: 15px;
    padding: 2rem;
    margin: 0 2rem;
    margin-bottom: 80px;
    margin-top: 0 !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    /* Glass Border */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: calc(100vh - 150px);
}

/* Light Mode Override */
html:not([data-theme="dark"]) .exam-content,
[data-theme="light"] .exam-content {
    background: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.sample-exam-page main {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

body.sample-exam-page {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* --- OVERVIEW MODAL BUTTON (in footer bar) --- */
.overview-modal-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--color-text-dim, #a0aec0);
    padding: 0.4rem 0.9rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.overview-modal-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--color-accent, #38bdf8);
    border-color: var(--color-accent, #38bdf8);
    transform: translateY(-1px);
}

html:not([data-theme="dark"]) .overview-modal-btn,
[data-theme="light"] .overview-modal-btn {
    background: #f0f4f8;
    border: 1px solid #d1d9e6;
    color: #4a5568;
}

html:not([data-theme="dark"]) .overview-modal-btn:hover,
[data-theme="light"] .overview-modal-btn:hover {
    background: #e2e8f0;
    color: var(--color-accent, #3b82f6);
    border-color: var(--color-accent, #3b82f6);
}

.overview-modal-btn i {
    font-size: 0.85rem;
}

/* --- OVERVIEW MODAL POPUP --- */
.overview-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.overview-modal.active {
    opacity: 1;
    visibility: visible;
}

.overview-modal-content {
    background: var(--color-card-bg, white);
    border-radius: 16px;
    padding: 1.5rem 2rem;
    max-width: 480px;
    width: 90%;
    max-height: 75vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9) translateY(30px);
    transition: all 0.3s ease;
}

.overview-modal.active .overview-modal-content {
    transform: scale(1) translateY(0);
}

[data-theme="dark"] .overview-modal-content {
    background: #1a2332;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.overview-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(128, 128, 128, 0.2);
}

.overview-modal-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-text-main, #333);
}

.overview-modal-header .overview-stats {
    font-size: 0.85rem;
    color: var(--color-text-dim, #666);
    font-weight: 500;
}

.overview-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6c757d;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.overview-modal-close:hover {
    background: rgba(128, 128, 128, 0.15);
    color: #333;
}

.overview-modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
    gap: 0.45rem;
    max-width: 100%;
}

@media (max-width: 480px) {
    .overview-modal-content {
        padding: 1rem 1.2rem;
        border-radius: 12px;
    }
    .overview-modal-grid {
        grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
        gap: 0.35rem;
    }
}

/* --- QUESTION OVERVIEW --- */
/* --- QUESTION OVERVIEW --- */
.question-overview {
    /* Dark Mode / Default Style */
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    order: 1;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
    margin-top: 0 !important;
}

/* Light Mode Override */
html:not([data-theme="dark"]) .question-overview,
[data-theme="light"] .question-overview {
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
}

.question-overview h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-accent);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 0.8rem 0;
}

.question-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(40px, 1fr));
    gap: 0.5rem;
    max-width: 600px;
    margin: 0 auto;
}

.question-dot {
    width: 40px;
    height: 40px;
    position: relative;

    /* Dark Mode Pattern */
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-text-dim);

    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

html:not([data-theme="dark"]) .question-dot,
[data-theme="light"] .question-dot {
    background: white;
    border: 2px solid #dee2e6;
    color: #6c757d;
}

.question-dot:hover {
    border-color: var(--color-accent);
    background: rgba(56, 189, 248, 0.15);
    /* Dark Hover */
    transform: translateY(-1px);
}

[data-theme="dark"] .question-dot:hover {
    background: rgba(255, 255, 255, 0.1);
    /* Subtle hover */
}

html:not([data-theme="dark"]) .question-dot:hover,
[data-theme="light"] .question-dot:hover {
    background: #f8f9fa;
}

.question-dot.current {
    background: var(--color-accent);
    color: white;
    border-color: var(--color-accent);
    transform: scale(1.05);
}

.question-dot.answered {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.question-dot.answered.current {
    background: #20c997;
    border-color: #20c997;
}

/* LIGHT MODE STATE OVERRIDES - Force colors */
html:not([data-theme="dark"]) .question-dot.current,
[data-theme="light"] .question-dot.current {
    background: var(--color-accent) !important;
    color: white !important;
    border-color: var(--color-accent) !important;
}

html:not([data-theme="dark"]) .question-dot.answered,
[data-theme="light"] .question-dot.answered {
    background: #28a745 !important;
    color: white !important;
    border-color: #28a745 !important;
}

html:not([data-theme="dark"]) .question-dot.answered.current,
[data-theme="light"] .question-dot.answered.current {
    background: #20c997 !important;
    border-color: #20c997 !important;
}

/* Summary dot styling */
.question-dot.summary {
    background: var(--color-accent);
    color: white;
    border-color: var(--color-accent);
    font-size: 0.7rem;
}

.question-dot.summary.current {
    background: var(--color-accent-hover);
    border-color: var(--color-accent-hover);
}

/* --- QUESTION COUNTER --- */
/* --- QUESTION COUNTER --- */
.question-counter {
    /* Dark Mode / Default */
    background: rgba(255, 255, 255, 0.05);
    /* Match Overview */
    padding: 0.5rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);

    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text-main);
    order: 2;
}

html:not([data-theme="dark"]) .question-counter,
[data-theme="light"] .question-counter {
    background: white;
    border-bottom: 2px solid #e9ecef;
    color: #2c3e50;
}

.progress-bar {
    background: #e9ecef;
    height: 6px;
    border-radius: 10px;
    margin: 0.3rem 0 0;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: green;
    border-radius: 10px;
    transition: width 0.3s ease;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 0;
}

.progress-percentage {
    font-weight: 700;
    color: var(--color-accent);
}

.exam-passing-info {
    margin-top: 0.75rem;
    padding: 0.5rem 1rem;
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid rgba(40, 167, 69, 0.2);
    border-radius: 6px;
    font-size: 0.8rem;
    color: #28a745;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.exam-passing-info i {
    font-size: 0.9rem;
}

/* --- QUESTION CONTAINER --- */
/* --- QUESTION CONTAINER --- */
.question-container {
    padding: 1.5rem 2rem 2rem;
    min-height: calc(100vh - 300px);

    /* Dark Mode Default */
    background: transparent;

    order: 3;
    flex: 1;
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

html:not([data-theme="dark"]) .question-container,
[data-theme="light"] .question-container {
    background: white;
}

.question {
    /* Dark Default */
    background: transparent;
    padding: 0;
    border-radius: 0;
    border: none;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    height: 100%;
    justify-content: flex-start;
}

html:not([data-theme="dark"]) .question,
[data-theme="light"] .question {
    background: white;
}

.question-header-row {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
    flex-shrink: 0;
    min-width: 0;
    max-width: 100%;
}

.question-number {
    display: inline-block;
    width: fit-content;
    background: var(--color-accent);
    color: white;
    padding: 0.3rem 0.7rem;
    border-radius: 15px;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
    white-space: nowrap;
    line-height: 1.4;
}

.question-text {
    font-size: 1.15rem;
    color: #2c3e50;
    margin-bottom: 0;
    line-height: 1.5;
    font-weight: 600;
    flex: 1;
    min-width: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

[data-theme="dark"] .question-text {
    color: #ffffff;
}

.question-image {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0.8rem auto 1.2rem;
    flex-shrink: 0;
    width: 100%;
}

.question-image img {
    width: 100%;
    max-width: 770px;
    max-height: 35vh;
    height: auto;
    object-fit: contain;
    display: block;
    border-radius: 8px;
    box-shadow: none;
    border: none;
}

.placeholder {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    color: #6c757d;
    border: 2px dashed #dee2e6;
    max-width: 280px;
    margin: 0 auto;
    text-align: center;
    font-size: 0.9rem;
}

.placeholder small {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #999;
}

/* --- ANSWER OPTIONS --- */
/* --- ANSWER OPTIONS (Mobile-Style Dark Mode Default) --- */
.options {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    flex: 1;
    justify-content: flex-start;
    margin-top: 0.8rem;
    min-height: 0;
    padding-bottom: 1rem;
}

/* Collapse empty options container (e.g. drag-drop questions) */
.options:empty {
    margin: 0;
    padding: 0;
    min-height: 0;
    gap: 0;
}


.option {
    /* Dark Mode Default (Mobile Match) */
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 1rem 1.2rem;
    margin-bottom: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* Light Mode Override */
html:not([data-theme="dark"]) .option,
[data-theme="light"] .option {
    background: white;
    border: 2px solid #e9ecef;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.option:hover {
    transform: translateX(3px);
    border-color: var(--color-accent);
    /* Vibrant Hover */
    background: rgba(56, 189, 248, 0.15);
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.2);
}

html:not([data-theme="dark"]) .option:hover,
[data-theme="light"] .option:hover {
    background: var(--color-card-bg-hover);
    border-color: var(--color-accent);
    box-shadow: var(--shadow-sm);
}

.option.selected {
    transform: translateX(3px);
    border-color: var(--color-accent);
    /* Vibrant Selected */
    background: rgba(56, 189, 248, 0.25);
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.2);
}

html:not([data-theme="dark"]) .option.selected,
[data-theme="light"] .option.selected {
    background: var(--color-card-bg-hover);
    border-color: var(--color-accent);
    box-shadow: var(--shadow-md);
}

.option label {
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--color-text-main);
    /* Handles both modes via var */
    line-height: 1.4;
    flex: 1;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-weight: 500;
    width: 100%;
}

html:not([data-theme="dark"]) .option label,
[data-theme="light"] .option label {
    color: #2c3e50;
}

.option-letter {
    background: var(--color-accent);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.8rem;
    min-width: 1.8rem;
    text-align: center;
    flex-shrink: 0;
}

.summary-section .question-number {
    background: var(--color-accent);
    color: white;
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border-radius: 15px;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    align-self: flex-start;
    flex-shrink: 0;
}

.summary-section .question-text {
    font-size: 1.2rem;
    color: #2c3e50;
    margin-bottom: 1.5rem;
    line-height: 1.5;
    font-weight: 600;
    flex-shrink: 0;
}

.summary-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.summary-stat-card {
    background: linear-gradient(135deg, #f8f9ff, #ffffff);
    padding: 1.5rem;
    border-radius: 15px;
    text-align: center;
    border: 2px solid var(--glass-border);
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.summary-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.summary-stat-card strong {
    display: block;
    font-size: 2.5rem;
    color: var(--color-accent);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.summary-stat-card span {
    font-size: 1rem;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-message {
    background: var(--color-card-bg-hover);
    color: var(--color-text-main);
    padding: 1.5rem;
    border-radius: 12px;
    margin: 1.5rem 0;
    border: 2px solid var(--glass-border);
    text-align: center;
    font-weight: 600;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    line-height: 1.4;
}

.summary-message.warning {
    background: rgba(255, 193, 7, 0.1);
    color: #856404;
    border-color: rgba(255, 193, 7, 0.3);
}

.summary-message.success {
    background: rgba(40, 167, 69, 0.1);
    color: #155724;
    border-color: rgba(40, 167, 69, 0.3);
}

.summary-actions {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.summary-submit-btn {
    background: var(--gradient-accent);
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    min-width: 200px;
    box-shadow: var(--shadow-lg);
}

.summary-submit-btn:hover {
    background: var(--gradient-accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

/* Ensure summary section takes full container space */
.question-container:has(.summary-section[style*="display: block"]) {
    display: flex;
    flex-direction: column;
}

.question-container .summary-section[style*="display: block"] {
    flex: 1;
    display: flex !important;
    flex-direction: column;
    justify-content: flex-start;
    height: auto;
    min-height: 400px;
}

/* --- EXAM FOOTER --- */
.exam-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;

    /* Dark Mode Default */
    background: rgba(15, 23, 42, 0.95);
    /* Dark background */
    border-top: 1px solid rgba(255, 255, 255, 0.1);

    padding: 0.8rem 2rem;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1.5rem;
    align-items: center;
    z-index: 1000;
    height: 70px;
    box-sizing: border-box;
}

html:not([data-theme="dark"]) .exam-footer,
[data-theme="light"] .exam-footer {
    background: white;
    border-top: 3px solid var(--color-accent);
}

.footer-btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 100px;
    justify-content: center;
    text-decoration: none;
    min-height: 38px;
}

.footer-btn.prev-btn {
    background: var(--color-accent);
    color: white;
    justify-self: start;
    border: none;
    border-radius: 6px;
}

.footer-btn.prev-btn:hover:not(:disabled) {
    background: var(--color-accent-hover);
    transform: translateX(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

html:not([data-theme="dark"]) .footer-btn.prev-btn,
[data-theme="light"] .footer-btn.prev-btn {
    background: transparent;
    color: var(--color-accent);
    border: 2px solid var(--color-accent);
}

html:not([data-theme="dark"]) .footer-btn.prev-btn:hover:not(:disabled),
[data-theme="light"] .footer-btn.prev-btn:hover:not(:disabled) {
    background: var(--color-accent);
    color: white;
}

.footer-btn.prev-btn:disabled {
    background: #e9ecef;
    color: #a0a0a0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

[data-theme="dark"] .footer-btn.prev-btn:disabled {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.3);
}

.footer-btn.next-btn {
    background: var(--color-accent);
    color: white;
    justify-self: end;
}

.footer-btn.next-btn:hover {
    background: var(--color-accent-hover);
    transform: translateX(2px);
}

/* --- SUMMARY SECTION (STYLED LIKE A QUESTION) --- */
.summary-section {
    background: white;
    padding: 0;
    border-radius: 0;
    border: none;
    display: none;
    /* Initially hidden */
    flex-direction: column;
    flex: 1;
    min-height: 0;
    height: 100%;
    justify-content: flex-start;
    width: 100%;
}

/* When summary section is shown */
.summary-section[style*="display: block"] {
    display: flex !important;
}

.summary-section .question-number {
    background: var(--color-accent);
    color: white;
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border-radius: 15px;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    align-self: flex-start;
    flex-shrink: 0;
}

/* ... (Rest of summary section styles remain unchanged in the file, ensuring I don't delete them) ... */

/* --- FOOTER INDICATOR --- */
.footer-indicator {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-accent);

    /* Dark Mode / Default Style */
    background: rgba(56, 189, 248, 0.1);
    /* Subtle blue tint */
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.2);
    /* Glow */
    border: 1px solid rgba(56, 189, 248, 0.3);

    padding: 0.5rem 1rem;
    border-radius: 12px;
    text-align: center;
    white-space: nowrap;
    justify-self: center;
}

html:not([data-theme="dark"]) .footer-indicator,
[data-theme="light"] .footer-indicator {
    background: white;
    border: 2px solid var(--color-accent);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* No need for light/dark split if it's always white/accent border like mobile */


/* --- NEW INTRO REDESIGN STYLES --- */

/* Intro Header */
.intro-header {
    text-align: center;
    margin-bottom: 3rem;
}

.intro-header h2 {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--gradient-text, linear-gradient(135deg, #2c3e50, #4ca1af));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.intro-header h2 i {
    color: #4ca1af;
    /* Fallback/accent color for icon */
    margin-right: 0.5rem;
}

.intro-subtitle {
    font-size: 1.2rem;
    color: var(--color-text-dim, #6c757d);
    max-width: 600px;
    margin: 0 auto;
}

/* Features Grid */
.intro-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

/* Feature Cards */
.intro-feature-card {
    background: var(--color-card-bg, white);
    padding: 2rem 1.5rem;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    /* Soft premium shadow */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.intro-feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--color-accent, #00b894);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.intro-feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
}

.intro-feature-card:hover::before {
    transform: scaleX(1);
}

.intro-feature-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 1rem 0 0.5rem;
    color: var(--color-text-main, #2c3e50);
}

.intro-feature-card p {
    font-size: 0.95rem;
    color: var(--color-text-dim, #6c757d);
    line-height: 1.5;
    margin: 0;
}

/* Icons */
.feature-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.intro-feature-card:hover .feature-icon {
    transform: scale(1.1) rotate(5deg);
}

.icon-questions {
    background: rgba(0, 184, 148, 0.1);
    color: #00b894;
}

.icon-errors {
    background: rgba(225, 112, 85, 0.1);
    color: #e17055;
}

.icon-nav {
    background: rgba(9, 132, 227, 0.1);
    color: #0984e3;
}

.icon-time {
    background: rgba(108, 92, 231, 0.1);
    color: #6c5ce7;
}

/* Actions Section */
.exam-actions {
    text-align: center;
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.ready-text {
    font-size: 1.1rem;
    color: var(--color-text-main, #2c3e50);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Main CTA Button (Premium Style Override/Enhancement) */
.main-cta-btn {
    display: inline-block;
    padding: 1.2rem 3.5rem;
    font-size: 1.3rem;
    font-weight: 800;
    text-decoration: none;
    border-radius: 50px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* Bouncy transition */
    box-shadow: 0 10px 20px rgba(0, 184, 148, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
    color: white !important;
    border: none;
    position: relative;
    overflow: hidden;
}

.main-cta-btn.primary {
    background: linear-gradient(135deg, #00b894, #00cec9);
}

.main-cta-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 30px rgba(0, 184, 148, 0.4);
}

.main-cta-btn:active {
    transform: translateY(-1px);
}

/* Secondary Actions */
.secondary-actions {
    margin-top: 1rem;
}

.back-link {
    color: var(--color-text-dim, #6c757d);
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s ease;
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

.back-link:hover {
    color: var(--color-text-main, #2c3e50);
    background: rgba(0, 0, 0, 0.05);
}

/* Animations */
@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 184, 148, 0.4);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(0, 184, 148, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 184, 148, 0);
    }
}

.pulse-animation {
    animation: pulse-glow 2s infinite;
}

/* Dark Mode Overrides for Intro */
[data-theme="dark"] .intro-feature-card {
    background: var(--color-card-bg-dark, #2d3436);
    border-color: rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .intro-header h2 {
    background: linear-gradient(135deg, #dfe6e9, #74b9ff);
    /* Lighter gradient for dark mode */
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme="dark"] .intro-subtitle,
[data-theme="dark"] .intro-feature-card p,
[data-theme="dark"] .back-link {
    color: #b2bec3;
}

[data-theme="dark"] .intro-feature-card h3,
[data-theme="dark"] .ready-text,
[data-theme="dark"] .back-link:hover {
    color: #dfe6e9;
    /* Light text for headers */
}

[data-theme="dark"] .back-link:hover {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .icon-questions {
    background: rgba(0, 184, 148, 0.2);
}

[data-theme="dark"] .icon-errors {
    background: rgba(225, 112, 85, 0.2);
}

[data-theme="dark"] .icon-nav {
    background: rgba(9, 132, 227, 0.2);
}

[data-theme="dark"] .icon-time {
    background: rgba(108, 92, 231, 0.2);
}

/* --- MOBILE RESPONSIVE --- */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden !important;
    }

    .exam-content {
        margin: 0 1rem;
        margin-bottom: 70px;
        margin-top: 0 !important;
    }


    .exam-footer {
        height: 60px;
        padding: 0.5rem 1rem;
        grid-template-columns: 1fr auto 1fr;
        gap: 1rem;
    }

    .footer-btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
        min-width: 80px;
        min-height: 32px;
    }

    .footer-indicator {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }

    .question-container {
        padding: 1rem 1.5rem 1.5rem;
        min-height: calc(100vh - 280px);
    }

    .question-text {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }

    .option {
        padding: 0.6rem;
        gap: 0.6rem;
    }

    .option label {
        font-size: 0.9rem;
        gap: 0.6rem;
        line-height: 1.3;

    }


    @media (max-width: 480px) {
        .exam-content {
            margin: 0 0.5rem;
            margin-bottom: 60px;
            margin-top: 0 !important;
        }

        .exam-footer {
            height: 55px;
            padding: 0.4rem 0.8rem;
            gap: 0.8rem;
        }

        .footer-btn {
            padding: 0.4rem 0.6rem;
            font-size: 0.75rem;
            min-width: 70px;
            min-height: 28px;
        }

        .footer-indicator {
            padding: 0.3rem 0.6rem;
            font-size: 0.75rem;
        }

        .question-container {
            padding: 0.8rem 1rem 1rem;
            min-height: calc(100vh - 260px);
        }

        .question-text {
            font-size: 1rem;
            margin-bottom: 0.8rem;
            line-height: 1.4;
        }

        .question-number {
            padding: 0.3rem 0.6rem;
            font-size: 0.8rem;
            margin-bottom: 0.8rem;
        }

        .option {
            padding: 0.5rem;
            gap: 0.5rem;
        }

        .option label {
            font-size: 0.85rem;
            gap: 0.5rem;
            line-height: 1.2;
        }

        .option-letter {
            padding: 0.15rem 0.35rem;
            font-size: 0.7rem;
            min-width: 1.4rem;
        }

        .options {
            gap: 0.4rem;
            margin-top: 0.5rem;
            padding-bottom: 0.6rem;
        }

        .question-image {
            margin: 0.6rem auto 1rem;
            display: flex;
            justify-content: center;
            align-items: center;
            width: 100%;
        }

        .question-image img {
            width: 100%;
            max-width: 400px;
            height: auto;
            display: block;
        }

        .placeholder {
            padding: 0.8rem;
            max-width: 220px;
            font-size: 0.8rem;
        }

        .question-overview {
            padding: 0.6rem 0.8rem;
            margin-top: 0 !important;
        }

        .question-grid {
            grid-template-columns: repeat(auto-fit, minmax(32px, 1fr));
            gap: 0.3rem;
        }

        .question-dot {
            width: 32px;
            height: 32px;
            font-size: 0.75rem;
        }

        .summary-message {
            padding: 1rem;
            font-size: 1rem;
        }

        .summary-submit-btn {
            padding: 0.7rem 1.2rem;
            font-size: 0.9rem;
            min-width: 160px;
        }
    }

}

/* --- SUMMARY MODAL STYLES --- */
.summary-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.summary-modal.active {
    opacity: 1;
    visibility: visible;
}

.summary-modal-content {
    background: white;
    border-radius: 20px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9) translateY(50px);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.summary-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 2rem 2rem 1rem;
    min-height: 0;
}

.summary-modal.active .summary-modal-content {
    transform: scale(1) translateY(0);
}

.summary-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 2rem;
    color: #6c757d;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    z-index: 1;
}

.summary-close:hover {
    background: #f8f9fa;
    color: #333;
    transform: scale(1.1);
}

.summary-modal-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-right: 3rem;
}

.summary-modal-header h3 {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.summary-modal-header p {
    color: #666;
    font-size: 1rem;
    margin: 0;
}

.summary-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 2rem 0;
}

.summary-stat {
    text-align: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9ff, #ffffff);
    border-radius: 15px;
    border: 2px solid rgba(102, 126, 234, 0.1);
}

.summary-stat strong {
    display: block;
    font-size: 2.5rem;
    color: #667eea;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.summary-stat span {
    font-size: 1rem;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-warning {
    background: rgba(255, 193, 7, 0.1);
    color: #856404;
    padding: 1rem;
    border-radius: 10px;
    text-align: center;
    font-weight: 600;
    border: 2px solid rgba(255, 193, 7, 0.3);
    margin: 1rem 0;
}

.summary-success {
    background: rgba(40, 167, 69, 0.1);
    color: #155724;
    padding: 1rem;
    border-radius: 10px;
    text-align: center;
    font-weight: 600;
    border: 2px solid rgba(40, 167, 69, 0.3);
    margin: 1rem 0;
}

.summary-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    padding: 1.25rem 2rem;
    margin-top: 0;
    border-top: 1px solid #e9ecef;
    background: white;
    flex-shrink: 0;
    border-radius: 0 0 20px 20px;
}

.summary-btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 120px;
    justify-content: center;
}

.summary-btn.secondary {
    background: #6c757d;
    color: white;
}

.summary-btn.secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.summary-btn.primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.summary-btn.primary:hover {
    background: linear-gradient(135deg, #5a6fd8, #6a42a0);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Loading state styles */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: #667eea;
    min-height: 200px;
}

.loading-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.loading-state p {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

/* Summary modal mobile overrides */
@media (max-width: 768px) {
    .summary-modal-content {
        padding: 0;
        margin: 1rem;
        max-width: none;
        width: calc(100% - 2rem);
    }

    .summary-modal-body {
        padding: 1.5rem 1.5rem 1rem;
    }

    .summary-modal-header {
        padding-right: 2rem;
    }

    .summary-modal-header h3 {
        font-size: 1.5rem;
    }

    .summary-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin: 1.5rem 0;
    }

    .summary-stat {
        padding: 1rem;
    }

    .summary-stat strong {
        font-size: 2rem;
    }

    .summary-buttons {
        flex-direction: column;
        gap: 0.8rem;
    }

    .summary-btn {
        width: 100%;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .summary-modal-content {
        margin: 0.5rem;
        width: calc(100% - 1rem);
    }

    .summary-close {
        top: 0.5rem;
        right: 0.5rem;
        width: 35px;
        height: 35px;
        font-size: 1.5rem;
    }

    .summary-modal-header {
        padding-right: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .summary-modal-header h3 {
        font-size: 1.3rem;
    }

    .summary-stat {
        padding: 0.8rem;
    }

    .summary-stat strong {
        font-size: 1.8rem;
    }

    .summary-stat span {
        font-size: 0.9rem;
    }

    .summary-modal .question-dot {
        width: 100% !important;
        aspect-ratio: 1 !important;
        height: auto !important;
        font-size: 0.85rem;
        border-radius: 50%;
    }

    .summary-modal .question-grid {
        grid-template-columns: repeat(8, 1fr) !important;
        gap: 0.35rem !important;
    }
}

/* --- YES/NO QUESTION SPECIFIC STYLES --- */
    .question.yes-no-question .options {
        max-width: 500px;
        margin: 0.8rem auto 1rem auto;
        gap: 0.8rem;
    }

    .question.yes-no-question .option {
        padding: 1rem;
        font-size: 1rem;
    }

    .question.yes-no-question .option-letter {
        min-width: 2rem;
        padding: 0.4rem 0.6rem;
        font-size: 0.9rem;
    }

    .question.yes-no-question .option label {
        font-size: 1rem;
        font-weight: 600;
    }

    /* Make yes/no options slightly larger and more prominent */
    .question.yes-no-question .option:hover {
        transform: translateX(5px);
        box-shadow: 0 3px 12px rgba(102, 126, 234, 0.15);
    }

    .question.yes-no-question .option.selected {
        transform: translateX(5px);
        box-shadow: 0 3px 12px rgba(102, 126, 234, 0.25);
    }

    /* Multiple Select Question Styling - only notification bar */


    .multiple-select-notification {
        display: flex;
        align-items: center;
        gap: 1rem;
        background: #f59e0b;
        color: white;
        padding: 1rem;
        border-radius: 8px;
        margin: 1rem 0;
        font-weight: 500;
    }

    .multiple-select-icon {
        font-size: 1.5rem;
        flex-shrink: 0;
    }

    .multiple-select-text {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
    }

    .multiple-select-text strong {
        font-size: 1.1rem;
        font-weight: 700;
    }

    .multiple-select-text span {
        font-size: 0.9rem;
        opacity: 0.9;
    }

    /* Custom checkbox styling for multiple select */
    .multiple-select-options .option {
        position: relative;
        border: 2px solid #e2e8f0;
        background: white;
        transition: all 0.2s ease;
        cursor: pointer;
        padding: 1rem;
        margin-bottom: 0.5rem;
        min-height: 60px;
        display: flex;
        align-items: center;
    }

    .multiple-select-options .option:hover {
        border-color: #3182ce;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(49, 130, 206, 0.2);
        background: #f7fafc;
    }

    .multiple-select-options .option.selected {
        background: #3182ce;
        border-color: #2c5282;
        color: white;
        box-shadow: 0 4px 12px rgba(49, 130, 206, 0.4);
        transform: translateY(-1px);
    }

    .multiple-select-options .option.selected:hover {
        background: #2c5282;
        transform: translateY(-3px);
    }

    .multiple-select-options .option input[type="checkbox"] {
        display: none;
        /* Hide default checkbox */
    }

    .multiple-select-options .option label {
        display: flex;
        align-items: center;
        gap: 1rem;
        cursor: pointer;
        width: 100%;
        padding: 0;
        margin: 0;
        font-size: 1rem;
        line-height: 1.4;
    }

    .checkbox-indicator {
        width: 28px;
        height: 28px;
        border: 3px solid #cbd5e0;
        border-radius: 6px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: white;
        color: transparent;
        transition: all 0.2s ease;
        flex-shrink: 0;
        position: relative;
    }

    .multiple-select-options .option:hover .checkbox-indicator {
        border-color: #3182ce;
        background: #f0f4ff;
    }

    .multiple-select-options .option.selected .checkbox-indicator {
        background: white;
        border-color: white;
        color: #3182ce;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    .multiple-select-options .option.selected .checkbox-indicator i {
        font-size: 18px;
        font-weight: bold;
        animation: checkmarkPop 0.2s ease-out;
    }

    @keyframes checkmarkPop {
        0% {
            transform: scale(0);
            opacity: 0;
        }

        50% {
            transform: scale(1.2);
        }

        100% {
            transform: scale(1);
            opacity: 1;
        }
    }

    /* Improve touch targets on mobile */
    @media (max-width: 768px) {
        .multiple-select-options .option {
            min-height: 70px;
            padding: 1.25rem;
            margin-bottom: 0.75rem;
        }

        .checkbox-indicator {
            width: 32px;
            height: 32px;
            border-width: 3px;
        }

        .multiple-select-options .option.selected .checkbox-indicator i {
            font-size: 20px;
        }

        .multiple-select-options .option label {
            font-size: 1.1rem;
            gap: 1.25rem;
        }
    }

    /* Add active state for better feedback */
    .multiple-select-options .option:active {
        transform: translateY(0);
        transition: none;
    }

    .multiple-select-options .option.selected:active {
        transform: translateY(-1px);
        background: #2a4b94;
    }

    /* Ensure text is readable */
    .multiple-select-options .option.selected label {
        color: white;
    }

    .multiple-select-options .option label {
        color: #374151;
    }

    /* Hide toggle button by default */
    .overview-toggle-btn {
        display: none;
    }


    /* --- DARK MODE OVERRIDES --- */
    [data-theme="dark"] .exam-page {
        background: var(--color-background);
        color: var(--color-text-main);
    }

    [data-theme="dark"] .exam-header,
    [data-theme="dark"] .exam-intro {
        background: rgba(30, 41, 59, 0.95);
        border-color: rgba(255, 255, 255, 0.1);
    }

    [data-theme="dark"] .exam-header h1,
    [data-theme="dark"] .exam-intro h2,
    [data-theme="dark"] .intro-list li span,
    [data-theme="dark"] .question-text {
        color: var(--color-text-main);
    }

    [data-theme="dark"] .exam-header p {
        color: var(--color-text-dim);
    }

    [data-theme="dark"] .intro-list li {
        background: rgba(255, 255, 255, 0.05);
    }

    [data-theme="dark"] .exam-content {
        background: #1e293b;
        /* Dark card background */
        border-color: rgba(255, 255, 255, 0.1);
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    }

    [data-theme="dark"] .question-overview {
        background: #0f172a;
        /* Darker header */
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    [data-theme="dark"] .question-container {
        background: #1e293b;
        color: white;
    }

    [data-theme="dark"] .question {
        background: #1e293b;
    }

    [data-theme="dark"] .question-counter {
        background: #1e293b;
        border-color: rgba(255, 255, 255, 0.1);
        color: white;
    }

    [data-theme="dark"] .progress-bar {
        background: white;
    }

    [data-theme="dark"] .progress-text {
        color: var(--color-text-dim);
    }

    [data-theme="dark"] .question-dot {
        background: #334155;
        border-color: #475569;
        color: #cbd5e1;
    }

    [data-theme="dark"] .question-dot:hover {
        background: #475569;
        border-color: #64748b;
    }

    [data-theme="dark"] .question-dot.answered {
        background: #059669;
        /* Darker green */
        border-color: #059669;
        color: white;
    }

    /* Options Dark Mode */
    [data-theme="dark"] .option {
        background: #0f172a;
        border-color: #334155;
        box-shadow: none;
    }

    [data-theme="dark"] .option:hover {
        background: #1e293b;
        border-color: #667eea;
    }

    [data-theme="dark"] .option label {
        color: white;
    }

    [data-theme="dark"] .option.selected {
        background: rgba(102, 126, 234, 0.2);
        border-color: #667eea;
    }

    /* Footer Dark Mode */
    [data-theme="dark"] .exam-footer {
        background: #1e293b;
        border-top: 3px solid #667eea;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    }

    [data-theme="dark"] .footer-indicator {
        background: rgba(102, 126, 234, 0.2);
        color: #a5b4fc;
        border-color: #667eea;
    }

    [data-theme="dark"] .footer-btn.prev-btn:disabled {
        background: #334155;
        color: #64748b;
    }

    [data-theme="dark"] .placeholder {
        background: #0f172a;
        border-color: #334155;
        color: #94a3b8;
    }

    [data-theme="dark"] .overview-toggle-btn {
        color: white;
    }


/* --- UNIFIED MOBILE HEADER STYLES --- */
@media (max-width: 768px) {

    /* 1. Reset & Hide Legacy Elements */
    /* DO NOT hide .header completely, otherwise .nav-links child is lost! */
    body.exam-page .header {
        height: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: visible !important;
        visibility: visible !important;
        background: transparent !important;
        border: none !important;
    }

    /* Hide specific header children instead */
    body.exam-page .header .logo,
    body.exam-page .header .nav-container>*:not(.nav-links),
    body.exam-page .header .theme-toggle-btn {
        display: none !important;
    }

    body.exam-page .exam-timer-badge,
    body.exam-page .question-overview,
    body.exam-page .overview-toggle-btn {
        display: none !important;
    }

    /* Adjust main content padding to clear fixed header */
    body.exam-page .exam-content {
        margin-top: 56px !important;
        padding-top: 0 !important;
    }

    /* Mobile CBR Header */
    .mobile-exam-header {
        display: flex !important;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 48px;
        background: #1a3a5c;
        z-index: 10005;
        align-items: center;
        justify-content: space-between;
        padding: 0 0.75rem;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    }

    .mobile-header-left {
        display: flex;
        align-items: center;
    }

    .mobile-exam-label {
        font-size: 0.7rem;
        font-weight: 700;
        color: rgba(255, 255, 255, 0.7);
        letter-spacing: 0.1em;
        text-transform: uppercase;
    }

    .mobile-header-center {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        align-items: center;
        gap: 0.35rem;
        color: #fff;
        font-weight: 700;
        font-size: 1rem;
        font-family: 'Courier New', monospace;
    }

    .mobile-header-center i {
        font-size: 0.8rem;
        opacity: 0.7;
    }

    .mobile-header-right {
        display: flex;
        align-items: center;
        gap: 0.15rem;
    }

    .mobile-header-btn {
        background: transparent;
        border: 1px solid rgba(255, 255, 255, 0.15);
        color: rgba(255, 255, 255, 0.85);
        width: 36px;
        height: 36px;
        border-radius: 6px;
        font-size: 0.9rem;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;
    }

    .mobile-header-btn:active {
        background: rgba(255, 255, 255, 0.15);
    }

    /* Mobile mark active state */
    .mobile-mark-btn.active {
        background: rgba(240, 173, 78, 0.25);
        border-color: #f0ad4e;
        color: #f0ad4e;
    }

    /* Mobile close/X button */
    .mobile-close-btn {
        border-color: rgba(255, 80, 80, 0.3);
        color: rgba(255, 120, 120, 0.85);
    }

    .mobile-close-btn:active {
        background: rgba(220, 53, 69, 0.25) !important;
        border-color: #dc3545;
        color: #ff6b6b;
    }
}

/* --- DRAG AND DROP QUESTION STYLES --- */
.drag-drop-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0;
}

.drop-zones-container {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.05);
    /* Match dark theme */
    padding: 1rem;
    border-radius: 12px;
    border: 1px dashed rgba(255, 255, 255, 0.2);
}

.drop-zone {
    flex: 1;
    min-width: 80px;
    min-height: 120px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 0.5rem;
    position: relative;
    transition: all 0.2s ease;
}

html:not([data-theme="dark"]) .drop-zones-container {
    background: #f8f9fa;
    border-color: #dee2e6;
}

html:not([data-theme="dark"]) .drop-zone {
    background: #ffffff;
    border-color: #ced4da;
}

.drop-zone.drag-over {
    background: rgba(56, 189, 248, 0.2);
    border-color: var(--color-accent);
    transform: scale(1.02);
}

.drop-zone-label {
    position: absolute;
    top: -10px;
    background: var(--color-accent);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    z-index: 2;
}

.draggable-items-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    padding: 1rem;
}

.draggable-item {
    background: rgba(255, 255, 255, 0.15);
    /* Glass items */
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    cursor: grab;
    user-select: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
    font-weight: 500;
    touch-action: none;
    /* Critical for touch dragging */
}

html:not([data-theme="dark"]) .draggable-item {
    background: white;
    border: 1px solid #dee2e6;
    color: #333;
}

.draggable-item:active {
    cursor: grabbing;
    transform: scale(1.05);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.2);
}

.draggable-item.dragging {
    opacity: 0.5;
}

/* Placed item style inside dropzone */
.drop-zone .draggable-item {
    width: 100%;
    margin: 0;
    font-size: 0.9rem;
    padding: 0.5rem;
    text-align: center;
    background: var(--color-accent);
    /* Highlight placed items */
    color: white;
    border: none;
}

/* Mobile Adjustments */
@media (max-width: 600px) {
    .drop-zones-container {
        gap: 0.5rem;
    }

    .drop-zone {
        min-width: 60px;
        min-height: 100px;
        font-size: 0.8rem;
    }

    .draggable-item {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
}

/* --- VISUAL DRAG ORB STYLES --- */
.draggable-orb {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #a0aec0, #718096);
    border: 2px solid white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    cursor: grab;
    z-index: 20;
    transform: translate(-50%, -50%);
    /* Center on coordinates */
    transition: transform 0.1s;
    /* Glass Effect */
    backdrop-filter: blur(2px);
}

.draggable-orb:active,
.draggable-orb.dragging {
    cursor: grabbing;
    transform: translate(-50%, -50%) scale(1.2);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.6);
    background: radial-gradient(circle at 30% 30%, #e2e8f0, #cbd5e0);
}

/* When placed in a slot, the orb changes style to fit */
.drop-zone .draggable-orb {
    position: static;
    transform: none;
    margin: auto;
    /* Center in slot */
    background: radial-gradient(circle at 30% 30%, var(--color-accent), #2c5282);
    width: 40px;
    height: 40px;
}

[data-theme="dark"] .draggable-orb {
    border-color: rgba(255, 255, 255, 0.5);
}

.question-image {
    position: relative;
    overflow: visible;
    /* Don't clip orbs */
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* --- HOTSPOT QUESTION STYLES --- */
.hotspot-options-grid {
    display: flex;
    gap: 1.25rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.5rem;
    width: 100%;
}
.hotspot-card {
    border: 3px solid var(--color-border, #e2e8f0);
    border-radius: 12px;
    padding: 8px;
    background: var(--color-card-bg, #ffffff);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 140px;
    position: relative;
    box-sizing: border-box;
}
.hotspot-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}
.hotspot-card.selected {
    border-color: #f59e0b; /* Golden CBR border */
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
}
.hotspot-card img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: contain;
    display: block;
}
.hotspot-label {
    font-weight: 700;
    margin-top: 6px;
    font-size: 1.1rem;
    color: var(--color-text-main, #2c3e50);
}
[data-theme="dark"] .hotspot-card {
    background: #2d3436;
    border-color: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .hotspot-card.selected {
    border-color: #f59e0b;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.5);
}
[data-theme="dark"] .hotspot-label {
    color: #dfe6e9;
}