/* === SMM Platform Patches === */

/* 1. Sticky Toolbar — тулбар прилипает при прокрутке */
.editor-toolbar {
  position: sticky !important;
  top: 0 !important;
  z-index: 20 !important;
  background: var(--bg-card, #1a1a2e) !important;
}

/* 1b. Scrollable Editor — фиксированная высота с полосой прокрутки */
.editor-content {
  max-height: 60vh !important;
  overflow-y: auto !important;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}

.editor-content::-webkit-scrollbar {
  width: 6px;
}

.editor-content::-webkit-scrollbar-track {
  background: transparent;
}

.editor-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.editor-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

.editor-content .tiptap.ProseMirror {
  min-height: 200px;
}

/* 2. Emoji Picker Overflow Fix — не выходит за правую панель */
.emoji-picker {
  width: min(480px, calc(100vw - var(--sidebar-width) - 460px)) !important;
  max-width: 480px !important;
  right: auto !important;
  overflow: hidden !important;
}

/* На узких экранах ещё компактнее */
@media (max-width: 1100px) {
  .emoji-picker {
    width: min(420px, calc(100vw - 40px)) !important;
  }
}

/* Emoji grid компактнее при тесноте */
.emoji-picker .emoji-grid {
  grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)) !important;
}

.emoji-picker .emoji-cell {
  width: auto !important;
  min-width: 38px !important;
}

/* 3. Blockquote стили для редактора */
.editor-content .tiptap blockquote {
  border-left: 3px solid var(--accent);
  background: var(--accent-bg);
  padding: 10px 16px;
  margin: 8px 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
  font-style: italic;
  position: relative;
}

.editor-content .tiptap blockquote::before {
  content: '❝';
  position: absolute;
  top: -4px;
  left: -14px;
  font-size: 20px;
  color: var(--accent);
  opacity: 0.5;
  font-style: normal;
}

/* Blockquote в редакторе — класс tg-blockquote на <p> */
.tiptap.ProseMirror p.tg-blockquote {
  border-left: 3px solid #6ab3f3;
  background: rgba(106, 179, 243, 0.08);
  padding: 6px 12px;
  margin: 6px 0;
  border-radius: 0 6px 6px 0;
  color: inherit;
  font-style: normal;
  transition: border-color 0.2s, background 0.2s;
}
/* Blockquote в превью TG — точный стиль как в Telegram Desktop */
.tg-preview blockquote {
  border-left: 3px solid #6ab3f3;
  background: rgba(106, 179, 243, 0.08);
  padding: 6px 12px;
  margin: 6px 0;
  border-radius: 0 6px 6px 0;
  color: inherit;
  font-style: normal;
}

/* Blockquote в превью VK — показываем как будет выглядеть текстовый аналог */
.vk-preview blockquote {
  border-left: 3px solid #71aaeb;
  background: rgba(113, 170, 235, 0.06);
  padding: 6px 12px;
  margin: 6px 0;
  border-radius: 0 4px 4px 0;
  color: #8899a6;
  font-style: italic;
}
.vk-preview blockquote::before {
  content: '┃ ';
  color: #71aaeb;
  font-weight: bold;
}

/* Blockquote в превью MAX */
.max-preview blockquote {
  border-left: 3px solid #ff8c5a;
  background: rgba(255, 140, 90, 0.06);
  padding: 6px 12px;
  margin: 6px 0;
  border-radius: 0 4px 4px 0;
  color: #999;
  font-style: italic;
}

/* Кнопка цитаты в тулбаре */
.toolbar-btn-quote {
  font-size: 16px !important;
  font-weight: bold !important;
  font-family: Georgia, serif !important;
}

.toolbar-btn-quote.is-active {
  background: var(--accent-bg) !important;
  color: var(--accent) !important;
  border: 1px solid var(--accent-border) !important;
  box-shadow: 0 0 8px var(--accent-glow) !important;
}

/* 8. Карточки прочитанных постов */
.card.is-read {
  opacity: 0.55;
  transition: opacity .3s ease;
}
.card.is-read:hover {
  opacity: 0.85;
}

/* ─── Platform Toggles ─── */
.smm-platform-toggles {
  display: inline-flex;
  gap: 3px;
  align-items: center;
  vertical-align: middle;
  margin-left: 6px;
}

.smm-pl-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1.5px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  transition: all .25s cubic-bezier(.4,0,.2,1);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  outline: none;
  padding: 0;
}

.smm-pl-toggle:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.15);
  transform: scale(1.1);
}

.smm-pl-toggle.active {
  border-color: var(--pl-color, rgba(255,255,255,0.2));
  background: color-mix(in srgb, var(--pl-color, #fff) 15%, transparent);
  box-shadow: 0 0 10px color-mix(in srgb, var(--pl-color, #fff) 25%, transparent);
}

.smm-pl-toggle.active:hover {
  box-shadow: 0 0 16px color-mix(in srgb, var(--pl-color, #fff) 35%, transparent);
  transform: scale(1.12);
}

.smm-pl-toggle[data-platform="telegram"] { --pl-color: #2AABEE; }
.smm-pl-toggle[data-platform="vk"]       { --pl-color: #4C75A3; }
.smm-pl-toggle[data-platform="max"]      { --pl-color: #ff8c00; }

/* В ячейках календаря (месяц) — компактнее */
.smm-platform-toggles.compact {
  gap: 2px;
  margin-left: 4px;
}
.smm-platform-toggles.compact .smm-pl-toggle {
  width: 22px;
  height: 22px;
  font-size: 11px;
  border-radius: 6px;
}

/* Анимация появления */
@keyframes smmToggleFadeIn {
  from { opacity: 0; transform: scale(0.8); }
  to   { opacity: 1; transform: scale(1); }
}
.smm-pl-toggle {
  animation: smmToggleFadeIn .2s ease-out;
}

