/* ava-voice.css — AVA Voice Widget */
/* Warm earthy palette adapted from Neos Wave voice widget */

:root {
  --nv-primary: #A07D48;
  --nv-primary-hover: #7E6238;
  --nv-surface: #1E1A16;
  --nv-border: rgba(255, 255, 255, 0.1);
  --nv-text: #F5EDD9;
  --nv-text-muted: #C4B99E;
  --nv-text-faint: #8A8478;
  --nv-success: #8DB580;
  --nv-speaking: #C4A06A;
  --nv-error: #C45A4A;
}

.nv-trigger {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9998;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--nv-primary);
  color: #FFF;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(160, 125, 72, 0.35), 0 2px 8px rgba(0,0,0,0.2);
  transition: transform 180ms cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 180ms cubic-bezier(0.16, 1, 0.3, 1),
              background 180ms cubic-bezier(0.16, 1, 0.3, 1);
}
.nv-trigger:hover {
  transform: scale(1.06);
  background: var(--nv-primary-hover);
  box-shadow: 0 6px 28px rgba(160, 125, 72, 0.45), 0 3px 12px rgba(0,0,0,0.25);
}
.nv-trigger:active { transform: scale(0.96); }
.nv-trigger svg { width: 26px; height: 26px; display: block; }
.nv-trigger[data-active="true"] { background: var(--nv-primary-hover); color: #FFF; }

.nv-trigger::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--nv-primary);
  opacity: 0;
  animation: nv-pulse 3s ease-in-out infinite;
}
.nv-trigger[data-active="true"]::after { animation: none; opacity: 0; }

@keyframes nv-pulse {
  0%, 100% { opacity: 0; transform: scale(1); }
  50% { opacity: 0.25; transform: scale(1.15); }
}

.nv-panel {
  position: fixed;
  bottom: 92px;
  right: 24px;
  z-index: 9999;
  width: 360px;
  max-height: 500px;
  background: var(--nv-surface);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4), 0 6px 20px rgba(0, 0, 0, 0.25);
  border: 1px solid var(--nv-border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  pointer-events: none;
  transition: opacity 220ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}
.nv-panel[data-open="true"] {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.nv-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, #A07D48, #C4A06A, #8C7055);
  z-index: 1;
}

.nv-header {
  padding: 20px 20px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--nv-border);
}
.nv-header-left { display: flex; align-items: center; gap: 10px; }
.nv-header-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--nv-text-faint); flex-shrink: 0;
  transition: background 300ms ease;
}
.nv-header-dot[data-status="connected"] { background: var(--nv-success); }
.nv-header-dot[data-status="speaking"] {
  background: var(--nv-speaking);
  animation: nv-dot-pulse 1s ease-in-out infinite;
}
@keyframes nv-dot-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.nv-header-title {
  font-family: 'Satoshi', system-ui, sans-serif;
  font-size: 16px; font-weight: 700;
  color: var(--nv-text);
}
.nv-header-subtitle {
  font-size: 11px;
  color: var(--nv-text-faint);
  letter-spacing: 0.04em;
  font-weight: 500;
  margin-top: 1px;
}
.nv-close {
  width: 28px; height: 28px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: var(--nv-text-muted);
  transition: background 150ms ease, color 150ms ease;
  background: transparent; border: none; cursor: pointer;
}
.nv-close:hover { background: rgba(255,255,255,0.06); color: var(--nv-text); }
.nv-close svg { width: 16px; height: 16px; }

.nv-transcript {
  flex: 1; overflow-y: auto;
  padding: 16px 20px;
  display: flex; flex-direction: column; gap: 14px;
  min-height: 200px; max-height: 320px;
}
.nv-transcript::-webkit-scrollbar { width: 4px; }
.nv-transcript::-webkit-scrollbar-track { background: transparent; }
.nv-transcript::-webkit-scrollbar-thumb { background: var(--nv-border); border-radius: 2px; }

.nv-msg {
  font-size: 14px; line-height: 1.55; max-width: 90%;
  animation: nv-msg-in 200ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes nv-msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.nv-msg--ai { color: var(--nv-text); align-self: flex-start; }
.nv-msg--user { color: var(--nv-text-muted); align-self: flex-end; text-align: right; font-style: italic; }
.nv-msg-label {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--nv-text-faint); margin-bottom: 3px;
}

.nv-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center;
  padding: 28px 20px; gap: 14px; flex: 1;
}
.nv-empty-icon {
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(160, 125, 72, 0.15);
  display: flex; align-items: center; justify-content: center;
  color: var(--nv-primary);
}
.nv-empty-icon svg { width: 26px; height: 26px; }
.nv-empty-text { font-size: 14px; color: var(--nv-text-muted); line-height: 1.55; max-width: 36ch; }
.nv-empty-hint { font-size: 12px; color: var(--nv-text-faint); }

.nv-controls {
  padding: 14px 20px 18px;
  border-top: 1px solid var(--nv-border);
  display: flex; align-items: center; justify-content: center; gap: 14px;
  background: rgba(0, 0, 0, 0.15);
}

.nv-mic-btn {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--nv-primary); color: #FFF;
  display: flex; align-items: center; justify-content: center;
  transition: background 180ms ease, transform 120ms ease;
  border: none; cursor: pointer;
}
.nv-mic-btn:hover { background: var(--nv-primary-hover); }
.nv-mic-btn:active { transform: scale(0.94); }
.nv-mic-btn[data-state="listening"] {
  background: var(--nv-primary);
  animation: nv-mic-glow 1.5s ease-in-out infinite;
}
.nv-mic-btn[data-state="speaking"] { background: var(--nv-speaking); color: #1E1A16; }
.nv-mic-btn[data-state="idle"] { background: var(--nv-primary); }
.nv-mic-btn svg { width: 22px; height: 22px; }

@keyframes nv-mic-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(160, 125, 72, 0.4); }
  50% { box-shadow: 0 0 0 10px rgba(160, 125, 72, 0); }
}

.nv-end-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--nv-error); color: #FFF;
  display: flex; align-items: center; justify-content: center;
  transition: background 180ms ease, transform 120ms ease, opacity 180ms ease;
  opacity: 0; pointer-events: none; border: none; cursor: pointer;
}
.nv-end-btn[data-visible="true"] { opacity: 1; pointer-events: auto; }
.nv-end-btn:hover { background: #A84438; }
.nv-end-btn svg { width: 16px; height: 16px; }

.nv-status {
  font-size: 12px; color: var(--nv-text-faint);
  text-align: center; min-width: 80px; letter-spacing: 0.02em;
}

.nv-visualiser { display: flex; align-items: center; justify-content: center; gap: 3px; height: 24px; }
.nv-bar {
  width: 3px; height: 4px;
  background: var(--nv-speaking); border-radius: 2px;
  transition: height 100ms ease;
}
.nv-visualiser[data-active="true"] .nv-bar { animation: nv-bar-bounce 0.8s ease-in-out infinite; }
.nv-visualiser[data-active="true"] .nv-bar:nth-child(1) { animation-delay: 0s; }
.nv-visualiser[data-active="true"] .nv-bar:nth-child(2) { animation-delay: 0.1s; }
.nv-visualiser[data-active="true"] .nv-bar:nth-child(3) { animation-delay: 0.2s; }
.nv-visualiser[data-active="true"] .nv-bar:nth-child(4) { animation-delay: 0.3s; }
.nv-visualiser[data-active="true"] .nv-bar:nth-child(5) { animation-delay: 0.15s; }

@keyframes nv-bar-bounce {
  0%, 100% { height: 4px; }
  50% { height: 20px; }
}

/* ── Signpost label ──────────────────────────────────────────── */
.nv-signpost {
  position: fixed;
  bottom: 36px;
  right: 92px;
  z-index: 9997;
  padding: 8px 16px;
  border-radius: 100px;
  background: var(--nv-surface);
  color: var(--nv-text);
  font-size: 14px;
  font-weight: 600;
  font-family: 'Satoshi', system-ui, sans-serif;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2), 0 1px 4px rgba(0,0,0,0.15);
  border: 1px solid var(--nv-border);
  opacity: 0;
  transform: translateX(8px);
  pointer-events: none;
  transition: opacity 400ms ease, transform 400ms ease;
  white-space: nowrap;
}
.nv-signpost::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  background: var(--nv-surface);
  border-right: 1px solid var(--nv-border);
  border-bottom: 1px solid var(--nv-border);
}
.nv-signpost-visible {
  opacity: 1;
  transform: translateX(0);
}

@media (max-width: 480px) {
  .nv-signpost { right: 80px; bottom: 28px; font-size: 13px; padding: 6px 14px; }
  .nv-panel { right: 12px; left: 12px; bottom: 84px; width: auto; }
  .nv-trigger { right: 16px; bottom: 16px; }
}
