/* Editor Panel Styles */

/* Dark theme tokens — shared by editor and AI chat panels */

.editor-panel {
    --ed-bg: #1e1e1e;
    --ed-bg-raised: #252526;
    --ed-bg-card: #2d2d30;
    --ed-bg-input: #3c3c3c;
    --ed-border: #1e1e1e;
    --ed-border-input: #555;
    --ed-accent: #007acc;
    --ed-accent-hover: #006bb3;
    --ed-text: #eee;
    --ed-text-secondary: #ccc;
    --ed-text-muted: #999;
    --ed-text-dim: #888;
    --ed-text-inactive: #969696;
}

.editor-panel {
    position: fixed;
    top: 0;
    right: -600px;
    width: 600px;
    height: 100vh;
    background: #1e1e1e;
    box-shadow: -4px 0 12px rgba(0,0,0,0.15);
    z-index: 999;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.editor-panel.open {
    right: 0;
}

/* VSCode-Style Header */

.editor-header {
    background: var(--ed-bg-raised);
    border-bottom: 1px solid var(--ed-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 35px;
    padding: 0;
}

.editor-header .close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: #cccccc;
    padding: 0;
    width: 35px;
    height: 35px;
    display: none;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.editor-header .close:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* VSCode-Style Tabs */

.editor-tabs {
    display: flex;
    height: 100%;
    gap: 0;
}

.editor-tab {
    display: flex;
    align-items: center;
    padding: 0 12px;
    min-width: 120px;
    height: 100%;
    background: var(--ed-bg-card);
    border-right: 1px solid var(--ed-border);
    color: var(--ed-text-inactive);
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s, color 0.2s;
    user-select: none;
}

.editor-tab:hover {
    color: #ffffff;
}

.editor-tab.active {
    background: var(--ed-bg);
    color: #ffffff;
    border-bottom: 1px solid var(--ed-accent);
}

.editor-tab .tab-label {
    white-space: nowrap;
}

/* Mobile: Show close button */

@media (max-width: 768px) {
    .editor-header .close.mobile-only {
        display: flex;
    }
}

/* Editor Container */

.editor-container {
    flex: 1;
    overflow: hidden;
}

/* Error Display */

.editor-error {
    padding: var(--spacing-md) var(--spacing-lg);
    background: #fef2f2;
    border-top: 1px solid #fecaca;
    color: #991b1b;
    font-size: 0.875rem;
    font-family: 'Courier New', monospace;
    display: none;
    white-space: pre-wrap;
    max-height: 150px;
    overflow-y: auto;
}

.editor-error.show {
    display: block;
}

.editor-error.success {
    background: #f0fdf4;
    border-top-color: #bbf7d0;
    color: #166534;
}
