/* css/share-qr-overlay.css — QR overlay modal (Phase 22-01 / SHR-06 / D-OVL-01..03). Imported into the components layer. */

/* ── Root: full-screen flex-centered modal ─── */
/* z-index ladder per 22-CONTEXT D-OVL-01: HUD=100, panel=200, toast-stack=250, QR-overlay=300, shortcut=400, cue=500.
   Toasts sit above the QR overlay so post-action toasts (e.g. "Copied!") stay visible. */
.qr-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: qr-overlay-in 200ms ease-out;
}

/* ── Backdrop: clickable layer that dismisses; sits behind the card. ─── */
.qr-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
}

/* ── Card: theme-token reuse (matches .shortcut-overlay__card precedent in css/overlays.css). ─── */
.qr-overlay__card {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid rgba(240, 236, 228, 0.1);
  border-radius: var(--radius);
  padding: var(--space-6);
  width: 340px;
  max-width: 90vw;
}

/* ── Close (X) button: top-right corner. ─── */
.qr-overlay__close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  background: transparent;
  color: var(--text-muted);
  border: none;
  border-radius: var(--radius);
  width: 32px;
  height: 32px;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.qr-overlay__close:hover,
.qr-overlay__close:focus {
  background: rgba(240, 236, 228, 0.08);
  color: var(--text-primary);
  outline: none;
}

/* ── Title ─── */
.qr-overlay__title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 var(--space-4);
  color: var(--text-primary);
  text-align: center;
}

/* ── Canvas wrap: white background guarantees max contrast for camera scanning (D-QR-03). ─── */
.qr-overlay__canvas-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: var(--space-3);
  background: white;
  border-radius: var(--radius);
  min-height: 256px;
}

/* image-rendering: pixelated keeps QR modules crisp regardless of devicePixelRatio
   (the encoder paints into a high-resolution canvas; CSS scales it down). */
.qr-overlay__canvas {
  width: 256px;
  height: 256px;
  image-rendering: pixelated;
  image-rendering: crisp-edges; /* Firefox fallback */
}

/* ── URL text below QR: monospace, copy-friendly, breaks anywhere. ─── */
.qr-overlay__url {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: var(--space-4) 0;
  word-break: break-all;
  text-align: center;
}

.qr-overlay__url code {
  background: transparent;
  padding: 0;
}

/* ── Copy URL primary button: full-width below URL. ─── */
.qr-overlay__copy {
  width: 100%;
}

/* ── Inline error (D-QR-05 TEXT_TOO_LONG fallback). ─── */
.qr-overlay__error {
  color: var(--color-warning);
  font-style: italic;
  padding: var(--space-5);
  margin: 0;
  text-align: center;
}

/* ── Exit animation: 150ms fade-out (D-OVL-03). ─── */
.qr-overlay.is-leaving {
  animation: qr-overlay-out 150ms ease-in forwards;
}

@keyframes qr-overlay-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes qr-overlay-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* ── Reduced-motion: instant show/hide (D-OVL-03 / precedent in css/responsive.css:142-152). ─── */
@media (prefers-reduced-motion: reduce) {
  .qr-overlay,
  .qr-overlay.is-leaving {
    animation: none;
  }
}
