/* =============================================
   Tour Guide / Onboarding Tooltip
   ============================================= */

.tour-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 9998;
}

.tour-spotlight {
  position: absolute;
  z-index: 9999;
  border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  transition: top 0.3s ease, left 0.3s ease, width 0.3s ease, height 0.3s ease;
}

.tour-tooltip {
  position: absolute;
  z-index: 10000;
  width: 400px;
  max-width: calc(100vw - 24px);
  background: var(--color-card, #fff);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 16px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  padding: 20px;
  animation: tour-scale-in 0.2s ease-out;
}

@keyframes tour-scale-in {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Arrow */
.tour-tooltip-arrow {
  position: absolute;
  width: 14px;
  height: 8px;
  transform: translateX(-50%);
}

.tour-tooltip-arrow::before {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  background: var(--color-card, #fff);
  border: 1px solid var(--color-border, #e5e7eb);
  transform: rotate(45deg);
}

/* Arrow pointing up (tooltip below target) */
.tour-tooltip[data-arrow-position="top"] .tour-tooltip-arrow {
  top: -7px;
}

.tour-tooltip[data-arrow-position="top"] .tour-tooltip-arrow::before {
  top: 4px;
  left: 0;
  border-bottom: none;
  border-right: none;
}

/* Arrow pointing down (tooltip above target) */
.tour-tooltip[data-arrow-position="bottom"] .tour-tooltip-arrow {
  bottom: -7px;
}

.tour-tooltip[data-arrow-position="bottom"] .tour-tooltip-arrow::before {
  bottom: 4px;
  left: 0;
  border-top: none;
  border-left: none;
}

/* Arrow pointing left (tooltip to the right of target) */
.tour-tooltip[data-arrow-position="left"] .tour-tooltip-arrow {
  left: -7px;
  width: 8px;
  height: 14px;
  transform: translateY(-50%);
}

.tour-tooltip[data-arrow-position="left"] .tour-tooltip-arrow::before {
  left: 4px;
  top: 0;
  border-right: none;
  border-top: none;
}

/* Arrow pointing right (tooltip to the left of target) */
.tour-tooltip[data-arrow-position="right"] .tour-tooltip-arrow {
  right: -7px;
  left: auto;
  width: 8px;
  height: 14px;
  transform: translateY(-50%);
}

.tour-tooltip[data-arrow-position="right"] .tour-tooltip-arrow::before {
  right: 4px;
  left: auto;
  top: 0;
  border-left: none;
  border-bottom: none;
}

/* Header: step counter + close button */
.tour-tooltip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.tour-step-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tour-step-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--color-primary, #1198B5) 10%, transparent);
  color: var(--color-primary, #1198B5);
}

.tour-step-text {
  font-size: 0.8125rem;
  color: var(--color-muted-foreground, #6b7280);
  font-weight: 500;
}

.tour-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--color-muted-foreground, #6b7280);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.tour-close-btn:hover {
  background: var(--color-muted, #f3f4f6);
  color: var(--color-foreground, #111827);
}

/* Progress bar */
.tour-progress {
  display: flex;
  gap: 3px;
  margin-bottom: 16px;
}

.tour-progress-segment {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: var(--color-muted, #e5e7eb);
  transition: background-color 0.2s;
}

.tour-progress-segment.tour-progress-active {
  background: var(--color-primary, #1198B5);
}

/* Content */
.tour-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-foreground, #111827);
  margin: 0 0 6px;
  line-height: 1.3;
}

.tour-body {
  font-size: 0.875rem;
  color: var(--color-muted-foreground, #6b7280);
  line-height: 1.6;
  margin: 0;
}

.tour-content {
  margin-bottom: 20px;
}

/* Footer */
.tour-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tour-footer-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tour-btn-text {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-muted-foreground, #6b7280);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
  transition: color 0.15s, background-color 0.15s;
}

.tour-btn-text:hover {
  color: var(--color-foreground, #111827);
  background: var(--color-muted, #f3f4f6);
}

.tour-btn-ghost {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-muted-foreground, #6b7280);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 6px;
  transition: color 0.15s, background-color 0.15s;
}

.tour-btn-ghost:hover {
  color: var(--color-foreground, #111827);
  background: var(--color-muted, #f3f4f6);
}

.tour-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-primary-foreground, #fff);
  background: var(--color-primary, #1198B5);
  border: none;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 8px;
  transition: opacity 0.15s;
}

.tour-btn-primary:hover {
  opacity: 0.9;
}

/* Mobile responsive */
@media screen and (max-width: 640px) {
  .tour-tooltip {
    width: calc(100vw - 24px);
    padding: 16px;
  }

  .tour-title {
    font-size: 1.125rem;
  }
}
