/* WhatsApp Float — bottom-right chat button + speech-bubble tooltip.
   Hidden by default; the JS injects #wa-float only when the dashboard
   "WhatsApp Switch" toggle is ON. */

#wa-float {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 2147483000;       /* above modals/overlays without going to int32 max */
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  text-decoration: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

#wa-float .wa-float-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25d366;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18), 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 160ms ease, box-shadow 160ms ease;
  animation: wa-float-pulse 2.4s ease-in-out infinite;
}

#wa-float:hover .wa-float-icon {
  transform: scale(1.06);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25), 0 2px 6px rgba(0, 0, 0, 0.14);
}

#wa-float .wa-float-bubble {
  position: relative;
  padding: 10px 14px;
  background: #fff;
  color: #111;
  font-size: 14px;
  line-height: 1.3;
  border-radius: 18px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
  max-width: 220px;
  opacity: 0;
  transform: translateX(8px);
  transition: opacity 220ms ease 120ms, transform 220ms ease 120ms;
  pointer-events: none;
}

#wa-float .wa-float-bubble::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -6px;
  transform: translateY(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  background: #fff;
  box-shadow: 2px -2px 4px -2px rgba(0, 0, 0, 0.08);
}

/* Auto-show tooltip on desktop after 1.5s — gives it the "live chat" feel
   without requiring hover. Click anywhere on the button still works. */
@media (hover: hover) and (min-width: 768px) {
  #wa-float .wa-float-bubble {
    animation: wa-float-bubble-in 600ms ease 1400ms forwards;
  }
  #wa-float:hover .wa-float-bubble {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Mobile: tighter, no animated bubble (saves space, less distraction) */
@media (max-width: 767px) {
  #wa-float {
    right: 14px;
    bottom: 14px;
  }
  #wa-float .wa-float-bubble {
    display: none;
  }
  #wa-float .wa-float-icon {
    width: 52px;
    height: 52px;
  }
}

@keyframes wa-float-pulse {
  0%, 100% { box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18), 0 2px 4px rgba(0, 0, 0, 0.1), 0 0 0 0 rgba(37, 211, 102, 0.55); }
  50%      { box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18), 0 2px 4px rgba(0, 0, 0, 0.1), 0 0 0 14px rgba(37, 211, 102, 0); }
}

@keyframes wa-float-bubble-in {
  to { opacity: 1; transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
  #wa-float .wa-float-icon { animation: none; }
  #wa-float .wa-float-bubble { animation: none; opacity: 1; transform: none; }
}
