/* ========================================
   SYSTÈME DE GESTION DES COOKIES - STYLES
   ======================================== */

/* Variables CSS pour faciliter la maintenance */
:root {
    --primary-color: #ef4444;
    --primary-dark: #dc2626;
    --primary-light: #fca5a5;
    --bg-dark: #1e293b;
    --bg-light: #f1f5f9;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --border-color: #e2e8f0;
    --transition-speed: 0.3s;
    --z-cookies: 9999;
}

/* ========================================
   BANNIÈRE DE CONSENTEMENT
   ======================================== */

.cookies-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: var(--z-cookies);
    padding: 24px 20px;
    border-top: 4px solid var(--primary-color);
    animation: slideUp 0.4s ease-out;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cookies-banner.hidden {
    display: none;
}

.cookies-banner.fade-out {
    animation: fadeOut 0.3s ease-out forwards;
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(20px);
    }
}

/* Conteneur principal */
.cookies-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Section texte */
.cookies-content {
    flex: 1;
}

.cookies-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cookies-icon {
    font-size: 22px;
}

.cookies-description {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.5;
    margin: 0;
}

.cookies-description a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition-speed) ease;
}

.cookies-description a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Section boutons */
.cookies-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
}

/* Boutons génériques */
.cookies-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    font-family: 'Poppins', sans-serif;
    white-space: nowrap;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cookies-btn:active {
    transform: scale(0.98);
}

/* Bouton Accepter */
.cookies-btn-accept {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.cookies-btn-accept:hover {
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
    transform: translateY(-2px);
}

/* Bouton Refuser */
.cookies-btn-reject {
    background: var(--bg-light);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}

.cookies-btn-reject:hover {
    background: #e2e8f0;
    border-color: var(--text-light);
}

/* Bouton Personnaliser */
.cookies-btn-customize {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.cookies-btn-customize:hover {
    background: var(--primary-color);
    color: white;
}

/* ========================================
   MODALE DE PERSONNALISATION
   ======================================== */

.cookies-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: var(--z-cookies);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.cookies-modal-overlay.hidden {
    display: none;
}

.cookies-modal {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cookies-modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cookies-modal-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cookies-modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-light);
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-dark);
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed) ease;
}

.cookies-modal-close:hover {
    background: #e2e8f0;
    transform: rotate(90deg);
}

/* Contenu de la modale */
.cookies-modal-content {
    padding: 24px;
}

/* Section de cookies */
.cookies-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.cookies-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.cookies-section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 8px 0;
}

.cookies-section-description {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.5;
    margin: 0 0 12px 0;
}

/* Toggle pour les cookies */
.cookies-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
}

.cookies-toggle-label {
    flex: 1;
    font-size: 14px;
    color: var(--text-dark);
    font-weight: 500;
    cursor: pointer;
}

/* Switch CSS personnalisé */
.switch {
    position: relative;
    width: 50px;
    height: 28px;
    background-color: #ccc;
    border-radius: 14px;
    cursor: pointer;
    transition: background-color var(--transition-speed) ease;
    border: none;
    padding: 0;
    margin: 0;
}

.switch.active {
    background-color: var(--primary-color);
}

.switch::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    background-color: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: left var(--transition-speed) ease;
}

.switch.active::after {
    left: 24px;
}

.switch:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.switch:disabled .switch-label {
    opacity: 0.6;
}

.switch-label {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 500;
}

/* Pied de page modale */
.cookies-modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.cookies-modal-footer .cookies-btn {
    min-width: 120px;
}

/* ========================================
   LIEN "GÉRER MES COOKIES"
   ======================================== */

.cookies-manage-link {
    color: var(--text-light);
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: color var(--transition-speed) ease;
    border: none;
    background: none;
    padding: 0;
    font-family: 'Poppins', sans-serif;
}

.cookies-manage-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* ========================================
   RESPONSIVE - MOBILE
   ======================================== */

@media (max-width: 768px) {
    .cookies-banner {
        padding: 16px 16px;
    }

    .cookies-container {
        gap: 12px;
    }

    .cookies-title {
        font-size: 16px;
    }

    .cookies-description {
        font-size: 13px;
    }

    .cookies-buttons {
        flex-direction: column;
        gap: 10px;
        justify-content: stretch;
    }

    .cookies-btn {
        width: 100%;
        padding: 12px 16px;
    }

    .cookies-modal {
        max-height: 90vh;
    }

    .cookies-modal-header {
        padding: 20px;
    }

    .cookies-modal-content {
        padding: 20px;
    }

    .cookies-modal-footer {
        flex-direction: column;
        padding: 16px 20px;
    }

    .cookies-modal-footer .cookies-btn {
        width: 100%;
    }

    .cookies-toggle-label {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .cookies-banner {
        padding: 12px 12px;
        border-top-width: 3px;
    }

    .cookies-title {
        font-size: 15px;
    }

    .cookies-description {
        font-size: 12px;
    }

    .cookies-modal-close {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
}

/* ========================================
   PRINT STYLES (masquer la bannière)
   ======================================== */

@media print {
    .cookies-banner,
    .cookies-modal-overlay {
        display: none !important;
    }
}
