/* CodeEditor component - CodeMirror 6 integration */

.code-editor {
    height: 100%;
    overflow: hidden;
}

.code-editor .cm-editor {
    height: 100%;
    outline: none;
}

.code-editor .cm-scroller {
    overflow: auto;
    font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
}

/* Text and cursor colors from syntax variables */
.code-editor .cm-editor {
    color: var(--syntax-text);
}

.code-editor .cm-content {
    caret-color: var(--syntax-key);
}

.code-editor .cm-cursor {
    border-left-color: var(--syntax-key);
}

/* Remove default focus outline - we handle it via the container */
.code-editor .cm-editor.cm-focused {
    outline: none;
}

/* Search panel */
.code-editor .cm-panel {
    font-size: 0.8125rem;
}

.code-editor .cm-panel input,
.code-editor .cm-panel button {
    font-size: 0.8125rem;
}

/* DiffEditor component - CodeMirror MergeView */

.diff-editor {
    height: 100%;
    overflow: hidden;
}

.diff-editor .cm-mergeView {
    height: 100%;
}

.diff-editor .cm-mergeView > div {
    height: 100%;
}

.diff-editor .cm-editor {
    height: 100%;
    outline: none;
    color: var(--syntax-text);
}

.diff-editor .cm-editor.cm-focused {
    outline: none;
}

.diff-editor .cm-scroller {
    overflow: auto;
    font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
}

.diff-editor .cm-content {
    caret-color: var(--syntax-key);
}

/* Change highlighting */
.diff-editor .cm-changedLine {
    background-color: rgba(234, 179, 8, 0.06);
}

.diff-editor .cm-deletedChunk,
.diff-editor .cm-changedText.del {
    background-color: rgba(239, 68, 68, 0.15);
}

.diff-editor .cm-insertedLine,
.diff-editor .cm-changedText.ins {
    background-color: rgba(34, 197, 94, 0.15);
}

/* Collapsed unchanged regions */
.diff-editor .cm-collapsedLines {
    color: var(--color-text-muted);
    font-size: 0.6875rem;
    padding: 2px 12px;
    cursor: pointer;
}

/* Gap between panels */
.diff-editor .cm-mergeViewGutter {
    background: var(--color-border-default);
    width: 1px;
}
