/* Onboarding Overlay Stage - Now a floating loop widget */
#onboardingOverlay {
  position: fixed;
  top: 50%;
  left: 5%;
  width: 380px;
  height: 520px;
  transform: translateY(-50%);
  transform-origin: left center;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none; /* Never blocks clicks */
  transition: opacity 0.6s ease;
}

#onboardingOverlay.active {
  opacity: 1;
}

/* Close Button */
.onboarding-close {
  display: none;
}

.onboarding-close:hover {
  background: rgba(255,255,255,0.15);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

/* Mockups Container */
.onboarding-stage {
  position: relative;
  width: 100%;
  height: 100%;
  perspective: none;
}

/* Premium Minimalist Mockup Windows */
.onboarding-mockup {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  background: #111827; /* Flat, dark minimal */
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 10px 25px rgba(0,0,0,0.4);
  padding: 24px;
  opacity: 0;
  transition: all 0.5s ease;
  pointer-events: none;
}

.onboarding-mockup.active {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1) translateY(0);
}

.onboarding-mockup.inactive {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.96) translateY(-10px);
}

/* Specific elements inside Mockup */
.mockup-header { 
  font-size: 1.3rem; 
  font-weight: 700; 
  margin-bottom: 28px; 
  color: #f8fafc; 
  text-align: center; 
  letter-spacing: -0.5px;
}

.mockup-field { 
  margin-bottom: 24px; 
  position: relative; 
}

.mockup-label { 
  font-size: 0.85rem; 
  color: #94a3b8; 
  margin-bottom: 8px; 
  display: block; 
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mockup-input { 
  width: 100%; 
  background: rgba(15, 23, 42, 0.6); 
  border: 1px solid rgba(255,255,255,0.05); 
  border-radius: 12px; 
  padding: 16px; 
  color: #fff;
  transition: all 0.3s ease;
  font-size: 1rem;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.mockup-btn {
  width: 100%;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  padding: 16px;
  border: none;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1.05rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Spotlight Effect */
.spotlight-overlay {
  position: absolute;
  top: -30px; left: -30px; right: -30px; bottom: -30px;
  background: rgba(0,0,0,0.85);
  border-radius: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
  z-index: 10;
  backdrop-filter: blur(3px);
}

.spotlight-active .spotlight-overlay {
  opacity: 1;
}

.spotlight-target {
  position: relative;
  z-index: 11 !important;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2), 0 0 30px rgba(245, 158, 11, 0.4);
  border-color: #f59e0b !important;
  background: rgba(30, 41, 59, 0.95) !important;
  transform: scale(1.02);
}

.spotlight-target-label {
  position: relative;
  z-index: 11 !important;
  color: #fcd34d !important;
  text-shadow: 0 0 10px rgba(245,158,11,0.5);
}

/* Virtual Cursor - Smooth Natural Movement */
#virtualCursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 36px;
  height: 36px;
  z-index: 10000;
  pointer-events: none;
  /* Natural easing curve for mouse movement */
  transition: transform 0.9s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s;
  opacity: 0;
  filter: drop-shadow(0 10px 15px rgba(0,0,0,0.4));
}

#virtualCursor.visible {
  opacity: 1;
}

#virtualCursor svg {
  transition: transform 0.15s ease;
  transform-origin: top left;
}

#virtualCursor.clicking svg {
  transform: scale(0.8);
}

/* Ripple effect for cursor click */
.cursor-ripple {
  position: absolute;
  top: -12px;
  left: -12px;
  width: 60px;
  height: 60px;
  background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 70%);
  border-radius: 50%;
  transform: scale(0);
  opacity: 0;
}

@keyframes rippleAnim {
  0% { transform: scale(0); opacity: 1; }
  50% { opacity: 0.6; }
  100% { transform: scale(1.8); opacity: 0; }
}

#virtualCursor.clicking .cursor-ripple {
  animation: rippleAnim 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* Tooltips */
.onboarding-tooltip {
  position: absolute;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: bold;
  top: -50px;
  right: 0;
  opacity: 0;
  transform: translateY(15px) scale(0.9);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 10px 25px rgba(34, 197, 94, 0.4);
}

.onboarding-tooltip::after {
  content: '';
  position: absolute;
  bottom: -6px;
  right: 24px;
  width: 12px;
  height: 12px;
  background: #16a34a;
  transform: rotate(45deg);
  border-radius: 2px;
}

.onboarding-tooltip.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ===== MOBILE: Hide onboarding guide overlay ===== */
@media (max-width: 768px) {
  #onboardingOverlay {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }
  
  #virtualCursor {
    display: none !important;
  }
}

/* ===== When any modal is active, hide onboarding overlay ===== */
.modal-overlay.active ~ #onboardingOverlay,
body:has(.modal-overlay.active) #onboardingOverlay {
  opacity: 0 !important;
  pointer-events: none !important;
}
