/* ============================================================
   Paws & Pills — First-Time User Onboarding Tour
   Lightweight, vanilla, dark-mode aware, Tailwind-friendly.
   All classes are namespaced with .pp-onb- to avoid collisions.
   ============================================================ */

/* Backdrop overlay (darkens everything except the spotlighted element) */
.pp-onb-overlay {
  position: fixed;
  inset: 0;
  z-index: 9990;
  pointer-events: auto;
  background: transparent;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.pp-onb-overlay.pp-onb-visible { opacity: 1; }

/* Spotlight: a transparent rectangle clipped via SVG mask to "cut a hole"
   in the overlay around the highlighted element. We use box-shadow trick:
   a tiny element with a huge spread shadow creates the surrounding dim. */
.pp-onb-spotlight {
  position: fixed;
  z-index: 9991;
  border-radius: 12px;
  box-shadow:
    0 0 0 4px rgba(245, 158, 11, 0.55),
    0 0 0 9999px rgba(15, 23, 42, 0.55);
  transition: top 0.25s ease, left 0.25s ease, width 0.25s ease, height 0.25s ease;
  pointer-events: none;
}
.dark .pp-onb-spotlight {
  box-shadow:
    0 0 0 4px rgba(251, 191, 36, 0.65),
    0 0 0 9999px rgba(0, 0, 0, 0.7);
}

/* Tooltip popup card */
.pp-onb-tooltip {
  position: fixed;
  z-index: 9993;
  max-width: 340px;
  width: calc(100vw - 2rem);
  background: #ffffff;
  color: #1f2937;
  border-radius: 14px;
  box-shadow:
    0 20px 25px -5px rgba(0, 0, 0, 0.25),
    0 10px 10px -5px rgba(0, 0, 0, 0.1);
  padding: 1rem 1.1rem 0.9rem;
  font-family: inherit;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease, top 0.25s ease, left 0.25s ease;
}
.pp-onb-tooltip.pp-onb-visible { opacity: 1; transform: translateY(0); }
.dark .pp-onb-tooltip {
  background: #1f2937;
  color: #f3f4f6;
  box-shadow:
    0 20px 25px -5px rgba(0, 0, 0, 0.55),
    0 10px 10px -5px rgba(0, 0, 0, 0.35);
}

/* Arrow */
.pp-onb-arrow {
  position: absolute;
  width: 14px;
  height: 14px;
  background: inherit;
  transform: rotate(45deg);
  background-color: #ffffff;
}
.dark .pp-onb-arrow { background-color: #1f2937; }
.pp-onb-arrow.pp-onb-arrow-top    { top: -7px;    left: 50%; margin-left: -7px; }
.pp-onb-arrow.pp-onb-arrow-bottom { bottom: -7px; left: 50%; margin-left: -7px; }
.pp-onb-arrow.pp-onb-arrow-left   { left: -7px;   top: 50%;  margin-top: -7px; }
.pp-onb-arrow.pp-onb-arrow-right  { right: -7px;  top: 50%;  margin-top: -7px; }

/* Tooltip header */
.pp-onb-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}
.pp-onb-title {
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  line-height: 1.2;
}
.pp-onb-title-icon { font-size: 1.15rem; line-height: 1; }
.pp-onb-close {
  background: transparent;
  border: 0;
  color: #9ca3af;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.15rem;
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease;
}
.pp-onb-close:hover { color: #4b5563; background: #f3f4f6; }
.dark .pp-onb-close:hover { color: #f3f4f6; background: #374151; }

/* Body text */
.pp-onb-body {
  font-size: 0.85rem;
  line-height: 1.45;
  color: #4b5563;
}
.dark .pp-onb-body { color: #d1d5db; }
.pp-onb-body strong { color: #b45309; }
.dark .pp-onb-body strong { color: #fbbf24; }

/* Footer (progress + buttons) */
.pp-onb-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.85rem;
}
.pp-onb-dots { display: flex; gap: 4px; }
.pp-onb-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #e5e7eb;
  transition: background 0.2s ease, transform 0.2s ease;
}
.dark .pp-onb-dot { background: #374151; }
.pp-onb-dot.pp-onb-dot-active { background: #f59e0b; transform: scale(1.4); }
.dark .pp-onb-dot.pp-onb-dot-active { background: #fbbf24; }

.pp-onb-buttons { display: flex; gap: 6px; align-items: center; }
.pp-onb-btn {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  border: 0;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
}
.pp-onb-btn:active { transform: scale(0.97); }
.pp-onb-btn-skip {
  background: transparent;
  color: #9ca3af;
}
.pp-onb-btn-skip:hover { color: #6b7280; }
.dark .pp-onb-btn-skip:hover { color: #f3f4f6; }
.pp-onb-btn-primary {
  background: #f59e0b;
  color: #fff;
}
.pp-onb-btn-primary:hover { background: #d97706; }
.dark .pp-onb-btn-primary { background: #d97706; }
.dark .pp-onb-btn-primary:hover { background: #b45309; }
.pp-onb-btn-secondary {
  background: #f3f4f6;
  color: #4b5563;
}
.pp-onb-btn-secondary:hover { background: #e5e7eb; color: #1f2937; }
.dark .pp-onb-btn-secondary { background: #374151; color: #d1d5db; }
.dark .pp-onb-btn-secondary:hover { background: #4b5563; color: #f9fafb; }

/* When the spotlighted element should be interactive (allow clicks through) */
.pp-onb-interactive {
  position: relative;
  z-index: 9992;
}

/* ============================================================
   Welcome / Replay modal
   ============================================================ */
.pp-onb-welcome-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9994;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.pp-onb-welcome-backdrop.pp-onb-visible { opacity: 1; }

.pp-onb-welcome-card {
  background: #ffffff;
  color: #1f2937;
  border-radius: 18px;
  max-width: 460px;
  width: 100%;
  padding: 1.75rem 1.6rem 1.4rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  transform: scale(0.95);
  transition: transform 0.2s ease;
  text-align: center;
}
.dark .pp-onb-welcome-card { background: #1f2937; color: #f3f4f6; }
.pp-onb-welcome-backdrop.pp-onb-visible .pp-onb-welcome-card { transform: scale(1); }

.pp-onb-welcome-emoji { font-size: 2.75rem; margin-bottom: 0.6rem; line-height: 1; }
.pp-onb-welcome-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
  color: #b45309;
}
.dark .pp-onb-welcome-title { color: #fbbf24; }
.pp-onb-welcome-text {
  font-size: 0.95rem;
  line-height: 1.5;
  color: #4b5563;
  margin-bottom: 1.1rem;
}
.dark .pp-onb-welcome-text { color: #d1d5db; }

.pp-onb-welcome-features {
  text-align: left;
  background: #fffbeb;
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  margin-bottom: 1.1rem;
  font-size: 0.85rem;
  color: #78350f;
}
.dark .pp-onb-welcome-features {
  background: rgba(245, 158, 11, 0.1);
  color: #fcd34d;
}
.pp-onb-welcome-features ul { margin: 0; padding: 0; list-style: none; }
.pp-onb-welcome-features li {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.2rem 0;
}
.pp-onb-welcome-features li span:first-child { font-size: 1rem; line-height: 1.2; }

.pp-onb-welcome-actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.pp-onb-welcome-actions .pp-onb-btn { font-size: 0.9rem; padding: 0.65rem 1rem; }

/* Help button in nav (added inline; just make sure pulse hint works) */
.pp-onb-help-pulse::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid #f59e0b;
  animation: pp-onb-pulse 1.6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes pp-onb-pulse {
  0%   { opacity: 0.7; transform: scale(0.95); }
  70%  { opacity: 0;   transform: scale(1.4); }
  100% { opacity: 0;   transform: scale(1.4); }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  .pp-onb-overlay, .pp-onb-tooltip, .pp-onb-spotlight, .pp-onb-welcome-backdrop,
  .pp-onb-welcome-card { transition: none !important; animation: none !important; }
}

/* Mobile tweaks */
@media (max-width: 480px) {
  .pp-onb-tooltip { max-width: calc(100vw - 1.5rem); }
}
