/* VynFlo web voice widget styles.
   Floating pill button. Positioned bottom-LEFT so it doesn't collide with the
   existing chat widget on the bottom-right. Change --vf-accent to match brand. */

.vf-voice-btn {
  --vf-accent: #6d5efc;      /* VynFlo violet, tweak to brand */
  --vf-accent-2: #8b7bff;
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 99998;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px 12px 14px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--vf-accent), var(--vf-accent-2));
  color: #fff;
  font: 600 15px/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(109, 94, 252, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}

.vf-voice-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(109, 94, 252, 0.45);
}

/* Lift above the site's cookie banner while it's showing (same mechanism the
   chat/WhatsApp buttons use: body.has-cookie-banner + --cookie-banner-offset). */
body.has-cookie-banner .vf-voice-btn {
  bottom: calc(24px + var(--cookie-banner-offset, 70px));
}

.vf-voice-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.vf-voice-label {
  white-space: nowrap;
}

/* Connecting: dim + gentle pulse */
.vf-voice-btn.is-connecting {
  background: linear-gradient(135deg, #7a7a8c, #9a9aad);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  cursor: default;
}

/* Live: red "end call" state with a pulsing ring */
.vf-voice-btn.is-live {
  background: linear-gradient(135deg, #e5484d, #f0686c);
  box-shadow: 0 8px 24px rgba(229, 72, 77, 0.4);
  animation: vf-live-pulse 1.6s ease-in-out infinite;
}

@keyframes vf-live-pulse {
  0%,
  100% {
    box-shadow: 0 8px 24px rgba(229, 72, 77, 0.4), 0 0 0 0 rgba(229, 72, 77, 0.35);
  }
  50% {
    box-shadow: 0 8px 24px rgba(229, 72, 77, 0.4), 0 0 0 12px rgba(229, 72, 77, 0);
  }
}

@media (max-width: 480px) {
  .vf-voice-btn {
    left: 16px;
    bottom: 16px;
    padding: 12px 16px;
  }
  body.has-cookie-banner .vf-voice-btn {
    bottom: calc(16px + var(--cookie-banner-offset, 70px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .vf-voice-btn.is-live {
    animation: none;
  }
}

/* Nudge ------------------------------------------------------------------
   The pill says "Talk to us", which does not tell a first-time visitor that
   there is a real voice agent behind it. This is a one-line prompt above the
   pill. It appears a few seconds in, it is clickable (it starts the call),
   and once dismissed it stays dismissed for that visitor. */
.vf-voice-nudge {
  position: fixed;
  left: 24px;
  bottom: 84px;
  z-index: 99997;
  max-width: 292px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 12px 13px 14px;
  border-radius: 14px;
  background: #121834;
  border: 1px solid rgba(139, 123, 255, 0.5);
  box-shadow: 0 14px 34px rgba(6, 9, 25, 0.4);
  color: #fff;
  font: 600 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.28s ease, transform 0.28s ease;
  pointer-events: none;
}

.vf-voice-nudge.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

/* The tail, pointing down at the pill it belongs to. */
.vf-voice-nudge::after {
  content: "";
  position: absolute;
  left: 26px;
  bottom: -7px;
  width: 12px;
  height: 12px;
  background: #121834;
  border-right: 1px solid rgba(139, 123, 255, 0.5);
  border-bottom: 1px solid rgba(139, 123, 255, 0.5);
  transform: rotate(45deg);
}

.vf-voice-nudge-dot {
  flex: none;
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: #8b7bff;
  box-shadow: 0 0 0 0 rgba(139, 123, 255, 0.55);
  animation: vf-nudge-dot 2.2s ease-out infinite;
}

@keyframes vf-nudge-dot {
  0% { box-shadow: 0 0 0 0 rgba(139, 123, 255, 0.55); }
  70% { box-shadow: 0 0 0 9px rgba(139, 123, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(139, 123, 255, 0); }
}

.vf-voice-nudge-close {
  flex: none;
  /* padding grows the hit area, the negative margin keeps the visual size */
  margin: -10px -8px -10px -4px;
  padding: 10px;
  border: 0;
  background: none;
  color: rgba(255, 255, 255, 0.55);
  font: 600 15px/1 system-ui, sans-serif;
  cursor: pointer;
  border-radius: 6px;
}

.vf-voice-nudge-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

body.has-cookie-banner .vf-voice-nudge {
  bottom: calc(84px + var(--cookie-banner-offset, 70px));
}

@media (max-width: 480px) {
  .vf-voice-nudge {
    left: 16px;
    bottom: 74px;
    max-width: min(292px, calc(100vw - 32px));
  }
  body.has-cookie-banner .vf-voice-nudge {
    bottom: calc(74px + var(--cookie-banner-offset, 70px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .vf-voice-nudge { transition: none; }
  .vf-voice-nudge-dot { animation: none; }
}
