/* voice-chat.css — Compact voice status bar (simple replacement for the
 * fullscreen orb overlay). Appears as a small pill/card just above the
 * input row; shows state + live transcript. Non-blocking.
 *
 * States: listening | thinking | speaking | error
 * All colours come from existing styles.css design tokens.
 */

/* ── Promoted mic button (inside the input pill) ──────────────────── */
.input-pill__mic {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    min-width: 36px;
    flex-shrink: 0;
    padding: 0;
    transition: background var(--ease), color var(--ease), transform var(--ease);
}
.input-pill__mic:hover,
.input-pill__mic:focus-visible {
    background: var(--accent-dim);
    color: var(--accent);
    outline: none;
}
.input-pill__mic:active { transform: scale(0.94); }

/* Recording state reuses existing micPulse keyframes */
.input-pill__mic.btn-circle--recording {
    background: var(--danger);
    color: var(--brand-pearl);
    animation: micPulse 1.5s ease-in-out infinite;
}

@media (max-width: 600px) {
    .input-pill__mic { width: 44px; height: 44px; min-width: 44px; min-height: 44px; }
}
@media (max-width: 360px) {
    .input-pill__mic { width: 36px; height: 36px; min-width: 36px; min-height: 36px; }
}

/* ── Voice status bar ─────────────────────────────────────────────── */
/* Small floating pill that appears above the input area while voice
 * mode is active. Not fullscreen — just a compact indicator. */
.voice-bar {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 999px;
    box-shadow: var(--shadow-md);
    max-width: 420px;
    width: calc(100% - 32px);
    position: fixed;
    bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    z-index: 9000;
    animation: voiceBarIn 0.18s ease;
}
.voice-bar--open { display: flex; }

[data-theme="dark"] .voice-bar {
    background: var(--bg-elevated);
    border-color: var(--border);
}

@keyframes voiceBarIn {
    from { opacity: 0; transform: translateX(-50%) translateY(8px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── State dot ─────────────────────────────────────────────────────── */
.voice-bar__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--brand-green);
    transition: background 0.2s;
}

.voice-bar[data-state="listening"] .voice-bar__dot {
    background: var(--brand-green);
    animation: voiceDotPulse 1.4s ease-in-out infinite;
}
.voice-bar[data-state="thinking"] .voice-bar__dot {
    background: var(--brand-violet);
    animation: voiceDotPulse 1.8s ease-in-out infinite;
}
.voice-bar[data-state="speaking"] .voice-bar__dot {
    background: var(--brand-green);
    animation: voiceDotPulse 0.7s ease-in-out infinite;
}
.voice-bar[data-state="error"] .voice-bar__dot {
    background: var(--brand-coral);
    animation: none;
}

@keyframes voiceDotPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.4; transform: scale(0.7); }
}

/* ── Labels + transcript ───────────────────────────────────────────── */
.voice-bar__label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    flex-shrink: 0;
}

.voice-bar__transcript {
    font-size: 13px;
    color: var(--text-secondary);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

/* ── EQ bars (speaking state only) ────────────────────────────────── */
.voice-bar__eq {
    display: none;
    gap: 2px;
    align-items: center;
    height: 16px;
    flex-shrink: 0;
}
.voice-bar[data-state="speaking"] .voice-bar__eq { display: flex; }
.voice-bar[data-state="speaking"] .voice-bar__transcript { display: none; }

.voice-bar__eq-bar {
    width: 3px;
    border-radius: 2px;
    background: var(--brand-green);
    height: calc(var(--bar, 0.4) * 14px + 3px);
    transition: height 100ms linear;
}

/* ── Close button ──────────────────────────────────────────────────── */
.voice-bar__close {
    width: 24px;
    height: 24px;
    min-width: 24px;
    border-radius: 50%;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    display: grid;
    place-items: center;
    line-height: 1;
    padding: 0;
    flex-shrink: 0;
    transition: background var(--ease), color var(--ease);
}
.voice-bar__close:hover { background: var(--bg-elevated); color: var(--text-primary); }

@media (min-width: 601px) {
    /* On desktop push the bar to sit above the input, not floating bottom */
    .voice-bar {
        bottom: calc(78px + env(safe-area-inset-bottom, 0px));
    }
}

@media (prefers-reduced-motion: reduce) {
    .voice-bar__dot { animation: none !important; }
    .voice-bar__eq-bar { transition: none; }
    .voice-bar { animation: none; }
}
