/* ============================================================
   exam-lab-nav.css — jump-to-lab chip strip
   ────────────────────────────────────────────────────────────
   Sits between the eye stage and the stacked diagnostic
   consoles (Cover Test / Krimsky / H-Test / RAPD light-reflex
   lab). Deliberately NOT sticky/pinned — it must never compete
   with .exam-card.is-pinned for the top of the viewport; it is
   a normal in-flow row you scroll past once you've jumped.
   ============================================================ */

.lab-nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  padding: 4px 2px 2px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.lab-nav::-webkit-scrollbar { display: none; }

.lab-nav__chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-soft);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.lab-nav__chip:hover {
  border-color: var(--accent);
  background: var(--accent-tint);
  color: var(--accent-strong);
}

.lab-nav__chip:active,
.lab-nav__chip.is-jumped {
  transform: scale(0.97);
  border-color: var(--accent);
  background: var(--accent-tint);
  color: var(--accent-strong);
}

/* Persisted "this is the open tab" state — same accent-tint language as
   :hover/.is-jumped, just not transient. aria-selected is the real
   source of truth (set by lab-nav.js); .is-active is a same-frame CSS
   hook so the paint never waits on a11y-tree attribute styling quirks. */
.lab-nav__chip.is-active,
.lab-nav__chip[aria-selected="true"] {
  border-color: var(--accent);
  background: var(--accent-tint);
  color: var(--accent-strong);
}
.lab-nav__chip.is-active .lab-nav__dot,
.lab-nav__chip[aria-selected="true"] .lab-nav__dot {
  opacity: 1;
}

/* "Most relevant for this patient" — a quiet cue, not an open console.
   Every console starts collapsed (lab-nav.js); the condition's best tool
   earns an accent dot + tinted border so the learner knows where to go. */
.lab-nav__chip.is-suggested {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  color: var(--text);
}
.lab-nav__chip.is-suggested .lab-nav__dot {
  background: var(--accent);
  opacity: 1;
  box-shadow: 0 0 0 3px var(--accent-tint);
}

.lab-nav__chip:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.lab-nav__chip[hidden] { display: none; }

.lab-nav__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.55;
  flex: none;
}

/* Brief highlight on the section you just jumped to, so the jump
   reads as a destination, not a silent scroll. */
.lab-nav-highlight {
  animation: labNavPulse 1.1s ease;
}
@keyframes labNavPulse {
  0%   { box-shadow: 0 0 0 3px var(--accent-tint); }
  100% { box-shadow: 0 0 0 0 transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .lab-nav-highlight { animation: none; }
  .lab-nav__chip { transition: none; }
}

html[dir="rtl"] .lab-nav__chip {
  font-family: 'IBM Plex Sans Arabic', 'Tajawal', 'Inter', system-ui, sans-serif;
}

@media (max-width: 640px) {
  .lab-nav {
    margin-inline: -4px;
    padding-inline: 4px;
  }
  .lab-nav__chip {
    height: 40px;
    font-size: 12.5px;
  }
}
