/**
 * EasyMDE Markdown Editor - Ex Machina Theme
 *
 * Custom styling for the EasyMDE editor to match BlogFlux's Ex Machina design system.
 * Colors follow the minimalist, clinical aesthetic with subtle amber accents.
 */

/* Import EasyMDE base styles */
@import 'easymde.min.css';

/* Editor container */
.EasyMDEContainer {
  margin: 0;
}

/* Main editor area (CodeMirror) */
.EasyMDEContainer .CodeMirror {
  background-color: #11161C !important; /* surface */
  color: #A6B0BB !important; /* secondary-text */
  border: 1px solid #1D2430 !important; /* border */
  border-radius: 6px !important;
  font-family: 'JetBrains Mono', 'Courier New', monospace !important;
  font-size: 14px !important;
  line-height: 1.6 !important;
  min-height: 400px !important;
  padding: 12px !important;
}

.EasyMDEContainer .CodeMirror-scroll {
  min-height: 400px !important;
}

/* Cursor */
.EasyMDEContainer .CodeMirror-cursor {
  border-left: 2px solid #FFB703 !important; /* accent-amber */
}

/* Selection */
.EasyMDEContainer .CodeMirror-selected {
  background: rgba(255, 183, 3, 0.15) !important; /* amber with opacity */
}

/* Active line */
.EasyMDEContainer .CodeMirror-activeline-background {
  background: rgba(255, 255, 255, 0.02) !important;
}

/* Toolbar */
.EasyMDEContainer .editor-toolbar {
  background-color: #0B0F13 !important; /* base */
  border: 1px solid #1D2430 !important; /* border */
  border-bottom: none !important;
  border-radius: 6px 6px 0 0 !important;
  padding: 8px 12px !important;
  opacity: 1 !important;
}

.EasyMDEContainer .editor-toolbar::before,
.EasyMDEContainer .editor-toolbar::after {
  display: none !important; /* Remove gradient overlays */
}

/* Toolbar buttons */
.editor-toolbar button {
  background-color: transparent !important;
  color: #A6B0BB !important; /* secondary-text */
  border: none !important;
  border-radius: 4px !important;
  padding: 6px 8px !important;
  transition: all 0.2s ease !important;
  cursor: pointer !important;
}

.editor-toolbar button:hover {
  background-color: rgba(255, 183, 3, 0.1) !important; /* amber hover */
  color: #FFB703 !important; /* accent-amber */
}

.editor-toolbar button.active {
  background-color: rgba(255, 183, 3, 0.15) !important;
  color: #FFB703 !important; /* accent-amber */
}

.editor-toolbar i.separator {
  border-left: 1px solid #1D2430 !important; /* border */
  border-right: 1px solid #1D2430 !important; /* border */
  margin: 0 8px !important;
}

/* Toolbar disabled buttons */
.editor-toolbar button:disabled,
.editor-toolbar button.disabled {
  opacity: 0.3 !important;
  cursor: not-allowed !important;
}

/* Status bar */
.EasyMDEContainer .editor-statusbar {
  background-color: #0B0F13 !important; /* base */
  border: 1px solid #1D2430 !important; /* border */
  border-top: none !important;
  border-radius: 0 0 6px 6px !important;
  color: #7E8894 !important; /* muted-text */
  padding: 8px 12px !important;
  font-size: 12px !important;
}

.editor-statusbar span {
  color: #7E8894 !important; /* muted-text */
}

/* Preview styling */
.EasyMDEContainer .editor-preview,
.EasyMDEContainer .editor-preview-side {
  background-color: #11161C !important; /* surface */
  border: 1px solid #1D2430 !important; /* border */
  padding: 20px !important;
}

/* Preview content - using same styles as show page */
.editor-preview h1,
.editor-preview-side h1 {
  font-size: 2.25em !important;
  color: #E6EBF0 !important; /* primary-text */
  font-weight: 600 !important;
  letter-spacing: 0.02em !important;
  margin-top: 0 !important;
  margin-bottom: 0.8em !important;
}

.editor-preview h2,
.editor-preview-side h2 {
  font-size: 1.875em !important;
  color: #E6EBF0 !important;
  font-weight: 600 !important;
  letter-spacing: 0.02em !important;
  margin-top: 1.6em !important;
  margin-bottom: 0.8em !important;
}

.editor-preview h3,
.editor-preview-side h3 {
  font-size: 1.5em !important;
  color: #E6EBF0 !important;
  font-weight: 600 !important;
  margin-top: 1.4em !important;
  margin-bottom: 0.6em !important;
}

.editor-preview p,
.editor-preview-side p {
  color: #A6B0BB !important; /* secondary-text */
  line-height: 1.75 !important;
  margin: 1.25em 0 !important;
}

.editor-preview a,
.editor-preview-side a {
  color: #FFB703 !important; /* accent-amber */
  text-decoration: underline !important;
  text-decoration-color: rgba(255, 183, 3, 0.3) !important;
  transition: all 0.2s ease !important;
}

.editor-preview a:hover,
.editor-preview-side a:hover {
  color: #FFC933 !important;
  text-decoration-color: #FFB703 !important;
}

.editor-preview code,
.editor-preview-side code {
  background: rgba(255, 183, 3, 0.08) !important;
  color: #FFB703 !important; /* accent-amber */
  padding: 2px 6px !important;
  border-radius: 3px !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 0.9em !important;
}

.editor-preview pre,
.editor-preview-side pre {
  background: #0B0F13 !important; /* base */
  border: 1px solid #1D2430 !important; /* border */
  border-radius: 6px !important;
  padding: 16px !important;
  overflow-x: auto !important;
  margin: 1.5em 0 !important;
}

.editor-preview pre code,
.editor-preview-side pre code {
  background: transparent !important;
  color: #A6B0BB !important;
  padding: 0 !important;
  border: none !important;
}

.editor-preview blockquote,
.editor-preview-side blockquote {
  border-left: 3px solid #FFB703 !important; /* accent-amber */
  background: rgba(255, 183, 3, 0.03) !important;
  padding: 12px 20px !important;
  margin: 1.5em 0 !important;
  color: #E6EBF0 !important;
  font-style: italic !important;
}

.editor-preview ul,
.editor-preview-side ul,
.editor-preview ol,
.editor-preview-side ol {
  color: #A6B0BB !important;
  padding-left: 1.8em !important;
  margin: 1.25em 0 !important;
}

.editor-preview ul li::marker,
.editor-preview-side ul li::marker {
  color: #FFB703 !important; /* accent-amber */
}

.editor-preview ol li::marker,
.editor-preview-side ol li::marker {
  color: #FFB703 !important;
  font-weight: 600 !important;
}

/* Fullscreen mode */
.EasyMDEContainer.fullscreen {
  z-index: 9999 !important;
  background-color: #0B0F13 !important; /* base */
}

.EasyMDEContainer.fullscreen .CodeMirror {
  min-height: calc(100vh - 100px) !important;
}

/* Side-by-side mode */
.EasyMDEContainer.sided {
  display: flex !important;
}

/* Scrollbar styling for editor */
.EasyMDEContainer .CodeMirror-scroll::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.EasyMDEContainer .CodeMirror-scroll::-webkit-scrollbar-track {
  background: #0B0F13; /* base */
}

.EasyMDEContainer .CodeMirror-scroll::-webkit-scrollbar-thumb {
  background: #1D2430; /* border */
  border-radius: 4px;
}

.EasyMDEContainer .CodeMirror-scroll::-webkit-scrollbar-thumb:hover {
  background: #2D3440;
}

/* Syntax highlighting in editor */
.cm-header {
  color: #E6EBF0 !important; /* primary-text */
  font-weight: 600 !important;
}

.cm-quote {
  color: #7E8894 !important; /* muted-text */
  font-style: italic !important;
}

.cm-link {
  color: #FFB703 !important; /* accent-amber */
}

.cm-url {
  color: #2EC4B6 !important; /* info-cyan */
}

.cm-strong {
  color: #E6EBF0 !important;
  font-weight: 600 !important;
}

.cm-em {
  color: #E6EBF0 !important;
  font-style: italic !important;
}

.cm-comment {
  color: #7E8894 !important; /* muted-text */
}
