/* Fichier: /css/cookie-consent.css */
/* Description: Styles pour le banner de consentement et le modal de préférences. */

:root {
    --cookie-banner-bg-light: rgba(249, 249, 249, 0.95);
    --cookie-banner-text-light: #1d1d1f;
    --cookie-banner-border-light: rgba(0, 0, 0, 0.1);
    --cookie-button-accept-bg: #007AFF;
    --cookie-button-accept-text: #ffffff;
    --cookie-button-secondary-bg-light: #e5e5e7;
    --cookie-button-secondary-text-light: #1d1d1f;

    --cookie-banner-bg-dark: rgba(28, 28, 30, 0.95);
    --cookie-banner-text-dark: #f5f5f7;
    --cookie-banner-border-dark: rgba(255, 255, 255, 0.15);
    --cookie-button-secondary-bg-dark: #3a3a3c;
    --cookie-button-secondary-text-dark: #f5f5f7;
}

#cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--cookie-banner-bg-light);
    color: var(--cookie-banner-text-light);
    padding: 1rem 1.5rem;
    z-index: 4000;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--cookie-banner-border-light);
    box-sizing: border-box;
    transform: translateY(100%);
    transition: transform 0.4s ease-out;
}

#cookie-consent-banner.show {
    display: flex;
    transform: translateY(0);
}

.cookie-consent-text {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

.cookie-consent-buttons {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

.cookie-consent-btn {
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.cookie-consent-btn:hover {
    transform: translateY(-1px);
}

#cookie-accept-btn {
    background-color: var(--cookie-button-accept-bg);
    color: var(--cookie-button-accept-text);
}

#cookie-reject-btn, #cookie-prefs-btn {
    background-color: var(--cookie-button-secondary-bg-light);
    color: var(--cookie-button-secondary-text-light);
}

/* Modal de Préférences */
#cookie-modal {
    position: fixed;
    z-index: 5000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.6);
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#cookie-modal.show {
    display: flex;
    opacity: 1;
}

.cookie-modal-content {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    width: 90%;
    max-width: 550px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transform: scale(0.95);
    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;
    border-bottom: 1px solid var(--cookie-banner-border-light);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.cookie-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

#cookie-modal-close {
    background: none; border: none; font-size: 1.75rem; cursor: pointer; color: #888;
}

.cookie-category {
    padding: 1rem 0;
    border-bottom: 1px solid #f0f0f0;
}
.cookie-category:last-of-type {
    border-bottom: none;
}

.cookie-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.cookie-category-header h4 {
    margin: 0;
    font-weight: 600;
}

.cookie-category-description {
    font-size: 0.85rem;
    color: #555;
    margin-top: 0.5rem;
    line-height: 1.6;
}

.cookie-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--cookie-banner-border-light);
}

/* Switch Toggle CSS */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 28px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--cookie-button-accept-bg);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

input:disabled + .slider {
    background-color: #dcdcdc;
    cursor: not-allowed;
}

/* Dark Mode Styles */
body.dark-mode #cookie-consent-banner {
    background-color: var(--cookie-banner-bg-dark);
    color: var(--cookie-banner-text-dark);
    border-top-color: var(--cookie-banner-border-dark);
}

body.dark-mode #cookie-reject-btn, body.dark-mode #cookie-prefs-btn {
    background-color: var(--cookie-button-secondary-bg-dark);
    color: var(--cookie-button-secondary-text-dark);
}

body.dark-mode .cookie-modal-content {
    background: #1c1c1e;
}

body.dark-mode .cookie-modal-header {
    border-bottom-color: var(--cookie-banner-border-dark);
}

body.dark-mode #cookie-modal-close {
    color: #aaa;
}

body.dark-mode .cookie-category {
    border-bottom-color: #3a3a3c;
}

body.dark-mode .cookie-category-description {
    color: #a1a1a6;
}

body.dark-mode .cookie-modal-footer {
    border-top-color: var(--cookie-banner-border-dark);
}

/* Footer Link */
#cookie-preferences-link {
    cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
    #cookie-consent-banner {
        flex-direction: column;
        text-align: center;
        padding-bottom: 1.5rem;
    }
}