/* --- Basisstijlen (Overgenomen van ontwerp) --- */
body {
    font-family: 'Lato', sans-serif;
    background-color: #f4f7f6;
    color: #333;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 900px;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* --- Header --- */
header {
    background-color: #00796b;
    color: white;
    padding: 20px 30px;
    text-align: center;
}

header h1 { margin: 0; font-size: 1.8em; }

/* --- Startpagina --- */
#start-container { padding: 40px; text-align: center; }
#start-container h2 { color: #004d40; margin-bottom: 20px; }
#start-container p { font-size: 1.2em; margin-bottom: 30px; line-height: 1.6; }

/* --- Quiz Containers --- */
#quiz-container, #results-container { padding: 30px; display: none; }

#question-header {
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
    padding-bottom: 15px;
}

#question-tally { font-size: 0.9em; font-weight: bold; color: #555; }

#question-text-container {
    display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap;
}

#question-text {
    font-size: 1.6em; font-weight: 700; color: #004d40; line-height: 1.4;
}

/* --- Audio Knoppen --- */
#speak-question-btn, #speech-btn-uitleg {
    font-size: 1.5em; cursor: pointer; color: #00796b;
    border: 2px solid #00796b; border-radius: 50%;
    width: 40px; height: 40px;
    display: flex; justify-content: center; align-items: center;
    background: white; transition: all 0.2s;
}
#speak-question-btn:hover { background-color: #e0f2f1; }

/* --- Groene Box voor de Som --- */
.green-question-box {
    background-color: #e8f5e9;
    border: 2px solid #4CAF50;
    border-radius: 8px;
    padding: 25px;
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* --- Ouderwetse Breuk Notatie Stijlen --- */
.fraction-wrapper {
    display: inline-flex;
    align-items: center;
    font-size: 1.5em;
    margin-top: 15px;
    gap: 10px;
}

.fraction-input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80px;
}

.fraction-line {
    width: 100%;
    height: 3px;
    background-color: #333;
    margin: 5px 0;
}

/* Input styling specifiek voor breuken */
input[type=number] {
    width: 60px; 
    padding: 8px; 
    font-size: 1em;
    border: 2px solid #ccc; 
    border-radius: 5px;
    text-align: center; 
    font-family: 'Lato', sans-serif;
    -moz-appearance: textfield;
    font-weight: bold;
}
input[type=number]:focus {
    border-color: #00796b; outline: none; background-color: #fffde7;
}

/* Verberg spinners */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

input:disabled {
    background-color: #c8e6c9; color: #2e7d32;
    border-color: #2e7d32; font-weight: bold;
}

/* --- Input Velden & Stappen --- */
.step-container {
    transition: all 0.3s ease;
}

/* --- Voortgang --- */
.progress-bar-container {
    width: 100%; background-color: #e0e0e0;
    border-radius: 5px; height: 15px;
    margin-bottom: 15px; overflow: hidden;
}
.progress-bar {
    width: 0%; height: 100%; background-color: #4CAF50;
    border-radius: 5px; transition: width 0.3s ease-in-out;
}

/* --- Knoppen Sectie --- */
#controls-container {
    display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px;
}

button {
    padding: 12px 24px; font-size: 1em; font-weight: 700;
    border: none; border-radius: 5px; cursor: pointer;
    transition: background-color 0.2s;
}

.btn { background-color: #00796b; color: white; flex-grow: 1; }
.btn:hover { background-color: #004d40; }
.btn:disabled { background-color: #aaa; cursor: not-allowed; }

.btn-green-action { background-color: #43a047; color: white; }
.btn-green-action:hover { background-color: #2e7d32; }

#next-question-btn {
    background-color: #ff9800; color: white; display: none;
    margin-top: 20px; width: 100%; padding: 15px; font-size: 1.2em;
}
#next-question-btn:hover { background-color: #f57c00; }

/* --- Feedback --- */
.feedback {
    font-size: 1.2em; font-weight: bold; padding: 15px;
    border-radius: 5px; margin-top: 10px; margin-bottom: 10px;
    line-height: 1.6; display: none; text-align: center;
}
.feedback.correct { color: #2e7d32; background-color: #c8e6c9; border: 1px solid #2e7d32; }
.feedback.incorrect { color: #c62828; background-color: #ffcdd2; border: 1px solid #c62828; }
.feedback.info { color: #0d47a1; background-color: #e3f2fd; border: 1px solid #0d47a1; }

/* --- Modal (Pop-up) --- */
.modal {
    display: none; position: fixed; z-index: 1000;
    left: 0; top: 0; width: 100%; height: 100%;
    overflow: auto; background-color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: #fefefe; margin: 5% auto; padding: 0;
    border: 1px solid #888; width: 90%; max-width: 600px;
    border-radius: 8px; box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s;
}

.modal-header {
    padding: 15px 20px; background-color: #00796b; color: white;
    display: flex; justify-content: space-between; align-items: center;
    border-top-left-radius: 8px; border-top-right-radius: 8px;
}

.modal-header h2 { margin: 0; font-size: 1.3em; }
.modal-header-controls { display: flex; gap: 10px; align-items: center; }

.speech-btn-modal {
    background: none; border: 2px solid white; color: white;
    border-radius: 50%; width: 35px; height: 35px;
    font-size: 1.2em; cursor: pointer; display: flex;
    justify-content: center; align-items: center;
}
.speech-btn-modal:hover { background-color: rgba(255,255,255,0.2); }

.close-btn {
    color: white; font-size: 28px; font-weight: bold;
    cursor: pointer; line-height: 1;
}

.modal-body {
    padding: 20px 30px; max-height: 500px; overflow-y: auto;
    line-height: 1.7; font-size: 1.1em;
}

.modal-body h3 {
    color: #004d40; border-bottom: 2px solid #eee;
    padding-bottom: 5px; margin-top: 20px;
}

/* --- Resultaten --- */
#results-container h2 { color: #004d40; text-align: center; }
#score-percentage {
    font-size: 3.5em; font-weight: 700; color: #4CAF50;
    text-align: center; margin: 20px 0;
}

#results-container ul {
    background-color: #fafafa; border: 1px solid #ddd;
    border-left: 5px solid #00796b; border-radius: 5px;
    padding: 20px 40px;
}

#results-container li { margin-bottom: 10px; line-height: 1.6; }

#results-buttons {
    margin-top: 30px; display: flex; gap: 10px; justify-content: center;
}

#print-summary { margin-top: 30px; }

.summary-header {
    display: grid; grid-template-columns: 2fr 1fr 1fr;
    font-weight: bold; padding: 10px; background-color: #eee;
    border-bottom: 2px solid #ccc;
}

.summary-item {
    display: grid; grid-template-columns: 2fr 1fr 1fr;
    padding: 15px; border-bottom: 1px solid #eee; align-items: center;
}
.summary-item:last-child { border-bottom: none; }

.summary-col { padding: 0 10px; }
.summary-col.center {
    border-left: 2px solid #eee; border-right: 2px solid #eee; text-align: center;
}

footer {
    text-align: center; font-size: 0.9em; color: #888;
    padding: 20px 30px; border-top: 1px solid #eee; margin-top: auto;
}

@keyframes fadeIn { from {opacity: 0;} to {opacity: 1;} }
@keyframes slideIn { from {transform: translateY(-50px); opacity: 0;} to {transform: translateY(0); opacity: 1;} }

/* --- Print Stijlen --- */
@media print {
    body { padding: 0; margin: 0; background-color: #fff; }
    .container { box-shadow: none; border: none; width: 100%; max-width: 100%; }
    #quiz-container, header, #results-buttons, footer, .modal, #start-container, #controls-container, #question-header, #score-percentage { display: none !important; }
    #results-container { display: block !important; padding: 0; }
    #results-container h2 { display: block; font-size: 24px; margin-bottom: 20px; }
    #results-container h3 { display: block; font-size: 1.2em; text-align: left; margin-bottom: 10px; color: black; }
    #results-container ul { display: block; border: 1px solid #000; color: black; page-break-inside: avoid; }
    #print-summary { margin-top: 20px; display: block !important; }
    .summary-header { background-color: #ccc !important; color: black !important; -webkit-print-color-adjust: exact; }
    .summary-item { border-bottom: 1px solid #000; padding: 10px 0; page-break-inside: avoid; }
    .print-green { color: green !important; font-weight: bold; }
    .print-red { color: red !important; font-weight: bold; }
}