/* ========== XECUTE — css/03-layout-editor.css ========== */
/* Main container, editor/preview split, editor pane, resize handle */

/* ====== MAIN CONTAINER ====== */
#main-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: calc(100vh - var(--header-h) - var(--tabs-h) - var(--footer-h) - var(--statusbar-h));
  min-height: 0;
  overflow: hidden;
}

/* ====== EDITOR / PREVIEW SPLIT ====== */
#editor-preview-split {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ====== EDITOR CONTAINER ====== */
#editor-container {
  display: flex;
  flex-direction: column;
  height: 50%;
  min-height: 80px;
  background: var(--bg-secondary);
  position: bottom;
  overflow: hidden;
}

/* Editor Toolbar */
#editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--toolbar-h);
  padding: 0 8px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

#editor-lang-badge {
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent);
  background: rgba(88,166,255,0.1);
  border: 1px solid rgba(88,166,255,0.2);
  border-radius: 4px;
  padding: 2px 8px;
  letter-spacing: 0.5px;
}

.editor-toolbar-actions {
  display: flex;
  gap: 2px;
}
.editor-toolbar-actions button {
  width: 28px;
  height: 26px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 4px;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, color 0.12s;
}
.editor-toolbar-actions button:hover { background: var(--bg-hover); color: var(--text-primary); }

/* Search Replace Panel */
#searchReplacePanel {
  display: none;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  flex-wrap: wrap;
}
#searchReplacePanel.visible { display: flex; }
#searchReplacePanel input {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 12px;
  width: 160px;
  outline: none;
}
#searchReplacePanel input:focus { border-color: var(--accent); }
.search-btns { display: flex; gap: 4px; }
.search-btns button {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-hover);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background 0.12s;
}
.search-btns button:hover { background: var(--accent); color: white; border-color: var(--accent); }

/* CodeMirror overrides */
.CodeMirror {
  flex: 1;
  height: 100% !important;
  font-family: 'JetBrains Mono', 'Fira Code', monospace !important;
  font-size: 13.5px !important;
  line-height: 1.6 !important;
  background: var(--bg-secondary) !important;
}
.CodeMirror-scroll {
  overflow: auto !important;
}
.CodeMirror-gutters {
  background: var(--bg-tertiary) !important;
  border-right: 1px solid var(--border) !important;
}
.CodeMirror-linenumber { color: var(--text-muted) !important; }

/* ====== RESIZE HANDLE ====== */
#resize-handle {
  flex-shrink: 0;
  height: 8px;
  background: var(--bg-tertiary);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  cursor: ns-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  transition: background 0.15s;
  position: relative;
  z-index: 10;
}
#resize-handle:hover { background: rgba(88,166,255,0.12); }
.resize-dots { display: flex; gap: 3px; }
.resize-dots span {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-muted);
}
#resize-handle:hover .resize-dots span { background: var(--accent); }
