/* Viewer chrome and export mode only. Slide styling lives in Tailwind classes in index.html. */
:root {
  --page: #ffffff;
  --text: #16213a;
  --muted: #4f5a70;
  --line: #dde2ea;
  --control: #7a8599;
  --hover: #f2f4f7;
  --focus: #2c63ad;
}
html, body { margin: 0; height: 100%; }
body { background: var(--page); color: var(--text); overflow: hidden; }

.viewer { position: fixed; inset: 0; display: flex; flex-direction: column; }
.stage-area { flex: 1; position: relative; min-height: 0; }
.stage { position: absolute; left: 0; top: 0; width: 1280px; height: 720px; transform-origin: 0 0; box-shadow: 0 0 0 1px var(--line); }
.stage .slide-wrap { position: absolute; left: 0; top: 0; display: none; }
.stage .slide-wrap.active { display: block; }

.bar-ui {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr auto auto auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-top: 1px solid var(--line);
  background: var(--page);
  font: 15px "Segoe UI", Calibri, Arial, sans-serif;
}
.bar-ui button {
  font: inherit;
  color: var(--text);
  background: var(--page);
  border: 1px solid var(--control);
  border-radius: 6px;
  padding: 6px 14px;
  min-height: 44px;
  cursor: pointer;
}
.bar-ui button:hover:not(:disabled) { background: var(--hover); }
.bar-ui button:disabled { color: #9aa2b1; border-color: var(--line); cursor: default; }
.bar-ui button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.bar-ui .counter { min-width: 210px; text-align: center; font-variant-numeric: tabular-nums; }
.bar-ui #btn-prev { grid-column: 2; }
.bar-ui .present { justify-self: end; }

/* Presenter view: script on top, the slide below left, controls below right. */
.script-panel { display: none; }
body.presenter .viewer {
  display: grid;
  --controls-min: 260px;
  grid-template-columns: var(--slide-w, minmax(0, 1fr)) minmax(var(--controls-min), 1fr);
  grid-template-rows: minmax(0, 0.8fr) minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
}
body.presenter .script-panel,
body.presenter .bar-ui {
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--page);
}
body.presenter .script-panel {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  padding: 16px 24px 0;
  font: 14px/1.5 "Segoe UI", Calibri, Arial, sans-serif;
}
.script-body { flex: 1; min-height: 0; overflow-y: auto; padding-bottom: 16px; }
.script-text { width: min(100%, 440px); margin: 0 auto; }
.script-body p { margin: 0 0 0.7em; }
.script-body strong { font-weight: 700; }
.script-body p.cue {color: #5d6b85; font-style: italic; font-size: 0.86em; }
body.presenter .stage-area { grid-column: 1; grid-row: 2; }
body.presenter .bar-ui {
  grid-column: 2;
  grid-row: 2;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto 1fr auto;
  gap: 12px;
  padding: 20px;
}
body.presenter .bar-ui .counter { grid-column: 1 / -1; grid-row: 1; min-width: 0; font-size: 26px; }
body.presenter .bar-ui #btn-prev { grid-column: 1; grid-row: 2; }
body.presenter .bar-ui #btn-next { grid-column: 2; grid-row: 2; }
body.presenter .bar-ui button { min-height: 56px; }
body.presenter .bar-ui .present { grid-column: 1 / -1; grid-row: 4; justify-self: stretch; }

/* Present: choose a display for the slides-only audience window. */
.present-dialog {
  width: min(460px, calc(100vw - 32px));
  padding: 20px;
  color: var(--text);
  background: var(--page);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgb(22 33 58 / 0.18);
  font: 15px/1.45 "Segoe UI", Calibri, Arial, sans-serif;
}
.present-dialog::backdrop { background: rgb(22 33 58 / 0.35); }
.present-dialog h2 { margin: 0 0 6px; font-size: 18px; }
.present-dialog p { margin: 0 0 14px; color: var(--muted); }
.present-dialog .screens { display: grid; gap: 8px; }
.present-dialog button {
  font: inherit;
  color: var(--text);
  background: var(--page);
  border: 1px solid var(--control);
  border-radius: 6px;
  padding: 8px 14px;
  min-height: 44px;
  text-align: left;
  cursor: pointer;
}
.present-dialog button:hover { background: var(--hover); }
.present-dialog button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.present-dialog .name { display: block; font-weight: 600; }
.present-dialog .detail { display: block; color: var(--muted); font-size: 14px; }
.present-dialog .actions { display: flex; justify-content: flex-end; margin-top: 14px; }

/* The audience window shows only the slide, with the presenter's pointer drawn over it. */
body.audience, body.standalone { background: #000; }
body.audience .bar-ui, body.standalone .bar-ui { display: none; }
body.audience .script-panel, body.standalone .script-panel { display: none; }
body.audience .stage { pointer-events: none; box-shadow: none; }
body.standalone .stage { box-shadow: none; }
.remote-cursor { position: absolute; left: 0; top: 0; z-index: 10; display: none; will-change: transform; }
.remote-cursor.on { display: block; }
.remote-cursor svg { display: block; filter: drop-shadow(1px 1.5px 1px rgb(0 0 0 / 0.35)); }
.remote-click {
  position: absolute;
  z-index: 9;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  border: 2px solid #2c63ad;
  border-radius: 50%;
  background: rgb(44 99 173 / 0.18);
  animation: remote-click 450ms ease-out forwards;
}
@keyframes remote-click { from { transform: scale(0.4); opacity: 1; } to { transform: scale(1.2); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  @keyframes remote-click { from { opacity: 1; } to { opacity: 0; } }
}
.audience-hint {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  margin: 0;
  padding: 8px 14px;
  border-radius: 6px;
  background: rgb(15 21 34 / 0.9);
  color: #e9edf5;
  border: 1px solid rgb(255 255 255 / 0.3);
  font: 15px "Segoe UI", Calibri, Arial, sans-serif;
}

/* deck.js swaps each clip's poster image for a native video in the browser. */
.media video { display: block; width: 100%; height: 100%; object-fit: contain; object-position: top; background: #ffffff; }
.media video:focus-visible { outline: 3px solid #7fb0ff; outline-offset: -3px; }

body.export { background: #ffffff; overflow: auto; }
body.export .viewer { position: static; display: block; }
body.export .stage { position: static; transform: none; width: auto; height: auto; box-shadow: none; }
body.export .stage .slide-wrap { position: static; display: block; }
body.export .bar-ui { display: none; }
