/* azimuth_center/static/css/tiptap-editor.css */

/* 🌗 Обёртка редактора */
#editor-wrapper {
  background-color: var(--editor-bg);
  color: var(--editor-color);
  border: 1px solid var(--editor-border);
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  min-height: 500px;
  max-height: 800px;
}

/* ✍️ Контейнер редактора */
#editor {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

/* 👨‍💻 Область редактирования tiptap */
.tiptap.ProseMirror {
  flex-grow: 1;
  min-height: 100%;
  width: 100%;
  outline: none;
  border: none;
  background: transparent;
  padding: 0;
  box-sizing: border-box;
  word-wrap: break-word;
  white-space: pre-wrap;
  overflow-y: auto;
}

/* 🕳 Плейсхолдер */
.tiptap.ProseMirror:empty::before {
  content: attr(data-placeholder);
  color: var(--editor-placeholder, #888);
  pointer-events: none;
  height: 0;
  display: block;
}

/* 📄 Контент */
.tiptap p {
  margin-bottom: 1rem;
}

.tiptap h1 {
  font-size: 1.8rem;
  font-weight: 600;
  margin: 1.2rem 0;
}

.tiptap h2 {
  font-size: 1.4rem;
  font-weight: 500;
  margin: 1rem 0;
}

.tiptap blockquote {
  border-left: 4px solid #ccc;
  padding-left: 1rem;
  color: #666;
  font-style: italic;
  margin: 1.2rem 0;
  background: rgba(200, 200, 200, 0.1);
  border-radius: 4px;
}

/* 🤖 AI-блок */
ai-block {
  background: var(--editor-ai-bg);
  display: block;
  padding: 10px;
  margin: 10px 0;
  border: 1px dashed #888;
  border-radius: 4px;
  text-align: center;
}

/* 🎛 Панель инструментов */
.tiptap-toolbar {
  background: var(--editor-toolbar-bg);
  border-bottom: 1px solid var(--editor-toolbar-border);
  padding: 0.5rem;
}

/* 🔘 Кнопки */
button {
  border: none;
  padding: 8px 14px;
  margin: 6px;
  background: #062c66a0;
  color: white;
  border-radius: 6px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

button:hover {
  background: #1e90ff;
}

/* 🌙 Тёмная тема */
body.dark {
  --editor-bg: #1f1f1f;
  --editor-color: #f5f5f5;
  --editor-border: rgba(255, 255, 255, 0.12);
  --editor-toolbar-bg: #2a2a2a;
  --editor-toolbar-border: #444;
  --editor-placeholder: #aaa;
  --editor-ai-bg: #2d2d2d;
}

/* ☀️ Светлая тема */
body:not(.dark) {
  --editor-bg: #ffffff;
  --editor-color: #222222;
  --editor-border: rgba(0, 0, 0, 0.12);
  --editor-toolbar-bg: #f9f9f9;
  --editor-toolbar-border: #ddd;
  --editor-placeholder: #888;
  --editor-ai-bg: #f0f0f0;
}
