/* ==========================================================================
   1. Konfigurasi Dasar & Variabel CSS (Foundation & Variables)
   ========================================================================== */

:root {
    /* Palet Warna Gradien */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --success-gradient: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    --error-gradient: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    --warning-gradient: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    --info-gradient: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);

    /* Sistem Bayangan (Shadow) */
    --shadow-light: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-medium: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-heavy: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Radius Sudut (Border Radius) */
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
    --border-radius-xl: 20px;

    /* Pengaturan Waktu Transisi */
    --transition-fast: 0.2s ease-in-out;
    --transition-medium: 0.3s ease-in-out;
    --transition-slow: 0.5s ease-in-out;
}


/* ==========================================================================
   2. Gaya Global & Komponen Dasar (Global & Base Styles)
   ========================================================================== */

body {
    font-family: 'Open Sans', sans-serif;
    transition: background-color 0.3s, color 0.3s;
}

.gradient-header,
.gradient-footer {
    background: linear-gradient(to right, #FFB300, #F44336, #1E88E5, #002E5D);
}

.timer-highlight {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Placeholder untuk lazy loading gambar atau konten */
.question-placeholder {
    min-height: 250px;
}


/* ==========================================================================
   3. Komponen Utama Halaman Kuis (Main Quiz Components)
   ========================================================================== */

/* --- 3.1. Kartu Pertanyaan (Question Card) --- */

.enhanced-question-card {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid transparent;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-medium);
    overflow: hidden;
    position: relative;
    transition: all var(--transition-medium);
    margin-bottom: 2rem;
}

.enhanced-question-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-medium);
}

.enhanced-question-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-heavy);
    border-color: rgba(99, 102, 241, 0.2);
}

.enhanced-question-card:hover::before {
    transform: scaleX(1);
}

.question-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    position: relative;
}

.question-number {
    position: absolute;
    top: -10px;
    right: 20px;
    background: var(--primary-gradient);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.875rem;
    box-shadow: var(--shadow-light);
}

.question-text {
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.6;
    color: #1f2937;
    margin: 0;
    padding-right: 80px;
}

/* --- 3.2. Pilihan Jawaban (Answer Options) --- */

.answer-options {
    padding: 1.5rem;
    display: grid;
    gap: 1rem;
}

.answer-option {
    position: relative;
    padding: 1rem 1.25rem;
    border: 2px solid transparent;
    border-radius: var(--border-radius-md);
    font-weight: 500;
    font-size: 1rem;
    text-align: left;
    cursor: pointer;
    transition: all var(--transition-medium);
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    overflow: hidden;
}

.answer-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-gradient);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform var(--transition-medium);
}

.answer-option:hover {
    transform: translateX(8px);
    border-color: rgba(99, 102, 241, 0.3);
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    box-shadow: var(--shadow-light);
}

.answer-option:hover::before {
    transform: scaleY(1);
}

.option-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--primary-gradient);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.875rem;
    margin-right: 12px;
    flex-shrink: 0;
}

/* Status Jawaban */
.answer-option.correct {
    background: var(--success-gradient);
    color: white;
    border-color: #22c55e;
    transform: translateX(0);
}

.answer-option.correct .option-label {
    background: rgba(255, 255, 255, 0.2);
}

.answer-option.incorrect {
    background: var(--error-gradient);
    color: white;
    border-color: #ef4444;
    transform: translateX(0);
}

.answer-option.incorrect .option-label {
    background: rgba(255, 255, 255, 0.2);
}

/* Sorotan untuk jawaban yang benar saat pengguna salah memilih */
.answer-option.correct-highlight {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    border-color: #22c55e;
    border-style: dashed;
    animation: correctPulse 2s ease-in-out;
}

.answer-option.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* --- 3.3. Bagian Penjelasan (Explanation Section) --- */

.explanation-section {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-top: 1px solid rgba(14, 165, 233, 0.2);
    padding: 1.5rem;
    margin-top: 1rem;
    position: relative;
}

.explanation-section::before {
    content: '💡';
    position: absolute;
    top: -12px;
    left: 20px;
    background: var(--info-gradient);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 1rem;
    box-shadow: var(--shadow-light);
}

.explanation-title {
    font-weight: 700;
    color: #0369a1;
    margin-bottom: 0.75rem;
    font-size: 1rem;
    padding-left: 24px;
}

.explanation-text {
    color: #1e40af;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* --- 3.4. Kartu Progres & Hasil (Progress & Results Card) --- */

.progress-card {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid transparent;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-medium);
    overflow: hidden;
    position: relative;
}

.progress-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-gradient);
}

.enhanced-progress-bar {
    width: 100%;
    height: 12px;
    background: linear-gradient(90deg, #e5e7eb, #f3f4f6);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.enhanced-progress-fill {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 6px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.enhanced-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background-image: linear-gradient(-45deg,
            rgba(255, 255, 255, 0.2) 25%,
            transparent 25%,
            transparent 50%,
            rgba(255, 255, 255, 0.2) 50%,
            rgba(255, 255, 255, 0.2) 75%,
            transparent 75%,
            transparent);
    background-size: 20px 20px;
    animation: progressStripes 1s linear infinite;
}

.score-display {
    font-size: 3.5rem;
    font-weight: 900;
    text-align: center;
    margin: 1rem 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.1));
}

.score-display.excellent {
    background: var(--success-gradient);
    -webkit-background-clip: text;
    background-clip: text;
}

.score-display.good {
    background: var(--warning-gradient);
    -webkit-background-clip: text;
    background-clip: text;
}

.score-display.needs-improvement {
    background: var(--error-gradient);
    -webkit-background-clip: text;
    background-clip: text;
}

/* --- 3.5. Tombol & Badge (Buttons & Badges) --- */

/* File: module-theme.css */

.enhanced-button {
    position: relative;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius-md);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-medium);
    overflow: hidden;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* <-- TAMBAHKAN BARIS INI */
    gap: 8px;
    box-shadow: var(--shadow-light);
}

.enhanced-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s;
}

.enhanced-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.enhanced-button:hover::before {
    left: 100%;
}

.enhanced-button:active {
    transform: translateY(0);
}

.enhanced-button.primary {
    background: var(--primary-gradient);
    color: white;
}

.enhanced-button.success {
    background: var(--success-gradient);
    color: white;
}

.enhanced-button.danger {
    background: var(--error-gradient);
    color: white;
}

.enhanced-button.info {
    background: var(--info-gradient);
    color: white;
}

.achievement-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--warning-gradient);
    color: white;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.875rem;
    box-shadow: var(--shadow-light);
    margin: 4px;
    animation: badgeAppear 0.5s ease-out;
}

/* --- 3.6. Timer & Navigasi Cepat (Timer & Quick Navigation) --- */

.enhanced-timer {
    font-size: 2rem;
    font-weight: 800;
    text-align: center;
    padding: 1rem;
    border-radius: var(--border-radius-lg);
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    color: white;
    box-shadow: var(--shadow-medium);
    position: relative;
    overflow: hidden;
}

.enhanced-timer.warning {
    background: var(--warning-gradient);
    animation: timerPulse 1s ease-in-out infinite;
}

.enhanced-timer.danger {
    background: var(--error-gradient);
    animation: timerUrgent 0.5s ease-in-out infinite;
}

.enhanced-quick-nav {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.9) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-medium);
    overflow: hidden;
}

.nav-button {
    padding: 12px 16px;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border: 1px solid transparent;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-medium);
    position: relative;
    overflow: hidden;
}

.nav-button:hover {
    background: var(--primary-gradient);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-light);
}

/* --- 3.7. Komponen Sticky (Sticky Elements) --- */

.sticky-result-card {
    position: sticky;
    top: 1rem;
    z-index: 40;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}


/* ==========================================================================
   4. Mode Gelap (Dark Mode)
   ========================================================================== */

body.dark-mode {
    background-color: #111827;
    color: #f3f4f6;
}

/* Override Global */
.dark-mode .bg-white {
    background-color: #1f2937;
}

.dark-mode .bg-gray-800 {
    background-color: #1f2937;
}

.dark-mode .text-gray-900 {
    color: #ffffff;
}

.dark-mode .text-gray-800 {
    color: #f3f4f6;
}

.dark-mode .text-gray-600 {
    color: #d1d5db;
}

.dark-mode .text-gray-500 {
    color: #9ca3af;
}

.dark-mode .bg-gradient-to-br {
    background-image: none;
    background-color: #111827;
}

.dark-mode .border-gray-200 {
    border-color: #374151;
}

.dark-mode .border-gray-700 {
    border-color: #4b5563;
}

.dark-mode .shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

/* Override Komponen Kuis */
.dark-mode .enhanced-question-card {
    background: linear-gradient(145deg, #1f2937 0%, #111827 100%);
    border-color: rgba(75, 85, 99, 0.3);
}

.dark-mode .question-header {
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
    border-bottom-color: rgba(75, 85, 99, 0.5);
}

.dark-mode .question-text {
    color: #f9fafb;
}

.dark-mode .answer-option {
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
    color: #f3f4f6;
}

.dark-mode .answer-option:hover {
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
}

.dark-mode .explanation-section {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    border-top-color: rgba(59, 130, 246, 0.3);
}

.dark-mode .explanation-title {
    color: #93c5fd;
}

.dark-mode .explanation-text {
    color: #dbeafe;
}

.dark-mode .progress-card {
    background: linear-gradient(145deg, #1f2937 0%, #111827 100%);
}

.dark-mode .enhanced-quick-nav {
    background: linear-gradient(145deg, rgba(31, 41, 55, 0.9) 0%, rgba(17, 24, 39, 0.9) 100%);
    border-color: rgba(75, 85, 99, 0.3);
}

.dark-mode .nav-button {
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
    color: #f3f4f6;
}


/* ==========================================================================
   5. Mode Ujian Fullscreen (Exam Mode Fullscreen)
   ========================================================================== */

/* --- 5.1. Container Utama Mode Ujian --- */
.exam-fullscreen-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
    font-family: 'Open Sans', sans-serif;
}

.exam-fullscreen-container.dark-mode {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
}

/* --- 5.2. Header Progress Mode Ujian --- */
.exam-progress-header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.exam-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.exam-question-counter {
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.exam-timer-display {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.exam-timer {
    color: white;
    font-size: 1.5rem;
    font-weight: 800;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 100px;
    text-align: center;
}

.exam-timer.warning {
    background: var(--warning-gradient);
    animation: timerPulse 1s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.5);
}

.exam-timer.danger {
    background: var(--error-gradient);
    animation: timerUrgent 0.5s ease-in-out infinite;
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.7);
}

.exam-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
}

.exam-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4ade80, #22c55e);
    border-radius: 4px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.exam-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background-image: linear-gradient(-45deg, transparent 25%, rgba(255, 255, 255, 0.2) 25%, rgba(255, 255, 255, 0.2) 50%, transparent 50%, transparent 75%, rgba(255, 255, 255, 0.2) 75%);
    background-size: 20px 20px;
    animation: progressStripes 1s linear infinite;
}

/* --- 5.3. Konten Soal Mode Ujian --- */
.exam-question-content {
    flex: 1;
    display: flex;
    /* Ubah ini agar konten mulai dari atas, tidak dipaksa ke tengah */
    align-items: flex-start; 
    justify-content: center;
    padding: 2rem;
    padding-bottom: 6rem;
    position: relative;
    /* Pastikan overflow-y: auto ada untuk mengaktifkan scrollbar jika perlu */
    overflow-y: auto; 
}

.question-card-exam {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 3rem;
    max-width: 900px;
    width: 100%;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    animation: questionAppear 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.question-card-exam.dark-mode {
    background: rgba(31, 41, 55, 0.95);
    color: #f9fafb;
}

.question-card-exam::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
}

.question-text-exam {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.6;
    color: #1f2937;
    margin-bottom: 2rem;
    text-align: center;
}

.question-card-exam.dark-mode .question-text-exam {
    color: #f9fafb;
}

/* --- 5.4. Grid Pilihan Mode Ujian --- */
.exam-options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 2rem;
}

.exam-option-button {
    padding: 1.5rem;
    border: 3px solid transparent;
    border-radius: 15px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 70px;
}

.exam-option-button:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: #667eea;
    box-shadow: 0 15px 30px rgba(102, 126, 234, 0.25);
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
}

.exam-option-button.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: scale(1.05);
    border-color: #4f46e5;
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.exam-option-button.correct {
    background: var(--success-gradient);
    color: white;
    border-color: #22c55e;
    animation: correctPulse 0.6s ease-out;
}

.exam-option-button.incorrect {
    background: var(--error-gradient);
    color: white;
    border-color: #ef4444;
    animation: shake 0.5s ease-in-out;
}

.exam-option-button.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.exam-option-button.eliminated {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: #9ca3af;
    border-color: #6b7280;
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}

.exam-option-button.eliminated .exam-option-label {
    background: rgba(107, 114, 128, 0.7);
}

.exam-option-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.exam-option-button.selected .exam-option-label,
.exam-option-button.correct .exam-option-label,
.exam-option-button.incorrect .exam-option-label {
    background: rgba(255, 255, 255, 0.2);
}

/* --- 5.5. Navigasi Mode Ujian --- */
.exam-navigation-controls {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 1.5rem 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1002;
}

.exam-nav-button {
    padding: 0.75rem 1.5rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 120px;
    justify-content: center;
}

.exam-nav-button:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.exam-nav-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.exam-nav-button.primary {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    border-color: #22c55e;
    font-weight: 700;
}

.exam-nav-button.primary:hover:not(:disabled) {
    box-shadow: 0 10px 25px rgba(34, 197, 94, 0.3);
    transform: translateY(-3px) scale(1.02);
}

/* --- 5.7. Live Feedback & Motivasi --- */
.exam-live-feedback {
    position: fixed;
    top: 50%;
    left: 2rem;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 1001;
}

.streak-indicator {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 20px;
    font-weight: 700;
    text-align: center;
    box-shadow: 0 10px 25px rgba(255, 107, 107, 0.3);
    animation: bounceIn 0.6s ease-out;
}

.time-bonus-indicator {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 15px;
    font-weight: 600;
    text-align: center;
    font-size: 0.9rem;
    animation: slideInLeft 0.5s ease-out;
}

/* --- 5.8. Achievement Unlock Modal --- */
.achievement-unlock-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    text-align: center;
    animation: achievementAppear 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.achievement-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.achievement-icon {
    font-size: 3rem;
    animation: bounceIn 1s ease-out 0.3s both;
}

/* --- 5.8.5. Exam Header Controls (REVISED) --- */
.exam-header-controls {
    display: flex;
    gap: 12px; /* Memberi sedikit jarak antar tombol */
    align-items: center;
}

.exam-control-btn {
    /* Ukuran Konsisten */
    width: 40px;
    height: 40px;
    
    /* Hapus padding dan atur display untuk centering */
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;

    /* Tampilan & Interaksi */
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 12px; /* Sudut lebih rounded */
    font-size: 1.1rem; /* Ukuran ikon agar terlihat jelas */
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.exam-control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px) scale(1.05); /* Efek hover lebih menarik */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.exam-control-button svg {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

.exam-control-button span {
    display: none;
}

/* Responsive - tampilkan text pada layar lebih besar */
@media (min-width: 768px) {
    .exam-control-button {
        padding: 0.5rem 1rem;
    }

    .exam-control-button span {
        display: inline;
    }
}



/* --- 5.9. Responsivitas Mode Ujian --- */
@media (max-width: 768px) {
    .exam-live-feedback {
        left: 1rem;
        right: 1rem;
        bottom: auto; /* Hapus posisi dari bawah */
        top: 5.5rem;  /* Posisikan 5.5rem dari atas layar */
        transform: none;
        flex-direction: row;
        justify-content: space-around;
        /* Tambahkan ini agar tidak tertimpa elemen lain jika ada */
        z-index: 1001; 
    }

    .exam-progress-header {
        padding: 1rem;
    }

    .question-card-exam {
        padding: 2rem 1.5rem;
        margin: 1rem;
    }

    .question-text-exam {
        font-size: 1.25rem;
    }

    .exam-option-button {
        padding: 1rem;
        font-size: 1rem;
        min-height: 60px;
    }

    .exam-option-label {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .exam-navigation-controls {
        padding: 1rem;
        flex-direction: row;
        /* Ubah kembali ke row untuk mobile */
        gap: 1rem;
    }

    .exam-nav-button {
        flex: 1;
        justify-content: center;
        min-width: auto;
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
    }

    .exam-question-content {
        padding: 1rem;
        padding-bottom: 7rem;
        /* Sesuaikan untuk mobile */
    }
}

@media (max-width: 480px) {
    .exam-fullscreen-container {
        font-size: 14px;
    }

    .exam-question-counter {
        font-size: 1rem;
    }

    .exam-timer {
        font-size: 1.2rem;
        min-width: 80px;
        padding: 0.4rem 0.8rem;
    }

    .question-card-exam {
        padding: 1.5rem 1rem;
        margin: 0.5rem;
    }

    .question-text-exam {
        font-size: 1.1rem;
        margin-bottom: 1.5rem;
    }

    .exam-option-button {
        padding: 0.8rem;
        font-size: 0.95rem;
        min-height: 55px;
        gap: 0.8rem;
    }

    .exam-option-label {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }

    .streak-indicator {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
    }

    .time-bonus-indicator {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }

    .confidence-meter {
        padding: 0.8rem;
    }

    .confidence-bar {
        width: 80px;
    }

    .exam-navigation-controls {
        padding: 0.8rem;
        gap: 0.5rem;
    }

    .exam-nav-button {
        padding: 0.7rem 0.8rem;
        font-size: 0.85rem;
        min-width: auto;
    }

    .exam-question-content {
        padding: 0.5rem;
        padding-bottom: 6rem;
    }
}

/* --- 5.10. High Contrast Mode --- */
@media (prefers-contrast: high) {
    .exam-fullscreen-container {
        background: linear-gradient(135deg, #000080 0%, #000040 100%);
    }

    .question-card-exam {
        background: #ffffff;
        border: 3px solid #000000;
    }

    .exam-option-button {
        border: 2px solid #000000;
        background: #ffffff;
        color: #000000;
    }

    .exam-option-button:hover {
        background: #f0f0f0;
        border-color: #0066cc;
    }

    .exam-option-button.selected {
        background: #0066cc;
        color: #ffffff;
        border-color: #004499;
    }

    .exam-option-button.correct {
        background: #008800;
        border-color: #004400;
    }

    .exam-option-button.incorrect {
        background: #cc0000;
        border-color: #880000;
    }
}

/* --- 5.11. Reduced Motion Mode --- */
@media (prefers-reduced-motion: reduce) {

    .exam-fullscreen-container *,
    .exam-fullscreen-container *::before,
    .exam-fullscreen-container *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .exam-timer.warning,
    .exam-timer.danger {
        animation: none;
    }

    .exam-progress-fill::after {
        animation: none;
    }
}


/* ==========================================================================
   6. Animasi & Keyframes (Animations & Keyframes)
   ========================================================================== */

@keyframes questionAppear {
    0% {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(-50px);
    }

    50% {
        opacity: 1;
        transform: scale(1.05) translateY(-10px);
    }

    70% {
        transform: scale(0.9) translateY(0);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes slideInLeft {
    0% {
        opacity: 0;
        transform: translateX(-30px);
    }

    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes achievementAppear {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5) rotateY(180deg);
    }

    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1) rotateY(0deg);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

@keyframes correctPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }
}

@keyframes timerPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

@keyframes timerUrgent {

    0%,
    100% {
        transform: scale(1) rotate(0deg);
    }

    25% {
        transform: scale(1.05) rotate(-1deg);
    }

    75% {
        transform: scale(1.05) rotate(1deg);
    }
}

@keyframes progressStripes {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 20px 0;
    }
}

@keyframes badgeAppear {
    0% {
        opacity: 0;
        transform: scale(0.5) translateY(-20px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes slideInUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ==========================================================================
   6. Kueri Media (Media Queries)
   ========================================================================== */

/* --- 6.1. Desain Responsif (Responsive Design) --- */

@media (max-width: 768px) {
    .sticky-result-card {
        top: 0;
        margin-bottom: 1.5rem;
    }

    .question-text {
        font-size: 1rem;
        padding-right: 60px;
    }

    .question-number {
        padding: 6px 12px;
        font-size: 0.75rem;
        right: 15px;
    }

    .answer-option {
        padding: 0.875rem 1rem;
        font-size: 0.925rem;
    }

    .option-label {
        width: 24px;
        height: 24px;
        font-size: 0.75rem;
        margin-right: 10px;
    }

    .score-display {
        font-size: 2.5rem;
    }

    .enhanced-timer {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .enhanced-question-card {
        margin-bottom: 1.5rem;
    }

    .question-header {
        padding: 1rem;
    }

    .answer-options {
        padding: 1rem;
        gap: 0.75rem;
    }

    .explanation-section {
        padding: 1rem;
    }

    .score-display {
        font-size: 2rem;
    }
}

/* --- 6.2. Aksesibilitas (Accessibility) --- */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.answer-option:focus,
.enhanced-button:focus {
    outline: 3px solid #3b82f6;
    outline-offset: 2px;
}

/* Mode Kontras Tinggi */
@media (prefers-contrast: high) {
    .enhanced-question-card {
        border: 3px solid #000;
    }

    .answer-option {
        border: 2px solid #000;
    }
}

/* ==========================================================================
   7. Animasi untuk Modal (Modal Animations)
   ========================================================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* --- 5.8.3. Hint Section Styling --- */
.hint-section {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #f59e0b;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    position: relative;
    animation: slideDown 0.5s ease-out;
}

.hint-section::before {
    content: "💡";
    position: absolute;
    top: -12px;
    left: 1rem;
    background: #f59e0b;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.hint-content {
    color: #92400e;
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.5;
    margin: 0;
}

.hint-section .hint-icon {
    color: #f59e0b;
    margin-right: 0.5rem;
    font-size: 1.2rem;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- 5.8.5. Exam Header Controls --- */
.exam-header-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.exam-control-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.exam-control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* --- 5.8.6. Exam Progress Modal --- */
.exam-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.exam-modal-content {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: slideInUp 0.4s ease;
}

.dark-mode .exam-modal-content {
    background: #1f2937;
    color: #f3f4f6;
}

.exam-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e5e7eb;
}

.dark-mode .exam-modal-header {
    border-bottom-color: #374151;
}

.exam-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
}

.dark-mode .exam-modal-header h3 {
    color: #f3f4f6;
}

.exam-modal-close {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.exam-modal-close:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.progress-summary {
    background: #f3f4f6;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.dark-mode .progress-summary {
    background: #374151;
}

.progress-summary p {
    margin: 4px 0;
    font-weight: 600;
    color: #374151;
}

.dark-mode .progress-summary p {
    color: #d1d5db;
}

.question-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 8px;
}

.question-item {
    width: 50px;
    height: 50px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    background: #f9fafb;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    transition: all 0.3s ease;
}

.question-item:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* === KODE PERBAIKAN DIMULAI DI SINI === */

/* Gaya untuk soal yang BELUM DIJAWAB */
.question-item.unanswered {
    background-color: #f3f4f6; /* Abu-abu terang */
    color: #6b7280;
}
.dark-mode .question-item.unanswered {
    background-color: #374151; /* Abu-abu gelap */
    color: #9ca3af;
}

/* Gaya untuk soal yang SUDAH DIJAWAB di mode ujian (Ungu) */
.question-item.answered-exam { background-color: rgba(91, 33, 182, 0.2); /* Ungu Tua dengan Opacity 20% */ border: 2px solid #7c3aed; /* Outline Ungu Terang */ color: #5b21b6; 
}
.dark-mode .question-item.answered-exam { background-color: rgba(76, 29, 149, 0.3); /* Ungu Lebih Gelap dengan Opacity 30% */ border: 2px solid #6d28d9; /* Outline Ungu */ color: #a78bfa; 
}

/* Gaya untuk soal yang SEDANG AKTIF/DILIHAT (Kuning) */
.question-item.current-exam {
    background-color: #fbbf24; /* Kuning */
    border-color: #f59e0b;
    color: #92400e;
    animation: pulse 1.5s infinite;
}

/* Dark mode untuk modal (hanya yang relevan dipertahankan) */
.dark-mode .question-item {
    background: #4b5563;
    border-color: #6b7280;
    color: #d1d5db;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* Anda bisa meletakkan ini di bagian mana saja, misalnya di bagian paling bawah */

#register-modal {
    z-index: 2000;
}

/* ==========================================================================
   Kustomisasi Warna Hasil Kuis (Final Fix - Hijau Soft)
   ========================================================================== */

/* Targetkan .score-summary-box HANYA KETIKA body TIDAK memiliki kelas .dark-mode.
  Ini akan memaksa gaya mode terang untuk diterapkan.
*/
body:not(.dark-mode) .score-summary-box {
    background-color: #86efac !important; /* Hijau Soft (Tailwind Green-300) */
}

body:not(.dark-mode) .score-summary-box p {
    color: #064e3b !important; /* Hijau Tua Gelap untuk Kontras */
}

/* Aturan untuk Mode Gelap (Hijau Soft yang Lebih Gelap) */
.dark-mode .score-summary-box {
    background-color: #22c55e !important; /* Hijau Soft Gelap (Tailwind Green-500) */
}

.dark-mode .score-summary-box p {
    color: #f0fdf4 !important; /* Hijau Sangat Muda untuk Kontras */
}

/* ==========================================================================
   Perbaikan Tampilan Pilihan Jawaban Mode Ujian (Dark Mode)
   ========================================================================== */

.dark-mode .exam-option-button {
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%); /* Latar belakang gelap */
    color: #f3f4f6; /* Warna teks terang (INI PERBAIKAN UTAMANYA) */
    border-color: transparent; /* Hapus border awal */
}

.dark-mode .exam-option-button:hover {
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
    border-color: #667eea; /* Border saat hover */
}

.dark-mode .exam-option-button.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #4f46e5; /* Border saat dipilih */
}