/* ===================================================================
   BANNIÈRE DE CONSENTEMENT AUX COOKIES - DESIGN PREMIUM
   Prépa-SSIAP - Conforme RGPD
   =================================================================== */

/* Overlay sombre */
#cookie-consent-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
    z-index: 999998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#cookie-consent-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Bannière principale */
#cookie-consent-banner {
    position: fixed;
    bottom: -100%;
    left: 50%;
    transform: translateX(-50%);
    max-width: 900px;
    width: 90%;
    background: linear-gradient(135deg, #2B5A9E 0%, #1A3A5C 100%);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3);
    z-index: 999999;
    transition: bottom 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    overflow: hidden;
}

#cookie-consent-banner.show {
    bottom: 0;
}

/* En-tête avec icône */
.cookie-consent-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 25px 30px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cookie-consent-icon {
    font-size: 2.5rem;
    animation: cookieBounce 2s ease-in-out infinite;
}

@keyframes cookieBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.cookie-consent-title {
    flex: 1;
}

.cookie-consent-title h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cookie-consent-title h3 i {
    font-size: 1.2rem;
    color: #D4AF37;
}

.cookie-consent-title p {
    margin: 5px 0 0 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Contenu */
.cookie-consent-content {
    padding: 25px 30px;
    color: white;
}

.cookie-consent-text {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 20px;
    color: rgba(255, 255, 255, 0.95);
}

/* Liste des types de cookies */
.cookie-types {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
    margin-bottom: 25px;
}

.cookie-type {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 12px 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.cookie-type:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
}

.cookie-type i {
    font-size: 1.2rem;
    color: #4CAF50;
}

.cookie-type.analytics i {
    color: #60A5FA;
}

.cookie-type.performance i {
    color: #FBBF24;
}

.cookie-type-text {
    flex: 1;
}

.cookie-type-text strong {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 3px;
}

.cookie-type-text span {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Note RGPD */
.cookie-consent-note {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 20px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-left: 3px solid #D4AF37;
    border-radius: 4px;
}

/* Boutons d'action */
.cookie-consent-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding: 20px 30px 30px;
    background: rgba(0, 0, 0, 0.15);
}

.cookie-btn {
    flex: 1;
    min-width: 150px;
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.cookie-btn i {
    font-size: 1.1rem;
}

/* Bouton Accepter (principal) */
.cookie-btn-accept {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.cookie-btn-accept:hover {
    background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
    transform: translateY(-2px);
}

/* Bouton Refuser */
.cookie-btn-reject {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.cookie-btn-reject:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

/* Bouton Personnaliser */
.cookie-btn-customize {
    background: linear-gradient(135deg, #D4AF37 0%, #C49A2E 100%);
    color: #1A3A5C;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.cookie-btn-customize:hover {
    background: linear-gradient(135deg, #C49A2E 0%, #B38B27 100%);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
    transform: translateY(-2px);
}

/* Lien "En savoir plus" */
.cookie-link {
    flex: 0 0 auto;
    padding: 14px 20px;
    background: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
    text-decoration: none;
    font-weight: 500;
}

.cookie-link:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

/* Modal de personnalisation */
#cookie-customize-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    background: linear-gradient(135deg, #2B5A9E 0%, #1A3A5C 100%);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    z-index: 1000000;
    opacity: 0;
    transition: all 0.3s ease;
}

#cookie-customize-modal.show {
    display: block;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.cookie-modal-header {
    padding: 25px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cookie-modal-header h3 {
    margin: 0;
    color: white;
    font-size: 1.3rem;
}

.cookie-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.cookie-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.cookie-modal-body {
    padding: 25px 30px;
    color: white;
}

.cookie-category {
    margin-bottom: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.cookie-category:hover {
    background: rgba(255, 255, 255, 0.12);
}

.cookie-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.cookie-category-title {
    font-weight: 600;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cookie-category-title i {
    color: #4CAF50;
}

.cookie-category-desc {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
}

/* Toggle switch */
.cookie-toggle {
    position: relative;
    width: 50px;
    height: 26px;
}

.cookie-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.2);
    transition: 0.3s;
    border-radius: 34px;
}

.cookie-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.cookie-toggle input:checked + .cookie-toggle-slider {
    background-color: #4CAF50;
}

.cookie-toggle input:checked + .cookie-toggle-slider:before {
    transform: translateX(24px);
}

.cookie-toggle input:disabled + .cookie-toggle-slider {
    cursor: not-allowed;
    opacity: 0.5;
}

.cookie-modal-actions {
    padding: 20px 30px 30px;
    display: flex;
    gap: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Responsive */
@media (max-width: 768px) {
    #cookie-consent-banner {
        width: 100%;
        border-radius: 16px 16px 0 0;
    }

    .cookie-consent-header {
        padding: 20px 20px 15px;
    }

    .cookie-consent-title h3 {
        font-size: 1.2rem;
    }

    .cookie-consent-content {
        padding: 20px;
    }

    .cookie-types {
        grid-template-columns: 1fr;
    }

    .cookie-consent-actions {
        flex-direction: column;
        padding: 15px 20px 25px;
    }

    .cookie-btn {
        width: 100%;
    }

    #cookie-customize-modal {
        width: 95%;
        max-height: 90vh;
    }

    .cookie-modal-actions {
        flex-direction: column;
    }
}

/* Animation de pulsation pour attirer l'attention */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow: 0 -15px 50px rgba(43, 90, 158, 0.4);
    }
}

#cookie-consent-banner.show {
    animation: pulse 3s ease-in-out infinite;
}
