/* css/tour.css: interactive tutorial (see js/tour.js) */

/* 🎓 Tutorial button in the header, styled to match the 📖 User Guide link */
.tour-launch {
  color: var(--accent2); font-weight: 600; font-size: 11px; letter-spacing: 0.05em;
  font-family: var(--font-body); text-shadow: none; cursor: pointer;
  background: var(--bg3); padding: 4px 8px; border-radius: 6px; border: 1px solid var(--border);
}
@media (hover: hover) { .tour-launch:hover { border-color: var(--border2); background: var(--bg4); } }

.tour-root { position: fixed; inset: 0; z-index: 10002; pointer-events: none; }

/* Swallows clicks on the page while the tour is open */
.tour-blocker { position: absolute; inset: 0; pointer-events: auto; }
.tour-root.tour-dim .tour-blocker { background: rgba(8, 6, 14, 0.72); }
/* ...except while a step is waiting for the person to do the thing, when the page has to be usable. */
.tour-root.tour-pass .tour-blocker { pointer-events: none; }
/* A dialog is z-index 200, far below the tour, so during a tour it would open behind the dimming.
   Lift it while the tour is running, with the tour above it again so the instructions stay readable
   over the dialog's own backdrop. The card cannot be lifted on its own - .tour-root makes a stacking
   context, so its children cannot escape it - which is why the whole root moves. reposition() then
   hides the spotlight while a dialog is open, since the dialog already dims the page for us. */
body.tour-active .modal-bg.open { z-index: 10001; }

/* Highlight box; its huge shadow darkens everything around it */
.tour-spot {
  position: fixed; border-radius: 14px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(8, 6, 14, 0.72), 0 0 0 2px var(--accent), 0 0 24px var(--accent-glow);
}
/* Animate only when moving to another step; while the page scrolls the box follows instantly. */
.tour-root.tour-anim .tour-spot { transition: top .25s ease, left .25s ease, width .25s ease, height .25s ease; }

.tour-card {
  position: fixed; pointer-events: auto; width: min(360px, calc(100vw - 32px));
  background: var(--bg2); color: var(--text); border: 1px solid var(--border2);
  border-radius: 16px; padding: 18px 18px 14px; box-shadow: 0 16px 40px rgba(0,0,0,0.55);
  font-family: var(--font-body); font-size: 13px; line-height: 1.55;
  outline: none;
}
.tour-card-center { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); width: min(420px, calc(100vw - 32px)); }
.tour-card-sheet {
  left: 12px !important; right: 12px; top: auto !important; bottom: 12px; width: auto;
  max-height: 46vh; overflow-y: auto;
}

.tour-progress { height: 3px; background: var(--bg3); border-radius: 3px; overflow: hidden; margin-bottom: 10px; }
.tour-progress-fill { height: 100%; background: var(--accent); width: 0; transition: width .25s ease; }
.tour-count { font-size: 10px; color: var(--text3); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px; }
.tour-title { font-family: var(--font-head); font-size: 15px; color: var(--gold); margin-bottom: 8px; letter-spacing: .02em; }
.tour-body { color: var(--text2); }
.tour-body b { color: var(--text); font-weight: 600; }
.tour-body code { background: var(--bg3); padding: 1px 5px; border-radius: 4px; font-size: 12px; }

/* Opening card: the two ways through the tour */
.tour-choices { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.tour-choice {
  display: flex; flex-direction: column; gap: 3px; width: 100%; text-align: left; cursor: pointer;
  font-family: var(--font-body); background: var(--bg3); color: var(--text);
  border: 1px solid var(--border); border-radius: 12px; padding: 11px 13px;
}
.tour-choice-label { font-weight: 600; font-size: 13px; }
.tour-choice-hint { font-size: 11.5px; color: var(--text3); line-height: 1.45; }
@media (hover: hover) { .tour-choice:hover { border-color: var(--accent); background: var(--bg4); } }
.tour-choice:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Shown while a step waits for the person to do something in the app */
.tour-wait {
  display: flex; align-items: center; gap: 8px; margin-top: 12px;
  font-size: 12px; color: var(--accent2);
}
.tour-wait-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none;
  animation: tour-pulse 1.4s ease-in-out infinite;
}
@keyframes tour-pulse { 0%, 100% { opacity: .35; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.15); } }
/* Done: the hint turns into a nudge toward Next, which is now theirs to press. */
.tour-wait-done { color: var(--green); }
.tour-wait-tick { font-weight: 700; flex: none; }

/* Next is out of reach until the step has been done - "Skip this step" is the way past otherwise. */
.tour-next:disabled {
  background: var(--bg3); color: var(--text3); box-shadow: none; cursor: not-allowed; font-weight: 500;
}
@media (hover: hover) { .tour-next:disabled:hover { background: var(--bg3); } }
.tour-stepskip {
  font-family: var(--font-body); font-size: 12px; font-weight: 500; cursor: pointer;
  border-radius: 20px; padding: 7px 12px; border: none; background: none; color: var(--text3);
}
@media (hover: hover) { .tour-stepskip:hover { color: var(--text2); } }
.tour-stepskip:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.tour-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; gap: 8px; }
.tour-nav { display: flex; gap: 6px; }
.tour-skip, .tour-back, .tour-next {
  font-family: var(--font-body); font-size: 12px; font-weight: 600; cursor: pointer;
  border-radius: 20px; padding: 7px 14px; border: none;
}
.tour-skip { background: none; color: var(--text3); padding-left: 0; }
.tour-back { background: var(--bg3); color: var(--text); }
.tour-next { background: var(--accent); color: #0a1a14; box-shadow: 0 4px 12px var(--accent-glow); }
@media (hover: hover) {
  .tour-skip:hover { color: var(--text2); }
  .tour-back:hover { background: var(--bg4); }
  .tour-next:hover { background: var(--accent2); }
}
.tour-skip:focus-visible, .tour-back:focus-visible, .tour-next:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .tour-root.tour-anim .tour-spot, .tour-progress-fill { transition: none; }
  .tour-wait-dot { animation: none; opacity: .8; }
}
