/* Realtime API Voice Chat Styles */

.realtime-voice-chat-container {
    margin: 15px 0;
    padding: 5px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.realtime-voice-btn,
.realtime-voice-btn-end {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.realtime-voice-btn {
    background: #28a745;
    color: white;
}

.realtime-voice-btn:hover {
    background: #218838;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.realtime-voice-btn .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.realtime-voice-btn-end {
    background: #dc3545;
    color: white;
    margin-left: 10px;
}

.realtime-voice-btn-end:hover {
    background: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.voice-chat-status {
    display: flex;
    align-items: center;
    gap: 15px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.voice-status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: white;
    border-radius: 20px;
    border: 1px solid #dee2e6;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    position: relative;
}

.status-dot.connecting {
    background: #ffc107;
    animation: pulse 1.5s ease-in-out infinite;
}

.status-dot.connected {
    background: #28a745;
    animation: pulse 1.5s ease-in-out infinite;
}

.status-dot.error {
    background: #dc3545;
}

.status-dot.disconnected {
    background: #6c757d;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 currentColor;
        opacity: 1;
    }
    50% {
        box-shadow: 0 0 0 8px transparent;
        opacity: 0.5;
    }
}

.status-text {
    font-size: 14px;
    font-weight: 600;
    color: #495057;
}

.voice-chat-instructions {
    margin-top: 15px;
    padding: 15px;
    background: white;
    border-radius: 6px;
    border-left: 4px solid #007bff;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
        padding-top: 15px;
        padding-bottom: 15px;
    }
}

.voice-chat-instructions h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #007bff;
}

.voice-chat-instructions p {
    margin: 8px 0;
    color: #495057;
    line-height: 1.6;
}

.voice-chat-instructions ul {
    margin: 10px 0;
    padding-left: 25px;
}

.voice-chat-instructions li {
    margin: 5px 0;
    color: #6c757d;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .realtime-voice-chat-container {
        padding: 5px;
    }

    .realtime-voice-btn,
    .realtime-voice-btn-end {
        font-size: 14px;
        padding: 8px 16px;
    }

    .voice-chat-status {
        flex-direction: column;
        align-items: flex-start;
    }

    .realtime-voice-btn-end {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }
}

/* Integration with existing chat UI */
#chat_message_autocomplete_wrapper.hidden-for-voice,
#write_chat_container.hidden-for-voice {
    display: none !important;
}

/* Loading state */
.realtime-voice-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.realtime-voice-btn.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    margin-left: 8px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
