/*
 * WebsDocs Voice Agent Widget
 * File: /voice-agent/widget/websdocs-voice-agent.css
 *
 * Launcher rule:
 * - No CSS background on launcher
 * - Launcher is only the provided transparent WebP image
 * - Premium panel opens after click
 * - Spectrum wave appears when .wdva-root has .is-call-active
 */

.wdva-root {
  --wdva-purple: #2a0146;
  --wdva-purple-2: #4b0a78;
  --wdva-purple-3: #160022;
  --wdva-cyan: #25d6ff;
  --wdva-lime: #b8ff2c;
  --wdva-orange: #ff8a00;
  --wdva-text: #241334;
  --wdva-muted: #70637b;
  --wdva-soft: rgba(42, 1, 70, 0.08);
  --wdva-line: rgba(42, 1, 70, 0.14);
  --wdva-white: #ffffff;
  --wdva-danger: #b42318;
  --wdva-success: #067647;
  --wdva-warning: #b54708;

  position: fixed;
  z-index: 2147483000;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--wdva-text);
}

.wdva-root[data-position="bottom-right"] {
  right: 22px;
  bottom: 22px;
}

.wdva-root[data-position="bottom-left"] {
  left: 22px;
  bottom: 22px;
}

.wdva-root[data-position="top-right"] {
  right: 22px;
  top: 22px;
}

.wdva-root[data-position="top-left"] {
  left: 22px;
  top: 22px;
}

/* =========================================================
   LAUNCHER — TRANSPARENT WEBP ONLY
   ========================================================= */

.wdva-launcher {
  width: 86px;
  height: 86px;
  position: fixed;
  right: 18px;
  bottom: 76px;
  padding: 0;
  margin: 0;
  border: 0;
  outline: none;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0;
  cursor: pointer;
  display: block;
  appearance: none;
  -webkit-appearance: none;
  line-height: 0;
  transition: transform 0.18s ease, filter 0.18s ease;
}

.wdva-launcher:hover {
  transform: translateY(-3px) scale(1.025);
}

.wdva-launcher:active {
  transform: translateY(0) scale(0.97);
}

.wdva-launcher:focus-visible {
  outline: 3px solid rgba(37, 214, 255, 0.65);
  outline-offset: 5px;
  border-radius: 18px;
}

.wdva-launcher-img {
  display: block;
  width: 66%;
  height: 66%;
  object-fit: contain;
  background: transparent !important;
  border: 0;
  box-shadow: none !important;
  pointer-events: none;
  user-select: none;
  transform: translateY(-4px);
  filter: drop-shadow(0 18px 28px rgba(42, 1, 70, 0.22));
}

.wdva-root.is-call-active .wdva-launcher-img {
  filter:
    drop-shadow(0 18px 28px rgba(42, 1, 70, 0.24))
    drop-shadow(0 0 20px rgba(37, 214, 255, 0.28));
}

.wdva-launcher-fallback {
  width: 86px;
  height: 86px;
  display: block;
  fill: rgba(42, 1, 70, 0.95);
  stroke: #ffffff;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  background: transparent;
}

/* =========================================================
   PREMIUM PANEL
   ========================================================= */

.wdva-panel {
  position: absolute;
  width: min(392px, calc(100vw - 28px));
  overflow: hidden;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  background:
    radial-gradient(circle at 18% 0%, rgba(37, 214, 255, 0.22), transparent 36%),
    radial-gradient(circle at 92% 12%, rgba(168, 85, 247, 0.24), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.97), rgba(250, 246, 255, 0.97));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow:
    0 30px 90px rgba(25, 4, 42, 0.28),
    0 10px 30px rgba(42, 1, 70, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.wdva-root.is-call-active .wdva-panel {
  box-shadow:
    0 34px 100px rgba(25, 4, 42, 0.30),
    0 0 44px rgba(37, 214, 255, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.wdva-root[data-position="bottom-right"] .wdva-panel,
.wdva-root[data-position="bottom-left"] .wdva-panel {
  bottom: 112px;
}

.wdva-root[data-position="top-right"] .wdva-panel,
.wdva-root[data-position="top-left"] .wdva-panel {
  top: 112px;
}

.wdva-root[data-position="bottom-right"] .wdva-panel,
.wdva-root[data-position="top-right"] .wdva-panel {
  right: 0;
}

.wdva-root[data-position="bottom-left"] .wdva-panel,
.wdva-root[data-position="top-left"] .wdva-panel {
  left: 0;
}

/* =========================================================
   PANEL HEADER
   ========================================================= */

.wdva-panel-head {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 20px;
  color: #ffffff;
  background:
    radial-gradient(circle at 20% 0%, rgba(37, 214, 255, 0.35), transparent 36%),
    radial-gradient(circle at 95% 10%, rgba(255, 138, 0, 0.28), transparent 34%),
    linear-gradient(135deg, #210036 0%, #3c065f 48%, #130022 100%);
}

.wdva-panel-head::before {
  content: "";
  position: absolute;
  inset: -80px -40px auto auto;
  width: 190px;
  height: 190px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 157, 46, 0.28), transparent 62%);
  pointer-events: none;
}

.wdva-panel-head::after {
  content: "";
  position: absolute;
  left: -28%;
  right: -28%;
  bottom: -42px;
  height: 90px;
  background:
    linear-gradient(90deg,
      transparent,
      rgba(37, 214, 255, 0.16),
      rgba(184, 255, 44, 0.10),
      rgba(255, 138, 0, 0.16),
      transparent
    );
  filter: blur(18px);
  pointer-events: none;
}

.wdva-agent {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.wdva-agent-mark {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-weight: 950;
  letter-spacing: -0.04em;
  color: #ffffff;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.75), transparent 24%),
    linear-gradient(135deg, #22d3ee 0%, #7c3aed 48%, #ff8a00 100%);
  box-shadow:
    0 14px 30px rgba(37, 214, 255, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.48);
}

.wdva-root.is-call-active .wdva-agent-mark {
  animation: wdvaAgentPulse 1.6s ease-in-out infinite;
}

.wdva-agent strong {
  display: block;
  font-size: 15px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.wdva-agent span {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.76);
}

.wdva-close {
  position: relative;
  z-index: 1;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: background 0.16s ease, transform 0.16s ease;
}

.wdva-close:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: scale(1.03);
}

/* =========================================================
   BODY + STATUS
   ========================================================= */

.wdva-body {
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(250, 247, 255, 0.94));
}

.wdva-status-card {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border-radius: 22px;
  border: 1px solid rgba(42, 1, 70, 0.12);
  background:
    radial-gradient(circle at 8% 0%, rgba(37, 214, 255, 0.12), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(246, 239, 255, 0.94));
  box-shadow:
    0 14px 34px rgba(42, 1, 70, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.wdva-status-card::after {
  content: "";
  display: block;
  grid-column: 1 / -1;
  height: 56px;
  margin-top: 14px;
  border-radius: 18px;
  background:
    linear-gradient(90deg,
      rgba(37, 214, 255, 0.00) 0%,
      rgba(37, 214, 255, 0.18) 20%,
      rgba(124, 58, 237, 0.24) 50%,
      rgba(255, 138, 0, 0.18) 80%,
      rgba(255, 138, 0, 0.00) 100%
    );
  border: 1px solid rgba(42, 1, 70, 0.08);
  opacity: 0.68;
}

.wdva-status-card::before {
  content: "";
  position: absolute;
  left: 26px;
  right: 26px;
  bottom: 26px;
  height: 34px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, transparent 0 3%, rgba(37, 214, 255, .85) 3% 5%, transparent 5% 8%),
    linear-gradient(90deg, transparent 0 10%, rgba(124, 58, 237, .90) 10% 12%, transparent 12% 15%),
    linear-gradient(90deg, transparent 0 17%, rgba(255, 138, 0, .82) 17% 19%, transparent 19% 22%),
    linear-gradient(90deg, transparent 0 25%, rgba(37, 214, 255, .85) 25% 27%, transparent 27% 30%),
    linear-gradient(90deg, transparent 0 34%, rgba(124, 58, 237, .90) 34% 36%, transparent 36% 39%),
    linear-gradient(90deg, transparent 0 44%, rgba(255, 138, 0, .82) 44% 46%, transparent 46% 49%),
    linear-gradient(90deg, transparent 0 54%, rgba(37, 214, 255, .85) 54% 56%, transparent 56% 59%),
    linear-gradient(90deg, transparent 0 65%, rgba(124, 58, 237, .90) 65% 67%, transparent 67% 70%),
    linear-gradient(90deg, transparent 0 76%, rgba(255, 138, 0, .82) 76% 78%, transparent 78% 81%),
    linear-gradient(90deg, transparent 0 88%, rgba(37, 214, 255, .85) 88% 90%, transparent 90% 100%);
  transform-origin: center bottom;
  transform: scaleY(0.42);
  opacity: 0.38;
  filter: blur(0.1px);
  pointer-events: none;
}

.wdva-root.is-call-active .wdva-status-card::before {
  opacity: 1;
  animation: wdvaSpectrum 0.95s ease-in-out infinite;
}

.wdva-root.is-call-active .wdva-status-card::after {
  opacity: 1;
  animation: wdvaGlowFlow 2.2s linear infinite;
}

.wdva-label,
.wdva-timer span {
  display: block;
  margin-bottom: 5px;
  font-size: 11px;
  color: rgba(112, 99, 123, 0.92);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 900;
}

#wdvaStatus {
  display: block;
  font-size: 14px;
  line-height: 1.42;
  color: var(--wdva-text);
}

#wdvaStatus[data-tone="success"] {
  color: var(--wdva-success);
}

#wdvaStatus[data-tone="warning"] {
  color: var(--wdva-warning);
}

#wdvaStatus[data-tone="error"] {
  color: var(--wdva-danger);
}

.wdva-timer {
  min-width: 78px;
  padding: 9px 10px;
  text-align: right;
  border-radius: 16px;
  background: rgba(42, 1, 70, 0.06);
  border: 1px solid rgba(42, 1, 70, 0.08);
}

.wdva-timer strong {
  display: block;
  font-size: 21px;
  color: var(--wdva-purple);
  letter-spacing: -0.04em;
}

.wdva-help {
  margin: 14px 0 0;
  color: rgba(52, 38, 64, 0.78);
  font-size: 13px;
  line-height: 1.6;
}


/* =========================================================
   CALL META — elapsed / started / session
   ========================================================= */

.wdva-meta-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.wdva-meta-item {
  min-width: 0;
  padding: 9px 10px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(42, 1, 70, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.wdva-meta-item span {
  display: block;
  margin-bottom: 4px;
  font-size: 9px;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 950;
  color: rgba(112, 99, 123, 0.86);
}

.wdva-meta-item strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.25;
  color: var(--wdva-purple);
}

.wdva-root.is-call-active .wdva-meta-item {
  border-color: rgba(37, 214, 255, 0.16);
  background: rgba(255, 255, 255, 0.78);
}

/* =========================================================
   BUTTONS
   ========================================================= */

.wdva-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.wdva-btn {
  border: 0;
  border-radius: 999px;
  min-height: 46px;
  padding: 13px 18px;
  cursor: pointer;
  font-weight: 950;
  font-size: 14px;
  line-height: 1;
  letter-spacing: -0.01em;
  transition: transform 0.16s ease, opacity 0.16s ease, box-shadow 0.16s ease;
}

.wdva-btn:hover {
  transform: translateY(-1px);
}

.wdva-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.wdva-btn-start {
  flex: 1;
  color: #170022;
  background:
    linear-gradient(135deg, #f8ff6a 0%, #b8ff2c 38%, #26d9ff 100%);
  box-shadow:
    0 14px 30px rgba(37, 214, 255, 0.24),
    0 10px 24px rgba(184, 255, 44, 0.20);
}

.wdva-btn-start:hover {
  box-shadow:
    0 18px 38px rgba(37, 214, 255, 0.30),
    0 12px 30px rgba(184, 255, 44, 0.24);
}

.wdva-btn-end {
  flex: 1;
  color: #ffffff;
  background:
    linear-gradient(135deg, #ff4d6d 0%, #b42318 100%);
  box-shadow: 0 14px 30px rgba(180, 35, 24, 0.22);
}

.wdva-small {
  margin: 14px 0 0;
  font-size: 11px;
  line-height: 1.5;
  color: rgba(80, 63, 94, 0.68);
}

#wdvaRemoteAudio {
  display: none;
}

/* =========================================================
   ANIMATIONS
   ========================================================= */

@keyframes wdvaSpectrum {
  0% {
    transform: scaleY(0.42);
    filter: hue-rotate(0deg);
  }

  18% {
    transform: scaleY(0.88);
  }

  36% {
    transform: scaleY(0.54);
  }

  52% {
    transform: scaleY(1);
    filter: hue-rotate(18deg);
  }

  72% {
    transform: scaleY(0.62);
  }

  100% {
    transform: scaleY(0.42);
    filter: hue-rotate(0deg);
  }
}

@keyframes wdvaGlowFlow {
  0% {
    filter: hue-rotate(0deg) saturate(1);
  }

  50% {
    filter: hue-rotate(24deg) saturate(1.25);
  }

  100% {
    filter: hue-rotate(0deg) saturate(1);
  }
}

@keyframes wdvaAgentPulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow:
      0 14px 30px rgba(37, 214, 255, 0.24),
      inset 0 1px 0 rgba(255, 255, 255, 0.48);
  }

  50% {
    transform: scale(1.045);
    box-shadow:
      0 18px 40px rgba(37, 214, 255, 0.36),
      0 0 22px rgba(124, 58, 237, 0.22),
      inset 0 1px 0 rgba(255, 255, 255, 0.55);
  }
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 480px) {
  .wdva-root[data-position="bottom-right"],
  .wdva-root[data-position="top-right"] {
    right: 14px;
  }

  .wdva-root[data-position="bottom-left"],
  .wdva-root[data-position="top-left"] {
    left: 14px;
  }

  .wdva-root[data-position="bottom-right"],
  .wdva-root[data-position="bottom-left"] {
    bottom: 14px;
  }

  .wdva-launcher {
    width: 76px;
    height: 76px;
    right: 18px;
    bottom: 66px;
  }

  .wdva-panel {
    width: calc(100vw - 28px);
    border-radius: 26px;
  }

  .wdva-root[data-position="bottom-right"] .wdva-panel,
  .wdva-root[data-position="bottom-left"] .wdva-panel {
    bottom: 96px;
  }

  .wdva-root[data-position="top-right"] .wdva-panel,
  .wdva-root[data-position="top-left"] .wdva-panel {
    top: 96px;
  }

  .wdva-panel-head {
    padding: 18px;
  }

  .wdva-body {
    padding: 16px;
  }

  .wdva-status-card {
    padding: 15px;
  }

  .wdva-meta-grid {
    grid-template-columns: 1fr;
  }

  .wdva-status-card::before {
    left: 24px;
    right: 24px;
  }
}

/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
  .wdva-launcher,
  .wdva-launcher:hover,
  .wdva-btn,
  .wdva-close,
  .wdva-root.is-call-active .wdva-status-card::before,
  .wdva-root.is-call-active .wdva-status-card::after,
  .wdva-root.is-call-active .wdva-agent-mark {
    animation: none !important;
    transition: none !important;
  }
}