/* Système de gestion des cookies */

/* Bannière principale des cookies */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(33, 37, 41, 0.95);
    backdrop-filter: blur(10px);
    color: white;
    padding: 1.5rem 0;
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.4s ease-in-out;
    border-top: 3px solid var(--primary-color);
}

.cookie-banner.show {
    transform: translateY(0);
}

.cookie-banner .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.cookie-banner .cookie-content {
    flex: 1;
    min-width: 300px;
}

.cookie-banner .cookie-content h6 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cookie-banner .cookie-content p {
    margin-bottom: 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

.cookie-banner .cookie-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.cookie-banner .btn {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.cookie-banner .btn-accept {
    background: var(--primary-color);
    border: 1px solid var(--primary-color);
    color: white;
}

.cookie-banner .btn-accept:hover {
    background: #0b5ed7;
    border-color: #0b5ed7;
}

.cookie-banner .btn-decline {
    background: transparent;
    border: 1px solid #6c757d;
    color: #6c757d;
}

.cookie-banner .btn-decline:hover {
    background: #6c757d;
    color: white;
}

.cookie-banner .btn-customize {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.cookie-banner .btn-customize:hover {
    background: var(--primary-color);
    color: white;
}

/* Modal de personnalisation des cookies */
.cookie-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.cookie-modal.show {
    display: flex;
}

.cookie-modal-content {
    background: white;
    border-radius: 0.5rem;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.3);
}

.cookie-modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cookie-modal-header h5 {
    margin: 0;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cookie-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.cookie-modal-close:hover {
    background: #f8f9fa;
    color: var(--dark-color);
}

.cookie-modal-body {
    padding: 1.5rem;
}

.cookie-category {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    background: #f8f9fa;
}

.cookie-category h6 {
    margin-bottom: 0.5rem;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cookie-category p {
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: #6c757d;
}

.cookie-category .form-check {
    margin-bottom: 0;
}

.cookie-category.essential .form-check-input {
    background-color: var(--success-color);
    border-color: var(--success-color);
}

.cookie-category.essential .form-check-input:disabled {
    opacity: 0.7;
}

.cookie-modal-footer {
    padding: 1.5rem;
    border-top: 1px solid #dee2e6;
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* Toggle switch personnalisé */
.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.cookie-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.cookie-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.cookie-toggle input:checked + .cookie-toggle-slider {
    background-color: var(--primary-color);
}

.cookie-toggle input:checked + .cookie-toggle-slider:before {
    transform: translateX(26px);
}

.cookie-toggle input:disabled + .cookie-toggle-slider {
    background-color: var(--success-color);
    cursor: not-allowed;
}

/* Responsive design */
@media (max-width: 768px) {
    .cookie-banner .container {
        flex-direction: column;
        text-align: center;
    }
    
    .cookie-banner .cookie-content {
        min-width: auto;
    }
    
    .cookie-banner .cookie-actions {
        justify-content: center;
        width: 100%;
    }
    
    .cookie-banner .btn {
        flex: 1;
        min-width: 100px;
    }
    
    .cookie-modal-content {
        margin: 1rem;
        max-height: 90vh;
    }
    
    .cookie-modal-footer {
        flex-direction: column;
    }
    
    .cookie-modal-footer .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .cookie-banner {
        padding: 1rem 0;
    }
    
    .cookie-banner .cookie-content h6 {
        font-size: 1rem;
    }
    
    .cookie-banner .cookie-content p {
        font-size: 0.85rem;
    }
    
    .cookie-banner .btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}

/* Animation d'apparition */
@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cookie-banner.show {
    animation: slideUp 0.4s ease-out;
}

/* Indicateur de statut des cookies */
.cookie-status-indicator {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1041;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cookie-status-indicator:hover {
    background: var(--dark-color);
    transform: scale(1.1);
}

.cookie-status-indicator.show {
    display: flex;
}