/* =============================================
   VIEWER HERO — CLINICAL PATHOLOGY UI
   lab/viewer.css
   ============================================= */

/* ── Hero container ──────────────────────────── */

/* Viewer stays fixed behind everything — page content scrolls over it */
#viewer-hero {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #0a0a0e;
  z-index: 10;
}

#osd-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #0a0a0e;
}

/* ── OSD overlay annotations ─────────────────── */

.osd-annotation {
  position: absolute;
  box-sizing: border-box;
  pointer-events: none;
  will-change: opacity;
  overflow: visible;
}

.osd-annotation--teal {
  border: 2px solid rgba(0, 180, 168, 0.9);
  background: rgba(0, 180, 168, 0.20);
}

.osd-annotation--purple {
  border: 2px solid rgba(124, 114, 255, 0.9);
  background: rgba(124, 114, 255, 0.18);
}

.osd-annotation--green {
  border: 2px solid rgba(77, 227, 138, 0.9);
  background: rgba(77, 227, 138, 0.15);
}

.ann-label-fixed--green {
  background: #4DE38A;
  color: #000000;
}

/* Fixed-position labels tracked by JS to sit above overlay boxes */
.ann-label-fixed {
  position: fixed;
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 20px;
  line-height: 1;
  padding: 10px 16px;
  border-radius: 3px 3px 3px 0;
  white-space: nowrap;
  pointer-events: none;
  z-index: 25;
  opacity: 0;
  transition: opacity 0.3s;
}

.ann-label-fixed--teal {
  background: #00B4A8;
  color: #000000;
}

.ann-label-fixed--purple {
  background: #7C72FF;
  color: #ffffff;
}

.annotation-hidden {
  opacity: 0;
}

.annotation-draw-in {
  animation: annotationDrawIn 0.6s ease-out forwards;
}

@keyframes annotationDrawIn {
  0%   { opacity: 0; clip-path: inset(0 100% 0 0); }
  60%  { opacity: 1; clip-path: inset(0 0% 0 0); }
  100% { opacity: 1; clip-path: inset(0 0% 0 0); }
}

/* ── Floating info chips ─────────────────────── */

.viewer-chip {
  position: absolute;
  bottom: 48px;
  background: rgba(10, 10, 14, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 18px;
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text, #E8EBF5);
  pointer-events: none;
  z-index: 20;
  white-space: nowrap;
  transition: none;
  will-change: transform;
}

#viewer-chip-coords {
  left: 5vw;
}

#viewer-chip-zoom {
  left: calc(5vw + 160px + 12px);
}

/* Zoom chip — bold value */
#viewer-chip-zoom span {
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* ── Case study annotations ─────────────────── */

.cs-annotation {
  position: absolute;
  box-sizing: border-box;
  border: 2px solid rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.15);
  will-change: opacity;
  overflow: visible;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.cs-annotation:hover {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(255, 255, 255, 1.0);
}

.cs-label-fixed {
  position: fixed;
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 20px;
  line-height: 1;
  padding: 10px 16px;
  border-radius: 3px 3px 3px 0;
  white-space: nowrap;
  pointer-events: none;
  z-index: 25;
  background: #ffffff;
  color: #000000;
  transition: font-size 0.15s ease;
}

.cs-label-fixed.cs-label-hovered {
  font-size: 24px;
}

.cs-lock-icon {
  margin-right: 4px;
  font-size: 10px;
}

.cs-hover-card {
  position: fixed;
  background: #ffffff;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  z-index: 50;
  pointer-events: none;
}

.cs-card-img {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

.intro-hover-card {
  background: #00B4A8 !important;
  border-radius: 8px;
  overflow: hidden;
  padding: 0;
}

.intro-card-inner {
  display: flex;
  flex-direction: row;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.intro-card-content {
  flex: 1 1 58%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  box-sizing: border-box;
  overflow: hidden;
}

.intro-card-headline {
  font-family: 'Manrope', sans-serif;
  font-size: 15px;
  font-weight: 800;
  color: #000000;
  line-height: 1.3;
  margin: 0;
}

.intro-card-body {
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  font-weight: 400;
  color: #000000;
  line-height: 1.6;
  margin: 0;
}

.intro-card-photo {
  flex: 0 0 38%;
  position: relative;
  overflow: hidden;
  padding: 16px;
  box-sizing: border-box;
  min-width: 0;
}

.intro-card-img {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  bottom: 16px;
  width: calc(100% - 32px);
  height: calc(100% - 32px);
  object-fit: cover;
  object-position: center top;
  border-radius: 12px;
}

.intro-hover-card .cs-hover-chip {
  background: rgba(0, 0, 0, 0.12);
  border-color: rgba(0, 0, 0, 0.2);
  color: rgba(0, 0, 0, 0.75);
  font-size: 11px;
  padding: 5px 12px;
}

.intro-hover-card .cs-hover-chips {
  background: transparent;
  padding: 0;
  gap: 6px;
}

.cs-hover-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px 8px 6px;
  background: #ffffff;
}

.cs-hover-chip {
  font-family: 'Manrope', sans-serif;
  font-size: 9px;
  font-weight: 700;
  color: rgba(10, 10, 10, 0.55);
  background: rgba(10, 10, 10, 0.04);
  border: 0.667px solid rgba(10, 10, 10, 0.12);
  border-radius: 100px;
  padding: 3px 9px;
  white-space: nowrap;
}

.cs-card-label {
  font-family: 'Manrope', sans-serif;
  font-size: 9px;
  font-weight: 600;
  color: #000000;
  padding: 4px 6px;
  line-height: 1.3;
  background: #ffffff;
  flex-shrink: 0;
}

.text-annotation-container {
  position: absolute;
  overflow: visible;
  pointer-events: none;
  width: 100%;
  height: 100%;
}

.text-annotation-svg {
  overflow: visible;
}

.text-annotation-label {
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  font-weight: 800;
  fill: #000000;
  dominant-baseline: auto;
}


/* ── Intro overlay ───────────────────────────── */

.viewer-intro-overlay {
  position: absolute;
  bottom: 48px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 10, 14, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--chrome-border);
  border-radius: 12px;
  padding: 14px 22px;
  text-align: center;
  z-index: 20;
  opacity: 1;
  transition: opacity 1s ease;
  pointer-events: none;
  white-space: nowrap;
}

.viewer-intro-overlay.fade-out {
  opacity: 0;
}

.intro-headline {
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px;
  letter-spacing: 0.01em;
}

.intro-subline {
  font-family: 'Manrope', sans-serif;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
  margin: 0;
}

/* ── Home FAB ────────────────────────────────── */

.home-fab {
  position: fixed;
  bottom: clamp(32px, 5vh, 56px);
  right: calc(5vw + 60px);
  z-index: 90;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgb(20, 20, 26);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 12px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.04);
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.home-fab:hover {
  background: rgb(28, 28, 36);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 4px 20px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.08);
  transform: translateY(-3px);
}

@media (max-width: 768px) {
  .home-fab {
    display: none;
  }
}

/* ── Mobile (≤768px) ─────────────────────────── */

@media (max-width: 768px) {
  .intro-headline {
    font-size: 12px;
  }

  .intro-subline {
    font-size: 10px;
  }

  .viewer-intro-overlay {
    padding: 10px 16px;
    bottom: 44px;
  }
}
