/*
 * Bestand: css/cookie-toestemming.css
 * Doel: Styling voor de cookie-toestemmingsbanner en de instellingenmodal.
 * Versie: 1.4
 */

/* Container voor de banner */
#cookie-toestemming-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #fff;
    padding: 20px;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    display: none; /* Wordt getoond via JS */
    border-top: 1px solid #e0e0e0;
    font-size: 15px;
}

#cookie-toestemming-banner-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap;
    gap: 15px;
}

#cookie-toestemming-banner-text {
    flex-grow: 1;
    min-width: 300px;
}

#cookie-toestemming-banner-text p {
    margin: 0;
    line-height: 1.5;
}

#cookie-toestemming-banner-text a {
    color: #007AFF;
    text-decoration: underline;
}

#cookie-toestemming-banner-acties {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Modal voor instellingen */
#cookie-toestemming-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 10000;
    display: none; /* Wordt getoond via JS */
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

#cookie-toestemming-modal-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 12px;
    width: 100%;
    max-width: 550px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

#cookie-toestemming-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

#cookie-toestemming-modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

#cookie-sluit-modal {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
    line-height: 1;
}

.cookie-categorie {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}
.cookie-categorie:last-of-type {
    border-bottom: none;
}

.cookie-categorie-omschrijving h4 {
    margin: 0 0 5px 0;
    font-size: 1rem;
}
.cookie-categorie-omschrijving p {
    margin: 0;
    font-size: 0.9rem;
    color: #555;
}

#cookie-toestemming-modal-footer {
    margin-top: 25px;
    text-align: right;
}

/* Knoppen */
.cookie-knop {
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease, transform 0.1s ease;
}
.cookie-knop:active {
    transform: scale(0.98);
}
.cookie-knop.primary {
    background-color: #007AFF;
    color: white;
}
.cookie-knop.secondary {
    background-color: #e9ecef;
    color: #495057;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
    flex-shrink: 0;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 28px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .slider {
    background-color: #34C759;
}
input:checked + .slider:before {
    transform: translateX(22px);
}
input:disabled + .slider {
    background-color: #e9ecef;
    cursor: not-allowed;
}

/* Dark Mode aanpassingen */
body.dark-mode #cookie-toestemming-banner {
    background-color: #1c1c1e;
    border-top-color: #3a3a3c;
    color: #f5f5f7;
}
body.dark-mode #cookie-toestemming-banner a {
    color: #58a6ff;
}
body.dark-mode #cookie-toestemming-modal-content {
    background-color: #2c2c2e;
    color: #f5f5f7;
}
body.dark-mode #cookie-toestemming-modal-header {
    border-bottom-color: #3a3a3c;
}
body.dark-mode #cookie-sluit-modal,
body.dark-mode .cookie-categorie-omschrijving p {
    color: #a1a1a6;
}
body.dark-mode .cookie-categorie {
    border-bottom-color: #3a3a3c;
}
body.dark-mode .cookie-knop.secondary {
    background-color: #495057;
    color: #f8f9fa;
}
body.dark-mode .cookie-knop.primary {
    background-color: #007AFF;
}

/* --- CORRECTIE VOOR TOGGLE IN DARK MODE --- */
/* Kleur van toggle in "uit" stand in Dark Mode */
body.dark-mode .slider {
    background-color: #495057;
}
/* Kleur van toggle in "aan" stand in Dark Mode */
body.dark-mode input:checked + .slider {
    background-color: #007AFF; /* Gebruikt de primaire actiekleur */
}
/* Kleur van gedeactiveerde toggle in Dark Mode */
body.dark-mode input:disabled + .slider {
    background-color: #3a3a3c;
    cursor: not-allowed;
}
/* --- EINDE CORRECTIE --- */


/* Responsief design */
@media (max-width: 768px) {
    /* --- AANPASSINGEN VOOR MOBIELE APPARATEN (Versie 1.4) --- */

    /* 1. Maak de cookiebanner kleiner om minder opdringerig te zijn */
    #cookie-toestemming-banner {
        padding: 12px;
    }
    #cookie-toestemming-banner-text p {
        font-size: 13px; /* Tekst kleiner gemaakt */
        line-height: 1.4;  /* Regelafstand aangepast voor compactheid */
    }
    #cookie-toestemming-banner-content {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    #cookie-toestemming-banner-acties {
        justify-content: center;
        margin-top: 8px;
        gap: 8px; /* Afstand tussen knoppen verkleind */
    }
    /* Maak de knoppen in de banner specifiek kleiner */
    #cookie-toestemming-banner .cookie-knop {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    /* 2. Zorgt ervoor dat de instellingenmodal kan scrollen */
    #cookie-toestemming-modal-content {
        padding: 25px 20px;
        max-height: 85vh; /* Voorkomt dat de modal groter is dan het scherm */
        overflow-y: auto;  /* Voegt een scrollbar toe als de inhoud te hoog is */
    }

    .cookie-categorie {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .cookie-categorie-omschrijving h4 {
        font-size: 0.95rem;
    }
    .cookie-categorie-omschrijving p {
        font-size: 0.85rem;
    }
}