/* neos-voice.css — Custom Neos Wave Voice Widget */

/* ── Floating trigger button ────────────────────────────────── */
.nv-trigger {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9998;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-primary, #0D9488);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(13, 148, 136, 0.35), 0 2px 8px rgba(0,0,0,0.10);
  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);
  box-shadow: 0 6px 28px rgba(13, 148, 136, 0.45), 0 3px 12px rgba(0,0,0,0.12);
}
.nv-trigger:active {
  transform: scale(0.96);
}
.nv-trigger svg {
  width: 26px;
  height: 26px;
  display: block;
}
.nv-trigger[data-active="true"] {
  background: var(--color-text, #1a1a2e);
}

/* Subtle pulse animation when idle */
.nv-trigger::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--color-primary, #0D9488);
  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.3; transform: scale(1.15); }
}

/* ── Panel ──────────────────────────────────────────────────── */
.nv-panel {
  position: fixed;
  bottom: 92px;
  right: 24px;
  z-index: 9999;
  width: 340px;
  max-height: 480px;
  background: var(--color-surface, #FFFFFF);
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(26, 26, 46, 0.14), 0 4px 16px rgba(26, 26, 46, 0.08);
  border: 1px solid var(--color-border, #E2E0D8);
  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;
}

/* ── Panel header ───────────────────────────────────────────── */
.nv-header {
  padding: 16px 20px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--color-border, #E2E0D8);
}
.nv-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nv-header-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-text-faint, #8a8a9e);
  flex-shrink: 0;
  transition: background 300ms ease;
}
.nv-header-dot[data-status="connected"] {
  background: var(--color-success, #16A34A);
}
.nv-header-dot[data-status="speaking"] {
  background: var(--color-primary, #0D9488);
  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-size: 14px;
  font-weight: 600;
  color: var(--color-text, #1a1a2e);
  letter-spacing: -0.01em;
}
.nv-close {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted, #5a5a70);
  transition: background 150ms ease, color 150ms ease;
}
.nv-close:hover {
  background: var(--color-surface-offset, #F5F4F1);
  color: var(--color-text, #1a1a2e);
}
.nv-close svg {
  width: 16px;
  height: 16px;
}

/* ── Transcript area ────────────────────────────────────────── */
.nv-transcript {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 180px;
  max-height: 300px;
}
.nv-transcript::-webkit-scrollbar {
  width: 4px;
}
.nv-transcript::-webkit-scrollbar-track {
  background: transparent;
}
.nv-transcript::-webkit-scrollbar-thumb {
  background: var(--color-border, #E2E0D8);
  border-radius: 2px;
}

/* ── Messages ───────────────────────────────────────────────── */
.nv-msg {
  font-size: 13.5px;
  line-height: 1.55;
  max-width: 88%;
  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(--color-text, #1a1a2e);
  align-self: flex-start;
}
.nv-msg--user {
  color: var(--color-text-muted, #5a5a70);
  align-self: flex-end;
  text-align: right;
  font-style: italic;
}
.nv-msg-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-faint, #8a8a9e);
  margin-bottom: 2px;
}

/* ── Empty state / prompt ───────────────────────────────────── */
.nv-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 20px;
  gap: 12px;
  flex: 1;
}
.nv-empty-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-primary-highlight, rgba(13, 148, 136, 0.10));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary, #0D9488);
}
.nv-empty-icon svg {
  width: 24px;
  height: 24px;
}
.nv-empty-text {
  font-size: 14px;
  color: var(--color-text-muted, #5a5a70);
  line-height: 1.5;
}
.nv-empty-hint {
  font-size: 12px;
  color: var(--color-text-faint, #8a8a9e);
}

/* ── Controls footer ────────────────────────────────────────── */
.nv-controls {
  padding: 12px 20px 16px;
  border-top: 1px solid var(--color-border, #E2E0D8);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

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

@keyframes nv-mic-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(13, 148, 136, 0.3); }
  50% { box-shadow: 0 0 0 10px rgba(13, 148, 136, 0); }
}

.nv-end-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-error, #DC2626);
  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;
}
.nv-end-btn[data-visible="true"] {
  opacity: 1;
  pointer-events: auto;
}
.nv-end-btn:hover {
  background: var(--color-error-hover, #B91C1C);
}
.nv-end-btn svg {
  width: 16px;
  height: 16px;
}

.nv-status {
  font-size: 12px;
  color: var(--color-text-faint, #8a8a9e);
  text-align: center;
  min-width: 80px;
}

/* ── Visualiser bars ────────────────────────────────────────── */
.nv-visualiser {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 24px;
}
.nv-bar {
  width: 3px;
  height: 4px;
  background: var(--color-primary, #0D9488);
  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; }
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 420px) {
  .nv-panel {
    right: 12px;
    left: 12px;
    bottom: 84px;
    width: auto;
  }
  .nv-trigger {
    right: 16px;
    bottom: 16px;
  }
}
