/* ==========================================
   Armature — Editor Surface (v0.25.0)
   ==========================================
   Replaces editor-mode.css for the pane-based editor.
   Covers: topbar, bootstrap, and component-specific
   overrides within the editor context.
   ========================================== */

/* ── Surface Shell ─────────────────────────── */

.ext-editor {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    background: var(--bg, #0e0e10);
}

/* ── Topbar ────────────────────────────────── */

.ext-editor-topbar {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: 0 var(--sp-3);
    height: 40px;
    flex-shrink: 0;
    background: var(--bg-secondary, #151517);
    border-bottom: 1px solid var(--border, #2a2a2e);
    font-size: 13px;
    position: relative;
    z-index: 20;
}

.ext-editor-topbar-back {
    display: flex;
    align-items: center;
    gap: var(--sp-1);
    color: var(--text-3, #777);
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    padding: var(--sp-1) var(--sp-2);
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

.ext-editor-topbar-back:hover {
    color: var(--text, #eee);
    background: var(--bg-hover);
}

.ext-editor-topbar-sep {
    width: 1px;
    height: 18px;
    background: var(--border, #2a2a2e);
}

.ext-editor-topbar-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text, #eee);
}

/* ── Workspace Selector ────────────────────── */

.ext-editor-ws-selector {
    position: relative;
}

.ext-editor-ws-selector-btn {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    background: none;
    border: 1px solid transparent;
    color: var(--text, #eee);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    padding: var(--sp-1) var(--sp-2);
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.ext-editor-ws-selector-btn:hover {
    border-color: var(--border, #2a2a2e);
    background: var(--bg-hover);
}

.ext-editor-ws-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: var(--sp-1);
    background: var(--bg-secondary, #1a1a1e);
    border: 1px solid var(--border, #2a2a2e);
    border-radius: 8px;
    min-width: 220px;
    max-height: 320px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    padding: var(--sp-1) 0;
}

.ext-editor-ws-dropdown.open { display: block; }

.ext-editor-ws-list {
    max-height: 240px;
    overflow-y: auto;
}

.ext-editor-ws-dropdown-item {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    color: var(--text, #eee);
    font-size: 12px;
    font-family: inherit;
    padding: var(--sp-2) var(--sp-3);
    cursor: pointer;
    transition: background 0.1s;
}

.ext-editor-ws-dropdown-item:hover {
    background: var(--bg-hover);
}

.ext-editor-ws-dropdown-item.active {
    color: var(--accent, #b38a4e);
    font-weight: 600;
}

.ext-editor-ws-dropdown-divider {
    height: 1px;
    background: var(--border, #2a2a2e);
    margin: var(--sp-1) 0;
}

.ext-editor-ws-new {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    color: var(--accent, #b38a4e);
}

.ext-editor-topbar-branch {
    display: flex;
    align-items: center;
    gap: var(--sp-1);
    background: var(--purple-dim, rgba(160, 120, 255, 0.1));
    padding: 2px var(--sp-2);
    border-radius: 4px;
}

.ext-editor-topbar-branch-text {
    font-size: 11px;
    font-weight: 600;
    color: var(--purple, #a078ff);
    font-family: var(--mono, 'SF Mono', monospace);
}

/* ── Body ──────────────────────────────────── */

.ext-editor-body {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* ── Bootstrap (no workspace) ──────────────── */

.ext-editor-bootstrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ext-editor-bootstrap-card {
    text-align: center;
    padding: var(--sp-10);
    background: var(--bg-secondary, #151517);
    border: 1px solid var(--border, #2a2a2e);
    border-radius: 12px;
    max-width: 360px;
}

.ext-editor-bootstrap-input {
    width: 100%;
    padding: var(--sp-2) var(--sp-3);
    background: var(--bg, #0e0e10);
    border: 1px solid var(--border, #2a2a2e);
    border-radius: 6px;
    color: var(--text, #eee);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    margin-bottom: var(--sp-3);
    box-sizing: border-box;
}

.ext-editor-bootstrap-input:focus {
    border-color: var(--accent, #b38a4e);
}

.ext-editor-bootstrap-btn {
    width: 100%;
    padding: var(--sp-3) var(--sp-4);
    background: var(--accent, #b38a4e);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.15s;
}

.ext-editor-bootstrap-btn:hover { opacity: 0.9; }
.ext-editor-bootstrap-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Workspace list in bootstrap */
.ext-editor-bootstrap-ws-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: var(--sp-3) var(--sp-3);
    background: var(--bg, #0e0e10);
    border: 1px solid var(--border, #2a2a2e);
    border-radius: 6px;
    color: var(--text, #eee);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    margin-bottom: var(--sp-2);
    text-align: left;
}

.ext-editor-bootstrap-ws-item:hover {
    border-color: var(--accent, #b38a4e);
    background: var(--bg-hover);
}

.ext-editor-bootstrap-ws-name {
    font-weight: 600;
}

.ext-editor-bootstrap-ws-date {
    font-size: 11px;
    color: var(--text-3, #777);
}

/* ── FileTree overrides (in editor context) ── */

.ext-editor .file-tree {
    height: 100%;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border, #2a2a2e);
}

.ext-editor .file-tree-header {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-2) var(--sp-3);
    border-bottom: 1px solid var(--border, #2a2a2e);
}

.ext-editor .file-tree-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-2, #999);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    flex: 1;
}

.ext-editor .file-tree-items {
    flex: 1;
    overflow-y: auto;
    padding: var(--sp-1) 0;
}

.ext-editor .file-tree-row {
    display: flex;
    align-items: center;
    gap: var(--sp-1);
    padding: 3px var(--sp-2);
    cursor: pointer;
    font-size: 12px;
    color: var(--text-2, #999);
    transition: background 0.1s;
}

.ext-editor .file-tree-row:hover {
    background: var(--bg-hover);
}

.ext-editor .file-tree-row.active {
    background: var(--accent-dim, rgba(179, 138, 78, 0.15));
    color: var(--text, #eee);
}

.ext-editor .file-tree-arrow {
    width: 12px;
    font-size: 10px;
    color: var(--text-3, #555);
    text-align: center;
}

.ext-editor .file-tree-icon {
    font-size: 13px;
    width: 18px;
    text-align: center;
}

.ext-editor .file-tree-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Git status indicators */
.ext-editor .file-tree-row.git-modified .file-tree-name { color: var(--warning, #e5a842); }
.ext-editor .file-tree-row.git-added .file-tree-name { color: var(--success, #4caf50); }
.ext-editor .file-tree-row.git-untracked .file-tree-name { color: var(--text-3, #555); font-style: italic; }
.ext-editor .file-tree-row.git-deleted .file-tree-name { color: var(--danger, #f44336); text-decoration: line-through; }

/* Context menu */
.ext-editor-file-tree-ctx-menu {
    position: fixed;
    background: var(--bg-secondary, #1a1a1e);
    border: 1px solid var(--border, #2a2a2e);
    border-radius: 6px;
    padding: var(--sp-1) 0;
    min-width: 120px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.ext-editor-file-tree-ctx-item {
    padding: var(--sp-2) var(--sp-3);
    font-size: 12px;
    color: var(--text, #eee);
    cursor: pointer;
}

.ext-editor-file-tree-ctx-item:hover {
    background: var(--bg-hover);
}

/* ── CodeEditor overrides ──────────────────── */

.ext-editor .code-editor {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.ext-editor .code-editor-tabs {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--bg-secondary, #151517);
    border-bottom: 1px solid var(--border, #2a2a2e);
    height: 32px;
    overflow-x: auto;
    flex-shrink: 0;
}

.ext-editor .code-editor-tabs::-webkit-scrollbar { height: 0; }

.ext-editor .code-editor-tab {
    display: flex;
    align-items: center;
    gap: var(--sp-1);
    padding: 0 var(--sp-3);
    height: 100%;
    font-size: 12px;
    color: var(--text-3, #777);
    cursor: pointer;
    border-right: 1px solid var(--border, #2a2a2e);
    transition: background 0.1s;
    white-space: nowrap;
}

.ext-editor .code-editor-tab:hover { background: var(--bg-hover); }
.ext-editor .code-editor-tab.active { color: var(--text, #eee); background: var(--bg, #0e0e10); }
.ext-editor .code-editor-tab.modified .code-editor-tab-modified { color: var(--warning, #e5a842); }

.ext-editor .code-editor-tab-icon { font-size: 12px; }
.ext-editor .code-editor-tab-modified { font-size: 10px; color: var(--text-3); }

.ext-editor .code-editor-tab-close {
    background: none;
    border: none;
    color: var(--text-3, #555);
    font-size: 12px;
    cursor: pointer;
    padding: 0 2px;
    margin-left: var(--sp-1);
    border-radius: 2px;
    line-height: 1;
}

.ext-editor .code-editor-tab-close:hover {
    background: var(--danger-dim, rgba(244, 67, 54, 0.15));
    color: var(--danger, #f44336);
}

.ext-editor .code-editor-content {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    position: relative;
}

.ext-editor .code-editor-welcome {
    height: 100%;
}

.ext-editor .code-editor-cm-wrap {
    height: 100%;
    overflow: auto;
}

.ext-editor .code-editor-cm-wrap .cm-editor {
    height: 100%;
}

.ext-editor .code-editor-statusbar {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    padding: 0 var(--sp-3);
    height: 24px;
    flex-shrink: 0;
    background: var(--bg-secondary, #151517);
    border-top: 1px solid var(--border, #2a2a2e);
    font-size: 11px;
    color: var(--text-3, #777);
    font-family: var(--mono, 'SF Mono', monospace);
}

.ext-editor .code-editor-textarea-fallback {
    width: 100%;
    height: 100%;
    background: var(--bg, #0e0e10);
    color: var(--text, #eee);
    border: none;
    padding: var(--sp-3);
    font-family: var(--mono, 'SF Mono', monospace);
    font-size: 13px;
    resize: none;
    outline: none;
    box-sizing: border-box;
}

/* ── Tabbed assist pane overrides ──────────── */

.ext-editor .pane-tabbed {
    border-left: 1px solid var(--border, #2a2a2e);
}

/* ChatPane in editor tabbed pane */
.ext-editor .chat-pane {
    position: absolute;
    inset: 0;
}

/* Notes in editor pane */
.ext-editor .ext-notes-editor {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ext-editor .ext-notes-editor-list-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ext-editor .ext-notes-list {
    flex: 1;
    overflow-y: auto;
}

/* Compact notes toolbar for narrow pane */
.ext-editor .ext-notes-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-1);
    padding: var(--sp-2) var(--sp-2);
    border-bottom: 1px solid var(--border, #2a2a2e);
}

.ext-editor .ext-notes-toolbar .sw-btn--sm {
    font-size: 11px;
    padding: 3px var(--sp-2);
}

.ext-editor .ext-notes-search-row {
    padding: var(--sp-1) var(--sp-2);
}

.ext-editor .ext-notes-filter-row {
    padding: 2px var(--sp-2) var(--sp-1);
    display: flex;
    gap: var(--sp-1);
}

.ext-editor .ext-notes-filter-select {
    font-size: 11px;
    flex: 1;
    min-width: 0;
}
