/* ═══════════════════════════════════════════════════════
   Walkthrough — Spotlight + Tooltip + Overlay Styling
   Lin's FB Seller Onboarding Agent
   Premium glassmorphism dark theme
   ═══════════════════════════════════════════════════════ */

/* ─── Connection Badge (Topbar) ─── */
.conn-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: default;
  transition: all 0.2s ease;
  white-space: nowrap;
  letter-spacing: 0.3px;
}

.conn-badge:hover {
  transform: scale(1.02);
}

.conn-badge-dot {
  font-size: 0.7rem;
  line-height: 1;
}

.conn-badge-label {
  line-height: 1;
}

.status-connected {
  background: rgba(0, 214, 143, 0.12);
  color: #4ade80;
  border: 1px solid rgba(0, 214, 143, 0.2);
}

.status-degraded {
  background: rgba(255, 167, 38, 0.12);
  color: #ffa726;
  border: 1px solid rgba(255, 167, 38, 0.2);
}

.status-offline {
  background: rgba(255, 107, 107, 0.12);
  color: #f87171;
  border: 1px solid rgba(255, 107, 107, 0.2);
}

/* ─── Help Button ─── */
.help-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #8f8fa3;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  flex-shrink: 0;
}

.help-btn:hover {
  background: rgba(167, 139, 250, 0.15);
  color: #a78bfa;
  border-color: rgba(167, 139, 250, 0.3);
  transform: scale(1.08);
}

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

/* ─── Toast Notifications ─── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10001;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  pointer-events: none;
}

.onboard-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 12px;
  background: rgba(28, 28, 40, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  color: #e8e8ea;
  font-size: 0.85rem;
  font-family: 'Inter', sans-serif;
  transform: translateX(120%);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
  max-width: 360px;
}

.onboard-toast-visible {
  transform: translateX(0);
  opacity: 1;
}

.onboard-toast-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.onboard-toast-msg {
  line-height: 1.4;
}

.onboard-toast-error {
  border-color: rgba(248, 113, 113, 0.2);
}

.onboard-toast-warn {
  border-color: rgba(255, 167, 38, 0.2);
}

.onboard-toast-info {
  border-color: rgba(167, 139, 250, 0.2);
}

/* ─── Walkthrough Overlay ─── */
.wt-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.wt-overlay.active {
  pointer-events: auto;
}

/* Dark backdrop with spotlight hole */
.wt-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(0, 0, 0, 0);
  transition: background 0.3s ease;
}

.wt-backdrop.active {
  background: rgba(0, 0, 0, 0.72);
}

/* Spotlight cutout — uses box-shadow for the "hole" */
.wt-spotlight {
  position: fixed;
  z-index: 9999;
  border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.72);
  pointer-events: auto;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  border: 2px solid rgba(167, 139, 250, 0.4);
}

.wt-spotlight::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 14px;
  border: 2px solid rgba(167, 139, 250, 0.15);
  animation: spotlightPulse 2s ease infinite;
}

@keyframes spotlightPulse {
  0%, 100% { border-color: rgba(167, 139, 250, 0.15); }
  50% { border-color: rgba(167, 139, 250, 0.35); }
}

/* ─── Walkthrough Tooltip ─── */
.wt-tooltip {
  position: fixed;
  z-index: 10000;
  width: 340px;
  max-width: calc(100vw - 32px);
  background: rgba(22, 22, 30, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 24px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(167, 139, 250, 0.06);
  color: #e8e8ea;
  font-family: 'Inter', sans-serif;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

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

/* Arrow */
.wt-arrow {
  position: absolute;
  width: 12px;
  height: 12px;
  background: rgba(22, 22, 30, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transform: rotate(45deg);
}

.wt-arrow-top {
  top: -7px;
  left: 28px;
  border-right: none;
  border-bottom: none;
}

.wt-arrow-bottom {
  bottom: -7px;
  left: 28px;
  border-left: none;
  border-top: none;
}

.wt-arrow-left {
  left: -7px;
  top: 28px;
  border-right: none;
  border-top: none;
}

.wt-arrow-right {
  right: -7px;
  top: 28px;
  border-left: none;
  border-bottom: none;
}

/* Tooltip content */
.wt-step-number {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(167, 139, 250, 0.15);
  color: #a78bfa;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 10px;
}

.wt-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.3;
  background: linear-gradient(135deg, #e8e8ea, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.wt-description {
  font-size: 0.88rem;
  color: #8f8fa3;
  line-height: 1.55;
  margin-bottom: 18px;
}

/* Progress dots */
.wt-progress {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 16px;
}

.wt-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  transition: all 0.3s ease;
}

.wt-dot.active {
  background: #a78bfa;
  box-shadow: 0 0 8px rgba(167, 139, 250, 0.4);
  width: 18px;
  border-radius: 3px;
}

.wt-dot.completed {
  background: #4ade80;
}

/* Navigation buttons */
.wt-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.wt-nav-left {
  display: flex;
  gap: 8px;
}

.wt-btn {
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  font-size: 0.82rem;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
}

.wt-btn-primary {
  background: linear-gradient(135deg, #6c5ce7, #5a4bd4);
  color: white;
}

.wt-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(108, 92, 231, 0.35);
}

.wt-btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  color: #8f8fa3;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.wt-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #e8e8ea;
}

.wt-btn-skip {
  background: none;
  border: none;
  color: #555568;
  padding: 8px 12px;
}

.wt-btn-skip:hover {
  color: #8f8fa3;
}

/* ─── Welcome / Finish (centered, no spotlight) ─── */
.wt-tooltip.wt-centered {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: 400px;
  text-align: center;
}

.wt-tooltip.wt-centered.visible {
  transform: translate(-50%, -50%) scale(1);
}

.wt-welcome-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  display: block;
}

/* ─── Help Dropdown (popover) ─── */
.help-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 10001;
  width: 260px;
  background: rgba(22, 22, 30, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: all 0.2s ease;
  font-family: 'Inter', sans-serif;
}

.help-popover.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.help-popover-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #555568;
  margin-bottom: 10px;
}

.help-popover-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 0.85rem;
  color: #8f8fa3;
}

.help-popover-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #e8e8ea;
}

.help-popover-item .popover-icon {
  font-size: 1rem;
}

.help-popover-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin: 8px 0;
}

.help-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 10px;
  font-size: 0.8rem;
  color: #8f8fa3;
}

.help-status-value {
  font-weight: 500;
}

.help-status-ok { color: #4ade80; }
.help-status-warn { color: #ffa726; }
.help-status-fail { color: #f87171; }

/* ─── Mobile Responsive ─── */
@media (max-width: 600px) {
  .wt-tooltip {
    width: calc(100vw - 24px);
    left: 12px !important;
    right: 12px !important;
    border-radius: 12px;
    padding: 18px;
  }

  .wt-tooltip.wt-centered {
    width: calc(100vw - 24px);
  }

  .wt-arrow {
    display: none;
  }

  .conn-badge-label {
    display: none;
  }

  .help-popover {
    right: -60px;
    width: calc(100vw - 24px);
  }
}
