/* DMS PDF — frontend engine styles (progress overlay + capture helpers). */

/* ---- progress overlay ---------------------------------------------------- */
.dms-pdf-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(17, 24, 39, 0.55);
  backdrop-filter: blur(2px);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.dms-pdf-overlay__panel {
  width: min(92vw, 360px);
  padding: 28px 24px 22px;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  text-align: center;
}

.dms-pdf-overlay__spinner {
  width: 42px;
  height: 42px;
  margin: 0 auto 16px;
  border: 4px solid #e5e7eb;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: dms-pdf-spin 0.9s linear infinite;
}

@keyframes dms-pdf-spin {
  to { transform: rotate(360deg); }
}

.dms-pdf-overlay__message {
  margin: 0 0 14px;
  font-size: 15px;
  line-height: 1.4;
  color: #111827;
}

.dms-pdf-overlay__bar {
  display: none;
  height: 6px;
  margin: 0 0 16px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.dms-pdf-overlay.is-determinate .dms-pdf-overlay__bar {
  display: block;
}

.dms-pdf-overlay__bar-fill {
  display: block;
  height: 100%;
  width: 0;
  background: #2563eb;
  transition: width 0.2s ease;
}

.dms-pdf-overlay__cancel {
  appearance: none;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  color: #374151;
  font-size: 13px;
  padding: 7px 18px;
  border-radius: 8px;
  cursor: pointer;
}

.dms-pdf-overlay__cancel:hover {
  background: #f3f4f6;
}

.dms-pdf-overlay__cancel:disabled {
  opacity: 0.5;
  cursor: default;
}

.dms-pdf-overlay.is-error .dms-pdf-overlay__spinner {
  border-top-color: #dc2626;
  animation: none;
  border-color: #fecaca;
}

.dms-pdf-overlay.is-error .dms-pdf-overlay__message {
  color: #b91c1c;
}

/* ---- download trigger ---------------------------------------------------- */
button.dms-pdf-download {
  cursor: pointer;
}

button.dms-pdf-download[disabled] {
  opacity: 0.6;
  cursor: default;
}

/* ---- capture helpers (hidden render container) --------------------------- */
.dms-pdf-render-root,
.dms-pdf-render-root * {
  box-shadow: none !important;
}

/* QR code: clip to its sized box and drop the inline-block baseline gap so the
   measured height matches the painted height (prevents page-split slicing). */
.dms-pdf-qr {
  overflow: hidden;
  line-height: 0;
  font-size: 0;
  vertical-align: top;
}

.dms-pdf-qr svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* Video widget -> static thumbnail with a play badge. */
.dms-pdf-video {
  position: relative;
  width: 100%;
  background: #111827;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.dms-pdf-video__poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dms-pdf-video__play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  transform: translate(-35%, -50%);
  border-style: solid;
  border-width: 22px 0 22px 38px;
  border-color: transparent transparent transparent rgba(255, 255, 255, 0.92);
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}
