﻿/* Theme panel and customization UI */

.theme-panel {
    position: fixed;
    top: 48px;
    right: 24px;
    width: min(820px, calc(100vw - 32px));
    max-height: calc(100vh - 64px);
    display: flex;
    flex-direction: column;
    background: var(--bg-dark, #2a2a2a);
    color: var(--text-primary, #e0e0e0);
    border: 1px solid var(--border-color, #404040);
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
    z-index: 10001;
    pointer-events: auto;
    overflow: hidden;
}

.theme-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color, #404040);
    background: var(--bg-darker, #1a1a1a);
    cursor: move;
    user-select: none;
}

.theme-panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.theme-panel-title h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary, #e0e0e0);
}

.theme-drag-handle {
    font-size: 18px;
    opacity: 0.7;
}

.theme-panel-close {
    background: transparent;
    border: none;
    color: var(--text-secondary, #b0b0b0);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}

.theme-panel-close:hover {
    color: var(--text-primary, #e0e0e0);
}

.theme-panel-body {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

.theme-panel-hint {
    margin: 0 0 16px;
    font-size: 13px;
    color: var(--text-secondary, #b0b0b0);
}

.theme-panel-actions {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--border-color, #404040);
    background: var(--bg-darker, #1a1a1a);
}

.theme-color-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.theme-paired-colors {
    margin-bottom: 20px;
}

.theme-paired-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 10px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary, #b0b0b0);
}

.theme-color-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color, #404040);
}

.theme-color-pair:last-child {
    border-bottom: none;
}

.theme-pair-col .theme-color-row {
    margin-bottom: 0;
}

.theme-extra-colors h4 {
    margin: 0 0 12px;
    font-size: 14px;
    color: var(--text-primary, #e0e0e0);
}

.theme-extra-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 16px;
}

.theme-color-grid h4 {
    margin: 0 0 12px;
    font-size: 14px;
    color: var(--text-primary, #e0e0e0);
}

.theme-color-row {
    margin-bottom: 12px;
}

.theme-color-row label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    color: var(--text-secondary, #b0b0b0);
}

.theme-color-inputs {
    display: flex;
    gap: 8px;
    align-items: center;
}

.theme-color-picker {
    width: 48px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--border-color, #404040);
    border-radius: 6px;
    cursor: pointer;
    background: transparent;
}

.theme-color-hex {
    flex: 1;
    padding: 8px;
    background: var(--bg-light, #3a3a3a);
    color: var(--text-primary, #e0e0e0);
    border: 1px solid var(--border-color, #404040);
    border-radius: 6px;
    font-family: monospace;
    font-size: 12px;
}

.theme-template-row,
.theme-preset-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.theme-template-input {
    flex: 1;
    padding: 8px;
    background: var(--bg-light, #3a3a3a);
    color: var(--text-primary, #e0e0e0);
    border: 1px solid var(--border-color, #404040);
    border-radius: 6px;
}

.theme-templates-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 24px;
}

.theme-template-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.theme-btn {
    border: 1px solid var(--border-color, #404040);
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-primary, #e0e0e0);
    background: var(--bg-light, #3a3a3a);
}

.theme-btn:hover {
    border-color: var(--accent-color, #f39c12);
}

.theme-btn-primary {
    flex: 1;
    background: var(--accent-color, #f39c12);
    border-color: var(--accent-color, #f39c12);
    color: #fff;
    font-weight: 600;
}

.theme-btn-save {
    background: #28a745;
    border-color: #28a745;
    color: #fff;
}

.theme-btn-delete {
    padding: 8px 10px;
    background: #dc3545;
    border-color: #dc3545;
    color: #fff;
}

.theme-btn-muted {
    background: var(--bg-light, #3a3a3a);
}

.theme-preset-btn {
    flex: 1;
    padding: 10px;
    border-radius: 6px;
    border-width: 2px;
    cursor: pointer;
    font-weight: 600;
}

.theme-preset-dark {
    background: #1a1a1a;
    color: #e0e0e0;
    border-color: #e0e0e0;
}

.theme-preset-light {
    background: #f5f5f5;
    color: #2a2a2a;
    border-color: #2a2a2a;
}

.theme-preset-sepia {
    background: #e8dcc8;
    color: #5c4033;
    border-color: #5c4033;
}

@media (max-width: 720px) {
    .theme-color-grid,
    .theme-paired-header,
    .theme-color-pair,
    .theme-extra-grid {
        grid-template-columns: 1fr;
    }

    .theme-panel {
        left: 16px;
        right: 16px;
        width: auto;
    }
}
