/* PitStrike interactive product tour — premium overlay + spotlight */

.pitstrike-tour {
  position: fixed;
  inset: 0;
  z-index: 420;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  pointer-events: none;
  /* Let the spotlight “hole” show real UI; do not paint an opaque layer here. */
  background: transparent;
  isolation: isolate;
  --tour-accent: #58a6ff;
  --tour-accent-2: #a371f7;
  --tour-mint: #3fb950;
  --tour-amber: #d29922;
  --tour-card-bg: linear-gradient(145deg, rgba(22, 27, 34, 0.97) 0%, rgba(13, 17, 23, 0.99) 100%);
}

.pitstrike-tour * {
  box-sizing: border-box;
}

.pitstrike-tour.is-active {
  pointer-events: auto;
}

/* Full-screen dim only when there is no spotlight (welcome / finish / fallback). */
.pitstrike-tour__dim {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(ellipse 120% 80% at 50% 42%, rgba(6, 10, 16, 0.55) 0%, rgba(4, 8, 14, 0.88) 55%, rgba(2, 4, 8, 0.92) 100%);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  pointer-events: none !important;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease;
}

.pitstrike-tour__dim.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  animation: pitstrike-tour-dim-in 0.5s ease forwards;
}

@keyframes pitstrike-tour-dim-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.pitstrike-tour__spotlight {
  position: absolute;
  z-index: 1;
  border-radius: 12px;
  pointer-events: none;
  /* Critical: hole must stay empty so the live app shows through (no separate veil above the page). */
  background: transparent;
  box-shadow:
    0 0 0 2px rgba(88, 166, 255, 0.95),
    0 0 28px rgba(163, 113, 247, 0.45),
    0 0 0 9999px rgba(4, 8, 14, 0.82);
  transition:
    top 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    left 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    width 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    height 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.35s ease,
    border-radius 0.35s ease;
  opacity: 0;
}

.pitstrike-tour__spotlight.is-visible {
  opacity: 1;
  animation: pitstrike-tour-spot-pulse 2.4s ease-in-out infinite;
}

@keyframes pitstrike-tour-spot-pulse {
  0%,
  100% {
    box-shadow:
      0 0 0 2px rgba(88, 166, 255, 0.9),
      0 0 24px rgba(163, 113, 247, 0.35),
      0 0 0 9999px rgba(4, 8, 14, 0.82);
  }
  50% {
    box-shadow:
      0 0 0 3px rgba(63, 185, 80, 0.75),
      0 0 36px rgba(88, 166, 255, 0.5),
      0 0 0 9999px rgba(4, 8, 14, 0.82);
  }
}

.pitstrike-tour__spotlight.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.pitstrike-tour__card {
  position: absolute;
  z-index: 2;
  width: min(420px, calc(100vw - 32px));
  max-height: min(72vh, 520px);
  display: flex;
  flex-direction: column;
  padding: 0;
  border-radius: 14px;
  background: var(--tour-card-bg);
  border: 1px solid rgba(88, 166, 255, 0.28);
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(163, 113, 247, 0.12) inset,
    0 1px 0 rgba(255, 255, 255, 0.06) inset;
  overflow: hidden;
  opacity: 0;
  transform: translateY(14px) scale(0.97);
  animation: pitstrike-tour-card-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards 0.08s;
}

@keyframes pitstrike-tour-card-in {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.pitstrike-tour__card-glow {
  position: absolute;
  inset: -2px;
  border-radius: 16px;
  background: linear-gradient(
    125deg,
    rgba(88, 166, 255, 0.5),
    rgba(163, 113, 247, 0.45),
    rgba(63, 185, 80, 0.35),
    rgba(210, 153, 34, 0.4),
    rgba(88, 166, 255, 0.5)
  );
  background-size: 300% 300%;
  animation: pitstrike-tour-border-flow 8s linear infinite;
  z-index: 0;
  opacity: 0.55;
  filter: blur(8px);
  pointer-events: none;
}

@keyframes pitstrike-tour-border-flow {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.pitstrike-tour__card-inner {
  position: relative;
  z-index: 1;
  background: linear-gradient(180deg, rgba(22, 27, 34, 0.98) 0%, rgba(13, 17, 23, 0.99) 100%);
  margin: 1px;
  border-radius: 13px;
  display: flex;
  flex-direction: column;
  max-height: min(72vh, 520px);
}

.pitstrike-tour__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(48, 54, 61, 0.65);
}

.pitstrike-tour__badge {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--tour-accent) 0%, var(--tour-accent-2) 100%);
  box-shadow: 0 4px 16px rgba(88, 166, 255, 0.35);
  animation: pitstrike-tour-badge-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes pitstrike-tour-badge-pop {
  from {
    transform: scale(0.6) rotate(-8deg);
    opacity: 0;
  }
  to {
    transform: scale(1) rotate(0);
    opacity: 1;
  }
}

.pitstrike-tour__head-text {
  min-width: 0;
  flex: 1;
}

.pitstrike-tour__kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: linear-gradient(90deg, var(--tour-mint), var(--tour-accent), var(--tour-accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 4px;
}

.pitstrike-tour__title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #f0f6fc;
  line-height: 1.25;
}

.pitstrike-tour__body {
  padding: 12px 18px 16px;
  font-size: 13px;
  line-height: 1.55;
  color: #c9d1d9;
  overflow-y: auto;
  flex: 1;
}

.pitstrike-tour__body strong {
  color: #e6edf3;
  font-weight: 600;
}

.pitstrike-tour__progress {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px 12px;
}

.pitstrike-tour__progress-track {
  flex: 1;
  height: 4px;
  border-radius: 4px;
  background: rgba(48, 54, 61, 0.8);
  overflow: hidden;
}

.pitstrike-tour__progress-fill {
  height: 100%;
  border-radius: 4px;
  width: 0%;
  background: linear-gradient(90deg, var(--tour-accent), var(--tour-mint), var(--tour-accent-2));
  background-size: 200% 100%;
  animation: pitstrike-tour-progress-shine 2s linear infinite;
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes pitstrike-tour-progress-shine {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}

.pitstrike-tour__progress-label {
  font-size: 11px;
  font-weight: 600;
  color: #8b949e;
  white-space: nowrap;
}

.pitstrike-tour__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 18px 16px;
  border-top: 1px solid rgba(48, 54, 61, 0.5);
  background: rgba(1, 4, 9, 0.35);
}

.pitstrike-tour__btn {
  appearance: none;
  border: 1px solid rgba(48, 54, 61, 0.9);
  background: rgba(33, 38, 45, 0.95);
  color: #c9d1d9;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.12s ease;
}

.pitstrike-tour__btn:hover {
  background: rgba(48, 54, 61, 0.95);
  border-color: rgba(88, 166, 255, 0.35);
}

.pitstrike-tour__btn:active {
  transform: scale(0.98);
}

.pitstrike-tour__btn--primary {
  border-color: rgba(88, 166, 255, 0.55);
  background: linear-gradient(180deg, rgba(88, 166, 255, 0.22) 0%, rgba(56, 139, 253, 0.12) 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(88, 166, 255, 0.2);
}

.pitstrike-tour__btn--primary:hover {
  border-color: rgba(88, 166, 255, 0.85);
  background: linear-gradient(180deg, rgba(88, 166, 255, 0.32) 0%, rgba(56, 139, 253, 0.2) 100%);
}

.pitstrike-tour__btn--ghost {
  border-color: transparent;
  background: transparent;
  color: #8b949e;
}

.pitstrike-tour__btn--ghost:hover {
  color: #c9d1d9;
  background: rgba(48, 54, 61, 0.4);
}

@media (max-width: 520px) {
  .pitstrike-tour__actions {
    flex-direction: column;
  }

  .pitstrike-tour__btn {
    width: 100%;
    text-align: center;
  }
}

body.pitstrike-tour-open {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .pitstrike-tour__dim,
  .pitstrike-tour__card,
  .pitstrike-tour__spotlight,
  .pitstrike-tour__badge,
  .pitstrike-tour__progress-fill,
  .pitstrike-tour__card-glow {
    animation: none !important;
  }

  .pitstrike-tour__spotlight,
  .pitstrike-tour__card {
    transition: none !important;
  }
}
