/* ================================================================
   Voyager Theme Picker — shadcn-inspired light/dark theme switcher

   The JS swaps --wp--preset--color--* CSS custom properties on :root.
   Every theme has paired light + dark values. Toggling dark mode swaps
   the entire set — backgrounds go dark, text goes light.

   Contrast is enforced by the JS contrast scanner (fixContrast()),
   not by CSS overrides. This file only handles picker widget styling
   and smooth transitions.
   ================================================================ */

/* Smooth color transitions only on theme-switchable elements.
   Scoped to avoid interfering with animations, GSAP, or layout. */
.voyager-theme-picker,
.wp-block-group,
.wp-block-column,
.wp-block-button__link,
.wp-block-heading,
body {
    transition: background-color 0.3s ease, color 0.2s ease, border-color 0.3s ease;
}

/* ----------------------------------------------------------------
   Picker Widget
   ---------------------------------------------------------------- */
/* Positioned to the left of Orbit chat widget (which is at right:20px bottom:20px) */
.voyager-theme-picker {
    position: fixed;
    bottom: 24px;
    right: 76px;
    z-index: 9998;
    font-family: var(--wp--preset--font-family--primary, system-ui, sans-serif);
}

/* Toggle button */
.vtp-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--wp--preset--color--light-gray, #E5E5E5);
    background: var(--wp--preset--color--surface, #ffffff);
    color: var(--wp--preset--color--foreground, #1B1F3B);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgb(0 0 0 / 0.1);
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.vtp-toggle:hover {
    transform: scale(1.08);
    border-color: var(--wp--preset--color--primary, #462CFF);
}

/* Panel */
.vtp-panel {
    position: absolute;
    bottom: 50px;
    right: 0;
    width: 240px;
    background: var(--wp--preset--color--surface, #ffffff);
    border: 1px solid var(--wp--preset--color--light-gray, #E5E5E5);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgb(0 0 0 / 0.12);
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px) scale(0.95);
    transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
}

.vtp-panel.vtp-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Sections */
.vtp-section {
    margin-bottom: 12px;
}

.vtp-section:last-child {
    margin-bottom: 0;
}

.vtp-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--wp--preset--color--muted, #6B7280);
    margin-bottom: 8px;
}

/* Mode buttons */
.vtp-modes {
    display: flex;
    gap: 4px;
    background: var(--wp--preset--color--light, #F8F8FC);
    border-radius: 8px;
    padding: 3px;
}

.vtp-mode-btn {
    flex: 1;
    padding: 6px 0;
    text-align: center;
    font-size: 12px;
    font-weight: 500;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: transparent;
    color: var(--wp--preset--color--muted, #6B7280);
    transition: background 0.15s, color 0.15s;
}

.vtp-mode-btn:hover {
    color: var(--wp--preset--color--foreground, #1B1F3B);
}

.vtp-mode-btn.vtp-active {
    background: var(--wp--preset--color--surface, #ffffff);
    color: var(--wp--preset--color--foreground, #1B1F3B);
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.06);
}

/* Theme buttons */
.vtp-themes {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.vtp-theme-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    background: transparent;
    transition: background 0.15s, border-color 0.15s;
}

.vtp-theme-btn:hover {
    background: var(--wp--preset--color--light, #F8F8FC);
}

.vtp-theme-btn.vtp-active {
    border-color: var(--wp--preset--color--primary, #462CFF);
    background: var(--wp--preset--color--light, #F8F8FC);
}

.vtp-swatch {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
}

.vtp-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--wp--preset--color--foreground, #1B1F3B);
}

/* ----------------------------------------------------------------
   Mobile
   ---------------------------------------------------------------- */
@media (max-width: 600px) {
    .voyager-theme-picker { bottom: 16px; right: 16px; }
    .vtp-panel { width: 220px; }
}
