/* ===================================
   SYSTÈME DE GESTION DES COOKIES SONAPIE
   =================================== */

/* Banner de cookies */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    z-index: 99999; /* au-dessus des autres éléments flottants */
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    /* Prendre en compte les encoches (iOS) */
    padding-bottom: env(safe-area-inset-bottom, 0);
}

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

.cookie-banner-content {
    padding: 20px 0;
    max-height: 70vh; /* éviter le rognage sur mobile */
    overflow-y: auto;
}

.cookie-text {
    padding-right: 20px;
}

.cookie-title {
    color: #e8af74;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 1.05rem;
}

.cookie-description {
    margin-bottom: 0;
    line-height: 1.5;
    color: #ecf0f1;
    font-size: 0.95rem;
}

.cookie-link {
    color: #e8af74;
    text-decoration: underline;
    transition: color 0.3s ease;
}

.cookie-link:hover {
    color: #d4956b;
}

/* Boutons du banner */
.cookie-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.btn-cookie-settings {
    background: transparent;
    border: 2px solid #90c7b8;
    color: #90c7b8;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-cookie-settings:hover {
    background: #90c7b8;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(144, 199, 184, 0.3);
}

.btn-cookie-reject {
    background: transparent;
    border: 2px solid #5e9f8d;
    color: #5e9f8d;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-cookie-reject:hover {
    background: #5e9f8d;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(94, 159, 141, 0.3);
}

.btn-cookie-accept {
    background: linear-gradient(135deg, #e8af74 0%, #d4956b 100%);
    border: none;
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(232, 175, 116, 0.3);
}

.btn-cookie-accept:hover {
    background: linear-gradient(135deg, #d4956b 0%, #c08660 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(232, 175, 116, 0.4);
}

/* Modal de paramètres */
.cookie-settings-content {
    max-height: 60vh;
    overflow-y: auto;
}

.cookie-category {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.cookie-category:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.cookie-category-title {
    font-weight: 600;
    margin-bottom: 0;
    color: #2c3e50;
}

.cookie-category-description {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 0;
    line-height: 1.5;
}

/* Switches personnalisés */
.form-check-input:checked {
    background-color: #e8af74;
    border-color: #e8af74;
}

.form-check-input:focus {
    border-color: #e8af74;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(232, 175, 116, 0.25);
}

/* Bouton de gestion des cookies dans le footer */
.cookie-manage-btn {
    background: transparent;
    border: 1px solid #90c7b8;
    color: #90c7b8;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.cookie-manage-btn:hover {
    background: #90c7b8;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(144, 199, 184, 0.3);
}

/* Boutons du modal */
.modal-footer .btn {
    font-size: 0.8rem;
    padding: 6px 14px;
    border-radius: 18px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.modal-footer .btn-secondary {
    background-color: #5e9f8d;
    border-color: #5e9f8d;
    color: white;
}

.modal-footer .btn-secondary:hover {
    background-color: #4d8a76;
    border-color: #4d8a76;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(94, 159, 141, 0.3);
}

.modal-footer .btn-primary {
    background-color: #90c7b8;
    border-color: #90c7b8;
    color: white;
}

.modal-footer .btn-primary:hover {
    background-color: #7db5a5;
    border-color: #7db5a5;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(144, 199, 184, 0.3);
}

.modal-footer .btn-success {
    background: linear-gradient(135deg, #e8af74 0%, #d4956b 100%);
    border: none;
    color: white;
}

.modal-footer .btn-success:hover {
    background: linear-gradient(135deg, #d4956b 0%, #c08660 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(232, 175, 116, 0.4);
}

/* Footer social et cookies */
.social-links a {
    color: #6c757d;
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: #90c7b8;
}

.cookie-links {
    white-space: nowrap;
}

.cookie-links .small {
    font-size: 0.8rem;
    text-decoration: none;
}

.cookie-links .small:hover {
    color: #90c7b8 !important;
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .cookie-banner-content {
        padding: 15px 0;
        max-height: 60vh; /* un peu plus restrictif en petit écran */
    }
    
    .cookie-actions {
        justify-content: center;
        margin-top: 15px;
        flex-wrap: wrap;
    }
    
    .cookie-text {
        padding-right: 0;
        text-align: center;
    }
    
    .btn-cookie-settings,
    .btn-cookie-reject,
    .btn-cookie-accept {
        font-size: 0.75rem;
        padding: 5px 10px;
    }
    
    .cookie-category {
        padding: 15px;
    }
    
    .modal-footer .btn {
        font-size: 0.75rem;
        padding: 5px 12px;
    }
    
    /* Footer responsive */
    .d-flex.justify-content-between {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 15px;
    }
    
    .social-links {
        order: 2;
    }
    
    .cookie-links {
        order: 1;
        white-space: normal;
    }
}

@media (max-width: 576px) {
    .cookie-actions {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }
    
    .btn-cookie-settings,
    .btn-cookie-reject,
    .btn-cookie-accept {
        width: 100%;
        text-align: center;
        white-space: normal; /* permettre le retour à la ligne */
    }
}
