const openChatButton = document.getElementById('openChatContainer');
const chatWidget = document.getElementById('chatWidget');
const closeChatButton = document.getElementById('closeChatContainer');
const conversation = document.getElementById('conversation');

function scrollToBottom() {
    conversation.scrollTop = conversation.scrollHeight;
}

openChatButton.addEventListener('click', function () {
    chatWidget.classList.remove('hidden');
    openChatButton.classList.add('hidden');
    closeChatButton.classList.remove('hidden');
    scrollToBottom();
});

function closeChat() {
    chatWidget.classList.add('hidden');
    openChatButton.classList.remove('hidden');
    closeChatButton.classList.add('hidden');
}


closeChatButton.addEventListener('click', closeChat);



