/* public/css/rich-editor.css */
.rich-editor-wrapper {
  display: flex;
  flex-direction: column;
  background: var(--surface, #1e293b);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
  margin-bottom: 12px;
}

.rich-editor-wrapper:focus-within {
  border-color: var(--accent, #6366f1);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.rich-editor-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 2px;
  padding: 6px 8px;
  background: rgba(15, 23, 42, 0.7);
  border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  scrollbar-width: thin;
}

.rich-editor-toolbar::-webkit-scrollbar {
  height: 4px;
}

.rich-editor-toolbar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
}

.rich-btn {
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-muted, #94a3b8);
  padding: 5px 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  transition: all 0.15s;
  user-select: none;
}

@media (max-width: 600px) {
  .rich-editor-toolbar {
    flex-wrap: wrap;
    overflow-x: visible;
    row-gap: 4px;
  }
}

.rich-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.rich-btn.active {
  background: var(--accent, #6366f1);
  color: #fff;
}

.rich-toolbar-divider {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.12);
  margin: 0 4px;
  flex-shrink: 0;
}

.rich-editor-content {
  min-height: 110px;
  max-height: 480px;
  overflow-y: auto;
  padding: 12px 14px;
  color: var(--text, #f8fafc);
  font-size: 14px;
  line-height: 1.6;
  outline: none;
  word-break: break-word;
}

.rich-editor-content:empty:before {
  content: attr(data-placeholder);
  color: var(--text-muted, #64748b);
  pointer-events: none;
  display: block;
}

.rich-editor-content h1, 
.rich-editor-content h2, 
.rich-editor-content h3 {
  margin: 8px 0 4px;
  color: #fff;
}

.rich-editor-content h1 { font-size: 1.5em; }
.rich-editor-content h2 { font-size: 1.3em; }
.rich-editor-content h3 { font-size: 1.15em; }

.rich-editor-content p {
  margin: 0 0 8px;
}

.rich-editor-content blockquote {
  border-left: 3px solid var(--accent, #6366f1);
  margin: 8px 0;
  padding: 4px 12px;
  color: var(--text-muted, #94a3b8);
  font-style: italic;
  background: rgba(99, 102, 241, 0.05);
  border-radius: 0 6px 6px 0;
}

.rich-editor-content pre, 
.rich-editor-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  color: #38bdf8;
}

.rich-editor-content code {
  padding: 2px 5px;
  font-size: 0.9em;
}

.rich-editor-content pre {
  padding: 10px 12px;
  overflow-x: auto;
  margin: 8px 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.rich-editor-content ul, 
.rich-editor-content ol {
  margin: 6px 0 8px 20px;
  padding: 0;
}

.rich-editor-content li {
  margin-bottom: 3px;
}

.rich-editor-content a {
  color: var(--accent, #6366f1);
  text-decoration: underline;
}

.rich-latex-pill {
  display: inline-block;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #c084fc;
  font-family: monospace;
  font-size: 12px;
  padding: 1px 6px;
  border-radius: 4px;
  cursor: pointer;
}
