/* ══════════════════════════════════════════════════════════════
   FIRST-TIME ONBOARDING TOUR
   A small coachmark sequence — see src/ui/onboarding.js. Deliberately
   simpler than the confirm/alert/prompt modals in modals.css: no dimmed
   full-page backdrop punched with a hole, just a highlight ring positioned
   over the current target plus a tooltip card, so the rest of the app stays
   visible (if not interactive) throughout the tour.
══════════════════════════════════════════════════════════════ */

.onboarding-overlay {
  position: fixed; inset: 0; z-index: 1250;
  opacity: 0; pointer-events: none; transition: opacity 0.18s ease;
}
.onboarding-overlay.visible { opacity: 1; pointer-events: auto; }

.onboarding-highlight {
  position: fixed; border-radius: var(--radius-md);
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 4000px rgba(0,0,0,0.55), 0 0 0 4px var(--accent-glow);
  transition: top 0.2s ease, left 0.2s ease, width 0.2s ease, height 0.2s ease;
  pointer-events: none;
}
/* One-shot "arrived" cue on a real step change (restarted by JS — see
   _playStepTransition() in src/ui/onboarding.js), not a constant loop —
   the ring already tracks position every frame via the transition above,
   this just makes a *new* target read as freshly spotlighted rather than
   the box merely sliding there from wherever it was. */
#sp-onboarding-highlight.onboarding-pop-in { animation: onboarding-highlight-in 0.22s ease; }
#sp-onboarding-content.onboarding-pop-in   { animation: onboarding-content-in 0.18s ease; }
@keyframes onboarding-highlight-in {
  from { box-shadow: 0 0 0 4000px rgba(0,0,0,0.55), 0 0 0 4px var(--accent-glow), 0 0 0 10px var(--accent-glow); }
  to   { box-shadow: 0 0 0 4000px rgba(0,0,0,0.55), 0 0 0 4px var(--accent-glow); }
}
@keyframes onboarding-content-in {
  from { opacity: 0; transform: translateY(3px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  #sp-onboarding-highlight.onboarding-pop-in,
  #sp-onboarding-content.onboarding-pop-in { animation: none; }
}

.onboarding-tooltip {
  position: fixed; z-index: 1;
  width: min(300px, calc(100vw - 24px));
  /* A viewport shorter than the tooltip (a landscape phone, high browser
     zoom) would otherwise push the actions row — Skip/Back/Next — off
     screen entirely, since _positionStep()'s clamp only keeps `top` inside
     the viewport, not the tooltip's own rendered height. Capping the
     height and scrolling the content instead keeps the actions always
     reachable. */
  max-height: calc(100vh - 24px);
  display: flex; flex-direction: column;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px 18px;
  box-shadow: var(--shadow-lg);
  transition: top 0.2s ease, left 0.2s ease;
}
#sp-onboarding-content { overflow-y: auto; min-height: 0; }
.onboarding-tooltip-actions { flex-shrink: 0; }
.onboarding-tooltip-count {
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 6px;
}
.onboarding-tooltip-title { font-size: 15px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.onboarding-tooltip-text  { font-size: 13.5px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 14px; }
.onboarding-dots { display: flex; gap: 6px; margin-bottom: 14px; flex-shrink: 0; }
.onboarding-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--border);
  transition: background 0.15s ease, transform 0.15s ease;
}
.onboarding-dot.is-done   { background: var(--text-muted); }
.onboarding-dot.is-active { background: var(--accent); transform: scale(1.35); }
.onboarding-tooltip-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.onboarding-skip {
  background: none; border: none; padding: 0; font-size: 13px; color: var(--text-muted);
  cursor: pointer; transition: color var(--transition);
}
.onboarding-skip:hover { color: var(--text-secondary); }
.onboarding-tooltip-nav { display: flex; gap: 8px; }
.onboarding-nav-btn {
  padding: 7px 14px; border-radius: var(--radius-md); font-size: 13px; font-weight: 500;
  background: var(--bg-base); border: 1px solid var(--border); color: var(--text-primary);
  cursor: pointer; transition: background var(--transition);
}
.onboarding-nav-btn:hover:not(:disabled) { background: var(--bg-surface); }
.onboarding-nav-btn:disabled { opacity: 0.4; cursor: default; }
.onboarding-nav-btn--primary { background: var(--accent); border-color: var(--accent); color: var(--text-inverse); }
.onboarding-nav-btn--primary:hover { opacity: 0.9; background: var(--accent); }

/* Back/Next/Done were sized for a mouse (~31px tall) — well under the ~44px
   touch-target guidance the rest of the mobile UI follows. Skip tour gets a
   real hit area too via padding rather than relying on its tight text
   bounds, without changing its inline position in the actions row. */
@media (max-width: 639px) {
  .onboarding-nav-btn { padding: 12px 16px; font-size: 14px; }
  .onboarding-skip { padding: 12px 0; font-size: 13px; }
}
