/* Éditeur principal */
.editor-container {
	flex: 1;
	position: relative;
	min-height: 0;
	background: var(--bg-color);
}

.editor {
	height: 100%;
}

/* Règle spécifique pour l'éditeur principal */
.editor-container .CodeMirror {
	height: 100% !important;
}

/* Règle générale pour la famille de polices des éditeurs */
.CodeMirror {
	font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
	font-size: 14px;
	line-height: 1.5;
}

/* Thème clair pour CodeMirror */
body.light-theme .CodeMirror {
	background: #ffffff;
	color: #333333;
}
body.light-theme .cm-s-default .cm-keyword {color: #708;}
body.light-theme .cm-s-default .cm-atom {color: #219;}
body.light-theme .cm-s-default .cm-number {color: #164;}
body.light-theme .cm-s-default .cm-def {color: #00f;}
body.light-theme .cm-s-default .cm-variable-2 {color: #05a;}
body.light-theme .cm-s-default .cm-variable-3, body.light-theme .cm-s-default .cm-type {color: #085;}
body.light-theme .cm-s-default .cm-comment {color: #a50;}
body.light-theme .cm-s-default .cm-string {color: #a11;}
body.light-theme .cm-s-default .cm-string-2 {color: #f50;}
body.light-theme .cm-s-default .cm-meta {color: #555;}
body.light-theme .cm-s-default .cm-qualifier {color: #555;}
body.light-theme .cm-s-default .cm-builtin {color: #30a;}
body.light-theme .cm-s-default .cm-bracket {color: #997;}
body.light-theme .cm-s-default .cm-tag {color: #170;}
body.light-theme .cm-s-default .cm-attribute {color: #00c;}
body.light-theme .cm-s-default .cm-hr {color: #999;}
body.light-theme .cm-s-default .cm-link {color: #00c;}
body.light-theme .cm-s-default .cm-error {color: #f00;}
body.light-theme .CodeMirror-activeline-background {background: #e8f2ff;}
body.light-theme .CodeMirror-matchingbracket {color: #0f0;}
body.light-theme .CodeMirror-dialog {
	background-color: #f8f9fa;
	color: #212529;
	border: 1px solid #ced4da;
	box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
body.light-theme .CodeMirror-dialog input {
	background-color: #fff;
	color: #212529;
	border: 1px solid #ced4da;
}
body.light-theme .CodeMirror-dialog button {
	background-color: #007bff;
	color: #fff;
	border: none;
}
body.light-theme .CodeMirror-dialog button:hover {
	background-color: #0056b3;
}
body.light-theme .CodeMirror-search-field {
	background: var(--input-bg) !important;
	border: 1px solid var(--input-border) !important;
	color: var(--text-color) !important;
}
body.light-theme .CodeMirror-search-field:focus {
	border-color: var(--input-focus-border) !important;
}

/* Styles pour le Diff Viewer */
.diff-viewer-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: var(--bg-color);
	z-index: 10002;
	display: none;
	flex-direction: column;
}
.diff-viewer-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 10px 20px;
	background-color: var(--header-bg);
	border-bottom: 1px solid var(--header-border);
	flex-shrink: 0;
}
.diff-viewer-close {
	background: none;
	border: none;
	color: var(--text-color);
	font-size: 24px;
	cursor: pointer;
}
.diff-viewer-container {
	flex-grow: 1;
	display: flex;
	flex-direction: column;
	min-height: 0;
}
.diff-viewer-inputs {
	flex-grow: 1;
	display: flex;
	gap: 20px;
	padding: 20px;
	justify-content: space-around;
	align-items: stretch;
}
.placeholder-pane {
	flex: 1;
	border: 2px dashed var(--input-border);
	border-radius: 8px;
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	align-items: center;
	text-align: center;
	color: var(--no-files-text-color);
	transition: background 0.2s;
	padding: 15px;
}
.placeholder-pane.dragover {
	background-color: rgba(0, 122, 204, 0.1);
	border-color: var(--input-focus-border);
}
.placeholder-pane h3 {
	color: var(--text-color);
	margin-bottom: 15px;
	flex-shrink: 0;
}
.diff-input-methods {
	flex-shrink: 0;
}
.diff-input-methods p {
	margin: 0;
}
.btn-link-input {
	background: none;
	border: none;
	color: var(--input-focus-border);
	text-decoration: underline;
	cursor: pointer;
	padding: 0;
	font-size: inherit;
	font-family: inherit;
}
.or-separator {
	margin: 15px 0;
	font-weight: bold;
	color: var(--breadcrumb-separator);
	flex-shrink: 0;
}
.diff-textarea {
	width: 100%;
	flex-grow: 1;
	background-color: var(--input-bg);
	color: var(--text-color);
	border: 1px solid var(--input-border);
	border-radius: 4px;
	padding: 10px;
	font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
	font-size: 13px;
	resize: none;
}
.diff-textarea:focus {
	outline: none;
	border-color: var(--input-focus-border);
}
.diff-viewer-actions {
	flex-shrink: 0;
	padding: 15px;
	text-align: center;
	border-top: 1px solid var(--header-border);
}

/* Styles pour CodeMirror MergeView */
.CodeMirror-merge {
	border: 1px solid var(--sidebar-border);
	background-color: var(--bg-color);
}

/* Surlignage des différences */
.CodeMirror-merge-l-chunk,
.CodeMirror-merge-l-chunk-start,
.CodeMirror-merge-l-chunk-end {
  background: rgba(255, 82, 82, 0.15);
}
.CodeMirror-merge-r-chunk,
.CodeMirror-merge-r-chunk-start,
.CodeMirror-merge-r-chunk-end {
  background: rgba(77, 208, 102, 0.15);
}
.CodeMirror-merge-l-ch-diff {
  background: rgba(255, 82, 82, 0.35);
}
.CodeMirror-merge-r-ch-diff {
  background: rgba(77, 208, 102, 0.35);
}
body.light-theme .CodeMirror-merge-l-chunk,
body.light-theme .CodeMirror-merge-l-chunk-start,
body.light-theme .CodeMirror-merge-l-chunk-end {
  background: #fdeaea;
}
body.light-theme .CodeMirror-merge-r-chunk,
body.light-theme .CodeMirror-merge-r-chunk-start,
body.light-theme .CodeMirror-merge-r-chunk-end {
  background: #eafdeb;
}
body.light-theme .CodeMirror-merge-l-ch-diff {
  background: #fdd8d8;
}
body.light-theme .CodeMirror-merge-r-ch-diff {
  background: #d8fdd8;
}

/* Annuler la hauteur fixe de la bibliothèque pour laisser le JS la calculer. */
.CodeMirror-merge .CodeMirror {
	height: auto !important;
}