/* Custom styles for SimpleMDE Markdown editor */

/* Editor container */
.markdown-editor-container {
  margin-bottom: 1.5rem;
}

/* Editor wrapper */
.CodeMirror {
  border-radius: 0.5rem;
  border-color: #e5e7eb !important;
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Oxygen,
    Ubuntu,
    Cantarell,
    "Open Sans",
    "Helvetica Neue",
    sans-serif;
}

/* Editor toolbar */
.editor-toolbar {
  border-top-left-radius: 0.5rem;
  border-top-right-radius: 0.5rem;
  border-color: #e5e7eb !important;
  background-color: #f9fafb !important;
}

/* Editor toolbar buttons */
.editor-toolbar button {
  color: #4b5563 !important;
}

.editor-toolbar button:hover,
.editor-toolbar button.active {
  color: #4f46e5 !important;
  border-color: #e5e7eb !important;
  background-color: #f3f4f6 !important;
}

/* Editor content area */
.CodeMirror-scroll {
  min-height: 150px;
}

/* Preview styling */
.editor-preview,
.editor-preview-side {
  background-color: #ffffff;
  border-color: #e5e7eb !important;
  padding: 1rem;
}

.editor-preview-side {
  border-left: 1px solid #e5e7eb !important;
}

/* Preview content styling */
.editor-preview h1,
.editor-preview-side h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  color: #111827;
}

.editor-preview h2,
.editor-preview-side h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: #111827;
}

.editor-preview h3,
.editor-preview-side h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-top: 1.25rem;
  margin-bottom: 0.75rem;
  color: #111827;
}

.editor-preview p,
.editor-preview-side p {
  margin-bottom: 1rem;
  line-height: 1.6;
}

.editor-preview code,
.editor-preview-side code {
  color: #4f46e5;
  background-color: #f3f4f6;
  padding: 0.2rem 0.4rem;
  border-radius: 0.25rem;
  font-family: "Fira Code", monospace;
  font-size: 0.875rem;
}

.editor-preview pre,
.editor-preview-side pre {
  background-color: #1f2937;
  color: #e5e7eb;
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  overflow-x: auto;
}

.editor-preview pre code,
.editor-preview-side pre code {
  color: inherit;
  background-color: transparent;
  padding: 0;
}

.editor-preview blockquote,
.editor-preview-side blockquote {
  border-left: 4px solid #e5e7eb;
  padding-left: 1rem;
  color: #4b5563;
  font-style: italic;
  margin-left: 0;
  margin-right: 0;
}

.editor-preview ul,
.editor-preview ol,
.editor-preview-side ul,
.editor-preview-side ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.editor-preview ul li,
.editor-preview-side ul li {
  list-style-type: disc;
  margin-bottom: 0.5rem;
}

.editor-preview ol li,
.editor-preview-side ol li {
  list-style-type: decimal;
  margin-bottom: 0.5rem;
}

.editor-preview table,
.editor-preview-side table {
  border-collapse: collapse;
  width: 100%;
  margin-bottom: 1rem;
}

.editor-preview table th,
.editor-preview table td,
.editor-preview-side table th,
.editor-preview-side table td {
  border: 1px solid #e5e7eb;
  padding: 0.5rem;
}

.editor-preview table th,
.editor-preview-side table th {
  background-color: #f9fafb;
  font-weight: 600;
}

/* Status bar */
.editor-statusbar {
  color: #6b7280;
  font-size: 0.75rem;
  padding: 0.5rem;
  background-color: #f9fafb;
  border-bottom-left-radius: 0.5rem;
  border-bottom-right-radius: 0.5rem;
  border: 1px solid #e5e7eb;
  border-top: none;
}

/* Error state */
.markdown-editor-error {
  color: #dc2626;
  font-size: 0.875rem;
  margin-top: 0.25rem;
  font-weight: 500;
}

.CodeMirror.border-red-500 {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 1px #ef4444;
}

.CodeMirror.border-red-500 + .editor-statusbar {
  border-color: #ef4444 !important;
}
