/*
 * chat-voice.css — mic (dictation) + speaker (TTS) controls for chat composers.
 * Shared by all chat surfaces. Theme-variable driven with fallbacks.
 */

.cv-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border: 1px solid var(--border, #2a2a3a);
    border-radius: 10px;
    background: var(--cv-btn-bg, rgba(255, 255, 255, 0.04));
    color: var(--text-muted, #8a8a99);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.08s;
}

.cv-btn:hover {
    color: var(--text-primary, #fff);
    border-color: var(--primary, #2563eb);
    background: var(--cv-btn-hover-bg, rgba(37, 99, 235, 0.12));
}

.cv-btn:active { transform: scale(0.94); }

.cv-btn:focus-visible {
    outline: 2px solid var(--primary, #2563eb);
    outline-offset: 1px;
}

.cv-btn svg { width: 18px; height: 18px; display: block; }

.cv-btn.cv-unsupported,
.cv-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* Mic actively recording */
.cv-btn.cv-recording {
    color: #fff;
    background: #ef4444;
    border-color: #ef4444;
    animation: cv-pulse 1.4s ease-in-out infinite;
}

/* Speaker toggled on */
.cv-btn.cv-on {
    color: #fff;
    background: var(--primary, #2563eb);
    border-color: var(--primary, #2563eb);
}

@keyframes cv-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
    50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

/* "Listening…" indicator shown while dictating */
.cv-indicator {
    display: none;
    align-items: center;
    gap: 8px;
    max-width: 800px;
    margin: 8px auto 0;
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    font-size: 0.78rem;
    font-weight: 600;
}

.cv-indicator .cv-pulse-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #ef4444;
    animation: cv-pulse 1.2s ease-in-out infinite;
}

.cv-indicator .cv-stop {
    margin-inline-start: auto;
    background: none;
    border: none;
    color: #ef4444;
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
    font-size: 0.78rem;
}

@media (prefers-reduced-motion: reduce) {
    .cv-btn,
    .cv-btn.cv-recording,
    .cv-indicator .cv-pulse-dot {
        animation: none;
        transition: none;
    }
}
