﻿/* ===================================
   Styles pour le système de cookies RGPD
   Compatible avec Brave et navigateurs modernes
   =================================== */

/* Banner de consentement */
.cookie-consent-banner {
    position: fixed;
    bottom: -100%;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    transition: bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-top: 3px solid #0f3460;
}

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

.cookie-consent-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
}

.cookie-consent-content {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.cookie-consent-icon {
    font-size: 3rem;
    color: #4CAF50;
    flex-shrink: 0;
}

.cookie-consent-text {
    flex: 1;
    min-width: 300px;
}

.cookie-consent-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.5rem;
}

.cookie-consent-description {
    color: #b8c5d6;
    margin-bottom: 0;
    line-height: 1.6;
}

.cookie-consent-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.cookie-consent-actions .btn {
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.cookie-consent-actions .btn-accept {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    border: none;
}

.cookie-consent-actions .btn-accept:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.cookie-consent-actions .btn-customize,
.cookie-consent-actions .btn-refuse {
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.cookie-consent-actions .btn-customize:hover,
.cookie-consent-actions .btn-refuse:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

/* Modal de personnalisation */
.cookie-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cookie-modal.show {
    display: flex;
    opacity: 1;
}

.cookie-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.cookie-modal-content {
    position: relative;
    background: #ffffff;
    border-radius: 16px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cookie-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
    border-bottom: 2px solid #e9ecef;
}

.cookie-modal-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
}

.cookie-modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: #6c757d;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.cookie-modal-close:hover {
    background: #f8f9fa;
    color: #1a1a2e;
    transform: rotate(90deg);
}

.cookie-modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

/* Catégories de cookies */
.cookie-category {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.cookie-category:hover {
    border-color: #0d6efd;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.1);
}

.cookie-category-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

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

.cookie-category-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 0.5rem;
}

.cookie-category-description {
    color: #6c757d;
    margin-bottom: 0;
    line-height: 1.6;
}

.cookie-category-toggle {
    flex-shrink: 0;
}

/* Switch toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 34px;
}

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

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

input:checked + .slider:before {
    transform: translateX(26px);
}

input:disabled + .slider {
    background-color: #4CAF50;
    opacity: 0.6;
    cursor: not-allowed;
}

.toggle-text {
    display: inline-block;
    margin-left: 10px;
    color: #4CAF50;
    font-weight: 600;
}

/* Détails des cookies */
.cookie-category-details {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

.cookie-category-details ul {
    margin: 0;
    padding-left: 1.5rem;
}

.cookie-category-details li {
    color: #495057;
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

/* Boîte d'information */
.cookie-info-box {
    background: #e7f3ff;
    border-left: 4px solid #0d6efd;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.cookie-info-box i {
    font-size: 1.5rem;
    color: #0d6efd;
    flex-shrink: 0;
}

.cookie-info-box strong {
    display: block;
    color: #1a1a2e;
    margin-bottom: 0.5rem;
}

.cookie-info-box p {
    margin: 0;
    color: #495057;
}

.cookie-info-box a {
    color: #0d6efd;
    text-decoration: underline;
}

/* Footer du modal */
.cookie-modal-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.5rem 2rem;
    border-top: 2px solid #e9ecef;
    background: #f8f9fa;
    border-radius: 0 0 16px 16px;
}

.cookie-modal-footer .btn {
    padding: 0.75rem 2rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
}

/* Bouton flottant pour rouvrir les paramètres */
.cookie-settings-button {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    z-index: 9998;
    transition: all 0.3s ease;
}

.cookie-settings-button:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 6px 20px rgba(13, 110, 253, 0.6);
}

/* Notification toast */
.cookie-notification {
    position: fixed;
    bottom: 100px;
    right: 20px;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 10001;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
}

.cookie-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.cookie-notification-success {
    border-left: 4px solid #4CAF50;
}

.cookie-notification-info {
    border-left: 4px solid #0d6efd;
}

.cookie-notification i {
    font-size: 1.5rem;
}

.cookie-notification-success i {
    color: #4CAF50;
}

.cookie-notification-info i {
    color: #0d6efd;
}

/* Responsive */
@media (max-width: 768px) {
    .cookie-consent-content {
        flex-direction: column;
        text-align: center;
    }

    .cookie-consent-actions {
        width: 100%;
        flex-direction: column;
    }

    .cookie-consent-actions .btn {
        width: 100%;
    }

    .cookie-modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .cookie-modal-header,
    .cookie-modal-body {
        padding: 1.5rem;
    }

    .cookie-modal-footer {
        flex-direction: column-reverse;
        padding: 1rem 1.5rem;
    }

    .cookie-modal-footer .btn {
        width: 100%;
    }

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

    .cookie-settings-button {
        bottom: 10px;
        left: 10px;
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }

    .cookie-notification {
        right: 10px;
        left: 10px;
        bottom: 70px;
    }
}

/* Mode sombre (optionnel) */
@media (prefers-color-scheme: dark) {
    .cookie-modal-content {
        background: #1a1a2e;
        color: #ffffff;
    }

    .cookie-modal-header {
        border-bottom-color: #2d2d44;
    }

    .cookie-modal-title,
    .cookie-category-title {
        color: #ffffff;
    }

    .cookie-category {
        background: #16213e;
        border-color: #2d2d44;
    }

    .cookie-category-description,
    .cookie-category-details li {
        color: #b8c5d6;
    }

    .cookie-category-details {
        background: #0f3460;
    }

    .cookie-modal-footer {
        background: #16213e;
        border-top-color: #2d2d44;
    }

    .cookie-notification {
        background: #1a1a2e;
        color: #ffffff;
    }
}

/* Accessibilité - Focus visible */
*:focus-visible {
    outline: 3px solid #0d6efd;
    outline-offset: 2px;
}

/* Animation de pulse pour attirer l'attention */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.cookie-settings-button {
    animation: pulse 2s infinite;
}
