/* Lesmateriaal (PDF en afbeeldingen): rustig, papier op de tafel. Kleuren komen uit style.css. */

/* ---------- weergave ---------- */
.mat-view {
  position: relative; display: flex; flex-direction: column; width: 100%; height: 100%; min-height: 0; min-width: 0;
  background: var(--raised); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow);
}
.mat-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 8px 12px;
  border-bottom: 1px solid var(--line-soft); background: var(--surface);
}
.mat-title { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 200px; }
.mat-name { font: 500 17px/1.25 var(--serif); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mat-chip {
  flex: none; font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-text); letter-spacing: .01em;
}
.mat-chip.priv { background: rgba(212, 165, 116, .24); color: var(--ochre-text); }
.mat-grp { display: flex; align-items: center; gap: 4px; }
.mat-pageno { font-size: 13.5px; font-weight: 600; color: var(--text); min-width: 7.5em; text-align: center; font-variant-numeric: tabular-nums; }
.mat-btn {
  width: 38px; height: 38px; padding: 8px; border-radius: 12px; border: 1px solid transparent; background: transparent;
  color: var(--muted); display: inline-grid; place-items: center; flex: none; transition: background-color .15s, color .15s;
}
.mat-btn:hover:not(:disabled) { background: var(--accent-soft); color: var(--text); }
.mat-btn:disabled { opacity: .35; cursor: default; }
.mat-btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }
.mat-btn.mat-x:hover { background: var(--danger-soft); color: var(--danger-text); }
.mat-btn [data-icon], .mat-btn span { width: 100%; height: 100%; display: block; }
.mat-tools { padding-left: 14px; border-left: 1px solid var(--line-soft); }
.mat-act { margin-left: auto; gap: 8px; }
.mat-op { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.mat-op input { width: 90px; accent-color: var(--accent); }

.mat-scroll {
  flex: 1; min-height: 0; display: flex; overflow: auto; background: var(--surface-2); touch-action: pan-x pan-y;
  overscroll-behavior: contain; scrollbar-width: thin;
}
.mat-page {
  position: relative; flex: none; margin: auto; width: var(--w, 10px); height: var(--h, 10px); background: #fff;
  box-shadow: 0 1px 2px rgba(28, 35, 32, .12), 0 14px 34px -14px rgba(28, 35, 32, .38); border-radius: 3px;
  transform-origin: 0 0; will-change: transform;
}
.mat-canvas, .mat-ink { position: absolute; inset: 0; width: 100%; height: 100%; display: block; border-radius: 3px; }
.mat-ink { pointer-events: none; }
.mat-ink.active { pointer-events: auto; touch-action: none; cursor: crosshair; }
.mat-view[data-tool="laser"] .mat-ink.active { cursor: none; }
.mat-dot {
  position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, #fff 0 14%, #ee4d34 18% 55%, rgba(238, 77, 52, 0) 72%);
  box-shadow: 0 0 18px 6px rgba(238, 77, 52, .45); opacity: 0; transition: opacity .35s ease;
}
.mat-dot.on { opacity: 1; transition-duration: .08s; animation: matPulse 1.3s ease-in-out infinite; }
@keyframes matPulse { 50% { transform: scale(1.18); } }

.mat-wait {
  position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: var(--raised); text-align: center; padding: 24px; color: var(--muted);
}
.mat-wait p { margin: 0; font-size: 15px; }
.mat-prog { width: min(260px, 70%); height: 6px; border-radius: 6px; background: var(--line-soft); overflow: hidden; }
.mat-prog i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 6px; transition: width .2s; }

/* ---------- op het podium en als privé-paneel ---------- */
/* Telefoon rechtop (leerling): het document krijgt de ruimte, alle tegels worden één smalle rij eronder. */
body.is-student .stage.speaker.mat-on { justify-content: flex-start; gap: 8px; overflow: hidden; }
body.is-student .stage.speaker.mat-on::before, body.is-student .stage.speaker.mat-on::after { display: none; }
body.is-student .stage.speaker.mat-on .spot { flex: 1; min-height: 0; }
body.is-student .stage.speaker.mat-on .gallery { flex: none; height: 76px; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; justify-content: center; gap: 6px; padding: 2px; }
body.is-student .stage.speaker.mat-on .gallery .tile { width: 118px !important; height: 66px !important; aspect-ratio: auto; border-radius: 12px; }
.stage.speaker .spot .mat-view, .mat-panel .mat-view { flex: 1; align-self: stretch; height: auto; max-width: none; }
.mat-panel {
  position: absolute; z-index: 12; top: 4px; right: 14px; bottom: 14px; width: min(46%, 560px); display: flex;
  animation: rise .22s var(--ease);
}
.mat-panel .mat-view { box-shadow: var(--shadow-lg); background: transparent; }
/* Verslepen en formaat: de plek komt uit materiaal.js (--pl/--pt/--pw/--ph, in pixels binnen het podium). */
.mat-panel.placed { left: var(--pl); top: var(--pt); width: var(--pw); height: var(--ph); right: auto; bottom: auto; }
.mat-panel.dragging { user-select: none; -webkit-user-select: none; }
.mat-panel .mat-bar { touch-action: none; cursor: grab; }
.mat-panel.dragging .mat-bar { cursor: grabbing; }
.mat-panel .mat-bar button, .mat-panel .mat-bar input, .mat-panel .mat-bar label { cursor: auto; }
.mat-panel .mat-bar button { cursor: pointer; }
.mat-grip { cursor: grab !important; touch-action: none; width: 30px; height: 38px; padding: 6px; margin-right: -4px; }
.mat-size { gap: 2px; }
.mat-sz {
  border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 10px; padding: 0 10px;
  min-height: 34px; font: 600 13px/1 var(--font);
}
.mat-sz:hover { background: var(--accent-soft); color: var(--text); }
.mat-rz { position: absolute; z-index: 5; touch-action: none; }
.mat-rz-n, .mat-rz-s { left: 18px; right: 18px; height: 10px; cursor: ns-resize; }
.mat-rz-e, .mat-rz-w { top: 18px; bottom: 18px; width: 10px; cursor: ew-resize; }
.mat-rz-n { top: -4px; } .mat-rz-s { bottom: -4px; } .mat-rz-e { right: -4px; } .mat-rz-w { left: -4px; }
.mat-rz-ne, .mat-rz-nw, .mat-rz-se, .mat-rz-sw { width: 22px; height: 22px; }
.mat-rz-ne { top: -5px; right: -5px; cursor: nesw-resize; } .mat-rz-sw { bottom: -5px; left: -5px; cursor: nesw-resize; }
.mat-rz-nw { top: -5px; left: -5px; cursor: nwse-resize; } .mat-rz-se { bottom: -5px; right: -5px; cursor: nwse-resize; }
.mat-rz-se::after {
  content: ""; position: absolute; right: 7px; bottom: 7px; width: 10px; height: 10px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  border-radius: 0 0 4px 0; opacity: .8;
}
.mat-rz-se:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 8px; }
.mat-grip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* Klein paneel: de balk blijft smal zodat de pagina zichtbaar blijft. Grotere maat geeft alle knoppen terug. */
.mat-panel.compact .mat-bar { padding: 4px 6px; gap: 2px 6px; }
.mat-panel.compact .mat-chip, .mat-panel.compact .mat-zoom, .mat-panel.compact .mat-op span, .mat-panel.compact .mat-name { display: none; }
.mat-panel.compact .mat-title { flex: 0 0 auto; }
.mat-panel.compact .mat-btn { width: 34px; height: 34px; padding: 6px; }
.mat-panel.compact .mat-pageno { min-width: 0; font-size: 12.5px; }
.mat-panel.compact .mat-sz { min-height: 30px; padding: 0 8px; font-size: 12.5px; }
.mat-panel.compact .mat-act { margin-left: auto; gap: 4px; }
.mat-panel.compact .mat-act .btn.small { min-height: 30px; padding: 0 10px; font-size: 12.5px; }
.mat-panel.compact .mat-op input { width: 64px; }
.mat-panel.tiny .mat-op, .mat-panel.tiny .mat-pageno { display: none; }
.mat-probe {
  position: fixed; left: 0; top: 0; width: 0; height: 0; visibility: hidden; pointer-events: none;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}
@media (pointer: coarse) {
  .mat-rz-ne, .mat-rz-nw, .mat-rz-se, .mat-rz-sw { width: 30px; height: 30px; }
  .mat-rz-n, .mat-rz-s { height: 16px; } .mat-rz-e, .mat-rz-w { width: 16px; }
  .mat-sz { min-height: 40px; }
}
/* Doorzichtig is alleen de pagina; de knoppenbalk blijft goed leesbaar. */
.mat-panel .mat-scroll { opacity: var(--mat-op, .85); }

@media (max-width: 760px) {
  .mat-bar { padding: 6px 8px; gap: 4px 8px; }
  .mat-name { font-size: 15px; }
  .mat-btn { width: 44px; height: 44px; }
  .mat-tools { padding-left: 0; border-left: 0; }
  .mat-act { margin-left: 0; }
  .mat-pageno { min-width: 6.5em; font-size: 13px; }
  .mat-panel { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; height: 62%; }
  .mat-view { border-radius: 16px; }
}

/* ---------- venster: bibliotheek ---------- */
.mat-body { display: grid; gap: 14px; }
.mat-h { margin: 6px 0 0; font: 600 13px/1.3 var(--font); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.mat-empty { margin: 0; color: var(--muted); line-height: 1.55; }
.mat-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mat-item {
  display: flex; align-items: center; gap: 4px; padding: 6px 8px 6px 6px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface);
}
.mat-open {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; text-align: left; border: 0; background: transparent; padding: 6px; border-radius: 12px;
}
.mat-open:hover:not(:disabled) { background: var(--accent-soft); }
.mat-open:disabled { cursor: default; }
.mat-ico { flex: none; width: 36px; height: 36px; padding: 7px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-text); }
.mat-nm { display: grid; min-width: 0; }
.mat-nm b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mat-nm small { color: var(--muted); font-size: 12.5px; }
.mat-rename { flex: 1; min-width: 0; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--accent); background: var(--raised); }
.mat-add { width: 100%; min-height: 50px; }
.mat-now {
  display: grid; gap: 10px; justify-items: start; padding: 16px; border-radius: 18px; background: var(--accent-soft); border: 1px solid var(--line);
}
.mat-now-t { margin: 0; display: grid; gap: 2px; font-size: 13px; color: var(--muted); }
.mat-now-t b { font: 500 20px/1.25 var(--serif); color: var(--text); }
.mat-now .timer-actions { width: 100%; }
.mat-dl-row { align-items: flex-start; }
.mat-dl-row small { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; }
.mat-choose-t { margin: 0; font: 500 21px/1.3 var(--serif); }
.mat-choices { display: grid; gap: 10px; }
.mat-choice {
  display: grid; grid-template-columns: 38px 1fr; column-gap: 14px; text-align: left; padding: 16px 18px; border-radius: 18px;
  border: 1px solid var(--line); background: var(--surface); transition: border-color .15s, background-color .15s;
}
.mat-choice:hover { border-color: var(--accent); background: var(--accent-soft); }
.mat-choice [data-icon], .mat-choice > span:first-child { grid-row: 1 / 3; width: 38px; height: 38px; padding: 7px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-text); align-self: center; }
.mat-choice b { font-size: 16.5px; font-weight: 600; }
.mat-choice small { color: var(--muted); font-size: 13.5px; line-height: 1.45; }

/* ---------- eindscherm ---------- */
.end-mat { display: grid; gap: 8px; justify-items: center; margin-top: 22px; }
.end-mat-t { margin: 0; font-size: 13px; color: var(--muted); }
.end-mat-btn { max-width: 100%; }
.end-mat-btn span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mat-btn.mat-dl.on { background: var(--accent-soft); }

@media (prefers-reduced-motion: reduce) {
  .mat-dot.on, .mat-panel { animation: none; }
}
