/**
 * STYLES DU BANNER DE CONSENTEMENT COOKIES
 * Design élégant et discret conforme RGPD
 */

/* Container principal du banner */
#cookie-consent-banner {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 420px;
}

/* Overlay semi-transparent (très discret) */
.cookie-banner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(2px);
    z-index: -1;
    opacity: 0;
    pointer-events: none;
}

/* Contenu du banner */
.cookie-banner-content {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.95) 0%, rgba(20, 20, 20, 0.95) 100%);
    backdrop-filter: blur(10px);
    border: 2px solid #C9A961;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    padding: 20px;
    border-radius: 12px;
    color: #fff;
}

/* Header du banner */
.cookie-banner-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(201, 169, 97, 0.3);
}

.cookie-banner-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #C9A961;
    display: flex;
    align-items: center;
    font-weight: 600;
}

.cookie-close-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.cookie-close-btn:hover {
    background: rgba(201, 169, 97, 0.2);
    color: #C9A961;
    transform: rotate(90deg);
}

/* Corps du banner */
.cookie-banner-body {
    margin-bottom: 15px;
}

.cookie-main-text {
    font-size: 0.9rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 12px;
}

/* Section des toggles */
.cookie-toggle-section {
    margin-top: 15px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    border: 1px solid rgba(201, 169, 97, 0.3);
    max-height: 300px;
    overflow-y: auto;
}

/* Scrollbar personnalisée */
.cookie-toggle-section::-webkit-scrollbar {
    width: 6px;
}

.cookie-toggle-section::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

.cookie-toggle-section::-webkit-scrollbar-thumb {
    background: rgba(201, 169, 97, 0.5);
    border-radius: 3px;
}

.cookie-toggle-section::-webkit-scrollbar-thumb:hover {
    background: rgba(201, 169, 97, 0.7);
}

/* Catégories de cookies */
.cookie-category {
    padding: 10px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    border-left: 2px solid #C9A961;
    transition: all 0.3s ease;
}

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

.cookie-category:last-child {
    margin-bottom: 0;
}

.cookie-category-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cookie-category-info {
    flex: 1;
}

.cookie-category-info strong {
    display: block;
    color: #C9A961;
    font-size: 0.95rem;
    margin-bottom: 3px;
}

.cookie-category-info p {
    margin: 0;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.3;
}

/* Toggle switch personnalisé */
.cookie-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
    flex-shrink: 0;
}

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

.cookie-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: 24px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

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

input:checked + .cookie-slider {
    background-color: #C9A961;
    border-color: #C9A961;
}

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

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

/* Footer avec boutons */
.cookie-banner-footer {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 10px;
}

/* Boutons d'action */
.cookie-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    white-space: nowrap;
}

.cookie-btn-accept {
    background: linear-gradient(135deg, #C9A961 0%, #A08760 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(201, 169, 97, 0.3);
}

.cookie-btn-accept:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(201, 169, 97, 0.5);
}

.cookie-btn-reject {
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.cookie-btn-reject:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: rgba(255, 255, 255, 0.5);
}

.cookie-btn-settings {
    background: transparent;
    color: #C9A961;
    border: 1px solid #C9A961;
}

.cookie-btn-settings:hover {
    background: rgba(201, 169, 97, 0.15);
}

.cookie-btn-save {
    background: linear-gradient(135deg, #C9A961 0%, #A08760 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(201, 169, 97, 0.3);
}

.cookie-btn-save:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(201, 169, 97, 0.5);
}

/* Liens du footer */
.cookie-banner-links {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    padding-top: 10px;
    border-top: 1px solid rgba(201, 169, 97, 0.2);
}

.cookie-banner-links a {
    color: #C9A961;
    text-decoration: none;
    font-size: 0.75rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
}

.cookie-banner-links a:hover {
    color: #fff;
    text-decoration: underline;
}

/* Responsive design */
@media (max-width: 768px) {
    #cookie-consent-banner {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .cookie-banner-content {
        padding: 16px;
        border-radius: 10px;
    }

    .cookie-banner-header h3 {
        font-size: 1rem;
    }

    .cookie-banner-footer {
        flex-direction: column;
    }

    .cookie-btn {
        width: 100%;
        justify-content: center;
    }

    .cookie-category-header {
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .cookie-banner-content {
        padding: 12px;
    }

    .cookie-banner-header h3 {
        font-size: 0.95rem;
    }

    .cookie-main-text {
        font-size: 0.85rem;
    }

    .cookie-btn {
        padding: 8px 14px;
        font-size: 0.8rem;
    }

    .cookie-banner-links {
        flex-direction: column;
        gap: 8px;
    }
}

/* Animation d'entrée */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

#cookie-consent-banner {
    animation: slideIn 0.4s ease-out forwards;
}

@media (max-width: 768px) {
    @keyframes slideInMobile {
        from {
            transform: translateY(100%);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }

    #cookie-consent-banner {
        animation: slideInMobile 0.4s ease-out forwards;
    }
}

/* Accessibilité */
.cookie-btn:focus,
.cookie-close-btn:focus,
.cookie-switch input:focus + .cookie-slider {
    outline: 2px solid #C9A961;
    outline-offset: 2px;
}

/* Icônes */
.cookie-banner-header i,
.cookie-btn i {
    margin-right: 6px;
}

/* Badge "Toujours actif" pour les cookies essentiels */
.cookie-category .badge-required {
    display: inline-block;
    background: rgba(201, 169, 97, 0.2);
    color: #C9A961;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 8px;
}

/* État de chargement */
.cookie-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.cookie-btn.loading::after {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
