@keyframes ripple {
  0% {
    transform: scale(0.96);
    opacity: 0.5;
  }
  100% {
    transform: scale(1.35);
    opacity: 0;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes bar {
  0%,
  100% {
    transform: scaleY(0.3);
  }
  50% {
    transform: scaleY(1);
  }
}

#retell-wrapper {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

#retell-btn-wrap {
  position: relative;
  display: inline-flex;
}

.ripple-ring {
  position: absolute;
  inset: -8px;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.3);
  display: none;
  pointer-events: none;
}
.ripple-ring:nth-child(1) {
  animation: ripple 1.8s ease-out 0s infinite;
}
.ripple-ring:nth-child(2) {
  animation: ripple 1.8s ease-out 0.6s infinite;
}
.ripple-ring:nth-child(3) {
  animation: ripple 1.8s ease-out 1.2s infinite;
}

#retell-btn {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 26px;
  border-radius: 999px;
  background: #1a1a1a;
  border: none;
  cursor: pointer;
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22), 0 3px 8px rgba(0, 0, 0, 0.14);
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
#retell-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.26), 0 4px 10px rgba(0, 0, 0, 0.16);
}
#retell-btn:disabled {
  cursor: default;
  opacity: 0.85;
}

.retell-btn__visual {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}
.icon-phone {
  width: 20px;
  height: 20px;
  display: block;
}
.retell-btn__label {
  display: inline-block;
}

.icon-spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: none;
}

#retell-bars {
  display: none;
  align-items: center;
  gap: 2px;
  width: 20px;
  height: 18px;
}
#retell-bars span {
  flex: 1;
  height: 100%;
  background: #fff;
  display: block;
  border-radius: 2px;
  transform-origin: center;
}
#retell-bars span:nth-child(1) { animation: bar 1s ease-in-out 0s   infinite; }
#retell-bars span:nth-child(2) { animation: bar 1s ease-in-out 0.2s infinite; }
#retell-bars span:nth-child(3) { animation: bar 1s ease-in-out 0.4s infinite; }
#retell-bars span:nth-child(4) { animation: bar 1s ease-in-out 0.6s infinite; }
#retell-bars span:nth-child(5) { animation: bar 1s ease-in-out 0.8s infinite; }

/* Connecting: swap the phone icon for a spinner. */
#retell-btn-wrap.connecting .icon-phone {
  display: none;
}
#retell-btn-wrap.connecting .icon-spinner {
  display: block;
}

/* Active call: red pill, animated bars, pulsing rings. */
#retell-btn-wrap.active .ripple-ring {
  display: block;
}
#retell-btn-wrap.active .icon-phone {
  display: none;
}
#retell-btn-wrap.active #retell-bars {
  display: inline-flex;
}
#retell-btn-wrap.active #retell-btn {
  background: #ef4444;
}

body[class*="storevoiceai-for-woocommerce"] #wpfooter,
body[class*="storevoiceai-for-woocommerce"] #footer-thankyou,
body[class*="storevoiceai-for-woocommerce"] #footer-upgrade {
  display: none !important;
}
