/* ——— Интерактивный плеер презентаций .pptx, живая рисовалка Zoom и пульт /teacher/present ——— */

/* Вписанный по пропорциям холст слайда (единая геометрия на любом экране) */
.slide-stage-host {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.slide-fitted-box {
  position: relative;
  background: #FFFFFF;
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.08);
  overflow: hidden;
  user-select: none;
}

.slide-content-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.slide-overlay-slot {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}

.slide-raster-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.slide-empty-msg {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  color: #475569;
  font-size: 0.95rem;
  font-weight: 600;
}

/* Векторная сцена слайда .pptx */
.pptx-scene-viewport {
  position: relative;
  transform-origin: 0 0;
  overflow: hidden;
  pointer-events: none;
}

.pptx-el {
  position: absolute;
  box-sizing: border-box;
}

.pptx-shape-svg {
  position: absolute;
  left: 0;
  top: 0;
  overflow: visible;
  pointer-events: none;
}

.pptx-txbody {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  line-height: 1.24;
  word-break: break-word;
}

.pptx-para {
  margin: 0 0 3px;
}
.pptx-para:last-child {
  margin-bottom: 0;
}

.pptx-bullet {
  font-weight: 700;
}

.pptx-table {
  width: 100%;
  height: 100%;
  border-collapse: collapse;
}
.pptx-table td {
  border: 1px solid #94A3B8;
  padding: 2px 4px;
  vertical-align: middle;
}

/* Слой живой рисовалки и клетчатой сетки */
.wb-overlay-root {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.wb-overlay-root.is-drawing-active {
  pointer-events: auto;
  touch-action: none;
  cursor: crosshair;
}
.wb-overlay-root[data-tool="eraser"].is-drawing-active {
  cursor: cell;
}
.wb-overlay-root[data-tool="text"].is-drawing-active {
  cursor: text;
}

.wb-grid-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.14s ease;
  background-image:
    linear-gradient(to right, rgba(21, 100, 217, 0.15) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(21, 100, 217, 0.15) 1px, transparent 1px);
}
.wb-grid-layer.is-visible {
  opacity: 1;
}

.wb-svg-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
  pointer-events: none;
}

/* Всплывающее поле ввода текста прямо на слайде */
.wb-text-input-pop {
  position: absolute;
  z-index: 14;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  border: 1.5px solid #1564D9;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
  pointer-events: auto;
}
.wb-text-input-pop textarea {
  width: 190px;
  min-height: 30px;
  margin: 0;
  padding: 4px 6px;
  border: 1px solid #CBD8EE;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 700;
  resize: both;
}
.wb-text-ok-btn {
  width: 30px !important;
  min-width: 30px !important;
  height: 30px;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 7px;
  background: #15803D;
  color: #FFFFFF;
}

/* Компактная плавающая панель рисовалки в стиле Zoom */
.wb-toolbar {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 5px 7px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(8px);
  pointer-events: auto;
  max-width: calc(100% - 16px);
  flex-wrap: nowrap;
  white-space: nowrap;
}

.wb-sep {
  width: 1px;
  height: 20px;
  background: rgba(148, 163, 184, 0.28);
  margin: 0 2px;
  flex-shrink: 0;
}

.wb-btn {
  width: auto !important;
  min-width: 30px !important;
  height: 30px;
  margin: 0 !important;
  padding: 0 7px !important;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: #F8FAFC;
  font-size: 0.86rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex-shrink: 0;
}
.wb-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
}
.wb-btn.is-active {
  background: #1564D9;
  color: #FFFFFF;
  border-color: #60A5FA;
}
.wb-btn--danger:hover:not(:disabled) {
  background: rgba(220, 38, 38, 0.28);
  color: #FECACA;
}
.wb-mini-caret {
  font-size: 0.72rem;
  opacity: 0.8;
}
.wb-color-dot {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid #FFFFFF;
  display: inline-block;
}

.wb-pop-wrap {
  position: relative;
  display: inline-flex;
}
.wb-pop-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 165px;
  padding: 6px;
  border-radius: 12px;
  background: #FFFFFF;
  border: 1px solid #CBD8EE;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.2);
  display: flex;
  flex-direction: column;
  gap: 3px;
  z-index: 28;
}
.wb-pop-opt {
  width: 100% !important;
  margin: 0 !important;
  padding: 7px 10px !important;
  border-radius: 8px;
  background: transparent;
  color: #1E293B;
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}
.wb-pop-opt:hover {
  background: #F1F6FE;
}
.wb-pop-opt.is-sel {
  background: #EFF6FF;
  color: #104FAE;
}
.wb-pop-ico {
  width: 20px;
  text-align: center;
  font-size: 0.96rem;
}

.wb-pop-menu--colors {
  min-width: 196px;
  gap: 8px;
  padding: 10px;
}
.wb-swatches {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}
.wb-swatch {
  width: 24px !important;
  min-width: 24px !important;
  height: 24px;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 50%;
  border: 2px solid #FFFFFF;
  box-shadow: 0 0 0 1px #CBD5E1;
}
.wb-swatch.is-sel {
  box-shadow: 0 0 0 2.5px #1564D9;
  transform: scale(1.1);
}
.wb-sizes {
  display: flex;
  gap: 4px;
}
.wb-size-btn {
  flex: 1;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 5px 6px !important;
  border-radius: 7px;
  background: #F1F5F9;
  color: #334155;
  font-size: 0.75rem;
  font-weight: 700;
}
.wb-size-btn.is-sel {
  background: #1564D9;
  color: #FFFFFF;
}

/* ——— Выделенная страница пульта презентации /teacher/present ——— */
#screen-teacher-present {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  padding-bottom: 12px;
}
#screen-teacher-present > .app-header {
  flex: 0 0 auto;
  margin-bottom: 8px;
}

.present-layout {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#pres-lesson-select {
  min-width: 196px;
  max-width: 280px;
}

.present-control-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 12px;
  margin-bottom: 10px;
  border-radius: 14px;
  background: #FFFFFF;
  border: 1px solid #D5E0F0;
  box-shadow: var(--shadow-xs);
  z-index: 24;
}

.pres-bar-left,
.pres-bar-center,
.pres-bar-right {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.pres-nav-btn {
  width: auto !important;
  height: 36px;
  margin: 0 !important;
  padding: 0 14px !important;
  border-radius: 9px;
  background: #F1F6FE;
  color: #173B7B;
  border: 1px solid #C8D7EE;
  font-size: 0.88rem;
  font-weight: 800;
}
.pres-nav-btn:hover:not(:disabled) {
  background: #E2EEFD;
  color: #104FAE;
}
.pres-nav-btn--next {
  background: #1564D9;
  color: #FFFFFF;
  border-color: transparent;
}
.pres-nav-btn--next:hover:not(:disabled) {
  background: #104FAE;
  color: #FFFFFF;
}

.pres-slide-counter {
  font-size: 0.88rem;
  font-weight: 700;
  color: #3E526E;
  padding: 0 4px;
  font-variant-numeric: tabular-nums;
}
.pres-slide-counter b {
  color: #173B7B;
  font-size: 0.98rem;
}

.pres-step-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #F1F6FE;
  border: 1px solid #D5E0F0;
  flex-wrap: wrap;
}
.pres-step-summary {
  font-size: 0.75rem;
  font-weight: 800;
  color: #104FAE;
  margin-right: 4px;
  font-variant-numeric: tabular-nums;
}
.pres-step-dot {
  width: auto !important;
  min-width: 24px !important;
  height: 22px;
  margin: 0 !important;
  padding: 0 6px !important;
  border-radius: 999px;
  background: #FFFFFF;
  color: #3E526E;
  border: 1px solid #CBD8EE;
  font-size: 0.73rem;
  font-weight: 800;
}
.pres-step-dot.is-done {
  background: #DCFCE7;
  color: #15803D;
  border-color: #86EFAC;
}
.pres-step-dot.is-current {
  background: #1564D9;
  color: #FFFFFF;
  border-color: #1564D9;
}
.pres-no-anim-tag {
  font-size: 0.75rem;
  color: #4A5D78;
  font-weight: 600;
}

/* Выдача маркера одному ученику */
.pres-marker-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.pres-marker-active-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 6px 0 12px;
  border-radius: 999px;
  background: #FEF3C7;
  border: 1px solid #FCD34D;
  color: #92400E;
  font-size: 0.82rem;
}
.pres-marker-revoke-btn {
  width: auto !important;
  height: 26px;
  margin: 0 !important;
  padding: 0 9px !important;
  border-radius: 999px;
  background: #FFFFFF;
  color: #B91C1C;
  border: 1px solid #FCA5A5;
  font-size: 0.75rem;
  font-weight: 800;
}
.pres-marker-revoke-btn:hover {
  background: #FEF2F2;
}
.pres-marker-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(340px, calc(100vw - 24px));
  padding: 12px;
  border-radius: 14px;
  background: #FFFFFF;
  border: 1px solid #CBD8EE;
  box-shadow: var(--shadow-lg);
  z-index: 38;
}
.pres-marker-pop-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 8px;
  color: #173B7B;
  font-size: 0.88rem;
}
.pres-marker-list {
  max-height: 240px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
}
.pres-marker-student-btn {
  width: 100% !important;
  margin: 0 !important;
  padding: 7px 10px !important;
  border-radius: 9px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  color: #173B7B;
  font-size: 0.84rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.pres-marker-student-btn:hover {
  background: #EFF6FF;
  border-color: #93C5FD;
}
.pres-marker-student-btn.is-selected {
  background: #FEF3C7;
  border-color: #F59E0B;
  color: #92400E;
}
.pres-marker-st-left {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}
.pres-marker-st-act {
  font-size: 0.75rem;
  color: #104FAE;
  white-space: nowrap;
}

/* Основная сцена студии: холст 80% + правая колонка 260px */
.present-workspace {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 264px;
  gap: 12px;
  align-items: stretch;
}
.present-workspace.is-sidebar-collapsed {
  grid-template-columns: minmax(0, 1fr);
}
.present-workspace.is-sidebar-collapsed .present-sidebar {
  display: none;
}
.present-workspace:fullscreen {
  background: #0F172A;
  padding: 12px;
}
.present-workspace:fullscreen .present-stage-wrap {
  background: #0F172A;
  border-color: rgba(148, 163, 184, 0.25);
}

.present-stage-wrap {
  position: relative;
  min-width: 0;
  min-height: 0;
  background: #E8EFFA;
  border: 1px solid #CBD8EE;
  border-radius: 16px;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  overflow: hidden;
}

.present-stage-canvas {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.present-sidebar {
  min-height: 0;
  overflow-y: auto;
  background: #FFFFFF;
  border: 1px solid #D5E0F0;
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pres-side-label {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #4A5D78;
  margin-bottom: 6px;
}

.pres-next-step-card {
  width: 100% !important;
  margin: 0 !important;
  padding: 10px 12px !important;
  border-radius: 10px;
  background: #EFF6FF;
  border: 1.5px solid #93C5FD;
  color: #104FAE;
  font-size: 0.83rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pres-next-slide-card {
  width: 100% !important;
  margin: 0 !important;
  padding: 6px !important;
  border-radius: 10px;
  background: #F8FAFC;
  border: 1.5px solid #D5E0F0;
  color: #173B7B;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.pres-next-slide-card:hover {
  border-color: #1564D9;
  background: #F0F6FF;
}
.pres-next-slide-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #FFFFFF;
  border-radius: 6px;
}
.pres-next-slide-title {
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.25;
}

.pres-deck-section {
  border-top: 1px solid #E8EFF9;
  padding-top: 10px;
  flex: 1 1 auto;
}
.pres-deck-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pres-deck-item {
  width: 100% !important;
  margin: 0 !important;
  padding: 6px !important;
  border-radius: 10px;
  background: #F8FAFC;
  border: 1.5px solid #E2E8F0;
  color: #173B7B;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pres-deck-item:hover {
  border-color: #93C5FD;
  background: #F0F6FF;
}
.pres-deck-item.is-current {
  border-color: #1564D9;
  background: #EFF6FF;
}
.pres-deck-item.is-live {
  border-color: #15803D;
  background: #F0FDF4;
}
.pres-deck-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pres-deck-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.pres-deck-live-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  padding: 1px 6px;
  border-radius: 5px;
  background: #15803D;
  color: #FFFFFF;
  font-size: 0.72rem;
  font-weight: 800;
}
.pres-deck-steps-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(15, 23, 42, 0.78);
  color: #FFFFFF;
  font-size: 0.72rem;
  font-weight: 700;
}
.pres-deck-caption {
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 960px) {
  #screen-teacher-present {
    height: auto;
    max-height: none;
    overflow: visible;
  }
  .present-workspace {
    grid-template-columns: 1fr;
  }
  .present-stage-wrap {
    min-height: 56vh;
  }
}

/* Компактная плашка эфира слайда на главной странице /teacher (вместо старого громоздкого блока) */
.teacher-live-slide-strip-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 9px 14px;
  border-radius: 12px;
  background: #EFF6FF;
  border: 1.5px solid #93C5FD;
  color: #173B7B;
}
.teacher-live-slide-info,
.teacher-live-slide-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.9rem;
}
.teacher-live-slide-actions,
.teacher-live-slide-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* Плашка ученика, когда ему выдан маркер на уроке */
.student-draw-granted-bar,
.student-draw-banner {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  margin-bottom: 6px;
  border-radius: 10px;
  background: #FEF3C7;
  border: 1px solid #FCD34D;
  color: #92400E;
  font-size: 0.86rem;
  font-weight: 700;
}
.student-draw-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #D97706;
  flex-shrink: 0;
}

/* Загрузка .pptx в конструкторе /teacher/editor */
.ed-pptx-box {
  margin-bottom: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #EFF6FF;
  border: 1.5px solid #93C5FD;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.ed-pptx-title {
  font-size: 0.96rem;
  font-weight: 800;
  color: #173B7B;
  margin-bottom: 2px;
}
.ed-pptx-sub {
  font-size: 0.83rem;
  color: #3E526E;
}
.ed-pptx-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ed-slide-badges {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.ed-pptx-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  background: #DBEAFE;
  color: #104FAE;
  font-size: 0.72rem;
  font-weight: 800;
}
.ed-anim-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  background: #FEF3C7;
  color: #92400E;
  font-size: 0.72rem;
  font-weight: 800;
}
