/* WP AI Engineer — Voice Assistant Widget */

:root {
  --rgo-voice-color: #9cff3b;
  --rgo-voice-bg: #0f172a;
  --rgo-voice-surface: #1e293b;
  --rgo-voice-border: #334155;
  --rgo-voice-text: #f1f5f9;
  --rgo-voice-muted: #94a3b8;
  --rgo-voice-radius: 16px;
}

/* ── Floating trigger button ── */
#rgo-voice-btn {
  position: fixed;
  bottom: 90px; /* above chat bubble */
  left: 24px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--rgo-voice-color);
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 99998;
  box-shadow: 0 4px 20px rgba(156,255,59,.35);
  transition: transform 0.2s, box-shadow 0.2s;
  user-select: none;
}
#rgo-voice-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(156,255,59,.5);
}

/* ── Panel ── */
#rgo-voice-panel {
  position: fixed;
  bottom: 80px;
  left: 24px;
  width: 320px;
  max-height: 480px;
  background: var(--rgo-voice-bg);
  border: 1px solid var(--rgo-voice-border);
  border-radius: var(--rgo-voice-radius);
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  display: flex;
  flex-direction: column;
  z-index: 99997;
  overflow: hidden;
  transform: scale(0.92) translateY(12px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.22s ease, opacity 0.22s ease;
}
#rgo-voice-panel.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

/* ── Header ── */
.rgo-voice-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--rgo-voice-border);
  flex-shrink: 0;
}
.rgo-voice-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--rgo-voice-text);
  letter-spacing: 0.01em;
}
.rgo-voice-close {
  background: none;
  border: none;
  color: var(--rgo-voice-muted);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color 0.15s;
}
.rgo-voice-close:hover { color: var(--rgo-voice-text); }

/* ── Status ── */
.rgo-voice-status {
  text-align: center;
  font-size: 12px;
  color: var(--rgo-voice-muted);
  padding: 8px 16px 0;
  flex-shrink: 0;
}
.rgo-voice-status--connected  { color: #22c55e; }
.rgo-voice-status--speaking   { color: var(--rgo-voice-color); }
.rgo-voice-status--connecting { color: #60a5fa; }
.rgo-voice-status--error      { color: #ef4444; }

/* ── Orb / Wave ── */
.rgo-voice-wave {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 0 12px;
  flex-shrink: 0;
}

.rgo-voice-orb {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--rgo-voice-surface);
  border: 2px solid var(--rgo-voice-border);
  transition: all 0.3s ease;
  position: relative;
}
.rgo-voice-orb::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid transparent;
  transition: all 0.3s ease;
}

.rgo-voice-orb--listening {
  background: rgba(96,165,250,.15);
  border-color: #60a5fa;
  box-shadow: 0 0 0 6px rgba(96,165,250,.1);
  animation: rgo-voice-pulse 1.2s ease-in-out infinite;
}
.rgo-voice-orb--thinking {
  background: rgba(234,179,8,.1);
  border-color: #eab308;
  animation: rgo-voice-spin-border 1.5s linear infinite;
}
.rgo-voice-orb--speaking {
  background: rgba(156,255,59,.15);
  border-color: var(--rgo-voice-color);
  box-shadow: 0 0 0 6px rgba(156,255,59,.1), 0 0 0 12px rgba(156,255,59,.05);
  animation: rgo-voice-breathe 0.8s ease-in-out infinite alternate;
}
.rgo-voice-orb--connected {
  background: rgba(34,197,94,.1);
  border-color: #22c55e;
}

@keyframes rgo-voice-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(96,165,250,.15); }
  50%       { box-shadow: 0 0 0 12px rgba(96,165,250,.05); }
}
@keyframes rgo-voice-spin-border {
  to { transform: rotate(360deg); }
}
@keyframes rgo-voice-breathe {
  from { transform: scale(1); }
  to   { transform: scale(1.08); }
}

/* ── Transcript ── */
.rgo-voice-transcript {
  flex: 1;
  overflow-y: auto;
  padding: 8px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 60px;
  max-height: 140px;
}
.rgo-voice-transcript::-webkit-scrollbar { width: 4px; }
.rgo-voice-transcript::-webkit-scrollbar-thumb { background: var(--rgo-voice-border); border-radius: 2px; }

.rgo-voice-msg {
  font-size: 12px;
  line-height: 1.5;
  padding: 6px 10px;
  border-radius: 8px;
  max-width: 88%;
}
.rgo-voice-msg--user {
  background: rgba(156,255,59,.12);
  color: #d4f7a4;
  align-self: flex-end;
  text-align: right;
}
.rgo-voice-msg--ai {
  background: var(--rgo-voice-surface);
  color: var(--rgo-voice-text);
  align-self: flex-start;
}

/* ── Controls ── */
.rgo-voice-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 12px 16px 16px;
  flex-shrink: 0;
  border-top: 1px solid var(--rgo-voice-border);
}

.rgo-voice-mic-btn,
.rgo-voice-stop-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, opacity 0.2s;
}
.rgo-voice-mic-btn {
  background: var(--rgo-voice-color);
  color: #0f172a;
}
.rgo-voice-mic-btn:hover {
  transform: scale(1.08);
}
.rgo-voice-stop-btn {
  background: #ef4444;
  color: #fff;
}
.rgo-voice-stop-btn:hover {
  transform: scale(1.08);
  background: #dc2626;
}

/* ── Responsive ── */
@media (max-width: 480px) {
  #rgo-voice-panel {
    left: 12px;
    right: 12px;
    width: auto;
    bottom: 70px;
  }
  #rgo-voice-btn {
    left: 16px;
    bottom: 80px;
  }
}
