/* ==========================================
   VARIABLES & GLOBAL SETTINGS
   ========================================== */
:root {
    --primary-color: #0F3460;
    --accent-color: #E94560;
    --bg-color: #F4F6F9;
    --card-bg: #FFFFFF;
    --text-color: #1A1A2E;
    --success-color: #27AE60;
    --danger-color: #E74C3C;
}

/* Proteksi Anti Select Teks & Base Styling */
body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);

    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.hidden { 
    display: none !important; 
}

@media print {
    body { 
        display: none !important; 
    }
}

/* ==========================================
   LAYOUT LOGIN
   ========================================== */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0F3460 0%, #16213E 100%);
}

.login-card {
    width: 100%;
    max-width: 380px;
    padding: 40px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.login-logo {
    height: 70px;
    object-fit: contain;
    margin-bottom: 15px;
}

.login-card h2 {
    margin: 0 0 5px 0;
    color: var(--primary-color);
}

.login-card p {
    color: #666;
    margin-bottom: 25px;
    font-size: 0.9rem;
}

.form-group {
    text-align: left;
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #CBD5E1;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 1rem;
}

.btn-login {
    width: 100%;
    padding: 12px;
    margin-top: 10px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-login:hover {
    background: #16213E;
}

.error-msg {
    color: var(--danger-color);
    font-size: 0.85rem;
    margin-bottom: 10px;
}

/* ==========================================
   APP HEADER & LAYOUT UTAMA
   ========================================== */
.main-header {
    height: 160px;
    position: relative;
    background: url('logoindomatika.png') center/cover no-repeat;
    color: white;
}

.header-overlay {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(15, 52, 96, 0.88);
    text-align: center;
}

.header-overlay h1 {
    margin: 0;
    font-size: 2rem;
}

.header-overlay p {
    margin-top: 5px;
    opacity: 0.9;
}

.container {
    display: grid;
    grid-template-columns: 240px 1fr 220px;
    gap: 20px;
    max-width: 1300px;
    margin: 20px auto;
    padding: 0 15px;
}

/* Sidebar Navigasi & Panel */
.sidebar, 
.navigation-panel {
    height: fit-content;
    padding: 15px;
    background: var(--card-bg);
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.sidebar h3, 
.navigation-panel h3 {
    margin-top: 0;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--bg-color);
    font-size: 1.05rem;
}

/* Daftar & Tombol Materi */
.materi-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.materi-list li {
    padding: 10px 12px;
    margin-bottom: 8px;
    background: var(--bg-color);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}

.materi-list li:hover, 
.materi-list li.active {
    background: var(--primary-color);
    color: white;
}

.btn-materi {
    padding: 8px 16px;
    background-color: #F0F2F5;
    color: #333333;
    border: 1px solid #CCCCCC;
    border-radius: 6px;
    font-weight: normal;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-materi.active {
    background-color: #0F3460 !important;
    color: #FFFFFF !important;
    border-color: #0F3460 !important;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* ==========================================
   QUIZ CARD & SOAL
   ========================================== */
.quiz-card {
    padding: 25px;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    margin-bottom: 20px;
    border-bottom: 1px solid #EEEEEE;
}

.question-logo {
    height: 45px;
    width: auto;
    object-fit: contain;
}

.info-header {
    text-align: center;
}

#questionCategory {
    font-weight: bold;
    color: #666666;
    font-size: 0.95rem;
}

.timer-badge {
    margin-top: 4px;
    padding: 4px 12px;
    background: #FFF3CD;
    color: #856404;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.85rem;
}

.question-text {
    min-height: 50px;
    margin-bottom: 20px;
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Pilihan Jawaban */
.options-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-btn {
    width: 100%;
    padding: 12px 15px;
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: 8px;
    font-size: 1rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

.option-btn:hover {
    border-color: var(--primary-color);
    background: #F0F4F8;
}

.option-btn.selected {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

/* Opsi Status Jawaban */
.option-btn.correct-choice {
    background-color: #D4EDDA !important;
    border-color: #28A745 !important;
    color: #155724 !important;
    font-weight: bold;
}

.option-btn.wrong-choice {
    background-color: #F8D7DA !important;
    border-color: #DC3545 !important;
    color: #721C24 !important;
    font-weight: bold;
}

.option-btn:disabled {
    cursor: not-allowed;
    opacity: 0.9;
}

/* Kontrol Navigasi Kuis */
.quiz-controls {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

.quiz-controls button, 
.btn-submit, 
.btn-restart {
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
}

.quiz-controls button:disabled {
    background: #CCCCCC;
    cursor: not-allowed;
}

.btn-submit {
    background: var(--success-color);
}

/* ==========================================
   NAVIGATION GRID (NOMOR SOAL)
   ========================================== */
.number-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.num-btn {
    padding: 8px 0;
    background: white;
    border: 1px solid #CBD5E1;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
}

.num-btn.active {
    outline: 2px solid var(--primary-color);
}

.num-btn.answered {
    background: var(--success-color);
    color: white;
    border-color: var(--success-color);
}

/* ==========================================
   REVIEW & RESULT BOX
   ========================================== */
.result-box {
    padding: 30px;
    background: white;
    border-radius: 12px;
}

.score-display {
    font-size: 3rem;
    font-weight: bold;
    color: var(--primary-color);
    text-align: center;
}

.status-badge {
    display: inline-block;
    margin: 10px 0;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 1.1rem;
}

.status-passed {
    background: #D4EDDA;
    color: #155724;
}

.status-failed {
    background: #F8D7DA;
    color: #721C24;
}

/* Review Jawaban */
.review-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.review-card {
    padding: 15px;
    background: #F8F9FA;
    border-radius: 8px;
    border-left: 5px solid #CCCCCC;
}

.review-card.correct {
    background: #F0FFF4;
    border-left-color: var(--success-color);
}

.review-card.wrong {
    background: #FFF5F5;
    border-left-color: var(--danger-color);
}

.review-badge {
    display: inline-block;
    margin-bottom: 8px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}

.review-badge.correct {
    background: var(--success-color);
    color: white;
}

.review-badge.wrong {
    background: var(--danger-color);
    color: white;
}

/* ==========================================
   RESPONSIVE DESIGN (TABLET & HP)
   ========================================== */
@media screen and (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
        gap: 15px;
        margin: 10px auto;
        padding: 0 10px;
        width: 100%;
        box-sizing: border-box;
    }

    .materi-list {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
    }

    .materi-list li, 
    .btn-materi {
        flex-shrink: 0;
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .main-header {
        height: 120px;
    }

    .header-overlay h1 {
        font-size: 1.3rem;
    }

    .header-overlay p {
        font-size: 0.8rem;
    }

    .quiz-card {
        padding: 15px;
    }

    .question-text {
        font-size: 1rem;
    }

    .option-btn {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
}