/**
 * marsRocketWords — Theme System
 *
 * Theme color definitions are now fully data-driven from the DB.
 * CSS is generated dynamically by /api/themesController.php/css.
 *
 * This file contains only the .theme-picker component styles.
 * Applied via  html[data-theme="<id>"]  by theme.js (synchronous,
 * prevents FOUC).
 */

/* ============================================================================
   THEME PICKER COMPONENT
   ============================================================================ */

.theme-picker {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.theme-picker-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--box-shadow);
    transition: border-color 0.15s, box-shadow 0.15s;
    white-space: nowrap;
    -webkit-user-select: none;
    user-select: none;
}

.theme-picker-btn:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--box-shadow-lg);
}

.theme-picker-btn .tp-icon {
    font-size: 15px;
}

.theme-picker-btn .tp-label {
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.theme-picker-btn .tp-chevron {
    font-size: 10px;
    opacity: 0.5;
    transition: transform 0.15s;
}

.theme-picker.open .tp-chevron {
    transform: rotate(180deg);
}

/* Dropdown panel */
.theme-picker-panel {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 200px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: var(--box-shadow-lg);
    padding: 6px;
    animation: tp-appear 0.12s ease;
}

.theme-picker.open .theme-picker-panel {
    display: block;
}

/* Inline variant — embedded in a page element instead of fixed to viewport */
.theme-picker--inline {
    position: relative;
    top: auto;
    right: auto;
    z-index: 10;
}

.theme-picker--inline .theme-picker-panel {
    right: 0;
    top: calc(100% + 4px);
}

@keyframes tp-appear {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tp-group-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    padding: 8px 10px 3px;
}

.tp-group-label:first-child {
    padding-top: 4px;
}

.tp-option {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 10px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    transition: background 0.1s;
}

.tp-option:hover {
    background: var(--overlay-lighter);
    color: var(--text-primary);
}

.tp-option.active {
    background: var(--overlay-light);
    color: var(--text-primary);
    font-weight: 600;
}

.tp-swatch {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--border-lighter);
    flex-shrink: 0;
}

.tp-check {
    margin-left: auto;
    font-size: 11px;
    color: var(--accent-primary);
}


/* Mobile adjustments */
@media (max-width: 480px) {
    .theme-picker {
        top: 8px;
        right: 8px;
    }

    .theme-picker-btn .tp-label {
        display: none;
    }

    .theme-picker-panel {
        right: -4px;
    }
}