/* chatbot-voice — Voice Assistant page styles.
   Self-contained: no shared classes with the text chatbot's stylesheet, so it
   can never collide with or override existing chatbot UI. */

:root {
  --bg: #0e1116;
  --panel: #171c24;
  --panel-2: #1f2630;
  --text: #e8edf3;
  --muted: #97a3b4;
  --accent: #2f7cf6;
  --accent-2: #1b5fd0;
  --recording: #e54848;
  --processing: #e6a13c;
  --playing: #2bb673;
  --error: #ff5c5c;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.voice-app {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 20px 48px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.voice-header h1 { margin: 0 0 4px; font-size: 1.6rem; }
.subtitle { margin: 0 0 18px; color: var(--muted); font-size: 0.95rem; }

/* ── Conversation history ── */
.history {
  flex: 1;
  background: var(--panel);
  border-radius: var(--radius);
  padding: 16px;
  overflow-y: auto;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.turn { max-width: 85%; padding: 10px 14px; border-radius: 12px; line-height: 1.4; }
.turn.user { align-self: flex-end; background: var(--accent-2); }
.turn.assistant { align-self: flex-start; background: var(--panel-2); }
.turn .role { display: block; font-size: 0.72rem; color: var(--muted); margin-bottom: 3px; }
/* Preserve the line breaks the formatter inserts (e.g. the numbered developer
   list) so items render one per line instead of running together inline. */
.turn .body { display: block; white-space: pre-wrap; }
.turn.streaming { opacity: 0.85; }

.history-empty { color: var(--muted); text-align: center; margin: auto; font-size: 0.9rem; }

/* ── Status / states ── */
.status {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 6px;
}
.state-label {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--panel-2);
}
.state-idle { color: var(--muted); }
.state-recording { color: #fff; background: var(--recording); }
.state-processing { color: #1a1205; background: var(--processing); }
.state-playing { color: #04150d; background: var(--playing); }
.state-error { color: #fff; background: var(--error); }
.tool-hint { color: var(--muted); font-size: 0.82rem; }

.error-banner {
  background: rgba(255, 92, 92, 0.12);
  border: 1px solid var(--error);
  color: #ffd5d5;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.88rem;
  margin-bottom: 8px;
}

/* ── Mic / push-to-talk ── */
.mic-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}
.mic-button {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.12s ease, background 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 6px 24px rgba(47, 124, 246, 0.35);
}
.mic-button:hover { background: var(--accent-2); }
.mic-button:active { transform: scale(0.95); }
.mic-button.recording {
  background: var(--recording);
  box-shadow: 0 0 0 0 rgba(229, 72, 72, 0.6);
  animation: pulse 1.4s infinite;
}
.mic-button:disabled { opacity: 0.5; cursor: not-allowed; animation: none; }

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(229, 72, 72, 0.55); }
  70%  { box-shadow: 0 0 0 22px rgba(229, 72, 72, 0); }
  100% { box-shadow: 0 0 0 0 rgba(229, 72, 72, 0); }
}

.mic-hint { color: var(--muted); font-size: 0.82rem; margin: 0; }
.reset-button {
  background: transparent;
  border: 1px solid var(--panel-2);
  color: var(--muted);
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.8rem;
}
.reset-button:hover { color: var(--text); border-color: var(--muted); }
