/* ========================================
   GESTION DES COOKIES - STYLES
   ======================================== */

/* Overlay de fond */
.cookie-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Container principal */
#cookie-consent-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#cookie-consent-banner.show {
    opacity: 1;
}

#cookie-consent-banner.show .cookie-overlay {
    opacity: 1;
}

#cookie-consent-banner.show .cookie-consent-container {
    transform: scale(1);
    opacity: 1;
}

.cookie-consent-container {
    position: relative;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    background: white;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.cookie-content {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

/* En-tête */
.cookie-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.cookie-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cookie-close {
    background: #f3f4f6;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: #6b7280;
}

.cookie-close:hover {
    background: #e5e7eb;
    transform: rotate(90deg);
    color: #1f2937;
}

/* Description */
.cookie-description {
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* Catégories de cookies */
.cookie-categories {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.cookie-category {
    background: #f9fafb;
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.3s ease;
}

.cookie-category:hover {
    background: #f3f4f6;
    transform: translateX(5px);
}

.cookie-category-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.cookie-category-info h4 {
    margin: 0 0 0.3rem 0;
    font-size: 1rem;
    color: #1f2937;
}

.cookie-category-info p {
    margin: 0;
    font-size: 0.875rem;
    color: #6b7280;
}

/* Switch toggle */
.cookie-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    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: #cbd5e1;
    transition: 0.3s;
    border-radius: 26px;
}

.cookie-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cookie-switch input:checked + .cookie-slider {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.cookie-switch input:checked + .cookie-slider:before {
    transform: translateX(24px);
}

.cookie-switch input:disabled + .cookie-slider {
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
    cursor: not-allowed;
}

/* Boutons d'action */
.cookie-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.cookie-btn {
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.cookie-btn-accept-all {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.cookie-btn-accept-all:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.cookie-btn-save {
    background: #10b981;
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.cookie-btn-save:hover {
    transform: translateY(-2px);
    background: #059669;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.cookie-btn-reject {
    background: #f3f4f6;
    color: #6b7280;
}

.cookie-btn-reject:hover {
    background: #e5e7eb;
    color: #1f2937;
}

/* Lien vers la politique */
.cookie-policy-link {
    display: block;
    text-align: center;
    margin-top: 1rem;
    color: #667eea;
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.3s ease;
}

.cookie-policy-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Bouton flottant pour rouvrir les paramètres */
.cookie-settings-floating {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    cursor: pointer;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cookie-settings-floating:hover {
    transform: translateY(-5px) rotate(20deg);
    box-shadow: 0 6px 30px rgba(102, 126, 234, 0.6);
}

/* Notification */
.cookie-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
    z-index: 10000;
    font-weight: 600;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease;
}

.cookie-notification.show {
    transform: translateX(0);
    opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .cookie-consent-container {
        width: 95%;
        max-height: 95vh;
    }

    .cookie-content {
        padding: 1.5rem;
    }

    .cookie-header h3 {
        font-size: 1.25rem;
    }

    .cookie-actions {
        gap: 0.5rem;
    }

    .cookie-btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .cookie-settings-floating {
        width: 50px;
        height: 50px;
        bottom: 15px;
        left: 15px;
        font-size: 1.2rem;
    }

    .cookie-notification {
        right: 10px;
        left: 10px;
        top: 10px;
    }
}

@media (max-width: 480px) {
    .cookie-content {
        padding: 1rem;
    }

    .cookie-header h3 {
        font-size: 1.1rem;
    }

    .cookie-category-header {
        flex-direction: column;
        gap: 0.75rem;
    }

    .cookie-switch {
        width: 45px;
        height: 24px;
    }

    .cookie-slider:before {
        height: 18px;
        width: 18px;
    }

    .cookie-switch input:checked + .cookie-slider:before {
        transform: translateX(21px);
    }
}

/* Animation de rebond pour le bouton flottant */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.cookie-settings-floating:not(:hover) {
    animation: bounce 2s infinite;
}
