/* Styles pour le bandeau de cookies RGPD */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--primary-color);
    color: var(--text-light);
    z-index: 9999;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.3);
    transform: translateY(100%);
    transition: transform 0.5s ease;
}

.cookie-banner.show {
    transform: translateY(0);
}

.cookie-content {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    max-width: var(--container-max-width);
    margin: 0 auto;
}

.cookie-text {
    margin-bottom: 1rem;
}

.cookie-text h5 {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.cookie-text p {
    opacity: 0.9;
    margin-bottom: 0;
}

.cookie-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.cookie-actions button {
    font-weight: 500;
    cursor: pointer;
}

/* Overlay pour le focus sur le panneau des paramètres */
/* L'overlay doit être défini AVANT le panneau pour être en dessous */
.cookie-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Plus sombre pour mieux voir le modal */
    z-index: 10000; /* L'overlay a un z-index inférieur au panneau */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cookie-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Panneau de personnalisation des cookies */
.cookie-settings {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 600px;
    background-color: var(--primary-color); /* Ajout d'une couleur de fond explicite */
    border-radius: 10px; /* Arrondir les bords */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3); /* Ombre prononcée */
    color: white; /* Texte en blanc */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 10001; /* Z-index SUPÉRIEUR à l'overlay */
    padding: 0;
    overflow: hidden;
    pointer-events: auto !important; /* Force les interactions */
}

.cookie-settings.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto !important;
}

/* Assurez-vous que tous les éléments du modal sont cliquables */
.cookie-settings *, 
.cookie-settings button, 
.cookie-settings input, 
.cookie-settings label {
    position: relative;
    z-index: 1;
    pointer-events: auto !important;
    cursor: pointer;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    background-color: rgba(0, 0, 0, 0.1); /* Légèrement plus sombre */
}

.settings-header h5 {
    margin: 0;
    font-weight: 600;
}

/* Améliorer le bouton de fermeture */
#close-settings {
    background: transparent;
    width: 32px;
    height: 32px;
    position: relative;
    cursor: pointer !important;
    opacity: 0.8;
    transition: opacity 0.2s;
    z-index: 10002;
}

#close-settings:hover {
    opacity: 1;
}

.settings-body {
    padding: 1.5rem;
    max-height: 70vh;
    overflow-y: auto;
    background-color: var(--primary-color); /* Couleur de fond explicite */
}

.cookie-option {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.cookie-option:last-child {
    border-bottom: none;
}

/* Rendez les interrupteurs plus visibles et explicitement cliquables */
.form-check-input {
    width: 3em !important;
    height: 1.5em !important;
    cursor: pointer !important;
    position: relative !important;
    z-index: 2 !important;
}

.form-check-label {
    cursor: pointer !important;
    position: relative !important;
    z-index: 2 !important;
    user-select: none; /* Empêche la sélection de texte */
}

.option-description {
    margin-top: 0.5rem;
    margin-left: 2.5rem;
    font-size: 0.9rem;
    opacity: 0.85;
}

.settings-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* Améliorez le bouton d'enregistrement */
#save-preferences {
    font-weight: bold;
    padding: 0.5rem 1.5rem;
    cursor: pointer !important;
    position: relative;
    z-index: 2;
}

/* Styles responsifs */
@media (min-width: 768px) {
    .cookie-content {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    
    .cookie-text {
        margin-bottom: 0;
        margin-right: 2rem;
    }
    
    .cookie-actions {
        flex-shrink: 0;
    }
}

@media (max-width: 576px) {
    .cookie-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .cookie-actions button {
        width: 100%;
    }
    
    .settings-actions button {
        width: 100%;
    }
}

/* Ajustement pour la forme active du switch */
.form-check-input:checked {
    background-color: var(--accent-color) !important;
    border-color: var(--accent-color) !important;
}