body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f4f7f6;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 20px auto;
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
    font-weight: 600;
}

h2 {
    color: #34495e;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
    margin-top: 30px;
    margin-bottom: 20px;
    font-weight: 500;
}

.error-message {
    color: #e74c3c;
    background-color: #fdedec;
    border: 1px solid #f5c6cb;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
}

/* Categorie Selectie */
#category-selection {
    margin-bottom: 30px;
}

.category-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.category-list label {
    display: block;
    background-color: #ecf0f1;
    padding: 12px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s;
    border: 1px solid #dcdcdc;
}

.category-list label:hover {
    background-color: #e0e6e8;
}

.category-list input[type="checkbox"] {
    margin-right: 10px;
    accent-color: #3498db; /* Kleur van vinkje */
}

.category-list input[type="checkbox"]:checked + span {
    font-weight: bold;
}

/* Oefening Knoppen */
#exercise-selection h2 {
    margin-bottom: 15px;
}

.exercise-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 knoppen per rij */
    gap: 15px;
    margin-top: 10px;
}

.exercise-buttons button {
    padding: 15px 20px;
    font-size: 1.1em;
    font-weight: 500;
    cursor: pointer;
    border: none;
    border-radius: 5px;
    background-color: #1abc9c; /* Blauwgroen (Teal) */
    color: white;
    transition: background-color 0.2s, transform 0.1s;
    text-align: left; /* Nummer en tekst links uitlijnen */
    display: flex;
    align-items: center;
}

.exercise-buttons button:hover {
    background-color: #16a085; /* Donkerder blauwgroen */
}

.exercise-buttons button:active {
    transform: scale(0.98);
}

/* Verwijder specifieke kleuren per knop */
/* .exercise-buttons button[value="practice_show_words"] { ... } */
/* .exercise-buttons button[value="practice_match_pairs"] { ... } */
/* .exercise-buttons button[value="practice_mc_image"] { ... } */
/* .exercise-buttons button[value="practice_mc_word"] { ... } */

/* Algemene Knop Styling */
.button {
    display: inline-block;
    padding: 10px 20px;
    font-size: 1em;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    border: none;
    border-radius: 5px;
    background-color: #3498db; /* Blauw */
    color: white;
    transition: background-color 0.2s, transform 0.1s;
}
.button:hover {
    background-color: #2980b9; /* Donkerder blauw */
}
.button:active {
    transform: scale(0.98);
}

.button.small-button {
    padding: 6px 12px;
    font-size: 0.9em;
}

/* Styling voor 'Woorden Oefenen' (practice_show_words.php) */
#word-display { margin-top: 10px; }
.word-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 15px; 
    padding: 10px;
}
.word-card {
    background-color: black;
    border-radius: 5px;
    padding: 10px;
    display: flex; 
    flex-direction: column;
    align-items: center;
    justify-content: space-between; 
    height: 210px;
    cursor: pointer; 
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    color: white;
}
.word-card:hover {
     transform: translateY(-3px);
     box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}
.img-container { 
    width: 140px; 
    height: 140px; 
    background-color: black;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 5px;
    overflow: hidden;
}
.word-card img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}
.word-text {
    font-weight: bold;
    margin-top: 5px;
    min-height: 1.2em; 
    text-align: center;
    width: 100%;
}
.word-text.hidden { 
    visibility: hidden; 
    height: 0;
    overflow: hidden;
    margin-top: 0;
}
.toggle-word-button { 
    margin-top: 5px;
    padding: 3px 8px;
    font-size: 0.8em;
    cursor: pointer;
    background-color: #f0ad4e; /* Oranje */
    color: white;
    border: none;
    border-radius: 3px;
}
.toggle-word-button:hover { background-color: #ec971f; }
.toggle-all-area { 
    text-align: center;
    margin-top: -10px; 
    margin-bottom: 20px;
}
.toggle-all-area button {
    padding: 8px 15px;
    font-size: 1em;
    cursor: pointer;
    background-color: #5bc0de; /* Blauw */
    color: white;
    border: none;
    border-radius: 5px;
}
.toggle-all-area button:hover { opacity: 0.9; }

/* Algemene Terug Knop Styling (consistent gemaakt) */
.back-button-area { 
    margin-bottom: 20px; 
    padding-bottom: 15px; 
    border-bottom: 1px solid #eee; 
    text-align: left; 
}
.back-button { 
    display: inline-block; /* Zorgt dat padding werkt */
    padding: 8px 15px;
    font-size: 1em;
    cursor: pointer;
    background-color: #6c757d; /* Grijs */
    color: white;
    border: none;
    border-radius: 5px;
    text-decoration: none;
}
.back-button:hover { opacity: 0.9; }

/* Styling voor 'Welk Plaatje?' (practice_mc_image.php) */
#exercise-area { min-height: 400px; } /* Behoud hier of inline? Voor nu hier */
#target-word-area { text-align: center; margin-bottom: 25px; font-size: 2.5em; font-weight: bold; color: #0056b3; }
#speak-button { background: none; border: none; font-size: 1em; cursor: pointer; margin-left: 10px; vertical-align: middle; }
#speak-button:hover { opacity: 0.7; }
#image-options-grid { 
    display: grid; 
    grid-template-columns: repeat(2, 1fr); /* Standaard 2 kolommen */
    gap: 20px; 
    margin-top: 20px; 
    justify-items: center; 
}
.image-option-card {
    background-color: black;
    border-radius: 8px;
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 180px; 
    height: 180px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 3px solid transparent;
    position: relative;
}
.image-option-card:hover { transform: scale(1.03); box-shadow: 0 5px 10px rgba(0,0,0,0.2); }
.image-option-card img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.image-option-card.correct { border-color: #28a745; }
.image-option-card.incorrect { border-color: #dc3545; }
.image-option-card.disabled { cursor: not-allowed; opacity: 0.5; }
.image-option-card.disabled::after { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(128, 128, 128, 0.4); border-radius: 8px; pointer-events: none; }
#feedback-area { margin-top: 25px; text-align: center; font-size: 1.4em; font-weight: bold; min-height: 1.5em; }
#feedback-area.correct { color: #28a745; }
#feedback-area.incorrect { color: #dc3545; }
#end-message { text-align: center; font-size: 1.5em; margin-top: 40px; }

/* Footer Styling */
footer {
    text-align: center;
    margin-top: 40px; /* Ruimte boven de footer */
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    font-size: 0.9em;
    color: #7f8c8d; /* Grijsachtige kleur */
}

footer a {
    color: #3498db; /* Blauwe link kleur */
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsive aanpassingen */
@media (max-width: 600px) {
    /* Maak categorie lijst 1 kolom */
    .category-list {
        grid-template-columns: 1fr;
    }

    /* Maak oefenknoppen 1 kolom */
    .exercise-buttons {
        grid-template-columns: 1fr;
    }

    /* Verklein plaatjes in 'Welk Plaatje?' oefening */
    #image-options-grid {
        gap: 10px; /* Minder ruimte tussen plaatjes */
    }
    .image-option-card {
        width: 95px; /* Kleiner formaat */
        height: 95px; /* Kleiner formaat */
        padding: 5px; /* Minder padding */
    }
    #target-word-area {
        font-size: 2em; /* Iets kleiner lettertype voor het woord */
    }
}