/* ===========================
   Tiptap Editor Styles
   =========================== */

/* Editor tabs */
.editor-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 0;
}

.editor-tab {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: #666;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.1s, border-color 0.1s;
}

.editor-tab:hover {
  color: #333;
}

.editor-tab--active {
  color: #545BFE;
  border-bottom-color: #545BFE;
}

/* Toolbar */
.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 8px;
  background: #f8f8fa;
  border: 1px solid #e0e0e0;
  border-top: none;
}

.editor-toolbar button {
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 500;
  color: #555;
  background: none;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s;
}

.editor-toolbar button:hover {
  background: #e8e8ec;
  border-color: #d0d0d0;
}

.toolbar-separator {
  width: 1px;
  height: 18px;
  background: #d0d0d0;
  margin: 0 4px;
}

/* Editor content area (Tiptap) */
.editor-content {
  border: 1px solid #e0e0e0;
  border-top: none;
  border-radius: 0 0 6px 6px;
  min-height: 300px;
  padding: 16px;
  font-size: 15px;
  line-height: 1.7;
  outline: none;
}

.editor-content:focus-within {
  border-color: #545BFE;
  box-shadow: 0 0 0 2px rgba(84, 91, 254, 0.15);
}

/* ProseMirror specific */
.editor-content .ProseMirror {
  outline: none;
  min-height: 280px;
}

.editor-content .ProseMirror p {
  margin: 0 0 12px;
}

.editor-content .ProseMirror h1,
.editor-content .ProseMirror h2,
.editor-content .ProseMirror h3 {
  margin: 20px 0 8px;
  font-weight: 600;
}

.editor-content .ProseMirror h1 { font-size: 24px; }
.editor-content .ProseMirror h2 { font-size: 20px; }
.editor-content .ProseMirror h3 { font-size: 16px; }

.editor-content .ProseMirror ul,
.editor-content .ProseMirror ol {
  padding-left: 24px;
  margin: 0 0 12px;
}

.editor-content .ProseMirror a {
  color: #545BFE;
  text-decoration: underline;
}

.editor-content .ProseMirror blockquote {
  border-left: 3px solid #d0d0d0;
  padding-left: 16px;
  margin: 12px 0;
  color: #666;
}

.editor-content .ProseMirror code {
  background: #f0f0f3;
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 13px;
}

.editor-content .ProseMirror pre {
  background: #1C1F58;
  color: #e0e0e0;
  padding: 16px;
  border-radius: 6px;
  overflow-x: auto;
}

/* HTML textarea mode */
.editor-html-textarea {
  width: 100%;
  min-height: 300px;
  padding: 16px;
  font-family: "SF Mono", "Fira Code", "Fira Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
  border: 1px solid #e0e0e0;
  border-top: none;
  border-radius: 0 0 6px 6px;
  resize: vertical;
  outline: none;
  tab-size: 2;
}

.editor-html-textarea:focus {
  border-color: #545BFE;
  box-shadow: 0 0 0 2px rgba(84, 91, 254, 0.15);
}

/* Preview mode */
.editor-preview {
  min-height: 300px;
  padding: 16px;
  border: 1px solid #e0e0e0;
  border-top: none;
  border-radius: 0 0 6px 6px;
  background: #fafafa;
  font-size: 15px;
  line-height: 1.7;
}

.editor-preview h2 { font-size: 20px; margin: 20px 0 8px; }
.editor-preview h3 { font-size: 16px; margin: 16px 0 6px; }
.editor-preview p { margin: 0 0 12px; }
.editor-preview ul, .editor-preview ol { padding-left: 24px; margin: 0 0 12px; }
.editor-preview a { color: #545BFE; }
