/* ============================================================
   leaderboard-sim-strip.css — Per-simulator selector for the leaderboard
   ------------------------------------------------------------
   A horizontal scrollable pill strip that sits between the page header
   and the time-window tabs. One chip per simulator + a "Total" chip:

       [ ▥ Total score ]  [ ◎ Retinoscopy ]  [ 👁 Strabismus ]  ...

   Active chip is filled with teal; inactive is outlined. The strip
   scrolls horizontally on small screens (no wrapping, no JS).

   Class vocabulary:
     .lb-sim-strip        — the scroll container / ARIA group
     .lb-sim-chip         — individual pill button
     .lb-sim-chip--active — currently selected
     .lb-sim__icon        — 18×18 SVG inside each chip
     .lb-sim-chip__label  — text label

   The small badge ".lb-sim-active-label" appears inline in the h2
   title when a tool is selected (e.g. "The chart · Retinoscopy").

   All motion honours prefers-reduced-motion.
   Logical properties throughout (RTL needs no overrides).
   ============================================================ */

/* ── Strip wrapper ──────────────────────────────────────────── */
.lb-sim-strip {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  /* Hide scrollbar on all browsers while keeping the element scrollable */
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-block: 2px;        /* room for box-shadow glow on focused chips */
  /* Slight negative side margin + matching padding keeps chips flush
     with the page edge on mobile while the scrollbar stays invisible. */
  margin-inline: -4px;
  padding-inline: 4px;
}
.lb-sim-strip::-webkit-scrollbar { display: none; }

/* ── Individual chip ────────────────────────────────────────── */
.lb-sim-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;               /* never shrink — scroll the strip instead */
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1.5px solid var(--acct-line-strong);
  background: var(--surface);
  font: inherit;
  font-size: .88rem;
  font-weight: 600;
  color: var(--acct-ink-soft);
  cursor: pointer;
  white-space: nowrap;
  transition:
    border-color .18s var(--acct-ease),
    background   .18s var(--acct-ease),
    color        .18s var(--acct-ease),
    box-shadow   .18s var(--acct-ease);
}
.lb-sim-chip:hover:not(.lb-sim-chip--active) {
  border-color: var(--acct-teal);
  color: var(--acct-teal-deep);
  background: color-mix(in srgb, var(--acct-teal) 6%, var(--surface));
}

/* Active / selected state: filled pill */
.lb-sim-chip--active {
  border-color: var(--acct-teal);
  background: var(--acct-teal);
  color: #fff;
  box-shadow: 0 2px 10px -4px color-mix(in srgb, var(--acct-teal) 60%, transparent);
}

/* Focus ring — visible without the :hover colour fight */
.lb-sim-chip:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--acct-teal) 45%, transparent);
  outline-offset: 2px;
}

/* ── Icon ───────────────────────────────────────────────────── */
.lb-sim__icon {
  width: 18px;
  height: 18px;
  flex: none;
  stroke: currentColor;
  opacity: .85;
  transition: opacity .18s ease;
}
.lb-sim-chip--active .lb-sim__icon { opacity: 1; }

/* ── Label ──────────────────────────────────────────────────── */
.lb-sim-chip__label {
  /* Truncate only on the very smallest screens — chips should be readable */
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}
@media (max-width: 360px) {
  .lb-sim-chip__label { display: none; }
  .lb-sim-chip { padding: 0 12px; }
  .lb-sim__icon { width: 20px; height: 20px; opacity: 1; }
}

/* ── Inline title label (e.g. "The chart · Retinoscopy") ─────── */
.lb-sim-active-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-inline-start: .45em;
  font-size: .55em;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--acct-tint);
  color: var(--acct-teal-deep);
  vertical-align: middle;
  line-height: 1.5;
  /* Reset to avoid inheriting the h2 letter-spacing */
  letter-spacing: 0;
}

/* ── Reduced motion ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .lb-sim-chip { transition: none; }
  .lb-sim__icon { transition: none; }
}
