/* ============================================================
   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: 11px;
    font-weight: 600;
    color: var(--text-muted);
    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: 12px;
    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(--border);
    border-radius: 4px;
    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: 11px;
    font-family: var(--font-mono);
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 4px;
    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: 12px;
}

.btn-danger {
    color: var(--error);
    border-color: var(--error);
}

.btn-danger:hover {
    background: rgba(248, 81, 73, 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: 6px;
    font-size: 12px;
    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); }
}
