/**
 * Styles pour la gestion des cookies RGPD
 */

/* Bannière de cookies */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #4CAF50, #2196F3);
    color: white;
    padding: 1.5rem 2rem;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
    z-index: 10000;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

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

.cookie-banner.hide {
    transform: translateY(100%);
}

.cookie-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

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

.cookie-text h4 {
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.cookie-text p {
    margin: 0;
    opacity: 0.9;
    line-height: 1.4;
}

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

.cookie-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.cookie-accept {
    background: white;
    color: #4CAF50;
}

.cookie-accept:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
}

.cookie-customize {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
}

.cookie-customize:hover {
    background: rgba(255,255,255,0.3);
}

.cookie-refuse {
    background: transparent;
    color: white;
    border: 1px solid rgba(255,255,255,0.5);
}

.cookie-refuse:hover {
    background: rgba(255,255,255,0.1);
}

/* Modale de préférences */
.cookie-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 2rem;
}

.cookie-modal.show {
    opacity: 1;
    visibility: visible;
}

.cookie-modal.hide {
    opacity: 0;
    visibility: hidden;
}

.cookie-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.cookie-modal.show .cookie-modal-content {
    transform: scale(1);
}

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

.cookie-modal-header h3 {
    color: #333;
    margin: 0;
    font-size: 1.5rem;
}

.cookie-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background 0.3s;
}

.cookie-close:hover {
    background: #f0f0f0;
}

.cookie-modal-body {
    padding: 2rem;
}

.cookie-category {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #2196F3;
}

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

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

.cookie-category h4 {
    color: #333;
    margin: 0;
    font-size: 1.2rem;
}

.cookie-required {
    background: #4CAF50;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.cookie-category p {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.cookie-category ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cookie-category li {
    padding: 0.25rem 0;
    color: #777;
    font-size: 0.9rem;
}

.cookie-category li:before {
    content: "• ";
    color: #2196F3;
    font-weight: bold;
}

/* Toggle Switch */
.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
}

.cookie-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

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

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

.cookie-toggle input:checked + .toggle-slider {
    background-color: #2196F3;
}

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

.cookie-modal-footer {
    padding: 1rem 2rem 2rem;
    text-align: center;
}

.cookie-save {
    background: linear-gradient(135deg, #4CAF50, #2196F3);
    color: white;
    padding: 1rem 2rem;
    font-size: 1rem;
    border-radius: 8px;
}

.cookie-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

/* Responsive Design */
@media (max-width: 768px) {
    .cookie-banner-content {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
    
    .cookie-actions {
        justify-content: center;
        width: 100%;
    }
    
    .cookie-btn {
        flex: 1;
        min-width: 100px;
    }
    
    .cookie-modal {
        padding: 1rem;
    }
    
    .cookie-modal-header {
        padding: 1.5rem 1.5rem 1rem;
    }
    
    .cookie-modal-body {
        padding: 1.5rem;
    }
    
    .cookie-category {
        padding: 1rem;
    }
    
    .cookie-category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .cookie-toggle {
        align-self: flex-end;
    }
}

/* Animation pour les éléments qui apparaissent */
.cookie-banner,
.cookie-modal {
    will-change: transform, opacity;
}

/* Styles pour les liens de politique de confidentialité */
.privacy-link {
    color: #2196F3;
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.3s;
}

.privacy-link:hover {
    color: #1976D2;
}

/* Indicateur de cookies acceptés (optionnel) */
.cookie-status {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #4CAF50;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

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

/* Bouton pour rouvrir les préférences */
.cookie-preferences-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: #2196F3;
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    font-size: 1.2rem;
    width: 50px;
    height: 50px;
}

.cookie-preferences-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}