/* Demo Tour - Interactive Onboarding System */

/* Overlay that covers the page */
.tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.tour-overlay.active {
  pointer-events: auto;
}

/* SVG-based spotlight mask for clean cutout effect */
/* OVERLAY MODE: The overlay is purely visual and never blocks clicks */
.tour-spotlight-svg {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;  /* ALWAYS pass through - never block user interaction */
  opacity: 0;
  transition: opacity 0.3s ease;
}

.tour-spotlight-svg.active {
  /* Keep pointer-events: none even when active - this is the key change */
  /* The overlay is purely visual, users can click through it */
  opacity: 1;
}

/* Highlighted element - PURE VISUAL, NO LAYOUT CHANGES */
/* Using outline (not border) to avoid any layout impact */
/* Outline doesn't affect element dimensions or position */
.tour-highlight {
  outline: 3px solid #3758F9;
  outline-offset: 4px;
  /* No position, z-index, or pointer-events changes */
  /* Element stays exactly where it was in the DOM flow */
}

/* Interactive target - just a visual hint, no style modifications */
.tour-interactive-target {
  /* No position/z-index changes - element stays in place */
  /* The dashed outline is purely visual feedback */
  outline: 2px dashed #F59E0B !important;
  outline-offset: 4px;
}

@keyframes tour-pulse {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 20px rgba(55, 88, 249, 0.3);
  }
  50% {
    opacity: 0.7;
    box-shadow: 0 0 30px rgba(55, 88, 249, 0.5);
  }
}

/* Interactive step indicator - bouncing hand pointer */
.tour-interactive-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 32px;
  animation: tour-bounce 1s ease-in-out infinite;
  pointer-events: none;
  z-index: 10001;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

@keyframes tour-bounce {
  0%, 100% {
    transform: translate(-50%, -50%) translateY(0);
  }
  50% {
    transform: translate(-50%, -50%) translateY(-8px);
  }
}

/* Tooltip container - starts hidden with no pointer events */
.tour-tooltip {
  position: fixed;
  z-index: 10000;
  width: 340px;
  max-width: calc(100vw - 32px);
  background: white;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;  /* CRITICAL: Don't block clicks when hidden */
  overflow: hidden;
}

.tour-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;  /* Only enable when visible */
}

/* Tooltip arrow */
.tour-tooltip::before {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  background: white;
  transform: rotate(45deg);
  box-shadow: -1px -1px 0 rgba(0, 0, 0, 0.05);
}

.tour-tooltip[data-position="bottom"]::before {
  top: -6px;
  left: 50%;
  margin-left: -6px;
}

.tour-tooltip[data-position="top"]::before {
  bottom: -6px;
  left: 50%;
  margin-left: -6px;
  box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.05);
}

.tour-tooltip[data-position="left"]::before {
  right: -6px;
  top: 50%;
  margin-top: -6px;
  box-shadow: 1px -1px 0 rgba(0, 0, 0, 0.05);
}

.tour-tooltip[data-position="right"]::before {
  left: -6px;
  top: 50%;
  margin-top: -6px;
  box-shadow: -1px 1px 0 rgba(0, 0, 0, 0.05);
}

/* Tooltip header with step indicator */
.tour-tooltip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 0;
}

.tour-step-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: linear-gradient(135deg, #3758F9 0%, #5B7AFA 100%);
  color: white;
  font-size: 11px;
  font-weight: 600;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tour-step-badge svg {
  width: 12px;
  height: 12px;
}

.tour-close-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #6B7280;
  transition: all 0.15s ease;
  cursor: pointer;
  border: none;
  background: transparent;
}

.tour-close-btn:hover {
  background: #F3F4F6;
  color: #374151;
}

/* Tooltip content */
.tour-tooltip-content {
  padding: 14px 16px;
}

.tour-tooltip-title {
  font-size: 16px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 8px;
  line-height: 1.3;
}

.tour-tooltip-description {
  font-size: 13px;
  color: #6B7280;
  line-height: 1.6;
  margin: 0;
}

.tour-tooltip-description strong {
  color: #374151;
  font-weight: 600;
}

/* Pro tip callout */
.tour-pro-tip {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 12px;
  background: #F0F4FF;
  border-radius: 10px;
  font-size: 12px;
  color: #4B5EAA;
  line-height: 1.5;
}

.tour-pro-tip-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #3758F9;
  color: white;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
}

/* Tooltip footer with navigation */
.tour-tooltip-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #F9FAFB;
  border-top: 1px solid #F3F4F6;
}

/* Progress dots */
.tour-progress {
  display: flex;
  gap: 6px;
}

.tour-progress-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #E5E7EB;
  transition: all 0.2s ease;
}

.tour-progress-dot.active {
  background: #3758F9;
  transform: scale(1.1);
}

.tour-progress-dot.completed {
  background: #10B981;
}

/* Navigation buttons */
.tour-nav-buttons {
  display: flex;
  gap: 8px;
}

.tour-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
}

.tour-btn-secondary {
  background: white;
  color: #374151;
  border: 1px solid #E5E7EB;
}

.tour-btn-secondary:hover {
  background: #F9FAFB;
  border-color: #D1D5DB;
}

.tour-btn-primary {
  background: linear-gradient(135deg, #3758F9 0%, #5B7AFA 100%);
  color: white;
  box-shadow: 0 2px 4px rgba(55, 88, 249, 0.3);
}

.tour-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(55, 88, 249, 0.4);
}

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

/* Welcome modal - starts hidden with no pointer events */
.tour-welcome-modal {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: none;  /* CRITICAL: Start hidden via display */
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;  /* CRITICAL: Don't block clicks when hidden */
  transition: opacity 0.3s ease;
}

.tour-welcome-modal.visible {
  opacity: 1;
  pointer-events: auto;  /* Only enable when visible */
}

.tour-welcome-card {
  width: 100%;
  max-width: 440px;
  background: white;
  border-radius: 20px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.3s ease;
}

.tour-welcome-modal.visible .tour-welcome-card {
  transform: scale(1) translateY(0);
}

.tour-welcome-header {
  position: relative;
  padding: 32px 24px 24px;
  background: linear-gradient(135deg, #3758F9 0%, #5B7AFA 100%);
  color: white;
  text-align: center;
}

.tour-welcome-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tour-welcome-icon svg {
  width: 32px;
  height: 32px;
}

.tour-welcome-header h2 {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 8px;
}

.tour-welcome-header p {
  font-size: 14px;
  opacity: 0.9;
  margin: 0;
}

.tour-welcome-body {
  padding: 24px;
}

.tour-feature-list {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
}

.tour-feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #F3F4F6;
}

.tour-feature-list li:last-child {
  border-bottom: none;
}

.tour-feature-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #F0F4FF;
  border-radius: 10px;
  color: #3758F9;
}

.tour-feature-icon svg {
  width: 18px;
  height: 18px;
}

.tour-feature-text {
  flex: 1;
}

.tour-feature-text strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 2px;
}

.tour-feature-text span {
  font-size: 13px;
  color: #6B7280;
}

.tour-welcome-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tour-welcome-btn {
  width: 100%;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
  text-align: center;
}

.tour-welcome-btn-primary {
  background: linear-gradient(135deg, #3758F9 0%, #5B7AFA 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(55, 88, 249, 0.3);
}

.tour-welcome-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(55, 88, 249, 0.4);
}

.tour-welcome-btn-secondary {
  background: #F3F4F6;
  color: #374151;
}

.tour-welcome-btn-secondary:hover {
  background: #E5E7EB;
}

/* Floating "Take Tour" button */
.tour-trigger-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9990;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: linear-gradient(135deg, #3758F9 0%, #5B7AFA 100%);
  color: white;
  font-size: 14px;
  font-weight: 600;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(55, 88, 249, 0.3), 0 0 0 0 rgba(55, 88, 249, 0.4);
  transition: all 0.2s ease;
  animation: tour-trigger-pulse 3s ease-in-out infinite;
}

.tour-trigger-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(55, 88, 249, 0.4);
  animation: none;
}

.tour-trigger-btn svg {
  width: 18px;
  height: 18px;
}

@keyframes tour-trigger-pulse {
  0%, 100% {
    box-shadow: 0 4px 12px rgba(55, 88, 249, 0.3), 0 0 0 0 rgba(55, 88, 249, 0.4);
  }
  50% {
    box-shadow: 0 4px 12px rgba(55, 88, 249, 0.3), 0 0 0 8px rgba(55, 88, 249, 0);
  }
}

/* Confetti animation for completion */
.tour-confetti {
  position: fixed;
  inset: 0;
  z-index: 10002;
  pointer-events: none;
  overflow: hidden;
}

.tour-confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  animation: tour-confetti-fall 3s ease-out forwards;
}

@keyframes tour-confetti-fall {
  0% {
    transform: translateY(-100px) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* Completion modal */
.tour-complete-card {
  text-align: center;
}

.tour-complete-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, #10B981 0%, #34D399 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  animation: tour-complete-bounce 0.5s ease;
}

.tour-complete-icon svg {
  width: 40px;
  height: 40px;
}

@keyframes tour-complete-bounce {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

/* Interaction hint animations */
.tour-click-hint {
  position: absolute;
  pointer-events: none;
  z-index: 10001;
}

.tour-click-ripple {
  position: absolute;
  width: 40px;
  height: 40px;
  border: 2px solid #3758F9;
  border-radius: 50%;
  animation: tour-ripple 1.5s ease-out infinite;
}

@keyframes tour-ripple {
  0% {
    transform: scale(0.5);
    opacity: 1;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

/* Mobile responsive */
@media (max-width: 640px) {
  .tour-tooltip {
    width: calc(100vw - 32px);
    max-width: none;
    left: 16px !important;
    right: 16px !important;
  }

  .tour-welcome-card {
    margin: 16px;
  }

  .tour-trigger-btn {
    bottom: 16px;
    right: 16px;
    padding: 10px 14px;
    font-size: 13px;
  }

  .tour-trigger-btn span {
    display: none;
  }
}
