/**
 * Styles pour le bandeau de consentement cookies RGPD
 * Design moderne et responsive pour Orizons Après-vie
 */

/* Variables CSS */
:root {
    --cookie-primary: #764ba2;
    --cookie-primary-dark: #5a3780;
    --cookie-primary-light: #8e5fc4;
    --cookie-success: #008b47;
    --cookie-success-hover: #00a854;
    --cookie-refuse: #6c757d;
    --cookie-refuse-hover: #5a6268;
    --cookie-text: #2c3e50;
    --cookie-text-light: #6c757d;
    --cookie-bg: #ffffff;
    --cookie-overlay: rgba(0, 0, 0, 0.5);
    --cookie-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    --cookie-border-radius: 12px;
    --cookie-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   BANDEAU DE CONSENTEMENT
   ======================================== */

.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-top: 3px solid var(--cookie-primary);
    box-shadow: var(--cookie-shadow);
    z-index: 999999;
    transform: translateY(100%);
    opacity: 0;
    transition: var(--cookie-transition);
    padding: 0;
    max-height: 90vh;
    overflow-y: auto;
}

.cookie-consent-banner.show {
    transform: translateY(0);
    opacity: 1;
}

.cookie-consent-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 25px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    flex-wrap: wrap;
}

.cookie-consent-content {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    flex: 1;
    min-width: 300px;
}

/* Icône cookie */
.cookie-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--cookie-primary) 0%, var(--cookie-primary-light) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 12px rgba(118, 75, 162, 0.3);
}

.cookie-icon svg {
    animation: cookieRotate 20s linear infinite;
}

@keyframes cookieRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Texte */
.cookie-text {
    flex: 1;
}

.cookie-text h3 {
    margin: 0 0 10px 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--cookie-text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.cookie-text p {
    margin: 0 0 8px 0;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--cookie-text-light);
}

.cookie-details {
    font-size: 0.875rem !important;
    margin-top: 12px !important;
}

.cookie-link {
    color: var(--cookie-primary);
    text-decoration: underline;
    font-weight: 500;
    transition: color 0.2s ease;
}

.cookie-link:hover {
    color: var(--cookie-primary-dark);
    text-decoration: none;
}

/* Boutons d'action */
.cookie-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.cookie-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--cookie-transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    font-family: inherit;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cookie-btn svg {
    flex-shrink: 0;
}

.cookie-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.cookie-btn:active {
    transform: translateY(0);
}

/* Bouton Accepter */
.cookie-btn-accept {
    background: linear-gradient(135deg, var(--cookie-success) 0%, var(--cookie-success-hover) 100%);
    color: white;
}

.cookie-btn-accept:hover {
    background: linear-gradient(135deg, var(--cookie-success-hover) 0%, var(--cookie-success) 100%);
}

/* Bouton Refuser */
.cookie-btn-refuse {
    background: var(--cookie-refuse);
    color: white;
}

.cookie-btn-refuse:hover {
    background: var(--cookie-refuse-hover);
}

/* Bouton Personnaliser */
.cookie-btn-customize {
    background: white;
    color: var(--cookie-primary);
    border: 2px solid var(--cookie-primary);
    box-shadow: none;
}

.cookie-btn-customize:hover {
    background: var(--cookie-primary);
    color: white;
}

/* ========================================
   MODAL DE PERSONNALISATION
   ======================================== */

.cookie-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.cookie-modal-content {
    position: relative;
    background: white;
    border-radius: var(--cookie-border-radius);
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    display: flex;
    flex-direction: column;
}

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

/* Header de la modal */
.cookie-modal-header {
    padding: 25px 30px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, var(--cookie-primary) 0%, var(--cookie-primary-light) 100%);
    color: white;
}

.cookie-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.cookie-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--cookie-transition);
    color: white;
}

.cookie-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Body de la modal */
.cookie-modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

/* Catégories de cookies */
.cookie-category {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

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

.cookie-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 15px;
}

.cookie-category-info h3 {
    margin: 0 0 5px 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--cookie-text);
}

.cookie-category-info p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--cookie-text-light);
    line-height: 1.5;
}

.cookie-category-details {
    padding-left: 20px;
    border-left: 3px solid var(--cookie-primary);
    margin-top: 15px;
}

.cookie-category-details p {
    margin: 8px 0;
    font-size: 0.875rem;
    color: var(--cookie-text-light);
    line-height: 1.6;
}

/* Switch toggle */
.cookie-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.cookie-switch input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-slider {
    position: relative;
    width: 50px;
    height: 26px;
    background: #ccc;
    border-radius: 13px;
    transition: var(--cookie-transition);
}

.cookie-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    top: 3px;
    background: white;
    border-radius: 50%;
    transition: var(--cookie-transition);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cookie-switch input:checked + .cookie-slider {
    background: var(--cookie-success);
}

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

.cookie-switch input:disabled + .cookie-slider {
    background: var(--cookie-primary);
    opacity: 0.7;
    cursor: not-allowed;
}

.cookie-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--cookie-text-light);
}

/* Footer de la modal */
.cookie-modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
}

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

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 968px) {
    .cookie-consent-container {
        flex-direction: column;
        align-items: stretch;
        padding: 20px;
    }

    .cookie-consent-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .cookie-icon {
        width: 40px;
        height: 40px;
    }

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

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

@media (max-width: 640px) {
    .cookie-consent-banner {
        max-height: 100vh;
    }

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

    .cookie-text p {
        font-size: 0.875rem;
    }

    .cookie-modal-content {
        border-radius: 0;
        max-height: 100vh;
        height: 100vh;
    }

    .cookie-modal-header {
        padding: 20px;
    }

    .cookie-modal-header h2 {
        font-size: 1.25rem;
    }

    .cookie-modal-body {
        padding: 20px;
    }

    .cookie-category {
        padding: 15px;
    }

    .cookie-category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

/* ========================================
   ANIMATIONS ET ÉTATS
   ======================================== */

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

/* Focus pour accessibilité */
.cookie-btn:focus-visible,
.cookie-modal-close:focus-visible,
.cookie-link:focus-visible {
    outline: 3px solid var(--cookie-primary);
    outline-offset: 2px;
}

/* États désactivés */
.cookie-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Scrollbar personnalisée pour la modal */
.cookie-modal-body::-webkit-scrollbar {
    width: 8px;
}

.cookie-modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.cookie-modal-body::-webkit-scrollbar-thumb {
    background: var(--cookie-primary);
    border-radius: 4px;
}

.cookie-modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--cookie-primary-dark);
}
