/* Onboarding tour — spotlight mask + popover. See src/js/components/tour.js.
   Colors come entirely from the theme tokens in variables.css, so the tour
   re-skins itself under every appearance (Classic / Windows 2000 / Ivory / Jarvis). */

/* Transparent, full-screen click-swallow layer. Sits just under the dim panels
   so the highlighted element stays visible but nothing underneath is clickable
   while the tour drives the app. */
.tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000000;
  background: transparent;
  cursor: default;
}

/* The four dim panels (purely visual — pointer-events off) that surround the
   highlight gap, plus the highlight ring. */
.tour-mask {
  position: fixed;
  inset: 0;
  z-index: 2000001;
  pointer-events: none;
}

.tour-mask-panel {
  position: fixed;
  background: rgba(0, 0, 0, 0.55);
  transition: left var(--speed) ease, top var(--speed) ease,
              width var(--speed) ease, height var(--speed) ease;
}

/* Centered steps (welcome / finish): a single full-screen scrim. */
.tour-mask--center .tour-mask-top { transition: none; }

.tour-ring {
  position: fixed;
  border: 2px solid var(--gold);
  border-radius: 10px;
  box-shadow: 0 0 0 2px var(--gold-soft), 0 0 22px 4px var(--gold-soft);
  pointer-events: none;
  transition: left var(--speed) ease, top var(--speed) ease,
              width var(--speed) ease, height var(--speed) ease;
}

/* The explanatory card. */
.tour-popover {
  position: fixed;
  z-index: 2000002;
  width: 320px;
  max-width: calc(100vw - 20px);
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
  font-family: var(--font-body);
  overflow: hidden;
  transition: left var(--speed) ease, top var(--speed) ease;
  animation: tour-pop-in 0.18s ease both;
}

@keyframes tour-pop-in {
  from { opacity: 0; transform: scale(0.97); }
  to   { opacity: 1; transform: scale(1); }
}

.tour-popover-body {
  padding: 18px 20px 14px;
}

.tour-title {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
}

.tour-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-muted);
}

.tour-text strong { color: var(--text); font-weight: 600; }

.tour-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-warm);
  /* If the dots + buttons can't share one row, let the actions drop to their
     own line instead of being clipped by the card's overflow:hidden. */
  flex-wrap: wrap;
}

.tour-progress {
  display: flex;
  align-items: center;
  gap: 6px;
  /* Many steps = many dots. Let the dot strip shrink and wrap so it yields
     space to the buttons rather than pushing them past the card edge. */
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: wrap;
}

.tour-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
  transition: background var(--speed) ease, transform var(--speed) ease;
}

.tour-dot.is-active {
  background: var(--gold);
  transform: scale(1.35);
}

.tour-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  /* Never shrink the buttons — they stay full-size and fully visible; the
     progress dots yield space instead. */
  flex-shrink: 0;
  margin-left: auto;
}

/* Skip is a quiet text button; Back/Next reuse the app's button classes. */
.tour-skip {
  background: none;
  border: none;
  padding: 6px 4px;
  font: inherit;
  font-size: 13px;
  color: var(--text-dim);
  cursor: pointer;
}
.tour-skip:hover { color: var(--text-muted); text-decoration: underline; }

.tour-actions .btn-ghost,
.tour-actions .btn-primary {
  padding: 7px 16px;
  font-size: 13px;
}

/* Tighter layout on very small screens. */
@media (max-width: 480px) {
  .tour-popover { width: calc(100vw - 20px); }
}

/* ── Help menu (src/js/components/help-menu.js) ──────────────────────────────
   A small modal listing help actions; the first replays the tour. */
.help-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000010;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: tour-pop-in 0.16s ease both;
}

.help-card {
  width: 360px;
  max-width: calc(100vw - 24px);
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
  font-family: var(--font-body);
  overflow: hidden;
}

.help-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
}

.help-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.help-close {
  background: none;
  border: none;
  font-size: 16px;
  line-height: 1;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
}
.help-close:hover { color: var(--text); background: var(--bg-warm); }

.help-list {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.help-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  background: none;
  border: none;
  border-radius: 10px;
  text-align: left;
  font: inherit;
  color: var(--text);
  cursor: pointer;
  transition: background var(--speed) ease;
}
.help-item:hover { background: var(--gold-soft); }

.help-item-icon { font-size: 20px; flex: 0 0 auto; }

.help-item-text { display: flex; flex-direction: column; }

.help-item-label { font-size: 14px; font-weight: 600; color: var(--text); }

.help-item-desc { font-size: 12px; color: var(--text-muted); }

/* "Soon" pill on Help items that aren't wired up yet (e.g. the beta survey /
   guide before their URLs are set). Signals "don't bother clicking". */
.help-item-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: var(--border-light);
  border-radius: 999px;
  vertical-align: middle;
}
/* Dim the whole row a touch so it reads as not-yet-available. */
.help-item.is-soon .help-item-icon,
.help-item.is-soon .help-item-label { opacity: 0.72; }
