/* ============================================================
   Cursor Trail — Styles front-end
   Panneau visiteur flottant + bouton toggle
   ============================================================ */

/* ── Bouton flottant ✦ ──────────────────────────────────────── */
#ct-fab {
    position: fixed;
    bottom: 28px;
    z-index: 1000000;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, #7b2ff7, #ff3e8e);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    box-shadow: 0 4px 20px rgba(123, 47, 247, 0.55);
    transition: transform 0.2s cubic-bezier(.34,1.56,.64,1),
                box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

#ct-fab.ct-pos-right { right: 24px; }
#ct-fab.ct-pos-left  { left: 24px;  }

#ct-fab:hover {
    transform: scale(1.12) rotate(15deg);
    box-shadow: 0 6px 28px rgba(123, 47, 247, 0.7);
}

#ct-fab:active { transform: scale(0.95); }

/* Pulse ring quand le panneau est fermé */
#ct-fab::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid rgba(123, 47, 247, 0.4);
    animation: ct-pulse 2.4s ease-out infinite;
    pointer-events: none;
}

#ct-fab.ct-open::before { animation: none; }

@keyframes ct-pulse {
    0%   { opacity: 1; transform: scale(1); }
    70%  { opacity: 0; transform: scale(1.5); }
    100% { opacity: 0; transform: scale(1.5); }
}

/* ── Panneau latéral ────────────────────────────────────────── */
#ct-panel {
    position: fixed;
    bottom: 90px;
    z-index: 999999;
    width: 290px;
    background: rgba(15, 12, 28, 0.92);
    backdrop-filter: blur(18px) saturate(1.4);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    border: 1px solid rgba(123, 47, 247, 0.3);
    border-radius: 18px;
    padding: 22px 20px 18px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55),
                0 0 0 1px rgba(255,255,255,0.04) inset;
    color: #e8e8f0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 13px;

    /* Animation d'ouverture */
    opacity: 0;
    transform: translateY(14px) scale(0.96);
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s cubic-bezier(.34,1.3,.64,1);
}

#ct-panel.ct-pos-right { right: 20px; }
#ct-panel.ct-pos-left  { left: 20px;  }

#ct-panel.ct-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* ── En-tête du panneau ─────────────────────────────────────── */
.ct-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.ct-panel-title {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.02em;
    background: linear-gradient(90deg, #ff3e8e, #7b2ff7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ct-panel-close {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
}
.ct-panel-close:hover { color: #fff; background: rgba(255,255,255,0.08); }

/* ── Séparateur ─────────────────────────────────────────────── */
.ct-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.07);
    margin: 14px 0;
}

/* ── Ligne de contrôle ──────────────────────────────────────── */
.ct-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.ct-row:last-child { margin-bottom: 0; }

.ct-row-label {
    color: #9999bb;
    font-size: 12px;
    font-weight: 500;
    flex-shrink: 0;
}

/* ── Mini toggle ────────────────────────────────────────────── */
.ct-mini-toggle {
    position: relative;
    width: 38px;
    height: 22px;
    flex-shrink: 0;
}

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

.ct-mini-slider {
    position: absolute;
    inset: 0;
    background: #2a2a3e;
    border-radius: 11px;
    cursor: pointer;
    transition: background 0.2s;
}

.ct-mini-slider::after {
    content: '';
    position: absolute;
    top: 3px; left: 3px;
    width: 16px; height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}

.ct-mini-toggle input:checked + .ct-mini-slider {
    background: linear-gradient(90deg, #7b2ff7, #ff3e8e);
}

.ct-mini-toggle input:checked + .ct-mini-slider::after {
    transform: translateX(16px);
}

/* ── Chips de sélection (mode couleur & forme) ──────────────── */
.ct-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.ct-chip {
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.12);
    background: transparent;
    color: #8888aa;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.ct-chip:hover { border-color: #7b2ff7; color: #ccc; }

.ct-chip.ct-active {
    background: linear-gradient(90deg, #7b2ff7, #ff3e8e);
    border-color: transparent;
    color: #fff;
}

/* ── Sélecteur de couleur compact ───────────────────────────── */
.ct-color-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.ct-color-swatch {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.15);
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.ct-color-swatch:hover { transform: scale(1.15); }
.ct-color-swatch.ct-active { border-color: #fff; transform: scale(1.15); }

.ct-color-swatch input[type="color"] {
    position: absolute;
    inset: -4px;
    opacity: 0;
    cursor: pointer;
    width: calc(100% + 8px);
    height: calc(100% + 8px);
}

/* ── Slider compact ─────────────────────────────────────────── */
.ct-slider-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    justify-content: flex-end;
}

.ct-slider-wrap input[type="range"] {
    -webkit-appearance: none;
    width: 110px;
    height: 4px;
    background: #2a2a3e;
    border-radius: 2px;
    outline: none;
    flex-shrink: 0;
}

.ct-slider-wrap input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7b2ff7, #ff3e8e);
    cursor: pointer;
    box-shadow: 0 0 4px rgba(123,47,247,.6);
}

.ct-slider-val {
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    width: 28px;
    text-align: right;
    flex-shrink: 0;
}

/* ── Pied du panneau ────────────────────────────────────────── */
.ct-panel-footer {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ct-reset-btn {
    background: none;
    border: 1px solid rgba(255,255,255,0.1);
    color: #666;
    font-size: 11px;
    padding: 5px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}

.ct-reset-btn:hover { border-color: #ff3e8e; color: #ff3e8e; }

.ct-panel-brand {
    font-size: 10px;
    color: #3a3a55;
    letter-spacing: 0.05em;
}

/* ── Aperçu couleur dans le panneau ─────────────────────────── */
#ct-panel-preview {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    margin-bottom: 16px;
    transition: background 0.3s;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media ( max-width: 360px ) {
    #ct-panel { width: calc(100vw - 32px); }
}
