.exam-body {
    background-color: #f1f5f9;
    padding-top: 80px;
}

.exam-header {
    background: var(--primary);
    color: white;
    height: 80px;
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.exam-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
}

.exam-header .exam-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.exam-logo {
    font-family: 'Outfit';
    font-size: 1.25rem;
    font-weight: 700;
}

.exam-timer {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1.5rem;
    border-radius: var(--radius-full);
    font-family: monospace;
    font-size: 1.2rem;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.2);
}

.exam-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.exam-user-info img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

/* Layout */
.exam-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
    margin-top: 2rem;
}

/* Question Area */
.question-container {
    background: white;
    padding: 3rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    min-height: 600px;
    display: flex;
    flex-direction: column;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #f1f5f9;
}

.question-badge {
    background: #eff6ff;
    color: var(--accent);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.question-number {
    font-weight: 600;
    color: var(--text-muted);
}

.question-text {
    font-size: 1.25rem;
    line-height: 1.7;
    margin-bottom: 3rem;
    color: var(--text-main);
    font-weight: 500;
}

/* Options */
.options-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 3rem;
}

.option-item {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    padding: 1.25rem;
    border: 2px solid #f1f5f9;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.option-item:hover {
    border-color: var(--accent);
    background: #f8fafc;
}

.option-item.selected {
    border-color: var(--accent);
    background: #eff6ff;
}

.option-label {
    width: 32px;
    height: 32px;
    background: #f1f5f9;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    flex-shrink: 0;
}

.option-item.correct { border-color: #10b981; background: #ecfdf5; }
.option-item.wrong { border-color: #ef4444; background: #fef2f2; }

.discussion-box {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-left: 4px solid var(--accent);
    border-radius: 8px;
    display: none;
}

.discussion-box.active { display: block; }
.discussion-box h4 { margin-bottom: 0.5rem; color: var(--accent); }


/* Nav Sidebar */
.nav-grid-container {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 100px;
}

.nav-grid-container h3 {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.nav-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
    margin-bottom: 2rem;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
}

.nav-item {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
}

.nav-item:hover { border-color: var(--accent); }
.nav-item.active { border-color: var(--accent); background: #eff6ff; color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.nav-item.answered { background: var(--accent); color: white; border-color: var(--accent); }
.nav-item.doubtful { background: var(--secondary); color: white; border-color: var(--secondary); }

.nav-legend {
    margin-top: 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    font-size: 0.85rem;
}

.legend-item { display: flex; align-items: center; gap: 8px; }
.box-legend { width: 16px; height: 16px; border-radius: 4px; border: 1px solid #e2e8f0; }
.box-legend.answered { background: var(--accent); }
.box-legend.doubtful { background: var(--secondary); }
.box-legend.active { border: 2px solid var(--accent); background: #eff6ff; }

.btn-finish {
    width: 100%;
    margin-top: 2.5rem;
    background: #ef4444;
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.btn-finish:hover { background: #dc2626; transform: translateY(-2px); }

/* Buttons */
.question-actions {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    padding-top: 2rem;
    border-top: 1px solid #f1f5f9;
}

.btn-nav {
    padding: 0.75rem 1.75rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-outline { background: transparent; border: 2px solid #e2e8f0; color: var(--text-main); }
.btn-warning { background: var(--secondary); color: white; border: none; }

/* Modals */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal.active { display: flex; }

.modal-content {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    text-align: center;
}

.modal-content h2 { margin-bottom: 1rem; }
.modal-content p { color: var(--text-muted); margin-bottom: 2.5rem; }

.modal-buttons { display: flex; gap: 1rem; justify-content: center; }

.result-card .success-icon {
    font-size: 5rem;
    color: #10b981;
    margin-bottom: 1.5rem;
}

.score-summary {
    background: #f8fafc;
    padding: 2rem;
    border-radius: 16px;
    margin-bottom: 1.5rem;
}

.score-item { display: flex; flex-direction: column; align-items: center; }
.score-item .label { font-size: 0.9rem; color: var(--text-muted); }
.score-item .value { font-size: 3.5rem; font-weight: 800; color: var(--primary); }

@media (max-width: 1024px) {
    .exam-layout { grid-template-columns: 1fr; }
    .exam-sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 999;
        transform: translateY(calc(100% - 60px));
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .exam-sidebar:hover,
    .exam-sidebar:focus-within {
        transform: translateY(0);
    }
    .nav-grid-container {
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
        padding-top: 0.75rem;
        max-height: 70vh;
        overflow-y: auto;
    }
    .nav-grid-container::before {
        content: '';
        display: block;
        width: 40px;
        height: 5px;
        background: #cbd5e1;
        border-radius: 999px;
        margin: 0 auto 1rem;
    }
    .nav-grid-container h3 {
        text-align: center;
        font-size: 0.95rem;
        margin-bottom: 1rem;
    }
}

@media (max-width: 768px) {
    .exam-body { padding-top: 60px; }
    .exam-header { height: 60px; }
    .exam-container { padding: 0 1rem; }
    .exam-logo span { display: none; }
    .exam-logo i { font-size: 1.3rem; }
    .exam-timer { padding: 0.4rem 1rem; font-size: 1rem; }
    .exam-user-info span { display: none; }
    .exam-user-info img { width: 32px; height: 32px; }

    .question-container {
        padding: 1.5rem;
        min-height: auto;
        border-radius: 16px;
    }
    .question-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
    }
    .question-badge { font-size: 0.75rem; padding: 0.35rem 0.75rem; }
    .question-number { font-size: 0.85rem; }
    .question-text {
        font-size: 1rem;
        margin-bottom: 1.5rem;
        line-height: 1.6;
    }
    .option-item {
        padding: 1rem;
        gap: 1rem;
    }
    .option-label {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
    .option-text { font-size: 0.9rem; }
    .question-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .btn-nav {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
        flex: 1;
        text-align: center;
    }

    .modal-content {
        padding: 2rem 1.5rem;
        border-radius: 16px;
        max-width: 95%;
    }
    .modal-content h2 { font-size: 1.3rem; }
    .score-item .value { font-size: 2.5rem; }
    .modal-buttons { flex-direction: column; }
    .modal-buttons .btn-nav { width: 100%; }

    .result-card .success-icon { font-size: 3rem; }
    .nav-grid { grid-template-columns: repeat(7, 1fr); gap: 0.5rem; }
    .nav-item { font-size: 0.75rem; }
}

@media (max-width: 480px) {
    .question-text { font-size: 0.9rem; }
    .option-item { padding: 0.8rem; gap: 0.75rem; }
    .nav-grid { grid-template-columns: repeat(6, 1fr); }
    .exam-layout { margin-top: 1rem; gap: 1rem; }
}
