/* Theme-aware Tour System CSS */

:root {
  /* Light theme defaults */
  --tour-bg: #ffffff;
  --tour-text: #15263d;
  --tour-desc: #37506b;
  --tour-step: #3b6ea8;
  --tour-button-text: #3b6ea8;
  --tour-button-hover: rgba(59, 130, 246, 0.08);
  --tour-button-active: #3b6ea8;
  --tour-button-active-text: #ffffff;
  --tour-dot: #cdd9e6;
  --tour-dot-active: #3b6ea8;
  --tour-overlay: rgba(10, 19, 43, 0.55);
  --tour-glow: rgba(120, 180, 255, 1);
}

/* Dark theme */
html[data-theme="dark"] {
  --tour-bg: #1f2937;
  --tour-text: #f0f4f8;
  --tour-desc: #d1d5db;
  --tour-step: #60a5fa;
  --tour-button-text: #60a5fa;
  --tour-button-hover: rgba(96, 165, 250, 0.12);
  --tour-button-active: #60a5fa;
  --tour-button-active-text: #111827;
  --tour-dot: #4b5563;
  --tour-dot-active: #60a5fa;
  --tour-overlay: rgba(10, 19, 43, 0.60);
  --tour-glow: rgba(96, 165, 250, 1);
}

/* Glass theme */
html[data-theme="glass"] {
  --tour-bg: rgba(30, 45, 65, 0.85);
  --tour-text: #f0f4f8;
  --tour-desc: #d1d5db;
  --tour-step: #60a5fa;
  --tour-button-text: #60a5fa;
  --tour-button-hover: rgba(96, 165, 250, 0.12);
  --tour-button-active: #60a5fa;
  --tour-button-active-text: #ffffff;
  --tour-dot: #4b5563;
  --tour-dot-active: #60a5fa;
  --tour-overlay: rgba(10, 19, 43, 0.50);
  --tour-glow: rgba(120, 180, 255, 1);
}

/* Brand themes - use primary color */
html[data-theme="allconnect"],
html[data-theme="allift"],
html[data-theme="connectfm"],
html[data-theme="iris"],
html[data-theme="redlift"],
html[data-theme="heli"],
html[data-theme="magni"],
html[data-theme="kanga"] {
  --tour-bg: #ffffff;
  --tour-text: #15263d;
  --tour-desc: #37506b;
  --tour-step: var(--navy);
  --tour-button-text: var(--navy);
  --tour-button-hover: rgba(0, 126, 163, 0.08);
  --tour-button-active: var(--navy);
  --tour-button-active-text: #ffffff;
  --tour-dot: #cdd9e6;
  --tour-dot-active: var(--navy);
  --tour-overlay: rgba(10, 19, 43, 0.55);
  --tour-glow: rgba(0, 126, 163, 1);
}

/* Tour Overlay */
.tour-overlay {
  position: fixed;
  inset: 0;
  background-color: var(--tour-overlay);
  z-index: 9999;
  display: none;
}

/* Tour Spotlight */
.tour-spotlight {
  position: fixed;
  z-index: 10000;
  border-radius: 14px;
  pointer-events: none;
  opacity: 0;
  box-shadow: 0 0 0 9999px var(--tour-overlay),
              0 0 0 5px rgba(255, 255, 255, 1),
              0 0 50px 8px var(--tour-glow),
              inset 0 0 40px -12px rgba(255, 255, 255, 0.8);
  transition: all 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Tour Tooltip */
.tour-tooltip {
  position: fixed;
  z-index: 10001;
  width: 340px;
  max-width: calc(100vw - 32px);
  background: var(--tour-bg);
  color: var(--tour-text);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.2s, top 0.3s, left 0.3s;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  display: none;
}

.tour-step-number {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tour-step);
  font-weight: 800;
  display: block;
  margin-bottom: 6px;
}

.tour-title {
  font-size: 18px;
  margin: 0 0 8px;
  font-weight: 700;
  color: var(--tour-text);
}

.tour-description {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--tour-desc);
  margin: 0;
}

.tour-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
}

/* Tour Dots */
.tour-dots {
  display: flex;
  gap: 6px;
}

.tour-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--tour-dot);
  cursor: pointer;
  transition: all 0.2s;
}

.tour-dot.active {
  background-color: var(--tour-dot-active);
  width: 18px;
  border-radius: 5px;
}

/* Tour Buttons */
.tour-buttons {
  display: flex;
  gap: 8px;
}

.tour-btn {
  border: none;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 16px;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tour-back {
  background: transparent;
  color: var(--tour-button-text);
}

.tour-back:hover {
  background: var(--tour-button-hover);
}

.tour-next {
  background: var(--tour-button-active);
  color: var(--tour-button-active-text);
}

.tour-next:hover {
  background: var(--tour-step);
  opacity: 0.9;
}

/* Skip Button */
.tour-skip {
  position: fixed;
  top: 16px;
  right: 22px;
  z-index: 10002;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border-radius: 9px;
  padding: 8px 14px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: none;
  transition: all 0.2s;
}

.tour-skip:hover {
  background: rgba(255, 255, 255, 0.24);
}

/* Floating Tour Button */
.tour-start-btn {
  position: fixed;
  bottom: 26px;
  right: 26px;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--tour-button-active);
  color: var(--tour-button-active-text);
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  padding: 0;
  font: inherit;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  opacity: 0.45;
}

.tour-start-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  opacity: 0.75;
}

.tour-start-btn:active {
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
  .tour-tooltip {
    max-width: 85vw;
  }

  .tour-title {
    font-size: 16px;
  }

  .tour-description {
    font-size: 13px;
  }

  .tour-btn {
    padding: 8px 12px;
    font-size: 12px;
  }
}
