/* SHA Voice Agent Widget */

/* ── Header button (desktop) ── */

#sha-voice-btn {
  padding: 12px 24px;
  border-radius: 4px;
  border: 1px solid;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-align: center;
  cursor: pointer;
  font-size: 18px;
  font-weight: 400;
  background: none;
  text-transform: uppercase;
  font-family: inherit;
  color: #fff;
  border-color: #fff;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  white-space: nowrap;
  margin-left: 8px;
}

#sha-voice-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

#sha-voice-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex-shrink: 0;
}

#sha-voice-btn.active {
  background: #c0392b;
  border-color: #c0392b;
  color: #fff;
}

#sha-voice-btn.active:hover {
  background: #e74c3c;
  border-color: #e74c3c;
}

/* Scrolled / non-home header states */
.site-header-desktop.is-scrolled #sha-voice-btn,
body.no-home .site-header-desktop #sha-voice-btn,
body.off-canvas-open .site-header-desktop #sha-voice-btn,
body.lang-menu-open .site-header-desktop #sha-voice-btn {
  background-color: #2c2c2c;
  color: #ffffff;
  border-color: #2c2c2c;
}

.site-header-desktop.is-scrolled #sha-voice-btn:hover,
body.no-home .site-header-desktop #sha-voice-btn:hover,
body.off-canvas-open .site-header-desktop #sha-voice-btn:hover,
body.lang-menu-open .site-header-desktop #sha-voice-btn:hover {
  background-color: #555555;
  border-color: #555555;
  color: #ffffff;
}

.site-header-desktop.is-scrolled #sha-voice-btn.active,
body.no-home .site-header-desktop #sha-voice-btn.active,
body.off-canvas-open .site-header-desktop #sha-voice-btn.active,
body.lang-menu-open .site-header-desktop #sha-voice-btn.active {
  background: #c0392b;
  border-color: #c0392b;
  color: #fff;
}

@media (max-width: 1200px) {
  #sha-voice-btn .sha-btn-label {
    display: none;
  }
  #sha-voice-btn {
    padding: 12px 14px;
  }
}

@media (max-width: 1023px) {
  #sha-voice-btn.solo-desktop {
    display: none !important;
  }
  #sha-voice-btn-mobile {
    display: inline-flex !important;
  }
}

/* ── Mobile floating button ── */

#sha-voice-btn-mobile {
  display: none;
  position: fixed;
  bottom: 72px;
  right: 16px;
  z-index: 99999;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: #2c2c2c;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  align-items: center;
  justify-content: center;
}

#sha-voice-btn-mobile svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

#sha-voice-btn-mobile.active {
  background: #c0392b;
}

/* ── Orb Overlay ── */

#sha-orb-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
}

#sha-orb-overlay.visible {
  display: flex;
}

#sha-orb-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

#sha-orb-status {
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.02em;
  opacity: 0.9;
}

#sha-orb-agent {
  width: 300px;
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#sha-orb-agent deepgram-agent {
  display: block;
}

/* Style the canvas inside the hoop */
#sha-orb-agent canvas {
  display: block;
}

#sha-orb-end {
  padding: 14px 40px;
  border-radius: 30px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(192, 57, 43, 0.8);
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#sha-orb-end:hover {
  background: rgba(231, 76, 60, 0.9);
  border-color: rgba(255, 255, 255, 0.5);
}

/* Pulse on header buttons while active */
@keyframes sha-pulse {
  0%, 100% { box-shadow: none; }
  50% { box-shadow: 0 0 0 6px rgba(192, 57, 43, 0.2); }
}

#sha-voice-btn.active,
#sha-voice-btn-mobile.active {
  animation: sha-pulse 2s ease-in-out infinite;
}
