{
                    const response = await fetch('/api/query', {
                        method: 'POST',
                        headers: {
                            'Content-Type': 'application/json',
                        },
                        body: JSON.stringify({ query: userMessage }),
                    });

                    const data = await response.json();
                    hideTypingAnimation();
                    const botResponse = data.response || "I'm sorry, I couldn't under