/* ===== Theme Customize Modal & Shared Modals ===== */
.theme-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.theme-modal-overlay.show {
    display: flex;
}

.theme-modal {
    width: 92vw;
    max-width: 1100px;
    height: 88vh;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@media (max-width: 600px) {
    .theme-modal {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
}

.theme-modal-header {
    display: flex;
    flex-direction: column;
    padding: 16px 20px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-primary);
    gap: 10px;
}

.theme-modal-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.theme-modal-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-modal-title i {
    font-size: 16px;
    color: var(--accent-primary);
    flex-shrink: 0;
}

.theme-modal-mode-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.theme-name-input-wrapper {
    display: flex;
}

.theme-name-input {
    flex: 1;
    width: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    outline: none;
    transition: border-color var(--transition-fast);
}

.theme-name-input:focus {
    border-color: var(--accent-primary);
}

.theme-modal-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.theme-modal-actions .btn-sm {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 6px;
}

.theme-modal-body {
    flex: 1;
    overflow: hidden;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.theme-modal-layout {
    display: flex;
    gap: 20px;
    flex: 1;
    overflow: hidden;
    min-width: 0;
}

.theme-modal-left {
    display: flex;
    flex-direction: column;
    flex: 0 0 420px;
    min-width: 0;
    overflow-y: auto;
    overflow-x: hidden;
    gap: 16px;
}

.theme-modal-right {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

@media (max-width: 700px) {
    .theme-modal-layout {
        flex-direction: column;
    }
    .theme-modal-left {
        flex: none;
    }
}

.theme-base-selector {
    margin-bottom: 0;
}

.theme-base-selector .settings-label {
    display: block;
    margin-bottom: 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
}

.theme-base-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.theme-base-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 14px;
    background: var(--bg-primary);
    border: 2px solid var(--border-primary);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.theme-base-btn:hover {
    border-color: var(--border-highlight);
    color: var(--text-primary);
}

.theme-base-btn.active {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: rgba(59, 130, 246, 0.08);
}

.theme-color-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 8px;
}

.theme-color-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 4px 0;
    cursor: pointer;
}

.theme-color-swatch-wrapper {
    flex-shrink: 0;
}

.theme-color-picker {
    display: block;
    width: 44px;
    min-width: 0;
    height: 36px;
    border: 2px solid var(--border-primary);
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
    background: none;
    transition: border-color var(--transition-fast);
}

.theme-color-picker:hover {
    border-color: var(--accent-primary);
}

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

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

.theme-color-picker::-moz-color-swatch {
    border: none;
    border-radius: 6px;
}

.theme-color-overlay {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
}

.theme-color-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.theme-color-hex {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    font-family: monospace;
    line-height: 1.3;
}

.theme-color-rgb {
    font-size: 11px;
    color: var(--text-tertiary);
    font-family: monospace;
    line-height: 1.3;
}

/* ===== Preview Panel ===== */
.theme-preview-panel {
    flex: 1;
    border: 1px solid var(--border-primary);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--preview-bg, #1e1e2e);
    font-size: 13px;
}

.theme-preview-topbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--preview-border, rgba(255,255,255,0.1));
    background: var(--preview-bg-secondary, rgba(0,0,0,0.2));
}

.theme-preview-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.theme-preview-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--preview-text, rgba(255,255,255,0.7));
    margin-left: 4px;
}

.theme-preview-body {
    flex: 1;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
}

.theme-preview-section-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.theme-preview-card {
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.theme-preview-card-title {
    font-size: 13px;
    font-weight: 600;
}

.theme-preview-card-text {
    font-size: 12px;
    line-height: 1.5;
}

.theme-preview-card-hint {
    font-size: 11px;
}

.theme-preview-btn-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.theme-preview-btn {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    border: none;
    cursor: default;
}

.theme-preview-badges {
    display: flex;
    gap: 8px;
}

.theme-preview-badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.theme-preview-input {
    width: 100%;
    padding: 7px 10px;
    border-radius: 6px;
    font-size: 12px;
    border: 1px solid;
    background: transparent;
    outline: none;
    box-sizing: border-box;
}

.theme-modal-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border-primary);
    display: flex;
    justify-content: flex-start;
}

.btn-theme-delete {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--error);
    border-radius: 6px;
    color: var(--error);
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-theme-delete:hover {
    background: rgba(239, 68, 68, 0.1);
}

