/* Onboarding Tour Styles - Family Finance Tracker */
/* Interactive guided tour for new users */

/* ============================================
   OVERLAY AND SPOTLIGHT
   ============================================ */

.tour-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  z-index: 9998;
  pointer-events: none;
  transition: background var(--duration-normal) var(--ease-standard);
}

.tour-overlay--active {
  background: rgba(0, 0, 0, 0.7);
  pointer-events: auto;
}

.tour-spotlight {
  position: fixed;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.7);
  border-radius: var(--radius-lg);
  z-index: 9999;
  pointer-events: none;
  transition: all 0.4s var(--ease-standard);
  background: transparent;
  display: none;
}

.tour-spotlight--pulse {
  animation: spotlightPulse 2s ease-in-out infinite;
}

@keyframes spotlightPulse {
  0%, 100% {
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.7),
                0 0 0 4px rgba(33, 128, 141, 0.3);
  }
  50% {
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.7),
                0 0 0 8px rgba(33, 128, 141, 0.5);
  }
}

/* ============================================
   TOOLTIP
   ============================================ */

.tour-tooltip {
  position: fixed;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-24);
  max-width: 400px;
  min-width: 300px;
  z-index: 10000;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-card-border);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s var(--ease-standard),
              transform 0.3s var(--ease-standard);
}

.tour-tooltip--visible {
  opacity: 1;
  transform: translateY(0);
}

.tour-tooltip__arrow {
  position: absolute;
  width: 16px;
  height: 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-card-border);
  transform: rotate(45deg);
  z-index: -1;
}

/* Arrow positions */
.tour-tooltip[data-position="bottom"] .tour-tooltip__arrow {
  top: -9px;
  left: 50%;
  margin-left: -8px;
  border-right: none;
  border-bottom: none;
}

.tour-tooltip[data-position="top"] .tour-tooltip__arrow {
  bottom: -9px;
  left: 50%;
  margin-left: -8px;
  border-left: none;
  border-top: none;
}

.tour-tooltip[data-position="left"] .tour-tooltip__arrow {
  right: -9px;
  top: 50%;
  margin-top: -8px;
  border-left: none;
  border-bottom: none;
}

.tour-tooltip[data-position="right"] .tour-tooltip__arrow {
  left: -9px;
  top: 50%;
  margin-top: -8px;
  border-right: none;
  border-top: none;
}

.tour-tooltip__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--color-bg-1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-16);
}

.tour-tooltip__icon i {
  font-size: var(--font-size-2xl);
  color: var(--color-primary);
}

.tour-tooltip__title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  margin: 0 0 var(--space-8) 0;
  line-height: var(--line-height-tight);
}

.tour-tooltip__content {
  font-size: var(--font-size-base);
  color: var(--color-text-secondary);
  margin: 0 0 var(--space-20) 0;
  line-height: var(--line-height-normal);
}

.tour-tooltip__actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-16);
}

/* ============================================
   PROGRESS DOTS
   ============================================ */

.tour-progress {
  display: flex;
  gap: var(--space-6);
  align-items: center;
}

.tour-progress__dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--color-border);
  transition: all 0.3s var(--ease-standard);
}

.tour-progress__dot--active {
  background: var(--color-primary);
  transform: scale(1.2);
}

.tour-progress__dot--completed {
  background: var(--color-success);
}

/* ============================================
   NAVIGATION BUTTONS
   ============================================ */

.tour-buttons {
  display: flex;
  gap: var(--space-8);
  align-items: center;
}

.tour-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-16);
  border-radius: var(--radius-base);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-standard);
  border: none;
  gap: var(--space-6);
}

.tour-btn--primary {
  background: var(--color-primary);
  color: var(--color-btn-primary-text);
}

.tour-btn--primary:hover {
  background: var(--color-primary-hover);
}

.tour-btn--secondary {
  background: transparent;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}

.tour-btn--secondary:hover {
  background: var(--color-secondary);
  color: var(--color-text);
}

.tour-btn--skip {
  background: transparent;
  color: var(--color-text-secondary);
  padding: var(--space-8);
}

.tour-btn--skip:hover {
  color: var(--color-text);
}

/* ============================================
   WELCOME MODAL
   ============================================ */

.tour-welcome {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-16);
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease-standard),
              visibility 0.3s var(--ease-standard);
}

.tour-welcome--visible {
  opacity: 1;
  visibility: visible;
}

.tour-welcome__content {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-32);
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-card-border);
  transform: scale(0.9);
  transition: transform 0.3s var(--ease-standard);
}

.tour-welcome--visible .tour-welcome__content {
  transform: scale(1);
}

.tour-welcome__icon {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--color-primary), var(--color-teal-300));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-24);
}

.tour-welcome__icon i {
  font-size: 36px;
  color: white;
}

.tour-welcome__title {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  margin: 0 0 var(--space-12) 0;
}

.tour-welcome__subtitle {
  font-size: var(--font-size-base);
  color: var(--color-text-secondary);
  margin: 0 0 var(--space-24) 0;
  line-height: var(--line-height-normal);
}

.tour-welcome__features {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
  margin-bottom: var(--space-24);
  text-align: left;
}

.tour-welcome__feature {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  font-size: var(--font-size-sm);
  color: var(--color-text);
}

.tour-welcome__feature i {
  color: var(--color-success);
  font-size: var(--font-size-base);
}

.tour-welcome__actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

.tour-welcome__actions .tour-btn {
  width: 100%;
  padding: var(--space-12) var(--space-24);
  font-size: var(--font-size-base);
}

/* ============================================
   COMPLETE MODAL
   ============================================ */

.tour-complete {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-16);
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease-standard),
              visibility 0.3s var(--ease-standard);
}

.tour-complete--visible {
  opacity: 1;
  visibility: visible;
}

.tour-complete__content {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-32);
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-card-border);
  transform: scale(0.9);
  transition: transform 0.3s var(--ease-standard);
}

.tour-complete--visible .tour-complete__content {
  transform: scale(1);
}

.tour-complete__icon {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  background: var(--color-success);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-24);
  animation: successPop 0.5s var(--ease-standard);
}

@keyframes successPop {
  0% { transform: scale(0); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.tour-complete__icon i {
  font-size: 36px;
  color: white;
}

.tour-complete__title {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  margin: 0 0 var(--space-12) 0;
}

.tour-complete__subtitle {
  font-size: var(--font-size-base);
  color: var(--color-text-secondary);
  margin: 0 0 var(--space-24) 0;
  line-height: var(--line-height-normal);
}

.tour-complete__actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

.tour-complete__actions .tour-btn {
  width: 100%;
  padding: var(--space-12) var(--space-24);
  font-size: var(--font-size-base);
}

/* ============================================
   HELP BUTTON (Replay Tour)
   ============================================ */

.tour-help-btn {
  position: fixed;
  bottom: calc(var(--space-24) + env(safe-area-inset-bottom));
  left: calc(var(--space-24) + env(safe-area-inset-left));
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: var(--color-btn-primary-text);
  border: none;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 998;
  transition: all var(--duration-normal) var(--ease-standard);
}

.tour-help-btn:hover {
  transform: scale(1.1);
  background: var(--color-primary-hover);
}

.tour-help-btn:active {
  transform: scale(0.95);
}

.tour-help-btn i {
  font-size: var(--font-size-xl);
}

/* Hide when tour is active */
.tour-overlay--active ~ .tour-help-btn {
  display: none;
}

/* ============================================
   MOBILE ADAPTATIONS
   ============================================ */

@media (max-width: 768px) {
  .tour-tooltip {
    max-width: calc(100vw - 32px);
    min-width: auto;
    padding: var(--space-20);
  }

  .tour-tooltip__title {
    font-size: var(--font-size-base);
  }

  .tour-tooltip__content {
    font-size: var(--font-size-sm);
  }

  .tour-tooltip__actions {
    flex-direction: column;
    gap: var(--space-12);
  }

  .tour-progress {
    justify-content: center;
    width: 100%;
  }

  .tour-buttons {
    width: 100%;
    justify-content: space-between;
  }

  .tour-welcome__content,
  .tour-complete__content {
    padding: var(--space-24);
    margin: var(--space-16);
  }

  .tour-welcome__icon,
  .tour-complete__icon {
    width: 64px;
    height: 64px;
  }

  .tour-welcome__icon i,
  .tour-complete__icon i {
    font-size: 28px;
  }

  .tour-welcome__title,
  .tour-complete__title {
    font-size: var(--font-size-xl);
  }

  .tour-help-btn {
    width: 44px;
    height: 44px;
    bottom: calc(var(--space-16) + env(safe-area-inset-bottom));
    left: calc(var(--space-16) + env(safe-area-inset-left));
  }
}

/* ============================================
   REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  .tour-overlay,
  .tour-spotlight,
  .tour-tooltip,
  .tour-welcome,
  .tour-welcome__content,
  .tour-complete,
  .tour-complete__content {
    transition: none;
  }

  .tour-spotlight--pulse {
    animation: none;
  }

  .tour-complete__icon {
    animation: none;
  }
}

/* ============================================
   DARK MODE ADJUSTMENTS
   ============================================ */

[data-color-scheme="dark"] .tour-spotlight {
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.85);
}

[data-color-scheme="dark"] .tour-spotlight--pulse {
  animation-name: spotlightPulseDark;
}

@keyframes spotlightPulseDark {
  0%, 100% {
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.85),
                0 0 0 4px rgba(50, 184, 198, 0.4);
  }
  50% {
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.85),
                0 0 0 8px rgba(50, 184, 198, 0.6);
  }
}
