/* AI Connect — Voice-Chat (Mikro-Button + Zustände).
   Gerendert von voice.js nur auf Widgets mit data-aic-voice="1"
   (Server-Gating: Chat-Provider hat Audio-Modelle + Sidecar-URL gesetzt).
   Class names match the dConnect twin (public/css/chat-voice.css). */

.ai-connect-chat__voice-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.6rem;
    flex: 0 0 2.6rem;
    padding: 0;
    border: 1px solid #d5d5d5;
    border-radius: 999px;
    background: #fff;
    color: #666;
    cursor: pointer;
    position: relative;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.ai-connect-chat__voice-btn:hover {
    border-color: #ff8700;
    color: #ff8700;
}

/* Verbindungsaufbau: dezentes Blinken */
.ai-connect-chat__voice-btn.is-connecting {
    color: #ff8700;
    animation: aic-voice-blink 1s infinite ease-in-out;
}

/* Zuhören: gefüllt + pulsierender Ring */
.ai-connect-chat__voice-btn.is-listening {
    background: #ff8700;
    border-color: #ff8700;
    color: #fff;
}
.ai-connect-chat__voice-btn.is-listening::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 999px;
    border: 2px solid rgba(255, 135, 0, 0.55);
    animation: aic-voice-pulse 1.6s infinite ease-out;
    pointer-events: none;
}

/* Denken: neutral gefüllt, ruhiges Blinken */
.ai-connect-chat__voice-btn.is-processing {
    background: #eee;
    border-color: #ddd;
    color: #999;
    animation: aic-voice-blink 1.4s infinite ease-in-out;
}

/* Sprechen: Umrandung "sendet" — Besucher darf reinsprechen (Barge-in) */
.ai-connect-chat__voice-btn.is-speaking {
    background: #fff;
    border-color: #ff8700;
    color: #ff8700;
}
.ai-connect-chat__voice-btn.is-speaking::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 999px;
    border: 2px solid rgba(255, 135, 0, 0.4);
    animation: aic-voice-pulse 0.9s infinite ease-out;
    pointer-events: none;
}

/* Vorläufige Nutzer-Bubble mit dem Live-Transkript */
.ai-connect-chat__msg--pending {
    opacity: 0.65;
}

@keyframes aic-voice-pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.45);
        opacity: 0;
    }
}

@keyframes aic-voice-blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.45;
    }
}
