/* Verbacall "Live Hear It" widget — self-contained, prefixed (vbc-) to avoid
   bleeding into / inheriting from the host WordPress theme. */

.vbc-livecall {
  --vbc-primary: #0e7c86;
  --vbc-primary-d: #0a5f67;
  --vbc-accent: #f0fbfc;
  --vbc-ink: #11242a;
  --vbc-muted: #5b7178;
  --vbc-line: #e3edef;
  --vbc-agent: #0e7c86;
  --vbc-you: #2f6df0;
  --vbc-danger: #d6453d;
  --vbc-radius: 18px;
  --vbc-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---- trigger button (inline, on the page) ---- */
.vbc-livecall-trigger {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 22px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  color: #fff;
  background: linear-gradient(180deg, #11919d 0%, #0e7c86 100%);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(14, 124, 134, 0.28);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}
.vbc-livecall-trigger:hover { transform: translateY(-1px); filter: brightness(1.04); box-shadow: 0 10px 24px rgba(14, 124, 134, 0.34); }
.vbc-livecall-trigger:active { transform: translateY(0); }
.vbc-livecall-trigger:focus-visible { outline: 3px solid rgba(14, 124, 134, 0.45); outline-offset: 2px; }
.vbc-livecall-trigger__icon { display: inline-flex; }

/* ---- overlay + modal ---- */
.vbc-livecall__overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(12, 28, 33, 0.55);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  font-family: var(--vbc-font);
}
.vbc-livecall__overlay.vbc-open { opacity: 1; pointer-events: auto; }

.vbc-livecall__modal {
  width: 100%;
  max-width: 440px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  color: var(--vbc-ink);
  border-radius: var(--vbc-radius);
  box-shadow: 0 24px 70px rgba(8, 30, 36, 0.35);
  overflow: hidden;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.2s ease;
}
.vbc-livecall__overlay.vbc-open .vbc-livecall__modal { transform: none; }

/* header */
.vbc-livecall__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--vbc-line);
}
.vbc-livecall__avatar {
  width: 42px; height: 42px; flex: 0 0 42px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: #fff;
  background: linear-gradient(180deg, #11919d, #0e7c86);
}
.vbc-livecall__titles { flex: 1; min-width: 0; }
.vbc-livecall__title { font-size: 16px; font-weight: 700; margin: 0; }
.vbc-livecall__status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--vbc-muted); margin-top: 2px;
}
.vbc-livecall__dot { width: 8px; height: 8px; border-radius: 50%; background: #b7c4c8; }
.vbc-livecall__status.is-live .vbc-livecall__dot { background: #1bbf73; box-shadow: 0 0 0 0 rgba(27,191,115,.5); animation: vbc-pulse 1.4s infinite; }
.vbc-livecall__status.is-busy .vbc-livecall__dot { background: #e8a13a; }
.vbc-livecall__status.is-err .vbc-livecall__dot { background: var(--vbc-danger); }
.vbc-livecall__timer { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--vbc-muted); }
.vbc-livecall__close {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  width: 32px; height: 32px; border-radius: 8px; color: var(--vbc-muted);
  display: grid; place-items: center;
}
.vbc-livecall__close:hover { background: var(--vbc-accent); color: var(--vbc-ink); }

/* orb / visualizer */
.vbc-livecall__stage {
  display: flex; flex-direction: column; align-items: center;
  padding: 26px 18px 8px;
}
.vbc-livecall__orb {
  position: relative; width: 116px; height: 116px; border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 50% 38%, #e7f7f8, #d3eef0);
  color: var(--vbc-primary);
}
.vbc-livecall__orb::before {
  content: ""; position: absolute; inset: -6px; border-radius: 50%;
  background: radial-gradient(circle, rgba(14,124,134,0.28), transparent 70%);
  transform: scale(var(--vbc-level, 1)); transition: transform 0.08s linear;
}
.vbc-livecall__orb svg { position: relative; }
.vbc-livecall__hint { margin: 14px 4px 2px; font-size: 13px; color: var(--vbc-muted); text-align: center; }

/* transcript */
.vbc-livecall__log {
  flex: 1; min-height: 90px; max-height: 34vh; overflow-y: auto;
  padding: 12px 18px 6px; display: flex; flex-direction: column; gap: 8px;
}
.vbc-msg { max-width: 86%; font-size: 14px; line-height: 1.4; }
.vbc-msg__who { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--vbc-muted); margin-bottom: 2px; }
.vbc-msg__body { padding: 9px 12px; border-radius: 12px; }
.vbc-msg.agent { align-self: flex-start; }
.vbc-msg.agent .vbc-msg__body { background: var(--vbc-accent); color: var(--vbc-ink); border-bottom-left-radius: 4px; }
.vbc-msg.you { align-self: flex-end; text-align: right; }
.vbc-msg.you .vbc-msg__body { background: #eef3ff; color: #16305f; border-bottom-right-radius: 4px; }
.vbc-msg.you .vbc-msg__who { text-align: right; }
.vbc-msg.interim .vbc-msg__body { opacity: .6; font-style: italic; }
.vbc-msg.sys { align-self: center; text-align: center; color: var(--vbc-muted); font-size: 12.5px; }
.vbc-msg.sys.warn { color: var(--vbc-danger); }
.vbc-caret { display: inline-block; width: 7px; height: 1.05em; vertical-align: text-bottom; background: var(--vbc-primary); margin-left: 1px; animation: vbc-blink 1s steps(2) infinite; }

/* footer / call button */
.vbc-livecall__foot { padding: 14px 18px 18px; border-top: 1px solid var(--vbc-line); }
.vbc-livecall__cta {
  width: 100%;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 14px 20px; font-size: 16px; font-weight: 700; line-height: 1;
  color: #fff; border: 0; border-radius: 14px; cursor: pointer;
  background: linear-gradient(180deg, #11919d, #0e7c86);
  box-shadow: 0 6px 16px rgba(14,124,134,0.28);
  transition: filter .12s ease, transform .12s ease;
}
.vbc-livecall__cta:hover { filter: brightness(1.05); }
.vbc-livecall__cta:disabled { opacity: .6; cursor: default; filter: none; }
.vbc-livecall__cta.is-end { background: linear-gradient(180deg, #e15a52, #d6453d); box-shadow: 0 6px 16px rgba(214,69,61,0.28); }
.vbc-livecall__legal { margin: 9px 2px 0; text-align: center; font-size: 11.5px; color: #9aabb0; }

@keyframes vbc-pulse { 0% { box-shadow: 0 0 0 0 rgba(27,191,115,.5); } 70% { box-shadow: 0 0 0 7px rgba(27,191,115,0); } 100% { box-shadow: 0 0 0 0 rgba(27,191,115,0); } }
@keyframes vbc-blink { 50% { opacity: 0; } }

/* mobile: bottom sheet */
@media (max-width: 560px) {
  .vbc-livecall__overlay { align-items: flex-end; padding: 0; }
  .vbc-livecall__modal { max-width: none; max-height: 90dvh; border-radius: 20px 20px 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  .vbc-livecall__overlay, .vbc-livecall__modal, .vbc-livecall__orb::before { transition: none; }
  .vbc-livecall__status.is-live .vbc-livecall__dot, .vbc-caret { animation: none; }
}
