/* Interactive product tour — paired with public/tour.js.
   Uses chrome.css design tokens so dark / light themes track. */

#__syl_tour_root {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 1000;
  display: none;
}
#__syl_tour_root.show { display: block; }

/* Backdrop — dims the page while keeping the spotlight bright */
.syl-tour-backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.55);
  pointer-events: auto;
  cursor: pointer;
  animation: syl-tour-fade-in 0.18s ease-out;
}
[data-theme="light"] .syl-tour-backdrop {
  background: rgba(20, 30, 25, 0.35);
}

/* Spotlight — a cut-out outline around the current target.
   We don't actually cut a hole in the backdrop (would need SVG masks
   or clip-path on every shape); instead, the spot is a positioned
   green-outlined box with a heavy outer shadow that creates the
   illusion of a vignette focusing attention. */
.syl-tour-spot {
  position: absolute;
  border: 2px solid var(--accent);
  box-shadow:
    0 0 0 9999px rgba(0, 0, 0, 0.55),
    0 0 22px var(--accent-glow);
  background: transparent;
  pointer-events: none;
  border-radius: 4px;
  transition: all 0.25s cubic-bezier(0.2, 0.7, 0.2, 1);
  animation: syl-tour-pulse 1.6s ease-in-out infinite;
}
[data-theme="light"] .syl-tour-spot {
  box-shadow:
    0 0 0 9999px rgba(20, 30, 25, 0.35),
    0 0 22px var(--accent-glow);
}
@keyframes syl-tour-pulse {
  0%, 100% { box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55), 0 0 18px var(--accent-glow); }
  50%      { box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55), 0 0 32px var(--accent-glow); }
}

/* Popover — the actual instruction card */
.syl-tour-popover {
  position: absolute;
  width: min(420px, calc(100vw - 24px));
  background: var(--panel);
  border: 1px solid var(--accent);
  box-shadow:
    0 20px 60px -20px rgba(0, 0, 0, 0.6),
    0 0 40px -10px var(--accent-glow);
  padding: 18px 20px 16px;
  pointer-events: auto;
  font-family: var(--sans);
  color: var(--fg);
  animation: syl-tour-pop-in 0.22s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.syl-tour-popover.centered { /* visual hook for the no-target fallback */
  box-shadow: 0 20px 60px -20px rgba(0,0,0,0.6), 0 0 60px -10px var(--accent-glow);
}

.syl-tour-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
}
.syl-tour-spark {
  color: var(--accent); font-size: 14px; line-height: 1;
}
.syl-tour-pos {
  flex: 1;
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--mid);
}
.syl-tour-pos b { color: var(--accent); }
.syl-tour-skip {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em;
  padding: 4px 10px; border: 1px solid var(--line-2);
  background: transparent; color: var(--dim);
  cursor: pointer; transition: all 0.15s;
  text-transform: uppercase;
}
.syl-tour-skip:hover { border-color: var(--danger); color: var(--danger); }

.syl-tour-title {
  margin: 0 0 8px;
  font-family: var(--sans); font-weight: 500;
  font-size: 18px; letter-spacing: -0.01em; line-height: 1.25;
  color: var(--fg);
}
.syl-tour-body {
  font-family: var(--sans); font-size: 13px; line-height: 1.6;
  color: var(--mid);
  margin-bottom: 16px;
}
.syl-tour-body b { color: var(--accent); font-weight: 500; }
.syl-tour-body a { color: var(--accent); text-decoration: underline; }

.syl-tour-actions {
  display: flex; align-items: center; gap: 8px;
}
.syl-tour-spacer { flex: 1; }
.syl-tour-prev,
.syl-tour-next {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em;
  padding: 7px 14px;
  cursor: pointer; transition: all 0.15s;
  text-transform: uppercase;
}
.syl-tour-prev {
  background: transparent; color: var(--mid);
  border: 1px solid var(--line-2);
}
.syl-tour-prev:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.syl-tour-prev:disabled { opacity: 0.35; cursor: not-allowed; }
.syl-tour-next {
  background: var(--accent); color: #000;
  border: 1px solid var(--accent);
}
.syl-tour-next:hover { box-shadow: 0 0 18px var(--accent-glow); }

/* Animations */
@keyframes syl-tour-fade-in {
  from { opacity: 0; } to { opacity: 1; }
}
@keyframes syl-tour-pop-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .syl-tour-backdrop,
  .syl-tour-popover { animation: none; }
  .syl-tour-spot { animation: none; transition: none; }
}

/* ── /app welcome banner ──
   Floats above the Scout form on first sign-in. Dismissable; once
   localStorage 'syl-tour-banner-seen' is set we never show it again
   unless the user clears storage. */
.syl-tour-banner {
  display: none;
  position: relative;
  max-width: 1280px; margin: 12px auto 0;
  padding: 14px 20px;
  background: var(--panel);
  border: 1px solid var(--accent);
  box-shadow: 0 0 24px -8px var(--accent-glow);
  align-items: center; gap: 16px; flex-wrap: wrap;
}
.syl-tour-banner.show { display: flex; }
.syl-tour-banner .banner-text {
  flex: 1;
  font-family: var(--sans); font-size: 14px; color: var(--fg);
}
.syl-tour-banner .banner-text b { color: var(--accent); }
.syl-tour-banner .banner-text small {
  display: block;
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.12em; color: var(--mid);
  margin-top: 2px;
}
.syl-tour-banner .banner-go {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em;
  padding: 8px 16px;
  background: var(--accent); color: #000;
  border: 1px solid var(--accent);
  cursor: pointer; transition: box-shadow 0.15s;
  text-transform: uppercase;
}
.syl-tour-banner .banner-go:hover { box-shadow: 0 0 18px var(--accent-glow); }
.syl-tour-banner .banner-dismiss {
  font-family: var(--mono); font-size: 14px; line-height: 1;
  padding: 4px 8px; background: transparent;
  border: 1px solid var(--line-2); color: var(--dim);
  cursor: pointer; transition: all 0.15s;
}
.syl-tour-banner .banner-dismiss:hover { border-color: var(--danger); color: var(--danger); }
