/* ═══════════════════════════════════════════════════
   Onboarding Tour — Community Overlay Styles
   ═══════════════════════════════════════════════════ */

/* Backdrop overlay */
.tour-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99990;
  pointer-events: none;
  transition: opacity .35s ease;
  opacity: 0;
}
.tour-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* Dark overlay with spotlight cutout — managed via box-shadow */
.tour-spotlight {
  position: fixed;
  z-index: 99991;
  border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,.55);
  transition: all .4s cubic-bezier(.4,0,.2,1);
  pointer-events: none;
}

/* The tooltip card */
.tour-tooltip {
  position: fixed;
  z-index: 99993;
  width: 360px;
  max-width: 90vw;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 48px rgba(0,0,0,.22), 0 2px 8px rgba(0,0,0,.08);
  overflow: hidden;
  animation: tour-pop .35s cubic-bezier(.175,.885,.32,1.275);
  transition: all .35s cubic-bezier(.4,0,.2,1);
}

@keyframes tour-pop {
  from { opacity: 0; transform: scale(.92) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.tour-tooltip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 0;
}
.tour-tooltip-header .tour-step-counter {
  font-size: 11px;
  font-weight: 700;
  color: #6d28d9;
  background: #eef2ff;
  padding: 3px 10px;
  border-radius: 12px;
}
.tour-tooltip-header .tour-close-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: #f3f4f6;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #6b7280;
  font-size: 14px;
  transition: all .2s;
}
.tour-tooltip-header .tour-close-btn:hover { background: #e5e7eb; color: #1a1a2e; }

.tour-tooltip-body {
  padding: 14px 20px 16px;
}
.tour-tooltip-body .tour-title {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0 0 6px;
  line-height: 1.3;
}
.tour-tooltip-body .tour-desc {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.55;
  margin: 0;
}

.tour-tooltip-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px 16px;
  gap: 10px;
}
.tour-tooltip-footer .tour-progress-dots {
  display: flex;
  gap: 5px;
}
.tour-tooltip-footer .tour-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e5e7eb;
  transition: all .25s;
}
.tour-tooltip-footer .tour-dot.active { background: #6d28d9; width: 20px; border-radius: 4px; }
.tour-tooltip-footer .tour-dot.done { background: #a5b4fc; }

.tour-tooltip-footer .tour-actions {
  display: flex;
  gap: 8px;
}
.tour-btn {
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all .2s;
}
.tour-btn-skip {
  background: transparent;
  color: #6b7280;
}
.tour-btn-skip:hover { background: #f3f4f6; }
.tour-btn-next {
  background: #6d28d9;
  color: #fff;
}
.tour-btn-next:hover { filter: brightness(1.1); }
.tour-btn-finish {
  background: #059669;
  color: #fff;
}
.tour-btn-finish:hover { filter: brightness(1.1); }

/* Center-screen welcome card (no target element) */
.tour-tooltip.center-mode {
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
}

/* Dismiss bar at top */
.tour-dismiss-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 99994;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 10px 20px;
  background: linear-gradient(135deg, #4f46e5, #6d28d9);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 2px 12px rgba(99,102,241,.3);
}
.tour-dismiss-bar .tour-dismiss-text { opacity: .9; }
.tour-dismiss-bar .tour-dismiss-btn {
  padding: 5px 14px;
  border-radius: 6px;
  background: rgba(255,255,255,.2);
  color: #fff;
  border: 1px solid rgba(255,255,255,.3);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
}
.tour-dismiss-bar .tour-dismiss-btn:hover { background: rgba(255,255,255,.35); }

/* Highlighted element */
.tour-highlight {
  position: relative;
  z-index: 99992 !important;
  pointer-events: auto !important;
}

/* Pulse ring on highlighted element */
.tour-highlight::after {
  content: '';
  position: absolute;
  inset: -4px;
  border: 2px solid #6d28d9;
  border-radius: inherit;
  animation: tour-pulse 1.5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes tour-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}

/* Mobile adjustments */
@media (max-width: 600px) {
  .tour-tooltip {
    width: calc(100vw - 24px);
    position: fixed !important;
    bottom: 16px !important;
    left: 12px !important;
    top: auto !important;
    right: auto !important;
  }
  .tour-tooltip.center-mode {
    top: auto !important;
    left: 12px !important;
    transform: none !important;
    bottom: 16px !important;
  }
  .tour-dismiss-bar {
    flex-direction: column;
    gap: 8px;
    padding: 8px 16px;
    font-size: 12px;
  }
}

/* Dark mode support */
[data-theme="dark"] .tour-tooltip,
body.dark-mode .tour-tooltip {
  background: #1e1e2e;
}
[data-theme="dark"] .tour-tooltip-body .tour-title,
body.dark-mode .tour-tooltip-body .tour-title { color: #f1f5f9; }
[data-theme="dark"] .tour-tooltip-body .tour-desc,
body.dark-mode .tour-tooltip-body .tour-desc { color: #94a3b8; }
[data-theme="dark"] .tour-tooltip-header .tour-close-btn,
body.dark-mode .tour-tooltip-header .tour-close-btn { background: #334155; color: #94a3b8; }
[data-theme="dark"] .tour-dot,
body.dark-mode .tour-dot { background: #334155; }
