/* ============================================================
   Theme Configurator — Color editor, save/load/import/export
   ============================================================ */

.theme-configurator-content {
    width: 560px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.theme-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 0;
    flex-shrink: 0;
}

.theme-toolbar .toolbar-spacer {
    flex: 1;
}

.theme-generate-bar {
    display: flex;
    gap: 6px;
    padding: 8px 0;
    flex-shrink: 0;
}

.theme-generate-bar input {
    flex: 1;
    min-width: 0;
}

.theme-editor-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 4px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin: 8px 0;
}

.theme-group {
    margin-bottom: 12px;
}

.theme-group-title {
    font-size: var(--fs-base);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 0 4px;
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    z-index: 1;
}

.theme-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 0;
}

.theme-label {
    flex: 1;
    font-size: var(--fs-md);
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.theme-color-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.theme-color-picker {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid var(--control-border);
    border-radius: var(--radius-sm);
    background: none;
    cursor: pointer;
}

.theme-color-picker::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.theme-color-picker::-webkit-color-swatch {
    border: none;
    border-radius: 2px;
}

.theme-color-text {
    width: 100px;
    padding: 4px 6px;
    font-size: var(--fs-base);
    font-family: var(--font-mono);
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    outline: none;
}

.theme-color-text:focus {
    border-color: var(--accent);
}

.theme-save-bar {
    display: flex;
    gap: 6px;
    padding: 8px 0 4px;
    flex-shrink: 0;
}

.theme-save-bar input {
    flex: 1;
    min-width: 0;
}

.btn-sm {
    padding: 4px 10px;
    font-size: var(--fs-md);
    min-height: var(--control-compact-height);
}

.btn-danger {
    color: var(--error-text); /* --error is 4.2:1 on the confirm dialog in the light theme; this is the same red where it reads as text (#5273) */
    border-color: var(--error);
}

.btn-danger:hover {
    background: rgba(var(--fx-red-rgb), 0.15);
}

.theme-generate-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
    background: var(--accent-dim);
    border: 1px solid var(--accent);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    color: var(--text-primary);
}

.theme-generate-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--text-muted);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: theme-spin 0.8s linear infinite;
    flex-shrink: 0;
}

@keyframes theme-spin {
    to { transform: rotate(360deg); }
}
