﻿/* ════════════════════════════════════════════════════════
   CSRD Esthetic — Cookie Consent CSS v1.0
   Thème rose (brand pink) — RGPD compliant
   ════════════════════════════════════════════════════════ */

:root {
    --brand-400:  #ec4899;   /* pink-500 */
    --brand-500:  #db2777;   /* pink-600 */
    --brand-dark: #be185d;   /* pink-700 */
    --accent-400: #f472b6;   /* pink-400 — noms de cookies */
}

/* ── Bannière (niveau 1) ────────────────────────────── */
.cc-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
    pointer-events: none;
}
.cc-banner.cc-visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}
.cc-banner-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 24px;
    background: rgba(15, 15, 35, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(236, 72, 153, 0.25);
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}
.cc-banner-content {
    flex: 1;
    min-width: 280px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.cc-banner-icon {
    font-size: 2rem;
    flex-shrink: 0;
    line-height: 1;
}
.cc-banner-text strong {
    display: block;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 6px;
}
.cc-banner-text p {
    color: #9ca3af;
    font-size: 0.82rem;
    line-height: 1.6;
    margin: 0;
}
.cc-banner-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* ── Boutons ────────────────────────────────────────── */
.cc-btn {
    padding: 10px 22px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: Poppins, system-ui, sans-serif;
    cursor: pointer;
    border: none;
    transition: all 0.25s ease;
    white-space: nowrap;
}
.cc-btn-accept {
    background: linear-gradient(135deg, var(--brand-400), var(--brand-dark));
    color: #fff;
    box-shadow: 0 2px 12px rgba(236, 72, 153, 0.35);
}
.cc-btn-accept:hover {
    box-shadow: 0 4px 20px rgba(236, 72, 153, 0.5);
    transform: translateY(-1px);
}
.cc-btn-reject {
    background: transparent;
    color: #9ca3af;
    border: 1px solid rgba(255, 255, 255, 0.12);
}
.cc-btn-reject:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
}
.cc-btn-customize {
    background: transparent;
    color: var(--brand-400);
    border: 1px solid rgba(236, 72, 153, 0.35);
}
.cc-btn-customize:hover {
    background: rgba(236, 72, 153, 0.1);
    border-color: var(--brand-400);
}
.cc-btn-save {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    box-shadow: 0 2px 12px rgba(34, 197, 94, 0.3);
}
.cc-btn-save:hover {
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.45);
    transform: translateY(-1px);
}

/* ── Panneau des préférences (niveau 2) ─────────────── */
.cc-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.cc-overlay.cc-visible {
    opacity: 1;
    pointer-events: auto;
}
.cc-overlay.cc-visible .cc-prefs-panel {
    transform: translateY(0) scale(1);
}
.cc-prefs-panel {
    width: 660px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 48px);
    background: #0f0f23;
    border: 1px solid rgba(236, 72, 153, 0.25);
    border-radius: 20px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px) scale(0.97);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Header */
.cc-prefs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(236, 72, 153, 0.15);
}
.cc-prefs-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
    font-family: Poppins, system-ui, sans-serif;
}
.cc-prefs-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #888;
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
}
.cc-prefs-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

/* Intro */
.cc-prefs-intro {
    padding: 16px 24px;
    font-size: 0.82rem;
    color: #9ca3af;
    line-height: 1.6;
}
.cc-prefs-intro p { margin: 0; }
.cc-link {
    color: var(--brand-400);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.cc-link:hover { color: #f9a8d4; }

/* Catégories */
.cc-prefs-categories {
    flex: 1;
    overflow-y: auto;
    padding: 0 24px 16px;
    scrollbar-width: thin;
    scrollbar-color: #333 transparent;
}
.cc-prefs-categories::-webkit-scrollbar { width: 4px; }
.cc-prefs-categories::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }

.cc-category {
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
    transition: border-color 0.2s;
}
.cc-category:hover {
    border-color: rgba(236, 72, 153, 0.2);
}
.cc-category-required {
    border-color: rgba(34, 197, 94, 0.15);
    background: rgba(34, 197, 94, 0.03);
}
.cc-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
}
.cc-category-info { flex: 1; min-width: 0; }
.cc-category-info h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    margin: 0 0 4px;
    font-family: Poppins, system-ui, sans-serif;
}
.cc-category-info p {
    font-size: 0.78rem;
    color: #888;
    line-height: 1.5;
    margin: 0;
}

/* Badge obligatoire */
.cc-required-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(34, 197, 94, 0.12);
    color: #22c55e;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid rgba(34, 197, 94, 0.25);
}

/* Toggle switch */
.cc-toggle-wrap { flex-shrink: 0; position: relative; }
.cc-toggle-input { position: absolute; opacity: 0; width: 0; height: 0; }
.cc-toggle-slider {
    display: block;
    width: 48px;
    height: 26px;
    border-radius: 13px;
    background: #374151;
    cursor: pointer;
    position: relative;
    transition: background 0.3s;
}
.cc-toggle-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}
.cc-toggle-input:checked + .cc-toggle-slider {
    background: linear-gradient(135deg, var(--brand-400), var(--brand-dark));
}
.cc-toggle-input:checked + .cc-toggle-slider::after {
    transform: translateX(22px);
}
.cc-toggle-input:focus-visible + .cc-toggle-slider {
    outline: 2px solid var(--brand-400);
    outline-offset: 2px;
}

/* Tableau des cookies */
.cc-category-footer { padding: 0 16px 12px; }
.cc-details-toggle {
    background: none;
    border: none;
    color: var(--brand-400);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 4px 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.cc-details-toggle:hover { color: #f9a8d4; }

.cc-cookie-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}
.cc-cookie-details.cc-open { max-height: 300px; }
.cc-cookie-details table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.72rem;
    margin-top: 8px;
}
.cc-cookie-details th {
    text-align: left;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.03);
    color: #888;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.65rem;
    letter-spacing: 0.04em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.cc-cookie-details td {
    padding: 6px 10px;
    color: #9ca3af;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
.cc-cookie-name {
    font-family: 'Courier New', monospace;
    color: var(--accent-400);
    font-weight: 600;
}

/* Footer panneau */
.cc-prefs-footer {
    display: flex;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid rgba(236, 72, 153, 0.15);
    flex-wrap: wrap;
    justify-content: center;
}

/* ── Bouton flottant ────────────────────────────────── */
.cc-settings-btn {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 9990;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 24px;
    background: rgba(15, 15, 35, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(236, 72, 153, 0.25);
    color: #9ca3af;
    font-size: 0.75rem;
    font-family: Poppins, system-ui, sans-serif;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.35s ease;
}
.cc-settings-btn.cc-visible {
    opacity: 1;
    transform: translateY(0);
}
.cc-settings-btn:hover {
    color: #fff;
    border-color: var(--brand-400);
    box-shadow: 0 4px 16px rgba(236, 72, 153, 0.25);
}
.cc-settings-btn svg { flex-shrink: 0; }
.cc-settings-label { font-weight: 500; }

/* ── Mobile ─────────────────────────────────────────── */
@media (max-width: 640px) {
    .cc-banner-inner {
        flex-direction: column;
        padding: 16px;
        gap: 16px;
    }
    .cc-banner-content {
        flex-direction: column;
        gap: 10px;
    }
    .cc-banner-actions {
        width: 100%;
        flex-direction: column;
    }
    .cc-banner-actions .cc-btn {
        width: 100%;
        text-align: center;
    }
    .cc-prefs-panel {
        border-radius: 16px 16px 0 0;
        max-height: 85vh;
    }
    .cc-overlay {
        align-items: flex-end;
    }
    .cc-settings-btn {
        bottom: 16px;
        left: 16px;
    }
}