:root {
    --primary: #2c3e50;
    --accent: #27ae60;
    --danger: #e74c3c;
    --light: #f4f7f6;
    --white: #ffffff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Roboto, sans-serif;
}

body {
    background-color: var(--light);
    color: var(--primary);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.container {
    background: var(--white);
    width: 100%;
    max-width: 450px;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    text-align: center;
}

section { display: none; }
section.active { display: block; }

h1 { margin-bottom: 10px; font-size: 2rem; }
p { color: #666; margin-bottom: 30px; }

/* Grid Tombol Kategori */
.category-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

button {
    padding: 15px;
    border: none;
    border-radius: 12px;
    background: var(--primary);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

button:active { transform: scale(0.95); }

/* Kuis Styles */
.quiz-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-weight: bold;
}

.timer-container {
    width: 100%;
    height: 10px;
    background: #eee;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 25px;
}

#timer-bar {
    width: 100%;
    height: 100%;
    background: var(--accent);
    transition: width 0.1s linear, background 0.3s;
}

#question-text {
    font-size: 1.2rem;
    margin-bottom: 25px;
    min-height: 60px;
}

.options-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-btn {
    background: #ecf0f1;
    color: var(--primary);
    text-align: left;
}

.option-btn:hover { background: #dde4e6; }

/* Result & AI Analysis */
.final-score {
    font-size: 3rem;
    font-weight: bold;
    color: var(--accent);
    margin: 20px 0;
}

.ai-box {
    background: #f9f9f9;
    border-left: 5px solid var(--accent);
    border-radius: 0 8px 8px 0;
    padding: 15px;
    text-align: left;
    margin-bottom: 25px;
    font-size: 0.95rem;
    line-height: 1.6;
    overflow-wrap: break-word;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.loading-text { font-style: italic; color: #888; }

.btn-primary {
    width: 100%;
    background: var(--accent);
    margin-top: 10px;
}
.btn-whatsapp {
    width: 100%;
    background-color: #25D366 !important;
    color: white;
    margin-top: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.btn-whatsapp:hover {
    background-color: #128C7E !important;
}

/* Responsif untuk Layar Kecil (HP) */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    .container {
        padding: 25px 15px; /* Mengurangi padding kiri-kanan agar teks lebih luas */
    }
    .ai-box {
        padding: 12px;
        font-size: 0.9rem; /* Sedikit mengecilkan font agar tidak terlalu padat */
        line-height: 1.5;
    }
}
.category-card {
    background: white;
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.level-indicator {
    display: flex;
    gap: 5px;
    margin-top: 10px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ddd;
}

.dot.active { background: var(--accent); } /* Level yang sudah tamat */

/* Animasi Fade-In Up untuk Layar Panduan */
@keyframes fadeInUp {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}

#guide-screen.active {
    animation: fadeInUp 0.4s ease-out forwards;
}
.modal {
    display: none; position: fixed; z-index: 1000;
    left: 0; top: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8); backdrop-filter: blur(5px);
}
.modal-content {
    background: white; margin: 15% auto; padding: 30px;
    border-radius: 20px; width: 80%; max-width: 400px;
    text-align: center; border-top: 10px solid var(--accent);
}
.animate-pop { animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
@keyframes popIn {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
.badge-icon { font-size: 80px; margin: 20px 0; }
.badge-item { 
    padding: 10px; border-radius: 10px; background: #f0f0f0; 
    margin: 5px; font-size: 12px; display: inline-block;
}
.badge-item.active { background: var(--accent); color: white; }