/* =================================
   BANNIÈRE COOKIES - VERSION OPTIMISÉE RGPD
   Fichier : cookies.css
   Auteur : N-Gage
   Date : 2025
   ================================= */

/* Variables CSS pour cohérence avec le design principal */
:root {
    --cookie-primary: #F28705;
    --cookie-dark: #2c3e50;
    --cookie-light: #ffffff;
    --cookie-gray: #6c757d;
    --cookie-success: #28a745;
    --cookie-danger: #dc3545;
    --cookie-shadow: 0 -5px 20px rgba(0,0,0,0.2);
    --cookie-border-radius: 15px;
    --cookie-transition: all 0.3s ease;
}

/* =================================
   BANNIÈRE PRINCIPALE
   ================================= */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(44, 62, 80, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px); /* Safari */
    color: var(--cookie-light);
    padding: 20px;
    box-shadow: var(--cookie-shadow);
    z-index: 10000;
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
    border-top: 3px solid var(--cookie-primary);
    display: none;
}

.cookie-banner.show {
    display: block;
    transform: translateY(0);
}

/* Contenu de la bannière */
.cookie-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

/* Texte de la bannière */
.cookie-text {
    flex: 1;
    min-width: 300px;
}

.cookie-text h4 {
    margin: 0 0 8px 0;
    color: var(--cookie-primary);
    font-size: 1.1em;
    font-weight: 600;
}

.cookie-text p {
    margin: 0;
    font-size: 0.9em;
    line-height: 1.4;
    color: #e2e8f0;
}

.cookie-text a {
    color: var(--cookie-primary);
    text-decoration: underline;
    font-weight: 500;
    transition: var(--cookie-transition);
}

.cookie-text a:hover {
    color: #e67e04;
    text-decoration: none;
}

/* =================================
   BOUTONS DE LA BANNIÈRE
   ================================= */
.cookie-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Styles de base pour tous les boutons */
.cookie-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--cookie-transition);
    font-size: 0.9em;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    min-width: 120px;
    font-family: inherit;
    outline: none;
}

/* Bouton Accepter - Design attractif mais équilibré */
.cookie-btn-accept {
    background: var(--cookie-primary);
    color: var(--cookie-light);
    border: 2px solid var(--cookie-primary);
}

.cookie-btn-accept:hover {
    background: #e67e04;
    border-color: #e67e04;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(242, 135, 5, 0.3);
}

/* CORRECTION RGPD : Bouton Refuser aussi visible que Accepter */
.cookie-btn-reject {
    background: var(--cookie-gray) !important;
    color: var(--cookie-light) !important;
    border: 2px solid var(--cookie-gray) !important;
}

.cookie-btn-reject:hover {
    background: #5a6268 !important;
    border-color: #5a6268 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

/* Bouton Paramètres */
.cookie-btn-settings {
    background: transparent;
    color: var(--cookie-primary);
    border: 2px solid var(--cookie-primary);
}

.cookie-btn-settings:hover {
    background: var(--cookie-primary);
    color: var(--cookie-light);
    transform: translateY(-1px);
}

/* États focus pour accessibilité */
.cookie-btn:focus {
    outline: 3px solid rgba(242, 135, 5, 0.5);
    outline-offset: 2px;
}

/* =================================
   MODAL DES PARAMÈTRES DÉTAILLÉS
   ================================= */
.cookie-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10001;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.cookie-modal.show {
    display: flex;
}

/* Contenu du modal */
.cookie-modal-content {
    background: var(--cookie-light);
    border-radius: var(--cookie-border-radius);
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Titre du modal */
.cookie-modal h3 {
    color: var(--cookie-dark);
    margin-bottom: 20px;
    font-size: 1.5em;
    font-weight: 600;
    text-align: center;
}

/* Bouton fermeture */
.cookie-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #999;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    transition: var(--cookie-transition);
}

.cookie-close:hover {
    color: #333;
    background: #f1f3f4;
}

.cookie-close:focus {
    outline: 2px solid var(--cookie-primary);
}

/* =================================
   CATÉGORIES DE COOKIES
   ================================= */
.cookie-category {
    margin-bottom: 25px;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: var(--cookie-transition);
}

.cookie-category:hover {
    border-color: var(--cookie-primary);
    box-shadow: 0 2px 8px rgba(242, 135, 5, 0.1);
}

.cookie-category h4 {
    margin: 0 0 10px 0;
    color: var(--cookie-dark);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 1.1em;
}

.cookie-category p {
    margin: 8px 0;
    color: #666;
    font-size: 0.9em;
    line-height: 1.5;
}

/* =================================
   TOGGLES (INTERRUPTEURS)
   ================================= */
.cookie-toggle {
    position: relative;
    width: 50px;
    height: 25px;
    background: #ccc;
    border-radius: 25px;
    cursor: pointer;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.cookie-toggle.active {
    background: var(--cookie-primary);
}

.cookie-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 21px;
    height: 21px;
    background: var(--cookie-light);
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cookie-toggle.active::after {
    transform: translateX(25px);
}

/* Toggle désactivé (cookies essentiels) */
.cookie-toggle.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: var(--cookie-success);
}

.cookie-toggle.disabled::after {
    transform: translateX(25px);
}

/* Amélioration accessibilité pour les toggles */
.cookie-toggle:focus {
    outline: 2px solid var(--cookie-primary);
    outline-offset: 2px;
}

/* =================================
   BOUTONS DU MODAL
   ================================= */
.cookie-modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
    flex-wrap: wrap;
}

.cookie-modal-buttons .cookie-btn {
    min-width: 140px;
}

/* =================================
   RESPONSIVE DESIGN
   ================================= */
@media (max-width: 768px) {
    .cookie-banner-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .cookie-text {
        min-width: auto;
    }
    
    .cookie-buttons {
        justify-content: center;
        width: 100%;
    }
    
    .cookie-btn {
        flex: 1;
        min-width: auto;
        max-width: 150px;
    }
    
    .cookie-modal-content {
        margin: 10px;
        padding: 20px;
        max-height: 95vh;
    }
    
    .cookie-modal-buttons {
        flex-direction: column;
    }
    
    .cookie-modal-buttons .cookie-btn {
        width: 100%;
    }
    
    .cookie-category h4 {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .cookie-banner {
        padding: 15px;
    }
    
    .cookie-text h4 {
        font-size: 1em;
    }
    
    .cookie-text p {
        font-size: 0.85em;
    }
    
    .cookie-btn {
        padding: 8px 15px;
        font-size: 0.85em;
        min-width: 100px;
    }
    
    .cookie-modal-content {
        padding: 15px;
    }
    
    .cookie-close {
        top: 10px;
        right: 15px;
    }
}

/* =================================
   ANIMATIONS ET MICRO-INTERACTIONS
   ================================= */
@keyframes cookieBounce {
    0% { transform: translateY(100%); }
    60% { transform: translateY(-10px); }
    80% { transform: translateY(5px); }
    100% { transform: translateY(0); }
}

.cookie-banner.show.bounce {
    animation: cookieBounce 0.6s ease-out;
}

/* Effet de pulsation pour attirer l'attention */
@keyframes cookiePulse {
    0% { box-shadow: 0 0 0 0 rgba(242, 135, 5, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(242, 135, 5, 0); }
    100% { box-shadow: 0 0 0 0 rgba(242, 135, 5, 0); }
}

.cookie-btn-accept.pulse {
    animation: cookiePulse 2s infinite;
}

/* =================================
   THÈME SOMBRE (OPTIONNEL)
   ================================= */
@media (prefers-color-scheme: dark) {
    .cookie-modal-content {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .cookie-modal h3 {
        color: #e2e8f0;
    }
    
    .cookie-category {
        border-color: #4a5568;
        background: rgba(255, 255, 255, 0.05);
    }
    
    .cookie-category h4 {
        color: #e2e8f0;
    }
    
    .cookie-category p {
        color: #cbd5e0;
    }
}

/* =================================
   CORRECTIONS FINALES RGPD
   ================================= */

/* Assurer que tous les boutons ont la même importance visuelle */
.cookie-btn-accept,
.cookie-btn-reject {
    font-weight: 700 !important;
    min-width: 130px;
}

/* Améliorer la lisibilité des textes légaux */
.cookie-text a {
    font-weight: 600;
    text-decoration: underline;
}

/* Contraste renforcé pour l'accessibilité */
.cookie-banner {
    background: rgba(26, 32, 44, 0.98); /* Plus sombre pour meilleur contraste */
}

/* Indicateur visuel pour les cookies actifs */
.cookie-toggle.active {
    box-shadow: 0 0 0 2px rgba(242, 135, 5, 0.3);
}

/* =================================
   PRINT STYLES
   ================================= */
@media print {
    .cookie-banner,
    .cookie-modal {
        display: none !important;
    }
}