/*
 * HubVoice — Mic-knapp och dikterings-UI
 * Följer Admin Hub-designspråket (grönt/violet/rött).
 */

/* ── Wrapper runt mic + polish-knappar ─────────────────────────────────────── */
.hub-voice-btn-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  vertical-align: middle;
  margin-left: 6px;
  flex-shrink: 0;
}

/* ── Mic-knapp ──────────────────────────────────────────────────────────────── */
.hub-voice-mic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  border: 2px solid #d1d5db;
  background: #f9fafb;
  color: #374151;
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  flex-shrink: 0;
}

.hub-voice-mic:hover:not(:disabled) {
  border-color: #7c3aed;
  background: #f5f3ff;
}

.hub-voice-mic:disabled {
  opacity: 0.5;
  cursor: wait;
}

/* Inspelning aktiv — violet glow */
.hub-voice-mic--active {
  border-color: #7c3aed !important;
  background: #ede9fe !important;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.25);
  animation: hub-voice-pulse 1.4s ease-in-out infinite;
}

@keyframes hub-voice-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.25); }
  50%       { box-shadow: 0 0 0 6px rgba(124, 58, 237, 0.10); }
}

/* Felläge — rött i 5 sek */
.hub-voice-mic--error {
  border-color: #dc2626 !important;
  background: #fef2f2 !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.20);
}

/* ── Fältet som dikteras i ─────────────────────────────────────────────────── */
.hub-voice-dictating {
  outline: 2px solid #7c3aed !important;
  outline-offset: 1px;
}

/* ── Renskriv-knapp ────────────────────────────────────────────────────────── */
.hub-voice-polish-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 1.8rem;
  padding: 0 0.6rem;
  border-radius: 6px;
  border: 1.5px solid #7c3aed;
  background: #f5f3ff;
  color: #5b21b6;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}

.hub-voice-polish-btn:hover:not(:disabled) {
  background: #7c3aed;
  color: #fff;
}

.hub-voice-polish-btn:disabled {
  opacity: 0.5;
  cursor: wait;
}

/* ── Status-flyover (global flytande, längst ner) ───────────────────────────── */
.hub-voice-status {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9990;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  pointer-events: none;
  white-space: nowrap;
  max-width: 90vw;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  display: none;
}

.hub-voice-status--idle {
  background: #1e293b;
  color: #e2e8f0;
  display: block;
}

.hub-voice-status--ok {
  background: #064e3b;
  color: #a7f3d0;
  display: block;
}

.hub-voice-status--err {
  background: #7f1d1d;
  color: #fecaca;
  display: block;
}
