/* ─────────────────────────────────────────────────────────────
   editor.css — стили визуального редактора презентаций
   ───────────────────────────────────────────────────────────── */

/* Floating toolbar — кнопка включения */
#vx-trigger {
  position: fixed; top: 16px; right: 16px;
  z-index: 2147483646;
  background: #15171A; color: #fff;
  border: 0; border-radius: 999px;
  padding: 10px 16px;
  font: 600 12px/1 -apple-system, sans-serif;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  display: flex; align-items: center; gap: 6px;
}
#vx-trigger:hover { background: #2A2D33; }
#vx-trigger.active { background: #FF5A1F; }
/* Когда открыт менеджер слайдов — скрываем кнопку «Дизайн», чтобы она
   не перекрывала «×» закрытия (обе fixed top-right). */
body.sm-open #vx-trigger { display: none; }

/* Sidebar inspector */
#vx-inspector {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 280px;
  background: #15171A; color: #fff;
  z-index: 2147483645;
  font: 13px/1.4 -apple-system, BlinkMacSystemFont, sans-serif;
  overflow-y: auto;
  padding: 60px 16px 24px;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  border-left: 1px solid rgba(255,255,255,0.08);
}
body.vx-on #vx-inspector { transform: translateX(0); }

/* Сжимаем сцену слайдов под инспектор: deck-stage скейлится по своему .canvas
   через transform — мы уменьшаем доступную ширину, его _fit() пересчитает scale.
   Транзишн на width даёт плавную анимацию синхронно с инспектором. */
deck-stage {
  transition: width 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
body.vx-on deck-stage {
  width: calc(100vw - 280px) !important;
}
#vx-inspector h4 {
  margin: 16px 0 8px; font: 700 11px/1 "JetBrains Mono", monospace;
  letter-spacing: 0.08em; text-transform: uppercase; color: #FF5A1F;
}
#vx-inspector .row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 6px;
}
#vx-inspector label {
  display: flex; flex-direction: column; gap: 3px;
  font-size: 10px; color: #A8ABB2; letter-spacing: 0.04em;
  text-transform: uppercase;
}
#vx-inspector input, #vx-inspector select {
  background: #0F1115; border: 1px solid rgba(255,255,255,0.08);
  color: #fff; padding: 6px 8px; border-radius: 6px;
  font: 12px -apple-system, sans-serif;
}
#vx-inspector input:focus, #vx-inspector select:focus {
  outline: 1px solid #FF5A1F;
}
#vx-inspector .empty {
  color: #6E7178; font-size: 12px; margin-top: 40px; text-align: center;
}
#vx-inspector .info-pill {
  display: inline-block; padding: 4px 8px; background: rgba(255,255,255,0.05);
  border-radius: 4px; font: 10px "JetBrains Mono", monospace; color: #A8ABB2;
  margin-bottom: 12px;
}
#vx-inspector .swatch {
  display: inline-block; width: 16px; height: 16px; border-radius: 3px;
  border: 1px solid rgba(255,255,255,0.15); vertical-align: middle; margin-right: 6px;
}
#vx-inspector hr {
  border: 0; border-top: 1px solid rgba(255,255,255,0.08); margin: 14px 0;
}
#vx-inspector .vx-revert-btn {
  display: block; width: 100%;
  padding: 8px 12px; margin-bottom: 12px;
  background: #FF5A1F; color: #fff;
  border: 0; border-radius: 6px;
  font: 500 12px -apple-system, sans-serif;
  cursor: pointer;
}
#vx-inspector .vx-revert-btn:hover { background: #C53D0F; }

/* Когда редактор включён — прячем стандартный toolbar */
body.vx-on #edit-toolbar { display: none !important; }

/* Selection box и hover-outline */
.vx-hover {
  outline: 1px dashed rgba(255,90,31,0.55);
  outline-offset: 1px;
}
.vx-selected {
  outline: 2px solid #FF5A1F !important;
  outline-offset: 1px;
}

/* Resize-хэндлы */
.vx-handle {
  position: absolute;
  width: 10px; height: 10px;
  background: #fff;
  border: 2px solid #FF5A1F;
  border-radius: 2px;
  z-index: 2147483640;
  pointer-events: auto;
}
.vx-handle.nw { cursor: nw-resize; }
.vx-handle.ne { cursor: ne-resize; }
.vx-handle.sw { cursor: sw-resize; }
.vx-handle.se { cursor: se-resize; }
.vx-handle.n  { cursor: n-resize; border-radius: 999px; }
.vx-handle.s  { cursor: s-resize; border-radius: 999px; }
.vx-handle.w  { cursor: w-resize; border-radius: 999px; }
.vx-handle.e  { cursor: e-resize; border-radius: 999px; }

/* Alignment guides */
.vx-guide {
  position: absolute;
  background: #FF00FF;
  z-index: 2147483639;
  pointer-events: none;
  box-shadow: 0 0 4px rgba(255,0,255,0.5);
}
.vx-guide.h { height: 1px; }
.vx-guide.v { width: 1px; }

/* Marquee-выделение */
#vx-marquee {
  position: absolute; pointer-events: none;
  background: rgba(255,90,31,0.1);
  border: 1px solid #FF5A1F;
  z-index: 2147483638;
  display: none;
}

/* HUD: размеры и позиция при drag */
#vx-hud {
  position: fixed;
  background: #FF5A1F; color: #fff;
  font: 11px/1 "JetBrains Mono", monospace;
  padding: 4px 8px; border-radius: 4px;
  z-index: 2147483644;
  pointer-events: none;
  display: none;
  white-space: nowrap;
}

/* Курсоры в редакторе */
body.vx-on section[data-label] * { cursor: default; }
body.vx-on .vx-draggable { cursor: move; }
body.vx-on .vx-text-edit {
  cursor: text !important;
  outline: 2px dashed #FF5A1F !important;
  outline-offset: 2px;
  background: rgba(255,90,31,0.04);
  min-width: 20px;
  min-height: 1em;
}
body.vx-on .vx-text-edit:focus {
  outline: 2px solid #FF5A1F !important;
}

/* Toast-уведомления */
#vx-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #15171A; color: #fff; padding: 10px 16px;
  border-radius: 8px; font: 13px -apple-system, sans-serif;
  z-index: 2147483647;
  opacity: 0; transition: opacity 0.2s;
  pointer-events: none;
}
#vx-toast.show { opacity: 1; }

/* Подсветка элемента-цели при drag&drop картинки из проводника. */
.vx-img-drop-hover {
  outline: 3px dashed #FF5A1F !important;
  outline-offset: -3px;
  position: relative;
}
.vx-img-drop-hover::after {
  content: "🖼️ отпустите чтобы заменить";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(21, 23, 26, 0.92);
  color: #fff;
  padding: 8px 14px;
  border-radius: 6px;
  font: 500 13px/1.2 -apple-system, sans-serif;
  pointer-events: none;
  white-space: nowrap;
  z-index: 100;
}

/* Ссылки добавленные через редактор (a.vx-link) — наследуют стиль родителя
   + ненавязчивое подчёркивание чтобы пользователь видел что это ссылка. */
a.vx-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: currentColor;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  cursor: pointer;
}
/* В режиме редактирования клики по ссылкам перехватываем — не уводим со страницы. */
body.vx-on a.vx-link { pointer-events: none; }

@media print {
  #vx-trigger, #vx-inspector, #vx-hud, #vx-toast,
  .vx-handle, .vx-guide, #vx-marquee { display: none !important; }
  .vx-hover, .vx-selected { outline: none !important; }

  /* Chromium PDF-renderer баг: на круглых элементах (border-radius: 50%)
     box-shadow рендерится как прямоугольная чёрная тень, накрывая фон.
     Видно на play-кнопках видеокарточек и кружках с тенью. Снимаем тени
     при печати — без них элемент выглядит так же чисто.
     Также убираем большие radial/linear box-shadow, которые Chromium часто
     отрисовывает как сплошные прямоугольники даже на не-круглых блоках. */
  * { box-shadow: none !important; }
  /* Убедимся что цвета фона и градиенты сохраняются при печати */
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
}
