/* css/index.css */

/* --- BASIS CONTAINERS --- */
.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    overflow: visible !important; 
    position: relative;
    z-index: 1;
}

.header {
    background: var(--header-bg);
    color: white;
    padding: 15px 20px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.header h1 {
    margin: 0;
    font-size: 1.4rem;
    text-align: left;
    flex: 1;
    min-width: 200px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.btn-admin-login {
    border: 1px solid rgba(255,255,255,0.5); 
    background: transparent; 
    color: white; 
    font-size: 12px; 
    padding: 6px 12px; 
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.2s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    height: 38px;
}

.btn-admin-login:hover { background: rgba(255,255,255,0.1); }

.lang-select {
    padding: 6px 10px;
    border-radius: 4px;
    border: none;
    font-size: 14px;
    cursor: pointer;
    background: rgba(255,255,255,0.9);
    height: 38px;
    margin: 0 !important;
}

.content { padding: 20px; }

/* --- FORMULIER --- */
.form-row { display: flex; gap: 20px; margin-bottom: 10px; }
.form-group { flex: 1; display: flex; flex-direction: column; }

/* --- QUIZ ELEMENTEN --- */
.quiz-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    background: #f1f5f9;
    padding: 10px;
    border-radius: 8px;
    flex-wrap: wrap;
    gap: 10px;
}

.nav-left, .nav-right { display: flex; gap: 10px; align-items: center; }

.prog-text { font-weight: bold; color: var(--text-muted); }

.timer-display {
    font-family: monospace;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary);
    background: white;
    padding: 5px 10px;
    border-radius: 4px;
    border: 1px solid var(--border);
    display: inline-block;
    min-width: 80px;
    text-align: center;
}

.timer-warning {
    color: #dc2626 !important;
    border-color: #dc2626 !important;
    background-color: #fee2e2 !important;
    animation: pulse 1s infinite;
}

/* Vlag Knop */
.btn-flag {
    font-size: 1.2rem;
    padding: 5px 10px;
    background: white;
    border: 1px solid var(--border);
    color: #ccc; 
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-flag.active {
    color: #eab308; 
    border-color: #eab308;
    background: #fefce8;
}

.question-text {
    font-size: 1.4em;
    line-height: 1.5;
    margin: 20px 0 30px 0;
    color: #1e293b;
    word-wrap: break-word;
}

.badge-domain {
    background: #e0f2fe;
    color: #0369a1;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    display: inline-block;
}

.option-card {
    border: 1px solid var(--border);
    padding: 15px;
    margin-bottom: 12px;
    cursor: pointer;
    border-radius: 8px;
    transition: 0.2s;
    display: flex;
    align-items: center;
    min-height: 55px;
    background: #fff;
}

.option-card:hover { border-color: var(--primary); background: #f0f7ff; }
.option-card strong { min-width: 30px; margin-right: 10px; color: var(--primary); flex-shrink: 0; }
.option-card span { word-break: break-word; line-height: 1.4; }

.option-correct { background: #dcfce7 !important; border-color: #16a34a !important; border-width: 2px !important; }
.option-incorrect { background: #fee2e2 !important; border-color: #dc2626 !important; }

#expl {
    padding: 20px;
    background: #f1f5f9;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 5px solid var(--primary);
    word-wrap: break-word;
}

/* --- REVIEW SCREEN --- */
.review-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 10px;
    margin: 20px 0;
}

.review-item {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    background: white;
    position: relative;
    transition: 0.2s;
}

.review-item:hover { border-color: var(--primary); }

.review-item.answered {
    background-color: #f0fdf4; 
    border-color: #86efac;
    color: #166534;
}

.review-item.flagged {
    background-color: #fefce8; 
    border-color: #fde047;
}

.review-flag-icon {
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 10px;
    color: #eab308;
}

.review-legend {
    display: flex;
    gap: 15px;
    font-size: 0.9em;
    margin-bottom: 10px;
    color: var(--text-muted);
}
.legend-item { display: flex; align-items: center; gap: 5px; }
.legend-box { width: 15px; height: 15px; border-radius: 3px; border: 1px solid #ccc; }

/* --- RESULTATEN & FOUTANALYSE (NIEUW) --- */
#results { text-align: center; }
.final-score { font-size: 2.5rem; margin: 20px 0; color: var(--header-bg); }
.domain-results { margin-top: 25px; padding: 15px; background: #f8fafc; border-radius: 8px; text-align: left; }
.domain-results h3 { margin-top: 0; border-bottom: 2px solid var(--border); padding-bottom: 10px; font-size: 1.1em; }
.domain-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dotted #e2e8f0; }

.mistakes-container {
    margin-top: 30px;
    text-align: left;
}

.mistake-card {
    border: 1px solid #fee2e2;
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 5px solid #dc2626;
}

.mistake-header {
    font-weight: bold;
    margin-bottom: 10px;
    color: #1e293b;
}

.mistake-answer {
    margin-bottom: 5px;
    font-size: 0.95em;
}

.mistake-user { color: #dc2626; text-decoration: line-through; margin-right: 10px; }
.mistake-correct { color: #16a34a; font-weight: bold; }

.mistake-expl {
    margin-top: 10px;
    background: #f1f5f9;
    padding: 10px;
    border-radius: 4px;
    font-size: 0.9em;
    color: #475569;
}

.progress-container { width: 100%; background-color: #e2e8f0; border-radius: 10px; height: 10px; margin-bottom: 20px; overflow: hidden; }
.progress-bar { height: 100%; background-color: var(--primary); width: 0%; transition: width 0.4s ease; }

/* --- MULTI-SELECT --- */
.multiselect { position: relative; width: 100%; margin-bottom: 20px; user-select: none; z-index: 100; }
.selectBox { position: relative; cursor: pointer; }
.selectBox select { width: 100%; font-weight: bold; color: var(--primary); cursor: pointer; background-color: #fff; padding: 15px; border: 1px solid var(--border); border-radius: 6px; appearance: none; -webkit-appearance: none; font-size: 16px; }
.overSelect { position: absolute; left: 0; right: 0; top: 0; bottom: 0; }
#checkboxes { display: none; border: 1px solid var(--border); border-top: none; max-height: 60vh; overflow-y: auto; -webkit-overflow-scrolling: touch; background: white; position: absolute; width: 100%; z-index: 9999; box-shadow: 0 20px 40px rgba(0,0,0,0.2); border-radius: 0 0 8px 8px; padding-bottom: 40px; }
#checkboxes label { display: grid !important; grid-template-columns: 40px 1fr; align-items: center; width: 100%; padding: 15px; cursor: pointer; border-bottom: 1px solid #f1f5f9; margin: 0; background-color: #fff; box-sizing: border-box; min-height: 50px; }
#checkboxes label:last-child { border-bottom: none; }
#checkboxes input[type="checkbox"] { width: 24px; height: 24px; margin: 0; cursor: pointer; opacity: 1 !important; -webkit-appearance: checkbox; }
#checkboxes span { font-size: 16px; color: #334155; line-height: 1.4; word-wrap: break-word; display: block; }
.select-all-option { background-color: #f8fafc !important; border-bottom: 2px solid #e2e8f0 !important; position: sticky; top: 0; z-index: 5; }
.checked-label { background-color: #eff6ff !important; }
.checked-label span { color: #1d4ed8 !important; font-weight: 700; }

@keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.7; } 100% { opacity: 1; } }

@media screen and (max-width: 600px) {
    .container { border-radius: 0; box-shadow: none; overflow: visible !important; }
    .content { padding: 15px; }
    .header { flex-direction: row; flex-wrap: wrap; justify-content: space-between; }
    .header h1 { font-size: 1.2rem; flex-basis: 100%; text-align: center; margin-bottom: 10px; }
    .header-actions { width: 100%; justify-content: center; }
    input, select, .btn { font-size: 16px; padding: 14px; }
    .quiz-nav { flex-direction: row; flex-wrap: wrap; justify-content: space-between; }
    .nav-left, .nav-right { width: 100%; justify-content: space-between; margin-bottom: 5px; }
    .btn-stop { width: auto; }
    .form-row { flex-direction: column; gap: 0; }
    .review-grid { grid-template-columns: repeat(5, 1fr); }
}

@media screen and (min-width: 601px) {
    .header h1 { flex-basis: auto; text-align: left; margin-bottom: 0; }
    .header-actions { width: auto; }
}
