/*
 * live-chat-widget.css — fixed "24/5 Live Chat" floating badge for standalone
 * dynamic pages. Self-contained; vanilla. Visual design mirrors the legacy
 * #chat-link (_LiveChatIcon.cshtml). Colours are exposed as CSS custom
 * properties (with hardcoded fallbacks) so a host page can re-theme it.
 */
[data-live-chat] {
  --lc-bg: #EC3F2A;
  --lc-bg-hover: #D7331F;
  --lc-color: #ffffff;

  position: fixed;
  right: 10px;
  bottom: 30px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-radius: 25px;
  background: var(--lc-bg);
  color: var(--lc-color);
  font-size: 18px;
  line-height: 1.2;
  font-weight: 400;
  text-decoration: none;
  box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.2);

  /* Visible by default (mirrors the legacy #chat-link, which is present on load). */
  transition: background 0.2s ease-in-out, opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
}

[data-live-chat]:hover {
  background: var(--lc-bg-hover);
}

[data-live-chat] svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
  flex: 0 0 auto;
}

/* Optional reveal-on-scroll mode (opt-in via data-live-chat-reveal="scroll"):
   start hidden, slide + fade in when the JS adds .is-visible. */
[data-live-chat][data-live-chat-reveal="scroll"] {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}

[data-live-chat][data-live-chat-reveal="scroll"].is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Mobile: collapse to an icon-only circle (legacy hides the label below 750px). */
@media (max-width: 750px) {
  [data-live-chat] {
    gap: 0;
    padding: 13px;
    border-radius: 50%;
  }

  [data-live-chat] .live-chat-label {
    display: none;
  }

  [data-live-chat] svg {
    width: 24px;
    height: 24px;
  }
}

/* Respect reduced-motion: skip the slide for the scroll-reveal mode. */
@media (prefers-reduced-motion: reduce) {
  [data-live-chat][data-live-chat-reveal="scroll"] {
    transform: none;
    transition: background 0.2s ease-in-out, opacity 0.3s ease-in-out;
  }
}
