/* CookieConsent.css - Bannière de consentement des cookies */
/* Version: 1.0.0 */

/* Bannière principale */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.1);
    padding: 20px;
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.4;
}

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

/* Container de la bannière */
.cookie-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

/* Icône cookie */
.cookie-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
    line-height: 1;
}

/* Contenu textuel */
.cookie-content {
    flex: 1;
    min-width: 250px;
}

.cookie-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px 0;
}

.cookie-text {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
    margin: 0;
}

.cookie-link {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

.cookie-link:hover {
    text-decoration: underline;
}

/* Actions/boutons */
.cookie-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

/* Styles des boutons */
.cookie-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    font-family: inherit;
    outline: none;
}

.cookie-btn:focus {
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.cookie-btn-primary {
    background: #007bff;
    color: white;
    border: 2px solid #007bff;
}

.cookie-btn-primary:hover {
    background: #0056b3;
    border-color: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.cookie-btn-secondary {
    background: transparent;
    color: #007bff;
    border: 2px solid #007bff;
}

.cookie-btn-secondary:hover {
    background: #007bff;
    color: white;
}

.cookie-btn-settings {
    background: #f8f9fa;
    color: #495057;
    border: 2px solid #dee2e6;
}

.cookie-btn-settings:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

/* Modal des paramètres */
.cookie-settings {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.cookie-settings.show {
    display: flex;
}

/* Contenu du modal */
.settings-modal {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

/* Header du modal */
.settings-header {
    padding: 20px 20px 15px;
    border-bottom: 1px solid #eee;
    position: relative;
    flex-shrink: 0;
}

.settings-title {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    padding-right: 40px;
}

.settings-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: all 0.2s ease;
}

.settings-close:hover {
    background: #f0f0f0;
    color: #333;
}

/* Body du modal */
.settings-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

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

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

.category-title {
    margin: 0;
    font-weight: 600;
    color: #333;
    font-size: 1rem;
}

/* Toggle switch */
.toggle {
    position: relative;
    width: 50px;
    height: 26px;
    background: #ccc;
    border-radius: 13px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    flex-shrink: 0;
}

.toggle.active {
    background: #007bff;
}

.toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle.active::after {
    transform: translateX(24px);
}

.toggle.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #28a745;
}

.toggle.disabled::after {
    background: #f8f9fa;
}

/* Description des catégories */
.category-desc {
    color: #666;
    font-size: 0.85rem;
    margin: 0;
    line-height: 1.4;
}

.category-required {
    display: inline-block;
    background: #28a745;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 500;
    margin-left: 10px;
}

/* Footer du modal */
.settings-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-shrink: 0;
}

/* Notification */
.cookie-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 15px 20px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10001;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    max-width: 300px;
}

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

.cookie-notification.error {
    background: #dc3545;
}

.cookie-notification.warning {
    background: #ffc107;
    color: #212529;
}

.cookie-notification.info {
    background: #17a2b8;
}

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

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

.cookie-banner.animate-in {
    animation: slideUp 0.4s ease-out;
}

.cookie-settings.animate-in {
    animation: fadeIn 0.3s ease-out;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cookie-banner {
        padding: 15px;
    }
    
    .cookie-container {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .cookie-content {
        min-width: auto;
    }
    
    .cookie-actions {
        justify-content: center;
        width: 100%;
    }
    
    .cookie-btn {
        flex: 1;
        min-width: 100px;
        padding: 12px 16px;
    }
    
    .settings-modal {
        margin: 10px;
        max-height: 90vh;
    }
    
    .settings-body {
        padding: 15px;
    }
    
    .cookie-category {
        padding: 12px;
        margin-bottom: 15px;
    }
    
    .settings-footer {
        padding: 15px;
        flex-direction: column;
    }
    
    .settings-footer .cookie-btn {
        width: 100%;
        margin-bottom: 8px;
    }
    
    .cookie-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .cookie-banner {
        padding: 12px;
    }
    
    .cookie-icon {
        font-size: 1.5rem;
    }
    
    .cookie-title {
        font-size: 1rem;
    }
    
    .cookie-text {
        font-size: 0.85rem;
    }
    
    .cookie-btn {
        font-size: 0.85rem;
        padding: 10px 14px;
    }
}

/* Mode sombre (optionnel) */
@media (prefers-color-scheme: dark) {
    .cookie-banner {
        background: rgba(33, 37, 41, 0.98);
        border-top-color: rgba(255, 255, 255, 0.1);
    }
    
    .cookie-title {
        color: #f8f9fa;
    }
    
    .cookie-text {
        color: #adb5bd;
    }
    
    .settings-modal {
        background: #212529;
        color: #f8f9fa;
    }
    
    .settings-header {
        border-bottom-color: #495057;
    }
    
    .settings-title {
        color: #f8f9fa;
    }
    
    .settings-close {
        color: #adb5bd;
    }
    
    .settings-close:hover {
        background: #495057;
        color: #f8f9fa;
    }
    
    .cookie-category {
        background: #343a40;
        border-color: #495057;
    }
    
    .category-title {
        color: #f8f9fa;
    }
    
    .category-desc {
        color: #adb5bd;
    }
    
    .settings-footer {
        border-top-color: #495057;
    }
}