/* ═══════════════════════════════════════════════════════
   Public Theme Switcher Widget
   ═══════════════════════════════════════════════════════ */

/* ── Sticky Toggle Button ── */
.theme-switcher-toggle {
    position: fixed;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-left: none;
    padding: 12px 14px;
    border-radius: 0 12px 12px 0;
    box-shadow: var(--shadow-card);
    cursor: pointer;
    z-index: 1040;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.theme-switcher-toggle:hover {
    background: var(--bg-subtle);
    padding-left: 20px;
}

.theme-switcher-toggle i {
    font-size: 1.25rem;
    background: var(--gradient-brand);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: transform 0.5s ease;
}

.theme-switcher-toggle:hover i {
    transform: rotate(180deg);
}


/* ── Pop-out Panel ── */
.theme-switcher-panel {
    position: fixed;
    top: 50%;
    left: -320px;
    /* Hidden by default */
    transform: translateY(-50%);
    width: 300px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0 16px 16px 0;
    box-shadow: var(--shadow-lg);
    z-index: 1045;
    transition: left 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}

.theme-switcher-panel.active {
    left: 0;
}

/* Header */
.theme-switcher-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-subtle);
}

.theme-switcher-header h5 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--heading-color);
}

.theme-switcher-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.theme-switcher-close:hover {
    color: var(--accent);
}

/* Body */
.theme-switcher-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

.theme-switcher-section {
    margin-bottom: 24px;
}

.theme-switcher-section:last-child {
    margin-bottom: 0;
}

.theme-switcher-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 12px;
    display: block;
}

/* ── Mode Selection Buttons (Light/Dark/Auto) ── */
.theme-mode-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 8px;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    background: var(--surface-alt);
    color: var(--text);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.theme-mode-btn:last-child {
    margin-bottom: 0;
}

.theme-mode-btn:hover {
    border-color: var(--border-card);
    background: var(--bg-subtle);
}

.theme-mode-btn.active {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.05);
    color: var(--primary);
}

.theme-mode-btn i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

/* ── Color Picker (Presets) ── */
.color-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.color-preset-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.color-preset-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.color-preset-btn.active {
    border: 2px solid var(--text);
    transform: scale(1.1);
}

/* Custom Color Input Wrapper */
.custom-color-wrapper {
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.custom-color-input {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
    background: none;
}

.custom-color-input::-webkit-color-swatch-wrapper {
    padding: 0;
}

.custom-color-input::-webkit-color-swatch {
    border: 1px solid var(--border);
    border-radius: 8px;
}

.custom-color-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}
