/* Onboarding product tour - deliberately its own visual language, not
   TAPE's flat/minimal dashboard chrome. Dark glass surfaces, a vivid
   indigo→teal gradient accent, and real motion - the tour is a one-time
   (or on-demand) moment, not a screen the trader stares at all day, so
   it can afford to be louder than the rest of the app. */

:root {
  --tour-grad-1: #7c5cff;
  --tour-grad-2: #22d3c8;
  --tour-surface: rgba(17, 18, 26, 0.94);
  --tour-surface-2: rgba(255, 255, 255, 0.06);
  --tour-border: rgba(255, 255, 255, 0.12);
  --tour-ink: #f3f2fa;
  --tour-ink-dim: rgba(243, 242, 250, 0.68);
}

/* pointer-events:none on the ROOT (not just the ring) is what actually
   makes the spotlight "hole" clickable - .tour-root itself spans the
   full viewport (inset:0) and, being a real element, would otherwise
   sit in the hit-test path over the hole too even though no VISIBLE
   dim panel is drawn there. Everything that genuinely needs clicks
   (the dim panels themselves, the card) opts back in explicitly -
   pointer-events isn't auto-inherited as "none" would suggest, it has
   to be set back to auto on each of them. Found by simulating a real
   mouse click (not the .click() DOM method, which bypasses hit-testing
   entirely and had been silently hiding this the whole time it was
   used to verify the tour). */
.tour-root { position: fixed; inset: 0; z-index: 999995; pointer-events: none; }

.tour-dim {
  position: fixed;
  pointer-events: auto;
  background: rgba(7, 8, 14, 0.74);
  backdrop-filter: blur(1.5px);
  -webkit-backdrop-filter: blur(1.5px);
  transition: top 0.38s cubic-bezier(0.4, 0, 0.2, 1), left 0.38s cubic-bezier(0.4, 0, 0.2, 1),
              width 0.38s cubic-bezier(0.4, 0, 0.2, 1), height 0.38s cubic-bezier(0.4, 0, 0.2, 1);
}

.tour-ring {
  position: fixed;
  border-radius: 14px;
  pointer-events: none;
  box-shadow: 0 0 0 2px var(--tour-grad-2), 0 0 0 6px rgba(34, 211, 200, 0.18), 0 0 32px 4px rgba(124, 92, 255, 0.55);
  transition: top 0.38s cubic-bezier(0.4, 0, 0.2, 1), left 0.38s cubic-bezier(0.4, 0, 0.2, 1),
              width 0.38s cubic-bezier(0.4, 0, 0.2, 1), height 0.38s cubic-bezier(0.4, 0, 0.2, 1);
  animation: tour-ring-pulse 2.2s ease-in-out infinite;
}
.tour-ring.hidden { display: none; }

@keyframes tour-ring-pulse {
  0%, 100% { box-shadow: 0 0 0 2px var(--tour-grad-2), 0 0 0 6px rgba(34, 211, 200, 0.18), 0 0 32px 4px rgba(124, 92, 255, 0.55); }
  50% { box-shadow: 0 0 0 2px var(--tour-grad-2), 0 0 0 9px rgba(34, 211, 200, 0.1), 0 0 44px 8px rgba(124, 92, 255, 0.7); }
}

.tour-card {
  position: fixed;
  pointer-events: auto;
  width: min(21.5rem, calc(100vw - 2.25rem));
  background: var(--tour-surface);
  border: 1px solid var(--tour-border);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), 0 4px 16px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  overflow: hidden;
  animation: tour-card-in 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.1);
  transition: top 0.38s cubic-bezier(0.4, 0, 0.2, 1), left 0.38s cubic-bezier(0.4, 0, 0.2, 1);
}
.tour-card.tour-card-center {
  position: fixed; top: 50% !important; left: 50% !important;
  transform: translate(-50%, -50%);
  width: min(24rem, calc(100vw - 2.25rem));
}

@keyframes tour-card-in {
  from { opacity: 0; transform: scale(0.94) translateY(6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.tour-card.tour-card-center { animation: tour-card-in-center 0.36s cubic-bezier(0.2, 0.9, 0.3, 1.1); }
@keyframes tour-card-in-center {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.92); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.tour-card-progress { height: 3px; background: rgba(255, 255, 255, 0.08); }
.tour-card-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--tour-grad-1), var(--tour-grad-2));
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.tour-card-body { padding: 1.15rem 1.25rem 1.1rem; }

.tour-card-kicker {
  font-family: "SF Mono", "Cascadia Code", ui-monospace, monospace;
  font-size: 0.66rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: transparent;
  background: linear-gradient(90deg, var(--tour-grad-1), var(--tour-grad-2));
  -webkit-background-clip: text; background-clip: text;
  margin-bottom: 0.4rem;
}

.tour-card-title {
  margin: 0 0 0.45rem;
  font-family: var(--font-display, system-ui), system-ui, sans-serif;
  font-weight: 700; font-size: 1.15rem; line-height: 1.25;
  color: var(--tour-ink);
}

.tour-card-text {
  margin: 0;
  font-size: 0.86rem; line-height: 1.55;
  color: var(--tour-ink-dim);
}

.tour-card-hint {
  margin: 0.6rem 0 0;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  background: var(--tour-surface-2);
  border: 1px dashed rgba(34, 211, 200, 0.45);
  font-size: 0.72rem; font-weight: 600;
  color: #6fe9df;
  display: flex; align-items: center; gap: 0.4rem;
}
.tour-card-hint::before { content: "👆"; font-size: 0.85rem; }

.tour-card-actions { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-top: 1rem; }
.tour-card-actions-right { display: flex; align-items: center; gap: 0.5rem; }

.tour-btn {
  font-family: inherit; font-size: 0.76rem; font-weight: 600; cursor: pointer;
  border-radius: 8px; padding: 0.45rem 0.85rem; border: 1px solid transparent;
  transition: transform 0.12s ease, filter 0.12s ease, background 0.12s ease;
}
.tour-btn:active { transform: scale(0.96); }

.tour-btn-skip { background: none; border-color: transparent; color: var(--tour-ink-dim); padding-left: 0.2rem; }
.tour-btn-skip:hover { color: var(--tour-ink); }

.tour-btn-back { background: var(--tour-surface-2); border-color: var(--tour-border); color: var(--tour-ink); }
.tour-btn-back:hover { background: rgba(255, 255, 255, 0.1); }

.tour-btn-next {
  background: linear-gradient(90deg, var(--tour-grad-1), var(--tour-grad-2));
  color: #0b0c12; font-weight: 700;
  box-shadow: 0 4px 16px rgba(124, 92, 255, 0.35);
}
.tour-btn-next:hover { filter: brightness(1.08); }

.tour-btn.hidden { display: none; }

@media (prefers-reduced-motion: reduce) {
  .tour-ring { animation: none; }
  .tour-card, .tour-dim, .tour-ring { transition: none; animation: none; }
}
