/* ========================================
   CHAT SETTINGS - Spyro Dragon Realm Theme
   Matches: purple/gold/pink palette, glass orbs,
   Quicksand + Nunito fonts, tropical magical vibe
   ======================================== */

/* ── Backdrop ── */
.cs-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(60, 20, 90, 0.45);
    z-index: 10000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    transition: opacity 0.28s ease;
}

/* ── Bottom Sheet ── */
.cs-sheet {
    width: 100%;
    max-width: 480px;
    max-height: 82vh;
    display: flex;
    flex-direction: column;
    border-radius: 24px 24px 0 0;
    background: linear-gradient(
        180deg,
        rgba(250, 248, 255, 0.97) 0%,
        rgba(240, 230, 250, 0.98) 40%,
        rgba(255, 255, 255, 0.99) 100%
    );
    box-shadow:
        0 -6px 40px rgba(155, 89, 182, 0.2),
        0 -2px 12px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.cs-sheet.cs-open {
    transform: translateY(0);
}

.cs-sheet.cs-closing {
    transform: translateY(100%);
    transition: transform 0.25s ease-in;
}

/* ── Drag Handle ── */
.cs-handle {
    display: flex;
    justify-content: center;
    padding: 10px 0 2px;
    cursor: grab;
}

.cs-handle-bar {
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(90deg, #d8b4fe, #f9a8d4);
    opacity: 0.6;
}

/* ── Header ── */
.cs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 20px 14px;
    border-bottom: 2px solid rgba(155, 89, 182, 0.1);
}

.cs-header-title {
    font-family: 'Satisfy', cursive;
    font-size: 26px;
    background: linear-gradient(135deg, #9b59b6, #ff6b9d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
}

.cs-header-close {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid rgba(155, 89, 182, 0.15);
    background: rgba(232, 223, 245, 0.6);
    color: #9b59b6;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.cs-header-close:active {
    background: rgba(155, 89, 182, 0.15);
    transform: scale(0.9);
}

/* ── Scrollable Body ── */
.cs-body {
    overflow-y: auto;
    padding: 4px 0 40px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* ── Section Headers ── */
.cs-section {
    font-family: 'Quicksand', sans-serif;
    font-weight: 800;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #9b59b6;
    padding: 20px 20px 6px;
    opacity: 0.7;
}

/* ── Row ── */
.cs-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 20px;
    gap: 12px;
    border-bottom: 1px solid rgba(155, 89, 182, 0.06);
}

.cs-row-col {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
}

.cs-row-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1;
    min-width: 0;
}

.cs-row-label {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 15px;
    color: #3c1a5e;
}

.cs-row-sub {
    font-family: 'Nunito', sans-serif;
    font-size: 12px;
    color: #9b7eb8;
    line-height: 1.3;
}

/* ── Toggle Switch (Purple/Pink gradient) ── */
.cs-tog {
    position: relative;
    width: 48px;
    height: 28px;
    border-radius: 14px;
    border: 2px solid rgba(155, 89, 182, 0.15);
    background: rgba(232, 223, 245, 0.5);
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
    transition: all 0.3s ease;
}

.cs-tog-on {
    background: linear-gradient(135deg, #9b59b6, #ff6b9d);
    border-color: transparent;
    box-shadow: 0 2px 10px rgba(155, 89, 182, 0.35);
}

.cs-tog-dot {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cs-tog-on .cs-tog-dot {
    transform: translateX(20px);
}

/* ── Pill Buttons (Segmented Control) ── */
.cs-pills {
    display: flex;
    background: rgba(232, 223, 245, 0.6);
    border-radius: 12px;
    padding: 3px;
    gap: 2px;
    flex-shrink: 0;
    border: 1px solid rgba(155, 89, 182, 0.1);
}

.cs-pill {
    padding: 6px 12px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #7c5a9b;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 32px;
}

.cs-pill:active {
    transform: scale(0.94);
}

.cs-pill-on {
    background: linear-gradient(135deg, #9b59b6, #ff6b9d);
    color: #fff;
    box-shadow: 0 2px 8px rgba(155, 89, 182, 0.35);
}

/* ── Bubble Swatches ── */
.cs-swatches {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
    gap: 8px;
    padding-top: 8px;
}

.cs-sw {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 2.5px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}

.cs-sw:active {
    transform: scale(0.88);
}

.cs-sw-on {
    border-color: #9b59b6 !important;
    box-shadow: 0 0 0 3px rgba(155, 89, 182, 0.2), 0 3px 10px rgba(155, 89, 182, 0.25);
}

.cs-sw-auto {
    background: conic-gradient(from 0deg, #9b59b6, #ff6b9d, #f39c12, #1abc9c, #3498db, #9b59b6);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cs-sw-auto span {
    font-size: 9px;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    font-family: 'Quicksand', sans-serif;
}

/* Swatch colors (matches bubble-styles.js) */
.cs-sw.bubble-style-mint     { background: linear-gradient(135deg, #a8edea, #7dd3c0); }
.cs-sw.bubble-style-snow     { background: linear-gradient(135deg, #f5f5f5, #d4d4d4); }
.cs-sw.bubble-style-midnight { background: linear-gradient(135deg, #2d2d3f, #1a1a2e); }
.cs-sw.bubble-style-charcoal { background: linear-gradient(135deg, #4a4a5a, #333340); }
.cs-sw.bubble-style-amber    { background: linear-gradient(135deg, #fbbf24, #d97706); }
.cs-sw.bubble-style-slate    { background: linear-gradient(135deg, #64748b, #475569); }
.cs-sw.bubble-style-moss     { background: linear-gradient(135deg, #4d7c0f, #365314); }
.cs-sw.bubble-style-ice      { background: linear-gradient(135deg, #7dd3fc, #38bdf8); }
.cs-sw.bubble-style-copper   { background: linear-gradient(135deg, #c2956a, #a07448); }
.cs-sw.bubble-style-lavender { background: linear-gradient(135deg, #c4b5fd, #a78bfa); }
.cs-sw.bubble-style-emerald  { background: linear-gradient(135deg, #34d399, #059669); }
.cs-sw.bubble-style-aurora   { background: linear-gradient(135deg, #a855f7, #10b981); }

/* ── Action Buttons ── */
.cs-act {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 14px 20px;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    border-bottom: 1px solid rgba(155, 89, 182, 0.06);
    transition: background 0.15s;
}

.cs-act:active {
    background: rgba(155, 89, 182, 0.06);
}

.cs-act-label {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 15px;
    color: #3c1a5e;
}

.cs-act-sub {
    font-family: 'Nunito', sans-serif;
    font-size: 12px;
    color: #9b7eb8;
}

.cs-act-danger .cs-act-label {
    color: #e74c3c;
}

.cs-act-danger .cs-act-sub {
    color: rgba(231, 76, 60, 0.5);
}

/* ── Compact Mode ── */
.chat-compact-mode .chat-message-wrapper {
    margin-bottom: 2px !important;
}

.chat-compact-mode .mb-4 {
    margin-bottom: 4px !important;
}

/* Bubble corners are controlled via --chat-bubble-radius CSS variable in chat-spyro-dragon.css */
