/* ============================================================
 * FTIR.fun Spectrum Extraction — Guided Tour
 * Dark-themed spotlight tour matching the advanced-upload page.
 * ============================================================ */

.ft-tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  /* spotlight mask is set via JS on --ft-tour-x/y/w/h */
  background: radial-gradient(
    circle at var(--ft-tour-cx, 50%) var(--ft-tour-cy, 50%),
    transparent 0,
    transparent calc(var(--ft-tour-r, 200px) - 4px),
    rgba(5, 9, 20, 0.72) calc(var(--ft-tour-r, 200px) + 4px),
    rgba(5, 9, 20, 0.82) 100%
  );
  transition: background 320ms cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
}
.ft-tour-overlay.is-active {
  opacity: 1;
  pointer-events: none;
}

.ft-tour-spotlight {
  position: fixed;
  z-index: 9997;
  border: 2px solid #22d3ee;
  border-radius: 8px;
  box-shadow:
    0 0 0 4px rgba(34, 211, 238, 0.18),
    0 0 24px rgba(34, 211, 238, 0.45),
    inset 0 0 0 1px rgba(34, 211, 238, 0.25);
  pointer-events: none;
  transition: opacity 180ms ease;
  opacity: 0;
}
.ft-tour-spotlight.is-active {
  opacity: 1;
}
.ft-tour-spotlight::before {
  content: "";
  position: absolute;
  inset: -10px;
  border: 1px dashed rgba(34, 211, 238, 0.5);
  border-radius: 12px;
  animation: ft-tour-pulse 1.6s ease-in-out infinite;
}
@keyframes ft-tour-pulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.04); opacity: 0.25; }
}

.ft-tour-reveal {
  display: block !important;
}

.ft-tour-tooltip {
  position: fixed;
  z-index: 9999;
  max-width: 360px;
  min-width: 280px;
  padding: 0;
  background: #0f1622;
  border: 1px solid rgba(34, 211, 238, 0.35);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.04);
  color: #e2e8f0;
  font-family: "Inter", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 240ms ease, transform 240ms cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}
.ft-tour-tooltip.is-active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.ft-tour-tooltip__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px 6px;
}
.ft-tour-tooltip__badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #22d3ee;
  color: #0a0e17;
  font-weight: 700;
  font-size: 13px;
  font-family: var(--ft-font-mono, "SFMono-Regular", monospace);
}
.ft-tour-tooltip__title {
  flex: 1;
  font-weight: 600;
  font-size: 14px;
  color: #22d3ee;
  letter-spacing: 0.02em;
}
.ft-tour-tooltip__close {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border: 0;
  background: transparent;
  color: #8899aa;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
  transition: background 160ms ease, color 160ms ease;
}
.ft-tour-tooltip__close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
}

.ft-tour-tooltip__body {
  padding: 0 16px 12px;
  color: #b8c4d4;
}
.ft-tour-tooltip__body b {
  color: #e2e8f0;
  font-weight: 600;
}

.ft-tour-tooltip__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.ft-tour-tooltip__progress {
  font-size: 12px;
  color: #5a6b85;
  font-family: var(--ft-font-mono, "SFMono-Regular", monospace);
}
.ft-tour-tooltip__btns {
  display: flex;
  gap: 8px;
}
.ft-tour-btn {
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}
.ft-tour-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
}
.ft-tour-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.ft-tour-btn--primary {
  background: #22d3ee;
  border-color: #22d3ee;
  color: #0a0e17;
  font-weight: 600;
}
.ft-tour-btn--primary:hover {
  background: #06b6d4;
  border-color: #06b6d4;
}
.ft-tour-btn--skip {
  background: transparent;
  border-color: transparent;
  color: #5a6b85;
}
.ft-tour-btn--skip:hover {
  color: #8899aa;
  background: transparent;
}

/* arrow pointing from tooltip to spotlight */
.ft-tour-tooltip__arrow {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #0f1622;
  border: 1px solid rgba(34, 211, 238, 0.35);
  transform: rotate(45deg);
}
.ft-tour-tooltip__arrow--top {
  top: -7px;
  border-right: 0;
  border-bottom: 0;
}
.ft-tour-tooltip__arrow--bottom {
  bottom: -7px;
  border-left: 0;
  border-top: 0;
}
.ft-tour-tooltip__arrow--left {
  left: -7px;
  border-right: 0;
  border-top: 0;
}
.ft-tour-tooltip__arrow--right {
  right: -7px;
  border-left: 0;
  border-bottom: 0;
}

/* Start Guide button (added to the Quick Tips notice) */
.ft-tour-launch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  margin-left: 10px;
  border-radius: 6px;
  border: 1px solid #22d3ee;
  background: rgba(34, 211, 238, 0.1);
  color: #22d3ee;
  font-size: 0.9em;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background 160ms ease, box-shadow 160ms ease;
}
.ft-tour-launch:hover {
  background: rgba(34, 211, 238, 0.2);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15);
}
.ft-tour-launch__dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22d3ee;
  animation: ft-tour-launch-pulse 1.4s ease-in-out infinite;
}
@keyframes ft-tour-launch-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.75); }
}

/* Welcome overlay (step 0, no spotlight) */
.ft-tour-welcome {
  position: fixed;
  z-index: 9999;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 520px;
  width: calc(100% - 48px);
  padding: 32px 32px 24px;
  background: linear-gradient(160deg, #0f1622 0%, #111d2e 100%);
  border: 1px solid rgba(34, 211, 238, 0.3);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7);
  color: #e2e8f0;
  text-align: center;
  opacity: 0;
  transition: opacity 280ms ease;
  pointer-events: none;
}
.ft-tour-welcome.is-active {
  opacity: 1;
  pointer-events: auto;
}
.ft-tour-welcome__eyebrow {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #22d3ee;
  margin-bottom: 10px;
}
.ft-tour-welcome__title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 12px;
  color: #f1f5f9;
}
.ft-tour-welcome__desc {
  font-size: 14px;
  line-height: 1.7;
  color: #93a7c4;
  margin: 0 0 20px;
}
.ft-tour-welcome__steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 24px;
}
.ft-tour-welcome__step {
  padding: 10px 6px;
  border: 1px solid rgba(34, 211, 238, 0.2);
  border-radius: 8px;
  background: rgba(34, 211, 238, 0.04);
  font-size: 11px;
  color: #b8c4d4;
}
.ft-tour-welcome__step b {
  display: block;
  color: #22d3ee;
  font-size: 13px;
  margin-bottom: 2px;
  font-family: var(--ft-font-mono, monospace);
}
.ft-tour-welcome__btns {
  display: flex;
  gap: 10px;
  justify-content: center;
}

@media (max-width: 640px) {
  .ft-tour-tooltip {
    max-width: calc(100vw - 32px);
    min-width: 0;
  }
  .ft-tour-welcome__steps {
    grid-template-columns: repeat(2, 1fr);
  }
}
