/**
 * STYLES DU BANNER DE CONSENTEMENT COOKIES
 * Design moderne et accessible conforme RGPD
 */

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

/* Overlay semi-transparent */
.cookie-banner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: -1;
}

/* Contenu du banner */
.cookie-banner-content {
    background: linear-gradient(135deg, rgba(13, 27, 42, 0.98) 0%, rgba(27, 38, 59, 0.98) 100%);
    backdrop-filter: blur(10px);
    border-top: 3px solid #ffd700;
    box-shadow: 0 -5px 30px rgba(0, 0, 0, 0.5);
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px;
    border-radius: 20px 20px 0 0;
    color: #fff;
}

/* Header du banner */
.cookie-banner-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
}

.cookie-banner-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: #ffd700;
    display: flex;
    align-items: center;
}

.cookie-close-btn {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cookie-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #ffd700;
    color: #ffd700;
    transform: rotate(90deg);
}

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

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

/* Section des toggles */
.cookie-toggle-section {
    margin-top: 20px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

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

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

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

.cookie-category-header {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

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

.cookie-category-info strong {
    display: block;
    color: #ffd700;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.cookie-category-info p {
    margin: 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.4;
}

/* Toggle switch personnalisé */
.cookie-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
    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.4s;
    border-radius: 30px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

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

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

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

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

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

/* Boutons d'action */
.cookie-btn {
    padding: 12px 25px;
    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;
    text-decoration: none;
    white-space: nowrap;
}

.cookie-btn-accept {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
}

.cookie-btn-accept:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.6);
}

.cookie-btn-reject {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4);
}

.cookie-btn-reject:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.6);
}

.cookie-btn-settings {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #0d1b2a;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

.cookie-btn-settings:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.6);
}

.cookie-btn-save {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.4);
}

.cookie-btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.6);
}

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

.cookie-banner-links a {
    color: #ffd700;
    text-decoration: none;
    font-size: 0.9rem;
    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-banner-content {
        padding: 20px;
        border-radius: 15px 15px 0 0;
    }

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

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

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

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

    .cookie-switch {
        align-self: flex-start;
    }
}

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

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

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

    .cookie-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

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

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

#cookie-consent-banner {
    animation: slideUp 0.5s ease-out forwards;
}

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

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

/* Badge "Toujours actif" pour les cookies essentiels */
.cookie-category .badge-required {
    display: inline-block;
    background: rgba(255, 215, 0, 0.2);
    color: #ffd700;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 10px;
}

/* É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); }
}
