/* CuratedLux v2.1 — Monochrome Editorial (ink + paper + oxblood seal) */

/* Hide horizontal scrollbar on the mobile nav tab strip */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* How It Works gallery: keep SVG captions inside the card */
.cl-example-svg { overflow: hidden; }
.cl-example-svg svg { display: block; width: 100%; height: auto; overflow: hidden; }
.cl-ex-pair img { display: block; }
.cl-example-photos img { background: #050505; }

/* ── Camera modal — dynamic per-device framing (adapts to every phone model) ── */
#cl-cam-video {
  width: 100%;
  /* dvh = dynamic viewport height: tracks the *actual* visible viewport on every
     phone (collapsing browser bars, notches, iPhone vs Android) so the camera
     viewfinder always fills the screen edge-to-edge with no layout jumps. */
  height: 52dvh;
  min-height: 240px;
  max-height: calc(100dvh - 210px);   /* leave room so the guide + controls stay reachable */
  object-fit: cover;                  /* camera feed fills the frame on ANY aspect ratio */
  background: #000;
}
@media (min-width: 768px) {
  #cl-cam-video { height: 60dvh; max-height: 720px; object-fit: contain; }
  /* keep the feed centred & letterboxed on desktop where full-bleed cover distorts */
}
/* Tall/narrow phones (iPhone, most Androids) get a taller, more immersive frame */
@media (min-height: 800px) and (max-width: 480px) {
  #cl-cam-video { height: 60dvh; }
}
/* Short/wide phones get a compact frame that doesn't push controls off-screen */
@media (max-height: 660px) {
  #cl-cam-video { height: 44dvh; min-height: 180px; }
}
/* Guide dock stays compact below the camera; the whole modal scrolls if tall */
#cl-guide-panel {
  max-height: 38vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}
/* Photo thumbnail rail — starts below the HUD banner so they never overlap */
#cl-thumb-rail { top: 4.5rem; }
@media (min-width: 768px) { #cl-thumb-rail { top: 3.5rem; } }

/* Hero gradient — now flat ink (no gold radial glow) */
.hero-gradient {
  background: #0a0a0a;
}

/* Shimmer → subtle paper-white ink drift (kept class, no gold) */
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.text-shimmer {
  background: linear-gradient(90deg, #e8e6e1 0%, #ffffff 35%, #e8e6e1 60%, #b8b5ad 85%, #e8e6e1 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 4s ease-in-out infinite;
}

/* Pulse dot */
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.75); }
}

.animate-pulse-dot {
  animation: pulse-dot 2s ease-in-out infinite;
}

/* Confidence bar fill — oxblood now (the sole accent, like an ink seal) */
@keyframes bar-fill {
  from { width: 0%; }
  to { width: var(--bar-width); }
}

.conf-bar {
  animation: bar-fill 0.8s ease-out forwards;
  background: linear-gradient(90deg, #4a0d18, #8a1c2c, #a3223a) !important;
}

/* Status badges */
.badge-active { background: rgba(52, 211, 153, 0.12); color: #34d399; border: 1px solid rgba(52,211,153,0.15); }
.badge-locked { background: rgba(232, 230, 225, 0.08); color: #b8b5ad; border: 1px solid rgba(232,230,225,0.16); }
.badge-sold { background: rgba(148, 163, 184, 0.12); color: #94a3b8; border: 1px solid rgba(148,163,184,0.1); }
.badge-archived { background: rgba(239, 68, 68, 0.1); color: #ef4444; border: 1px solid rgba(239,68,68,0.1); }
.badge-matched { background: rgba(129, 140, 248, 0.12); color: #818cf8; border: 1px solid rgba(129,140,248,0.15); }
.badge-accepted { background: rgba(52, 211, 153, 0.12); color: #34d399; border: 1px solid rgba(52,211,153,0.15); }
.badge-pending { background: rgba(148, 163, 184, 0.12); color: #94a3b8; border: 1px solid rgba(148,163,184,0.1); }

/* Focus ring — paper-white (was gold) */
*:focus-visible {
  outline: 2px solid rgba(232, 230, 225, 0.6);
  outline-offset: 2px;
}

/* Smooth transitions */
a, button, input, select, textarea {
  transition-property: background-color, border-color, color, opacity, box-shadow;
  transition-duration: 150ms;
  transition-timing-function: ease-in-out;
}

/* Selection — oxblood */
::selection {
  background: rgba(138, 28, 44, 0.35);
  color: #fff;
}

/* Modal backdrop */
.modal-enter {
  opacity: 0;
  transform: scale(0.95);
}
.modal-enter-active {
  opacity: 1;
  transform: scale(1);
  transition: all 0.2s ease-out;
}

/* Drop zone drag-over — oxblood accent */
#drop-zone.drag-over {
  border-color: #8a1c2c !important;
  background: rgba(138, 28, 44, 0.06) !important;
}

/* Match score colors */
.score-high { color: #34d399; }
.score-mid { color: #d7b86a; }
.score-low { color: #ef4444; }

/* Toast notification */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  border-radius: 0;
  font-size: 0.875rem;
  animation: toast-in 0.3s ease-out, toast-out 0.3s ease-in 3s forwards;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-10px); }
}

.toast-success { background: #064e12; color: #d1fae5; border: 1px solid #15803d; }
.toast-error { background: #450a0a; color: #fee2e2; border: 1px solid #dc2626; }
.toast-info { background: #141414; color: #e8e6e1; border: 1px solid #2a2a28; }

/* Print styles for dossiers */
@media print {
  body { background: white !important; color: black !important; }
  nav, footer, button, #dossier-detail { display: none; }
  #dossier-certificate { border-color: #0a0a0a !important; background: white !important; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   CAPTURE-UI HARDENING — Tailwind-CDN INDEPENDENCE (MVP stabiliser)
   The <nav>/scan body relies on cdn.tailwindcss.com (PlayCDN) to generate its
   utility classes at runtime. If that script loads late, is blocked, or its
   MutationObserver misses the innerHTML-injected camera modal, the capture UI
   would render UNSTYLED (raw video, floating buttons, invisible thumb rail) —
   the "app is glitchy" report. These rules hard-style the CAMERA modal + its
   critical feedback elements so capture always works even with zero CDN. Only
   the layout-critical properties carry !important so PlayCDN (when present)
   can still refine colours/spacing; the geometry guarantees the flow is usable.
   ═══════════════════════════════════════════════════════════════════════════ */
.clx-camera-modal {
  position: fixed !important;
  top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
  z-index: 60 !important;
  background: rgba(0, 0, 0, 0.95) !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  -webkit-overflow-scrolling: touch;
}
.clx-camera-inner {
  position: relative !important;
  max-width: 42rem !important;
  width: 100% !important;
  min-height: 100% !important;
  margin: 0 auto !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  padding: 1rem !important;
}
/* The camera feed stays the DOMINANT element regardless of CDN state. */
.clx-camera-feed {
  position: relative !important;
  border-radius: 0.75rem;
  overflow: hidden;
  background: #000;
}
#cl-cam-video {
  width: 100%;
}
/* Ensure the video fills its frame on phones and is at least usable if Tailwind
   never set .w-full/.bg-black on it. */
#cl-cam-video {
  background: #000 !important;
}
/* Guide dock always scrolls and stays below the video. */
#cl-guide-panel {
  max-height: 38vh !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  background: rgba(24, 24, 24, 0.95);
  border: 1px solid rgba(212, 175, 55, 0.15);
  border-radius: 0.75rem;
}
/* Thumb rail — always starts below the HUD banner, never collides. */
#cl-thumb-rail {
  position: absolute !important;
  top: 4.5rem !important;
  right: 0.5rem !important;
  z-index: 30 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 0.375rem !important;
  max-height: 70% !important;
  overflow-y: auto !important;
}
@media (min-width: 768px) { #cl-thumb-rail { top: 3.5rem !important; } }
/* Live HUD banner overlays the top of the camera with step info. */
#cl-live-hud-banner {
  position: absolute !important;
  top: 0.5rem !important;
  left: 0.5rem !important;
  right: 3.5rem !important;
  z-index: 30 !important;
  background: rgba(0, 0, 0, 0.75) !important;
  border: 1px solid rgba(212, 175, 55, 0.4) !important;
  border-radius: 0.5rem !important;
  padding: 0.5rem 0.75rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  pointer-events: none !important;
}
/* Mega shutter — the primary capture CTA. Always a big gold, full-width,
   tappable block so a shot can ALWAYS be taken even without CDN. */
#cl-mega-snap {
  display: flex !important;
  width: 100% !important;
  margin-top: 0.5rem;
  padding: 0.875rem !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 0.5rem;
  border-radius: 0.75rem;
  background: #d4af37 !important;
  color: #000 !important;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.8125rem;
  cursor: pointer;
  border: none;
}
/* Analyze-now (in-camera, hidden until ≥1 photo or description). When shown it
   must be a tappable green block even without CDN. */
#cl-analyze-now-btn {
  display: none; /* default hidden; JS toggles via .hidden removal */
  width: 100% !important;
  margin-top: 0.5rem;
  padding: 0.75rem !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 0.5rem;
  border-radius: 0.75rem;
  background: #10b981 !important;
  color: #000 !important;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8125rem;
  cursor: pointer;
  border: none;
}
#cl-analyze-now-btn:not(.hidden) {
  display: flex !important;
}
#cl-analyze-now-btn.hidden {
  display: none !important;
}
/* Progress count banner — this is the "how many photos" feedback. Even unstyled
   it must be readable. */
#cl-live-hud-banner :is(#cl-progress-count, #cl-progress-total) {
  font-weight: 700;
}
/* Close button — always tappable, top-right. */
#cl-cam-close {
  position: absolute !important;
  top: 0.5rem !important;
  right: 0.5rem !important;
  z-index: 40 !important;
  width: 2.25rem !important;
  height: 2.25rem !important;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.7) !important;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}
/* Capture-stage buttons (Next / Skip) — always tappable rows. */
#cl-guide-skip-step, #cl-guide-skip, #cl-guide-next {
  padding: 0.625rem 0.75rem !important;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.08);
  color: #e8e6e1;
  border: 1px solid rgba(255, 255, 255, 0.15);
}
#cl-guide-next[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}
#cl-guide-skip { opacity: 0.6; }


/* Demo assessment: readable controls and navigation on narrow screens. */
:focus-visible { outline: 2px solid #e8e6e1; outline-offset: 3px; }
.clx-nav > div:first-child { flex: 1; min-width: 0; }
.clx-nav-tabs { min-width: 0; }
.clx-account-links { padding-left: 12px; }
#clx-feedback-fab { position: static !important; margin: 12px auto 24px; font-size: 14px !important; padding: 12px 18px !important; }
#cl-assessment-card [class*="text-white/"], #review-editable-fields label { color: #b8b5ad; }
@media (max-width: 640px) {
 .clx-nav { height: auto !important; display: grid !important; grid-template-columns: 1fr auto; padding-top: 10px; }
 .clx-nav > div:first-child { display: contents; }
 .clx-nav > div:first-child > button { display: none; }
 .clx-nav-tabs { grid-column: 1 / -1; grid-row: 2; padding: 10px 0; width: 100%; }
 .clx-account-links { grid-column: 2; grid-row: 1; }
 .clx-nav-tabs a { padding: 10px 12px; font-size: 12px; }
 #cl-auth-hero { padding: 16px; }
 #cl-auth-hero h2 { font-size: 26px; }
 #cl-auth-hero [class*="text-[10px]"], #cl-assessment-card [class*="text-[9px]"] { font-size: 12px; }
 #cl-assessment-card .flex.items-end { flex-wrap: wrap; }
}
