/* ==========================================================================
   FinPulse Live UI Walkthrough Component Styles
   Simulated user journey across real UI tabs of https://finpulse-demo.minotaur-kitefin.ts.net/
   Harmonized with emanuelandreescu.com design system tokens
   ========================================================================== */

.fp-tour {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
  user-select: none;
}

/* --------------------------------------------------------------------------
   Top Sub-Navigation Bar (Tabs + Controls)
   -------------------------------------------------------------------------- */
.fp-tour__nav {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: color-mix(in oklab, var(--bg-2) 90%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.fp-tour__tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.fp-tour__tabs::-webkit-scrollbar {
  display: none;
}

.fp-tour__tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font: 500 0.74rem/1 var(--f-mono);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s, background 0.2s, border-color 0.2s, transform 0.15s;
}

.fp-tour__tab:hover {
  color: var(--fg);
  background: color-mix(in oklab, var(--surface) 60%, transparent);
}

.fp-tour__tab.is-active {
  color: var(--fg);
  background: var(--surface);
  border-color: var(--line-strong);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.fp-tour__tab-num {
  font-size: 0.68rem;
  color: var(--accent-verified);
  font-weight: 600;
}
.fp-tour__tab.is-active .fp-tour__tab-num {
  color: var(--accent-verified);
  text-shadow: 0 0 8px var(--accent-verified-soft);
}

.fp-tour__controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.fp-tour__ctrl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.fp-tour__ctrl-btn:hover {
  color: var(--fg);
  border-color: var(--line-strong);
  background: color-mix(in oklab, var(--surface) 80%, var(--fg) 5%);
}

.fp-tour__ctrl-btn svg {
  width: 14px;
  height: 14px;
}

.fp-tour__play-icon {
  display: none;
}
.fp-tour.is-paused .fp-tour__pause-icon {
  display: none;
}
.fp-tour.is-paused .fp-tour__play-icon {
  display: inline-block;
}

/* --------------------------------------------------------------------------
   Step Progress Bar
   -------------------------------------------------------------------------- */
.fp-tour__progress-bar {
  position: relative;
  z-index: 10;
  width: 100%;
  height: 2px;
  background: var(--line);
  overflow: hidden;
}

.fp-tour__progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-verified), var(--kw-sky));
  transition: width 0.1s linear;
}

/* --------------------------------------------------------------------------
   Viewport & Slides
   -------------------------------------------------------------------------- */
.fp-tour__viewport {
  position: relative;
  flex: 1;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  background: #06090e;
}

.fp-tour__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s var(--ease), transform 0.6s var(--ease);
  transform: scale(1.015);
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.fp-tour__slide.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.fp-tour__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

/* --------------------------------------------------------------------------
   Hotspot Pin & Radar Ping
   -------------------------------------------------------------------------- */
.fp-tour__slide picture {
  display: contents;
}
.fp-tour__hotspot {
  top: var(--y);
  left: var(--x);
  position: absolute;
  width: 22px;
  height: 22px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 5;
}

.fp-tour__dot {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--accent-verified);
  box-shadow: 0 0 10px var(--accent-verified);
}

.fp-tour__ping {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--accent-verified);
  animation: fp-ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes fp-ping {
  0% { transform: scale(0.6); opacity: 1; }
  80%, 100% { transform: scale(2.2); opacity: 0; }
}

/* --------------------------------------------------------------------------
   Simulated Mouse Pointer & Click
   -------------------------------------------------------------------------- */
.fp-tour__cursor {
  position: absolute;
  width: 22px;
  height: 22px;
  pointer-events: none;
  z-index: 15;
  transition: top 0.75s cubic-bezier(0.22, 1, 0.36, 1), left 0.75s cubic-bezier(0.22, 1, 0.36, 1);
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.6));
}

.fp-tour__cursor-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-15deg);
}

.fp-tour__cursor-ripple {
  position: absolute;
  left: 2px;
  top: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--accent-verified);
  opacity: 0;
}

.fp-tour__cursor.is-clicking .fp-tour__cursor-ripple {
  animation: fp-cursor-click 0.6s ease-out;
}

@keyframes fp-cursor-click {
  0% { transform: scale(0.4); opacity: 1; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* --------------------------------------------------------------------------
   Glassmorphic Journey HUD Overlay
   -------------------------------------------------------------------------- */
.fp-tour__hud {
  position: absolute;
  left: clamp(12px, 2.5vw, 24px);
  bottom: clamp(12px, 2.5vw, 22px);
  max-width: min(520px, calc(100% - 24px));
  z-index: 20;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: color-mix(in oklab, var(--surface) 88%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 16px 36px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: rise 0.4s var(--ease) both;
}

.fp-tour__hud-tag {
  display: flex;
  align-items: center;
  gap: 7px;
}

.fp-tour__hud-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-verified);
  box-shadow: 0 0 8px var(--accent-verified);
  animation: live-pulse 2s infinite ease-in-out;
}

.fp-tour__hud-stage {
  font: 600 0.68rem/1 var(--f-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-verified);
}

.fp-tour__hud-title {
  margin: 0;
  font: 600 clamp(0.92rem, 0.8rem + 0.5vw, 1.15rem)/1.25 var(--f-body);
  color: var(--fg);
  letter-spacing: -0.015em;
}

.fp-tour__hud-desc {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--muted);
}

.fp-tour__hud-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.fp-tour__hud-pill {
  font: 500 0.68rem/1 var(--f-mono);
  padding: 4px 8px;
  border-radius: 5px;
  background: var(--bg-2);
  color: var(--muted);
  border: 1px solid var(--line);
  white-space: nowrap;
}

.fp-tour__hud-pill--green {
  color: var(--accent-verified);
  background: var(--accent-verified-soft);
  border-color: color-mix(in oklab, var(--accent-verified) 30%, transparent);
}

/* --------------------------------------------------------------------------
   Responsive Adaptations
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  /* Phone captures: hotspot coordinates measured on the portrait image. */
  .fp-tour__hotspot {
    top: var(--my, var(--y));
    left: var(--mx, var(--x));
  }
  .fp-tour__tab-name {
    display: none;
  }
  .fp-tour__tab {
    padding: 5px 8px;
  }
  .fp-tour__hud {
    left: 8px;
    right: 8px;
    bottom: 8px;
    max-width: none;
    padding: 7px 11px;
    gap: 3px;
    background: rgba(9, 13, 19, 0.84);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 9px;
    border: 1px solid var(--line-strong);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  }
  .fp-tour__hud-tag {
    gap: 5px;
  }
  .fp-tour__hud-stage {
    font-size: 0.60rem;
    letter-spacing: 0.08em;
  }
  .fp-tour__hud-title {
    font-size: 0.80rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .fp-tour__hud-desc {
    display: none;
  }
  .fp-tour__hud-pills {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fp-tour__cursor {
    display: none;
  }
  .fp-tour__ping {
    animation: none;
  }
  .fp-tour__slide {
    transition: opacity 0.2s ease;
    transform: none !important;
  }
}
