/* Onboarding Tour Styles */

/* Skip button */
#tour-skip-btn {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 350001;
  background: rgba(30, 36, 48, 0.9);
  border: 1.5px solid rgba(93, 158, 250, 0.5);
  border-radius: 25px;
  padding: 8px 18px;
  color: #a0b0c8;
  font-family: 'Monda', 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  gap: 8px;
}

#tour-skip-btn:hover {
  background: rgba(93, 158, 250, 0.2);
  border-color: #5d9efa;
  color: #fff;
}

#tour-skip-btn .skip-icon {
  font-size: 16px;
}

/* Overlay - no darkening, just for z-index stacking */
#tour-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: transparent;
  z-index: 350000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}

#tour-overlay.visible {
  opacity: 1;
}

/* Pseudo cursor */
#tour-cursor {
  position: fixed;
  z-index: 350010;
  pointer-events: none;
  width: 24px;
  height: 24px;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity 0.4s ease;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

#tour-cursor.visible {
  opacity: 1;
}

#tour-cursor.pointer {
  transform: translate(-30%, -10%);
}

#tour-cursor.clicking {
  animation: cursor-click 0.3s ease;
}

@keyframes cursor-click {
  0% { transform: translate(-30%, -10%) scale(1); }
  50% { transform: translate(-30%, -10%) scale(0.85); }
  100% { transform: translate(-30%, -10%) scale(1); }
}

/* Tour cursor SVG styles */
#tour-cursor svg {
  width: 100%;
  height: 100%;
}

/* Highlight overlay with cutout */
#tour-highlight-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 249999;
  pointer-events: none;
}

/* Highlighted element cutout - no background darkening */
.tour-highlight-cutout {
  position: fixed;
  z-index: 250002;
  pointer-events: none;
  border: 3px solid #5d9efa;
  border-radius: 12px;
  box-shadow:
    0 0 20px rgba(93, 158, 250, 0.6),
    inset 0 0 20px rgba(93, 158, 250, 0.2);
  animation: tour-highlight-pulse 2s infinite ease-in-out;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.tour-target-boost {
  position: relative;
  z-index: 350004 !important;
}

@keyframes tour-highlight-pulse {
  0%, 100% {
    box-shadow:
      0 0 20px rgba(93, 158, 250, 0.6),
      inset 0 0 20px rgba(93, 158, 250, 0.2);
  }
  50% {
    box-shadow:
      0 0 35px rgba(93, 158, 250, 0.9),
      inset 0 0 30px rgba(93, 158, 250, 0.4);
  }
}

/* Tooltip */
#tour-tooltip {
  position: fixed;
  z-index: 350005;
  background: rgba(30, 36, 48, 0.95);
  border: 1.5px solid rgba(93, 158, 250, 0.6);
  border-radius: 16px;
  padding: 20px 24px;
  max-width: 380px;
  color: #f5f6fa;
  font-family: 'Monda', 'Inter', sans-serif;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

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

#tour-tooltip-title {
  font-size: 18px;
  font-weight: 700;
  color: #5d9efa;
  margin-bottom: 10px;
}

#tour-tooltip-text {
  font-size: 14px;
  line-height: 1.5;
  color: #c8d0dc;
}

#tour-tooltip-text b,
#tour-tooltip-text strong {
  color: #5d9efa;
}

/* Tooltip navigation */
.tour-tooltip-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(93, 158, 250, 0.2);
}

.tour-tooltip-progress {
  font-size: 12px;
  color: #6b7a8e;
}

.tour-tooltip-buttons {
  display: flex;
  gap: 10px;
}

.tour-tooltip-btn {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.tour-tooltip-btn.primary {
  background: #5d9efa;
  color: #1e2430;
}

.tour-tooltip-btn.primary:hover {
  background: #7bb3ff;
}

.tour-tooltip-btn.secondary {
  background: rgba(93, 158, 250, 0.15);
  color: #5d9efa;
  border: 1px solid rgba(93, 158, 250, 0.3);
}

.tour-tooltip-btn.secondary:hover {
  background: rgba(93, 158, 250, 0.25);
}

/* Language selector in tour */
.tour-language-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  justify-content: center;
}

.tour-lang-btn {
  padding: 8px 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #a0b0c8;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tour-lang-btn:hover {
  background: rgba(93, 158, 250, 0.2);
  border-color: rgba(93, 158, 250, 0.4);
}

.tour-lang-btn.active {
  background: #5d9efa;
  color: #1e2430;
  border-color: #5d9efa;
}

/* Typing animation for chat simulation */
.tour-typing-indicator {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
}

.tour-typing-dot {
  width: 8px;
  height: 8px;
  background: #5d9efa;
  border-radius: 50%;
  animation: tour-typing-bounce 1.4s infinite ease-in-out;
}

.tour-typing-dot:nth-child(1) { animation-delay: 0s; }
.tour-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.tour-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes tour-typing-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
  40% { transform: translateY(-6px); opacity: 1; }
}

/* Simulated text typing */
.tour-typed-text {
  overflow: hidden;
  border-right: 2px solid #5d9efa;
  white-space: nowrap;
  animation: tour-typing 3s steps(40, end), tour-blink 0.75s step-end infinite;
}

@keyframes tour-typing {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes tour-blink {
  from, to { border-color: transparent; }
  50% { border-color: #5d9efa; }
}

/* Custom layer highlight in sidebar */
.tour-layer-highlight {
  animation: tour-layer-glow 1.5s infinite ease-in-out;
  border-radius: 8px;
}

@keyframes tour-layer-glow {
  0%, 100% {
    box-shadow: 0 0 10px rgba(93, 158, 250, 0.5);
    background: rgba(93, 158, 250, 0.1);
  }
  50% {
    box-shadow: 0 0 25px rgba(93, 158, 250, 0.8);
    background: rgba(93, 158, 250, 0.2);
  }
}

/* Dataset highlight in sidebar */
.tour-dataset-highlight {
  animation: tour-dataset-glow 1.5s infinite ease-in-out;
  border-radius: 8px;
}

@keyframes tour-dataset-glow {
  0%, 100% {
    box-shadow: 0 0 10px rgba(0, 216, 90, 0.5);
    background: rgba(0, 216, 90, 0.1);
  }
  50% {
    box-shadow: 0 0 25px rgba(0, 216, 90, 0.8);
    background: rgba(0, 216, 90, 0.2);
  }
}

.tour-send-pulse {
  background: #7bb3ff !important;
  box-shadow: 0 0 0 0 rgba(93, 158, 250, 0.6);
  animation: tour-send-pulse 1.4s infinite ease-in-out;
}

@keyframes tour-send-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(93, 158, 250, 0.75);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(93, 158, 250, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(93, 158, 250, 0);
  }
}

.tour-dataset-callout {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(0, 216, 90, 0.4);
  background: rgba(0, 216, 90, 0.08);
  color: #d0ffe2;
  font-weight: 600;
  line-height: 1.45;
}

.tour-risk-note {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 12, 22, 0.85);
  color: #c6d2e4;
  font-size: 13px;
  line-height: 1.55;
  text-align: left;
}

/* Simulated input focus */
.tour-input-focus {
  box-shadow: 0 0 0 3px rgba(93, 158, 250, 0.4) !important;
  border-color: #5d9efa !important;
}

/* Arrow indicator */
.tour-arrow {
  position: absolute;
  width: 0;
  height: 0;
}

.tour-arrow.top {
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 10px solid rgba(30, 36, 48, 0.95);
  top: -10px;
}

.tour-arrow.bottom {
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 10px solid rgba(30, 36, 48, 0.95);
  bottom: -10px;
}

.tour-arrow.left {
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-right: 10px solid rgba(30, 36, 48, 0.95);
  left: -10px;
}

.tour-arrow.right {
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-left: 10px solid rgba(30, 36, 48, 0.95);
  right: -10px;
}

/* Mobile adjustments */
@media (max-width: 1024px) {
  #tour-skip-btn {
    top: 10px;
    right: 10px;
    padding: 6px 14px;
    font-size: 12px;
  }

  #tour-tooltip {
    max-width: 300px;
    padding: 16px 18px;
  }

  #tour-tooltip-title {
    font-size: 16px;
  }

  #tour-tooltip-text {
    font-size: 13px;
  }
}

/* Animation for new layer/dataset appearing */
@keyframes tour-new-item-appear {
  0% {
    opacity: 0;
    transform: translateX(-20px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

.tour-new-item-animate {
  animation: tour-new-item-appear 0.5s ease forwards;
}

/* Success checkmark animation */
.tour-success-check {
  width: 60px;
  height: 60px;
  margin: 0 auto 16px;
}

.tour-success-check svg {
  width: 100%;
  height: 100%;
}

.tour-success-check .checkmark {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: tour-checkmark-draw 0.6s ease forwards;
}

@keyframes tour-checkmark-draw {
  to { stroke-dashoffset: 0; }
}

/* Celebration confetti placeholder */
.tour-celebration {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 250020;
}

/* Assist chat toggle reveal during the tour */
#mapthos-chat #chat-toggle.tour-force-visible {
  opacity: 1 !important;
  transform: scale(1) !important;
}
