/* --- 1. CONFIGURATION DU THÈME (Sombre par défaut) --- */
:root {
    --ck-bg: #0f172a;               /* Fond bleu nuit */
    --ck-glass-bg: rgba(15, 23, 42, 0.95);
    --ck-border: rgba(255, 255, 255, 0.1);
    --ck-accent: #3b82f6;           /* Bleu primaire */
    --ck-success: #10b981;          /* Vert enregistrement */
    --ck-danger: #ef4444;           /* Rouge refus */
    --ck-text: #f8fafc;
    --ck-text-muted: #94a3b8;
    --ck-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    --ck-radius: 24px;
}

/* --- 2. BANNIÈRE (BAS DE PAGE) --- */
.cookie-wrapper {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 10000; /* Priorité maximale */
    padding: 20px;
    pointer-events: none;
    display: flex;
    justify-content: center;
}

.cookie-banner {
    pointer-events: auto;
    width: 100%;
    max-width: 650px;
    background: var(--ck-glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--ck-border);
    border-radius: var(--ck-radius);
    padding: 25px;
    box-shadow: var(--ck-shadow);
    color: var(--ck-text);
    animation: ckSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.cookie-banner header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.cookie-icon { font-size: 1.5rem; }

.cookie-banner h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: var(--ck-text);
}

.cookie-content p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--ck-text-muted);
    margin-bottom: 20px;
}

.cookie-link {
    color: var(--ck-accent);
    text-decoration: underline;
    transition: opacity 0.2s;
}

.cookie-link:hover { opacity: 0.8; }

/* --- 3. MODAL (RÉGLAGES) --- */
.cookie-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.9); /* Fond ultra sombre */
    backdrop-filter: blur(8px);
    z-index: 10001; /* Au-dessus de la bannière */
    display: none; /* Géré par JS (flex lors de l'ouverture) */
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cookie-modal-content {
    background: var(--ck-bg);
    border: 1px solid var(--ck-border);
    border-radius: var(--ck-radius);
    padding: 30px;
    width: 100%;
    max-width: 500px;
    position: relative;
    box-shadow: var(--ck-shadow);
    animation: ckFadeScale 0.4s ease-out;
}

.btn-close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: var(--ck-text-muted);
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
}

.modal-header { margin-bottom: 25px; }
.modal-title { font-size: 1.5rem; font-weight: 800; margin-bottom: 5px; }
.modal-subtitle { font-size: 0.9rem; color: var(--ck-text-muted); }

/* Liste des réglages */
.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 15px;
    margin-bottom: 10px;
    border: 1px solid transparent;
}

.setting-info { display: flex; flex-direction: column; }
.setting-name { font-weight: 600; font-size: 1rem; }
.setting-desc { font-size: 0.8rem; color: var(--ck-text-muted); }

/* --- 4. BOUTONS --- */
.cookie-actions, .modal-footer {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.cookie-btn {
    flex: 1;
    min-width: 140px;
    padding: 12px 15px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

.btn-accept, .btn-save { background: var(--ck-accent); color: white; }
.btn-accept:hover, .btn-save:hover { background: #2563eb; transform: translateY(-2px); }

.btn-reject { background: rgba(255, 255, 255, 0.05); color: var(--ck-text-muted); border: 1px solid var(--ck-border); }
.btn-reject:hover { border-color: var(--ck-danger); color: var(--ck-danger); }

.btn-manage { background: rgba(255, 255, 255, 0.1); color: white; }

/* --- 5. SWITCHES (Bootstrap Overrides) --- */
.form-check-input {
    width: 2.8em !important;
    height: 1.5em !important;
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid var(--ck-border) !important;
}

.form-check-input:checked {
    background-color: var(--ck-accent) !important;
    border-color: var(--ck-accent) !important;
}

/* --- 6. ANIMATIONS --- */
@keyframes ckSlideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes ckFadeScale {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* --- 7. RESPONSIVE --- */
@media (max-width: 576px) {
    .cookie-banner { padding: 20px; }
    .cookie-actions { flex-direction: column; }
    .cookie-btn { width: 100%; }
}