/* ============================================ */
/* ROOT VARIABLES & RESET                      */
/* ============================================ */

:root {
    /* === Light Mode Colors === */
    --primary: #6C63FF;
    --primary-light: #8B83FF;
    --primary-dark: #5A52D6;
    --secondary: #FF6B9D;
    --secondary-light: #FF8BB5;
    --accent: #FFD93D;
    --success: #6BCB77;
    --danger: #FF6B6B;
    --warning: #FFA94D;
    
    --bg-primary: #F8F9FE;
    --bg-secondary: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-input: #F1F2F6;
    --bg-hover: #EEF0F8;
    
    --text-primary: #2D2D3F;
    --text-secondary: #6B6B80;
    --text-light: #A0A0B8;
    
    --border-color: #E2E4EC;
    --shadow-color: rgba(108, 99, 255, 0.15);
    --shadow-hover: rgba(108, 99, 255, 0.25);
    
    --radius: 16px;
    --radius-sm: 10px;
    --radius-lg: 24px;
    
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    
    --font-family: 'Quicksand', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* === Dark Mode === */
[data-theme="dark"] {
    --primary: #8B83FF;
    --primary-light: #A69CFF;
    --primary-dark: #6C63FF;
    --secondary: #FF8BB5;
    --secondary-light: #FFA8C4;
    
    --bg-primary: #1A1A2E;
    --bg-secondary: #16213E;
    --bg-card: #1F2A4A;
    --bg-input: #2A3555;
    --bg-hover: #2A3A5A;
    
    --text-primary: #E8E8F0;
    --text-secondary: #B0B0C8;
    --text-light: #7A7A92;
    
    --border-color: #2A3A5A;
    --shadow-color: rgba(0, 0, 0, 0.4);
    --shadow-hover: rgba(0, 0, 0, 0.6);
}

/* === Reset & Base === */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    transition: background var(--transition), color var(--transition);
    overflow-x: hidden;
}


/* ============================================ */
/* FIX: HILANGKAN HIGHLIGHT BIRU & PROTECTION  */
/* ============================================ */

/* Hilangkan outline biru */
*:focus {
    outline: none !important;
}

*:focus-visible {
    outline: 2px solid var(--primary) !important;
    outline-offset: 2px;
}

/* Hilangkan tap highlight di mobile */
* {
    -webkit-tap-highlight-color: transparent !important;
    -webkit-touch-callout: none !important;
}

/* Cegah selection */
::selection {
    background: var(--primary);
    color: white;
}

.btn, 
.option-btn,
.header-btn,
button {
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
}

/* Cegah drag gambar */
img,
svg,
[contenteditable="true"] {
    -webkit-user-drag: none !important;
    -khtml-user-drag: none !important;
    -moz-user-drag: none !important;
    -o-user-drag: none !important;
    user-drag: none !important;
    pointer-events: auto;
}

/* Cegah copy seluruh halaman */
body {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Izinkan di input */
input, textarea {
    user-select: text !important;
    -webkit-user-select: text !important;
}
q
/* ============================================ */
/* SCROLLBAR STYLING                          */
/* ============================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* ============================================ */
/* PROTECTION - CEKAL COPY & DRAG             */
/* ============================================ */

/* Cegah drag gambar dan elemen */
img,
canvas,
svg,
video,
[contenteditable="true"] {
    -webkit-user-drag: none !important;
    -khtml-user-drag: none !important;
    -moz-user-drag: none !important;
    -o-user-drag: none !important;
    user-drag: none !important;
    pointer-events: auto;
}

/* Cegah selection pada elemen tertentu */
.no-select,
.protected {
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
}

/* Cegah copy pada seluruh halaman (opsional) */
body.protected {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Tapi izinkan selection pada input dan textarea */
input, textarea {
    user-select: text !important;
    -webkit-user-select: text !important;
}

/* ============================================ */
/* FIX: HILANGKAN HIGHLIGHT BIRU & SELECTION  */
/* ============================================ */

/* Hilangkan outline biru pada focus */
*:focus {
    outline: none !important;
}

/* Tapi tetap ada focus indicator untuk aksesibilitas */
*:focus-visible {
    outline: 2px solid var(--primary) !important;
    outline-offset: 2px;
}

/* Hilangkan highlight biru saat tap/klik di mobile */
* {
    -webkit-tap-highlight-color: transparent !important;
    -webkit-touch-callout: none !important;
}

/* Hilangkan selection (highlight biru saat drag teks) */
::selection {
    background: var(--primary);
    color: white;
}

/* Untuk mencegah user select teks di tombol */
.btn, 
.option-btn,
.header-btn,
button {
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
}

/* Hilangkan drag pada gambar */
img,
[contenteditable="true"],
[contenteditable="true"] * {
    -webkit-user-drag: none !important;
    user-drag: none !important;
}

/* Hilangkan default highlight pada link */
a {
    -webkit-tap-highlight-color: transparent !important;
}

/* Hilangkan default outline pada button di Chrome/Safari */
button:focus {
    outline: none !important;
}

/* ============================================ */
/* APP CONTAINER                              */
/* ============================================ */

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================ */
/* HEADER / NAVBAR                            */
/* ============================================ */

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    box-shadow: 0 2px 20px var(--shadow-color);
    margin-bottom: 24px;
    transition: background var(--transition), box-shadow var(--transition);
    position: sticky;
    top: 20px;
    z-index: 100;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    cursor: default;
}

.logo-icon {
    font-size: 2rem;
    animation: float 3s ease-in-out infinite;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.header-right {
    display: flex;
    gap: 8px;
}

.header-btn {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-btn:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1) rotate(5deg);
}

.header-btn:active {
    transform: scale(0.9);
}

/* ============================================ */
/* MAIN CONTENT                              */
/* ============================================ */

.main-content {
    flex: 1;
    position: relative;
}

/* ============================================ */
/* SCREENS                                    */
/* ============================================ */

.screen {
    display: none;
    animation: fadeSlideIn 0.4s ease-out;
}

.screen.active {
    display: block;
}

/* ============================================ */
/* ANIMATIONS                                */
/* ============================================ */

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

@keyframes pulse {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }
    20% {
        transform: translateX(-10px);
    }
    40% {
        transform: translateX(10px);
    }
    60% {
        transform: translateX(-6px);
    }
    80% {
        transform: translateX(6px);
    }
}

@keyframes celebration {
    0% {
        transform: scale(0.8) rotate(-5deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.15) rotate(3deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

@keyframes slimeySquishy {
    0% {
        transform: scale(1, 1);
    }
    30% {
        transform: scale(1.1, 0.85);
    }
    60% {
        transform: scale(0.95, 1.05);
    }
    100% {
        transform: scale(1, 1);
    }
}

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

@keyframes progressPulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

/* ============================================ */
/* BUTTONS                                    */
/* ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font-family);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    min-height: 52px;
}

.btn:active {
    transform: scale(0.95);
}

.btn-squishy {
    transition: all var(--transition-bounce);
}

.btn-squishy:active {
    animation: slimeySquishy 0.4s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 15px var(--shadow-color);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--shadow-hover);
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    transform: translateY(-2px);
    border-color: var(--primary);
}

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

.btn-success:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
}

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

.btn-danger:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
}

.btn-hint {
    background: var(--accent);
    color: var(--text-primary);
}

.btn-hint:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
}

.btn-large {
    padding: 18px 40px;
    font-size: 1.1rem;
    min-height: 60px;
}

.btn-small {
    padding: 10px 18px;
    font-size: 0.85rem;
    min-height: 38px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ============================================ */
/* HOME SCREEN                               */
/* ============================================ */

.home-container {
    max-width: 600px;
    margin: 0 auto;
}

.hero {
    text-align: center;
    padding: 30px 20px;
    margin-bottom: 30px;
}

.hero-emoji {
    font-size: 4rem;
    animation: float 3s ease-in-out infinite;
    display: block;
    margin-bottom: 16px;
}

.hero-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 400px;
    margin: 0 auto;
}

.quiz-settings {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.settings-card,
.stats-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: 0 4px 20px var(--shadow-color);
    transition: background var(--transition), box-shadow var(--transition);
}

.settings-title,
.stats-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.form-group {
    margin-bottom: 18px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 1rem;
    transition: all var(--transition);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B6B80' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 44px;
}

.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--shadow-color);
}

.form-select:hover {
    border-color: var(--primary-light);
}

.checkbox-group {
    margin: 16px 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-input);
    transition: all var(--transition);
    flex-shrink: 0;
    position: relative;
}

.checkbox-label input:checked+.checkbox-custom {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-label input:checked+.checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: 700;
}

.checkbox-label:hover .checkbox-custom {
    border-color: var(--primary);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    text-align: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 4px;
}

/* ============================================ */
/* QUIZ SCREEN                               */
/* ============================================ */

.quiz-container {
    max-width: 700px;
    margin: 0 auto;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg-card);
    border-radius: var(--radius);
    margin-bottom: 20px;
    box-shadow: 0 2px 10px var(--shadow-color);
    transition: background var(--transition);
}

.quiz-info {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.quiz-category {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.9rem;
    padding: 4px 12px;
    background: var(--bg-input);
    border-radius: 20px;
}

.quiz-difficulty {
    font-weight: 500;
    font-size: 0.8rem;
    padding: 4px 12px;
    border-radius: 20px;
}

.quiz-difficulty[data-difficulty="sedang"] {
    background: var(--warning);
    color: white;
}

.quiz-difficulty[data-difficulty="sulit"] {
    background: var(--danger);
    color: white;
}

.quiz-score {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.score-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.score-value {
    font-size: 1.3rem;
    color: var(--primary);
}

/* Progress Bar */
.progress-container {
    margin-bottom: 20px;
}

.progress-bar-wrapper {
    width: 100%;
    height: 8px;
    background: var(--bg-input);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 10px;
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progressPulse 2s ease-in-out infinite;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Timer */
.timer-container {
    margin-bottom: 20px;
    position: relative;
}

.timer-bar {
    height: 4px;
    background: var(--success);
    border-radius: 10px;
    transition: width 0.3s linear, background 0.3s;
}

.timer-bar.warning {
    background: var(--warning);
}

.timer-bar.danger {
    background: var(--danger);
    animation: pulse 0.5s ease-in-out infinite;
}

.timer-text {
    position: absolute;
    right: 0;
    top: -20px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Question Area */
.question-area {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: 0 4px 20px var(--shadow-color);
    transition: background var(--transition), box-shadow var(--transition);
}

.question-number {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 500;
    margin-bottom: 8px;
}

.question-text {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 24px;
    line-height: 1.5;
    color: var(--text-primary);
}

/* Options Grid */
.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

@media (max-width: 480px) {
    .options-grid {
        grid-template-columns: 1fr;
    }
}

.option-btn {
    padding: 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    text-align: left;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
}

.option-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.option-btn:active:not(:disabled) {
    transform: scale(0.97);
}

.option-btn .option-letter {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--text-secondary);
    flex-shrink: 0;
    transition: all var(--transition);
}

.option-btn:hover:not(:disabled) .option-letter {
    background: var(--primary);
    color: white;
}

.option-btn.correct {
    border-color: var(--success);
    background: var(--success);
    color: white;
    animation: celebration 0.5s ease;
}

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

.option-btn.wrong {
    border-color: var(--danger);
    background: var(--danger);
    color: white;
    animation: shake 0.5s ease;
}

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

.option-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.option-btn:disabled:not(.correct):not(.wrong) {
    opacity: 0.5;
}

/* Hint */
.hint-container {
    margin-top: 16px;
    padding: 16px 20px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--accent);
    animation: fadeSlideIn 0.3s ease;
}

.hint-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.hint-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.hint-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ============================================ */
/* EXPLANATION SCREEN                        */
/* ============================================ */

.explanation-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 20px 0;
}

.explanation-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 40px 30px;
    box-shadow: 0 8px 30px var(--shadow-color);
    text-align: center;
    transition: background var(--transition), box-shadow var(--transition);
    animation: fadeSlideIn 0.4s ease;
}

.explanation-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 12px;
}

.explanation-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.explanation-content {
    text-align: left;
    margin: 20px 0 30px;
    padding: 20px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
}

.explanation-answer,
.explanation-detail {
    margin-bottom: 12px;
}

.explanation-answer:last-child,
.explanation-detail:last-child {
    margin-bottom: 0;
}

.explanation-answer .label,
.explanation-detail .label {
    display: block;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.explanation-answer .value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--success);
}

.explanation-detail .value {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ============================================ */
/* RESULT SCREEN                             */
/* ============================================ */

.result-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 20px 0;
}

.result-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 40px 30px;
    box-shadow: 0 8px 30px var(--shadow-color);
    text-align: center;
    transition: background var(--transition), box-shadow var(--transition);
    animation: fadeSlideIn 0.5s ease;
}

.result-emoji {
    font-size: 4.5rem;
    display: block;
    margin-bottom: 12px;
    animation: float 3s ease-in-out infinite;
}

.result-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.result-score {
    margin-bottom: 24px;
}

.result-score-number {
    font-size: 4rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.result-score-label {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.result-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.result-detail-item {
    background: var(--bg-input);
    padding: 12px;
    border-radius: var(--radius-sm);
}

.result-detail-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-detail-value {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
    margin-top: 2px;
}

.result-detail-value.correct {
    color: var(--success);
}

.result-detail-value.wrong {
    color: var(--danger);
}

.result-stats {
    margin: 20px 0 24px;
    padding: 16px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    max-height: 150px;
    overflow-y: auto;
}

.result-stats-item {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 0.85rem;
}

.result-stats-item .stat-category {
    color: var(--text-secondary);
}

.result-stats-item .stat-score {
    font-weight: 600;
    color: var(--text-primary);
}

.result-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ============================================ */
/* HISTORY SCREEN                            */
/* ============================================ */

.history-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px 0;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.history-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 4px;
}

.history-item {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px var(--shadow-color);
    transition: all var(--transition);
}

.history-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 16px var(--shadow-hover);
}

.history-item-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.history-item-category {
    font-weight: 600;
    font-size: 0.95rem;
}

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

.history-item-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

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

.history-item-percentage {
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--bg-input);
    font-weight: 600;
}

.history-item-percentage.good {
    background: var(--success);
    color: white;
}

.history-item-percentage.medium {
    background: var(--warning);
    color: white;
}

.history-item-percentage.bad {
    background: var(--danger);
    color: white;
}

.history-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 12px;
}

/* ============================================ */
/* FOOTER                                    */
/* ============================================ */

.app-footer {
    text-align: center;
    padding: 20px;
    margin-top: 30px;
    color: var(--text-light);
    font-size: 0.85rem;
    border-top: 1px solid var(--border-color);
}

/* ============================================ */
/* RESPONSIVE DESIGN                         */
/* ============================================ */

@media (max-width: 768px) {
    .app-container {
        padding: 12px;
    }

    .app-header {
        padding: 10px 16px;
        top: 12px;
        border-radius: var(--radius-sm);
    }

    .logo-text {
        font-size: 1.2rem;
    }

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

    .header-btn {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }

    .hero-title {
        font-size: 1.6rem;
    }

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

    .settings-card,
    .stats-card {
        padding: 20px;
    }

    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .stat-number {
        font-size: 1.4rem;
    }

    .question-area {
        padding: 20px;
    }

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

    .option-btn {
        font-size: 0.85rem;
        padding: 12px 14px;
        min-height: 44px;
    }

    .result-card,
    .explanation-card {
        padding: 28px 20px;
    }

    .result-score-number {
        font-size: 3rem;
    }

    .result-details {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .btn {
        padding: 12px 20px;
        font-size: 0.9rem;
        min-height: 44px;
    }

    .btn-large {
        padding: 14px 28px;
        font-size: 1rem;
        min-height: 52px;
    }

    .history-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .history-item-right {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 480px) {
    .app-container {
        padding: 8px;
    }

    .app-header {
        padding: 8px 12px;
        top: 8px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .logo-text {
        font-size: 1rem;
    }

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

    .header-btn {
        width: 34px;
        height: 34px;
        font-size: 0.9rem;
    }

    .hero {
        padding: 16px 10px;
    }

    .hero-emoji {
        font-size: 3rem;
    }

    .hero-title {
        font-size: 1.3rem;
    }

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

    .settings-card,
    .stats-card {
        padding: 16px;
    }

    .settings-title,
    .stats-title {
        font-size: 1rem;
    }

    .form-select {
        padding: 10px 14px;
        font-size: 0.9rem;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 6px;
    }

    .stat-number {
        font-size: 1.2rem;
    }

    .stat-label {
        font-size: 0.7rem;
    }

    .quiz-header {
        flex-direction: column;
        gap: 8px;
        padding: 12px 16px;
    }

    .quiz-info {
        width: 100%;
        justify-content: center;
    }

    .question-area {
        padding: 16px;
    }

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

    .option-btn {
        font-size: 0.8rem;
        padding: 10px 12px;
        min-height: 40px;
        gap: 8px;
    }

    .option-btn .option-letter {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }

    .result-card,
    .explanation-card {
        padding: 20px 16px;
    }

    .result-score-number {
        font-size: 2.5rem;
    }

    .result-details {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }

    .result-detail-value {
        font-size: 1.1rem;
    }

    .btn {
        padding: 10px 16px;
        font-size: 0.85rem;
        min-height: 40px;
    }

    .btn-large {
        padding: 12px 20px;
        font-size: 0.95rem;
        min-height: 46px;
    }

    .explanation-card {
        padding: 24px 16px;
    }

    .explanation-icon {
        font-size: 3rem;
    }

    .explanation-title {
        font-size: 1.3rem;
    }

    .explanation-content {
        padding: 16px;
    }

    .history-title {
        font-size: 1.2rem;
    }

    .history-item {
        padding: 12px 16px;
    }

    .history-item-category {
        font-size: 0.85rem;
    }

    .history-item-score {
        font-size: 1.1rem;
    }

    .timer-text {
        font-size: 0.7rem;
        top: -18px;
    }
}

/* ============================================ */
/* UTILITY CLASSES                           */
/* ============================================ */

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

.text-primary {
    color: var(--primary);
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

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

.mt-1 {
    margin-top: 8px;
}
.mt-2 {
    margin-top: 16px;
}
.mt-3 {
    margin-top: 24px;
}
.mb-1 {
    margin-bottom: 8px;
}
.mb-2 {
    margin-bottom: 16px;
}
.mb-3 {
    margin-bottom: 24px;
}

.hidden {
    display: none !important;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.gap-1 {
    gap: 8px;
}
.gap-2 {
    gap: 16px;
}
.gap-3 {
    gap: 24px;
}

/* ============================================ */
/* TAMBAHKAN DI STYLE.CSS                     */
/* ============================================ */

/* ============================================ */
/* RIPPLE EFFECT                             */
/* ============================================ */

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: ripple-animation 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.btn {
    position: relative;
    overflow: hidden;
}

/* ============================================ */
/* CONFETTI ANIMATION                        */
/* ============================================ */

.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.confetti {
    position: absolute;
    animation: confetti-fall 3s ease-out forwards;
    opacity: 1;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(0) rotate(0deg) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg) scale(0.5);
        opacity: 0;
    }
}

/* ============================================ */
/* SHORTCUT HELP                            */
/* ============================================ */

.shortcut-help {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    animation: fadeSlideIn 0.3s ease;
}

.shortcut-help-content {
    background: var(--bg-card);
    padding: 32px;
    border-radius: var(--radius-lg);
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px var(--shadow-color);
    animation: slimeySquishy 0.5s ease;
}

.shortcut-help-content h3 {
    font-size: 1.3rem;
    margin-bottom: 16px;
    text-align: center;
    color: var(--text-primary);
}

.shortcut-help-content ul {
    list-style: none;
    padding: 0;
    margin-bottom: 20px;
}

.shortcut-help-content ul li {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.shortcut-help-content ul li:last-child {
    border-bottom: none;
}

.shortcut-help-content kbd {
    background: var(--bg-input);
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    font-family: var(--font-family);
    min-width: 30px;
    text-align: center;
}

.shortcut-help-content .btn {
    width: 100%;
}

/* ============================================ */
/* ERROR TOAST                              */
/* ============================================ */

.error-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--danger);
    color: white;
    padding: 16px 24px;
    border-radius: var(--radius);
    box-shadow: 0 8px 30px rgba(255, 107, 107, 0.4);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 9997;
    animation: fadeSlideIn 0.3s ease;
    max-width: 90%;
}

.error-toast .error-icon {
    font-size: 1.2rem;
}

.error-toast .error-message {
    font-size: 0.9rem;
    flex: 1;
}

.error-toast button {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.3s;
}

.error-toast button:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ============================================ */
/* TRANSISI SOAL YANG LEBIH HALUS           */
/* ============================================ */

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

.question-area {
    animation: fadeSlideIn 0.3s ease;
}

/* ============================================ */
/* PROGRESS BAR GLOW                         */
/* ============================================ */

.progress-bar-wrapper {
    position: relative;
}

.progress-bar-wrapper::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--primary));
    background-size: 200% 100%;
    border-radius: 12px;
    opacity: 0.2;
    animation: progress-glow 3s ease-in-out infinite;
    z-index: -1;
}

@keyframes progress-glow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* ============================================ */
/* RESPONSIVE FONT SIZE SCALING              */
/* ============================================ */

@media (max-width: 768px) {
    html {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
    
    .hero-title {
        font-size: 1.4rem;
    }
    
    .question-text {
        font-size: 1rem;
    }
    
    .shortcut-help-content {
        padding: 20px;
    }
    
    .shortcut-help-content ul li {
        font-size: 0.8rem;
        padding: 6px 10px;
    }
}

/* ============================================ */
/* PRINT STYLES                              */
/* ============================================ */

@media print {
    .app-header,
    .app-footer,
    .header-right,
    .btn,
    .timer-container,
    .hint-container {
        display: none !important;
    }
    
    .screen {
        display: block !important;
    }
    
    .screen:not(.active) {
        display: none !important;
    }
    
    .question-area {
        box-shadow: none !important;
        border: 1px solid #ddd;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
}
