/* Voice Input for Perfex CRM. Override the variables below to match a theme. */
.voice-input {
  --voice-input-bg: #ffffff;
  --voice-input-fg: #475569;
  --voice-input-border: #cbd5e1;
  --voice-input-accent: #dc2626;
  position: fixed;
  z-index: 10500; /* above Bootstrap modals */
  display: flex;
  align-items: center;
  gap: 2px;
  font: 12px/1.2 inherit;
}
.voice-input[hidden],
.voice-input [hidden] { display: none !important; }

.voice-input__mic,
.voice-input__lang {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  margin: 0;
  padding: 0 5px;
  border: 1px solid var(--voice-input-border);
  border-radius: 12px;
  background: var(--voice-input-bg);
  color: var(--voice-input-fg);
  cursor: pointer;
  opacity: .75;
  transition: opacity .15s, color .15s, border-color .15s;
}
.voice-input__mic { width: 24px; padding: 0; }
.voice-input__lang { font-size: 10px; font-weight: 600; letter-spacing: .03em; }
.voice-input__mic:hover,
.voice-input__lang:hover,
.voice-input__mic:focus-visible,
.voice-input__lang:focus-visible { opacity: 1; }

.voice-input.is-listening .voice-input__mic {
  opacity: 1;
  color: #fff;
  background: var(--voice-input-accent);
  border-color: var(--voice-input-accent);
  animation: voice-input-pulse 1.4s ease-out infinite;
}
@keyframes voice-input-pulse {
  0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .45); }
  100% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .voice-input.is-listening .voice-input__mic { animation: none; }
}

.voice-input__menu {
  position: absolute;
  top: 28px;
  right: 0;
  min-width: 160px;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  background: var(--voice-input-bg);
  border: 1px solid var(--voice-input-border);
  border-radius: 6px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, .12);
}
.voice-input__menu button {
  display: block;
  width: 100%;
  padding: 6px 12px;
  border: 0;
  background: none;
  color: #1e293b;
  text-align: left;
  font-size: 13px;
  cursor: pointer;
}
.voice-input__menu button:hover { background: #f1f5f9; }

.voice-input__bubble {
  position: absolute;
  top: 28px;
  right: 0;
  max-width: 320px;
  min-width: 120px;
  padding: 6px 10px;
  background: #1e293b;
  color: #f8fafc;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.4;
  white-space: normal;
  pointer-events: none;
}
