/* pdf-viewer.css - Viewer-Dialog des PDF-Exports (0.16.0): Kit-<dialog>
   in 90 vw x 90 vh, Kopfzeile mit Seiten-Navigation, Zoom, Download,
   Drucken; Seiten als Canvas (PDF.js) mit Lupen-Cursor. */

dialog.modal.pdf-modal {
  width: 90vw;
  max-width: 90vw;
  height: 90vh;
  max-height: 90vh;
  padding: 0;
  overflow: hidden;
}
dialog.modal.pdf-modal[open] { display: flex; flex-direction: column; }

.pdf-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-wrap: wrap;
}
.pdf-head .pdf-title { font-weight: 700; margin-right: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pdf-head .pdf-group { display: inline-flex; align-items: center; gap: 0.25rem; }
.pdf-head .pdf-page-label { font-variant-numeric: tabular-nums; min-width: 8.5rem; text-align: center; font-size: var(--fs-sm); color: var(--text-muted); }
.pdf-head .pdf-zoom-label { min-width: 3.4rem; text-align: center; font-size: var(--fs-sm); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.pdf-head .btn.icon svg { width: 1.1rem; height: 1.1rem; }
.pdf-head .btn.icon[disabled] { opacity: 0.4; cursor: default; }

.pdf-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  background: var(--surface-2);
  padding: 1rem;
  position: relative;
}
.pdf-body.zoom-in .pdf-page canvas { cursor: zoom-in; }
.pdf-body.zoom-out .pdf-page canvas { cursor: zoom-out; }
.pdf-page {
  width: fit-content;
  margin: 0 auto 1rem;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}
.pdf-page canvas { display: block; }

.pdf-status {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.6rem;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--surface-2) 85%, transparent);
  text-align: center;
  padding: 1rem;
}
.pdf-status .spinner {
  width: 2rem; height: 2rem; border-radius: 50%;
  border: 3px solid var(--border-strong); border-top-color: var(--accent);
  animation: pdf-spin 0.9s linear infinite;
}
@keyframes pdf-spin { to { transform: rotate(360deg); } }
.pdf-status.error { color: var(--danger); }

/* PDF-Icon in den Seitenkoepfen */
.page-head .pdf-export { margin: 0; }
.page-head .pdf-export svg { width: 1.25rem; height: 1.25rem; }
.page-head .pdf-export.busy { opacity: 0.5; pointer-events: none; }

@media (max-width: 680px) {
  dialog.modal.pdf-modal { width: 96vw; max-width: 96vw; height: 92vh; max-height: 92vh; }
  .pdf-head .pdf-title { flex-basis: 100%; }
}
