/* Voice Chat Plugin styles */

#llm-voice-mic {
    background: transparent;
    color: var(--main-color);
    border: none;
    border-radius: 10px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s, color 0.2s;
    flex-shrink: 0;
}

#llm-voice-mic:hover {
    opacity: 0.9;
}

#llm-voice-mic.recording {
    color: #d00;
    animation: voice-pulse 1.2s ease-in-out infinite;
}

#llm-voice-mic.error {
    color: #d00;
    opacity: 0.6;
}

@keyframes voice-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.15);
    }
}

/* Toast for unavailable voice chat */
#llm-chat-input-container {
    position: relative;
}

#llm-voice-toast {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-size: 0.8rem;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.2s, transform 0.2s;
    z-index: 20;
}

#llm-voice-toast.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Recording overlay — anchors to the chat window */
#llm-chat-window {
    position: relative;
}

#llm-voice-overlay {
    display: none;
    position: absolute;
    inset: 72px 5% 74px 5%; /* sit within messages area at ~90% */
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10;
    border-radius: 16px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#llm-voice-overlay.active {
    display: flex;
}

#llm-voice-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

#llm-voice-stop-btn {
    position: absolute;
    top: 27%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #d00;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    transition: transform 0.1s, background 0.2s;
}

#llm-voice-stop-btn:hover {
    background: #f00;
    transform: translate(-50%, -50%) scale(1.08);
}

#llm-voice-stop-btn:active {
    transform: translate(-50%, -50%) scale(0.95);
}

#llm-voice-transcript {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 45%;
    z-index: 1;
    padding: 0.75rem 1rem 1rem;
    overflow-y: auto;
    color: #fff;
    font-size: 1.1rem;
    line-height: 1.5;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9);
    background: transparent;
    pointer-events: none;
    white-space: pre-wrap;
    word-break: break-word;
    display: flex;
    align-items: flex-end;
}
