/**
 * Sarah 100% Pure Voice AI Assistant
 * The Premiere Metro Group, LLC.
 */

:root {
  --sarah-primary: #002244;
  --sarah-accent: #0056b3;
  --sarah-voice-blue: #0284c7;
  --sarah-voice-glow: rgba(2, 132, 199, 0.35);
  --sarah-surface: #ffffff;
  --sarah-border: #e2e8f0;
  --sarah-radius: 28px;
  --sarah-shadow: 0 24px 60px rgba(0, 34, 68, 0.35);
}

/* ==========================================================================
   Launcher Button & Speech Bubble Callout
   ========================================================================== */

.sarah-launcher-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Speech Bubble Callout */
.sarah-speech-bubble {
  background: #ffffff;
  color: var(--sarah-primary);
  padding: 11px 18px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 8px 25px rgba(0, 34, 68, 0.18);
  border: 1px solid #cbd5e1;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  animation: bubbleFloat 3s ease-in-out infinite alternate;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sarah-speech-bubble:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 30px rgba(0, 34, 68, 0.25);
}

.sarah-speech-bubble::after {
  content: '';
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 8px solid #ffffff;
}

@keyframes bubbleFloat {
  0% { transform: translateY(0); }
  100% { transform: translateY(-6px); }
}

/* Circular Avatar Launcher Button */
.sarah-launcher-btn {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  border: 3.5px solid #ffffff;
  background: var(--sarah-primary);
  box-shadow: 0 8px 26px rgba(0, 34, 68, 0.35);
  cursor: pointer;
  padding: 0;
  position: relative;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.sarah-launcher-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 32px rgba(0, 34, 68, 0.45);
}

.sarah-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.sarah-close-icon {
  display: none;
  font-size: 24px;
  color: #ffffff;
}

.sarah-launcher-container.is-active .sarah-avatar-img {
  display: none;
}
.sarah-launcher-container.is-active .sarah-close-icon {
  display: block;
}
.sarah-launcher-container.is-active .sarah-speech-bubble {
  display: none;
}

/* Pulsing Red Unread Badge */
.sarah-unread-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 22px;
  height: 22px;
  background: #ef4444;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
  animation: pulseBadge 2s infinite;
}

@keyframes pulseBadge {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { transform: scale(1.15); box-shadow: 0 0 0 9px rgba(239, 68, 68, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* ==========================================================================
   Voice Call Interface Window (Zero-Text Layout)
   ========================================================================== */

.sarah-call-window {
  position: fixed;
  bottom: 104px;
  right: 24px;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100vh - 128px);
  background: linear-gradient(180deg, #031528 0%, #001f3f 100%);
  color: #ffffff;
  border-radius: var(--sarah-radius);
  box-shadow: var(--sarah-shadow);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(24px) scale(0.95);
  transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.28s;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.sarah-call-window.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Header */
.sarah-call-header {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sarah-call-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sarah-call-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  color: #ffffff;
  letter-spacing: 0.3px;
}

.sarah-call-timer {
  font-size: 12px;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
  margin-left: 4px;
}

.sarah-call-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sarah-call-close-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #ffffff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.2s;
}

.sarah-call-close-btn:hover {
  background: rgba(239, 68, 68, 0.4);
}

/* Center Avatar Stage */
.sarah-call-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  flex: 1;
}

.sarah-avatar-aura-wrap {
  position: relative;
  width: 150px;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.sarah-aura-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
  transition: all 0.3s ease;
}

.sarah-ring-inner {
  width: 168px;
  height: 168px;
  border: 2px solid rgba(2, 132, 199, 0.35);
}

.sarah-ring-outer {
  width: 196px;
  height: 196px;
  border: 1px solid rgba(2, 132, 199, 0.18);
}

.sarah-call-avatar {
  width: 136px;
  height: 136px;
  border-radius: 50%;
  border: 4px solid #0284c7;
  overflow: hidden;
  box-shadow: 0 0 32px rgba(2, 132, 199, 0.45);
  position: relative;
  z-index: 2;
  cursor: pointer;
  transition: all 0.3s;
}

.sarah-call-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Animations for Speaking & Listening */
.is-speaking .sarah-call-avatar {
  border-color: #38bdf8;
  box-shadow: 0 0 45px rgba(56, 189, 248, 0.85);
  animation: talkPulse 1.2s infinite alternate ease-in-out;
}
.is-speaking .sarah-ring-inner {
  border-color: rgba(56, 189, 248, 0.6);
  animation: auraPulse 1.2s infinite ease-out;
}
.is-speaking .sarah-ring-outer {
  border-color: rgba(56, 189, 248, 0.3);
  animation: auraPulse 1.2s infinite 0.4s ease-out;
}

.is-listening .sarah-call-avatar {
  border-color: #22c55e;
  box-shadow: 0 0 45px rgba(34, 197, 94, 0.85);
  animation: listenPulse 1.4s infinite alternate ease-in-out;
}
.is-listening .sarah-ring-inner {
  border-color: rgba(34, 197, 94, 0.6);
  animation: auraPulse 1.4s infinite ease-out;
}
.is-listening .sarah-ring-outer {
  border-color: rgba(34, 197, 94, 0.3);
  animation: auraPulse 1.4s infinite 0.5s ease-out;
}

@keyframes auraPulse {
  0% { transform: translate(-50%, -50%) scale(0.9); opacity: 0.8; }
  100% { transform: translate(-50%, -50%) scale(1.25); opacity: 0; }
}

@keyframes talkPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.05); }
}

@keyframes listenPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.03); }
}

/* Status Pill */
.sarah-status-pill {
  font-size: 13.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #93c5fd;
  transition: all 0.3s;
  margin-bottom: 14px;
}

.is-speaking .sarah-status-pill {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.5);
  color: #38bdf8;
}

.is-listening .sarah-status-pill {
  background: rgba(34, 197, 94, 0.18);
  border-color: rgba(34, 197, 94, 0.5);
  color: #4ade80;
}

/* Subtitle Live Caption */
.sarah-live-caption {
  font-size: 13.5px;
  line-height: 1.45;
  color: #e2e8f0;
  text-align: center;
  min-height: 48px;
  max-height: 80px;
  overflow-y: auto;
  padding: 0 14px;
  font-weight: 500;
  opacity: 0.95;
}

/* Wave lines */
.sarah-wave-bars {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 12px;
}
.sarah-wbar {
  width: 3px;
  background: currentColor;
  border-radius: 2px;
  animation: wbarAnim 0.8s infinite alternate ease-in-out;
}
.sarah-wbar:nth-child(2) { animation-delay: 0.15s; height: 12px; }
.sarah-wbar:nth-child(3) { animation-delay: 0.3s; height: 7px; }
.sarah-wbar:nth-child(4) { animation-delay: 0.45s; height: 10px; }

@keyframes wbarAnim {
  0% { transform: scaleY(0.3); }
  100% { transform: scaleY(1.3); }
}

/* Bottom Controls Dock */
.sarah-call-dock {
  padding: 16px 20px 20px;
  background: rgba(0, 15, 30, 0.7);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-around;
  flex-shrink: 0;
}

.sarah-dock-mic {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: #0284c7;
  color: #ffffff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 6px 22px rgba(2, 132, 199, 0.5);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sarah-dock-mic:hover {
  transform: scale(1.08);
  background: #0369a1;
}

.sarah-dock-mic.is-active {
  background: #22c55e;
  box-shadow: 0 0 26px rgba(34, 197, 94, 0.7);
  animation: pulseMicBtn 1.5s infinite;
}

@keyframes pulseMicBtn {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { box-shadow: 0 0 0 12px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.sarah-dock-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
  padding: 10px 16px;
  border-radius: 24px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.sarah-dock-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.sarah-compliance-disclaimer {
  font-size: 10px;
  line-height: 1.35;
  color: #94a3b8;
  text-align: center;
  padding: 8px 14px 10px;
  background: rgba(1, 10, 20, 0.9);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
  letter-spacing: 0.1px;
}

.sarah-dock-end {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.sarah-dock-end:hover {
  background: #ef4444;
  color: #ffffff;
}

/* Mobile Responsive */
@media (max-width: 480px) {
  .sarah-call-window {
    right: 12px;
    bottom: 84px;
    width: calc(100vw - 24px);
    height: calc(100vh - 100px);
  }
  .sarah-speech-bubble {
    display: none;
  }
}
