<style>
    .iframe-container {
        position: fixed;
        bottom: 3%;
        right: 1.5%;
        display: none;
        background: white;
        border: 1px solid #ccc;
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    iframe {
        width: 486px;
        height: 712px;
        border: none;
    }

    .close {
        position: absolute;
        top: 10px;
        right: 15px;
        width: 50px;
        height: 50px;
        background: transparent;
        outline: none;
        border: none;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 5px;
    }

    .openButton {
        position: fixed;
        bottom: 3%;
        right: 1.5%;
        width: 50px;
        height: 50px;
        margin-left: auto;
        margin-top: auto;
        background: rgb(204, 68, 82);
        border: none;
        outline: none;
        border-radius: 50%;
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 2rem;
        cursor: pointer;
        box-shadow: 0px 16px 16px rgba(0, 0, 0, 0.15);
    }

    @media screen and (max-width: 486px) {
        .iframe-container {
            bottom: 0;
            right: 0;
        }

        iframe {
            width: 100vw;
            height: 100vh;
        }
    }

    .close:hover {
        background: rgba(0, 0, 0, 0.05);
    }

    .close:focus {
        background: rgba(0, 0, 0, 0.1);
    }
</style>
<button onclick="handleClick(this)" class="openButton">
    <img src="https://mayslimobot.com/ChatIcon.svg" />
</button>
<div class="iframe-container">
    <button class="close" onclick="handleClose()">
        <svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 24 24" height="30" width="30" xmlns="http://www.w3.org/2000/svg"><path fill="none" d="M0 0h24v24H0z"></path><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"></path></svg>
    </button>
    <iframe src="http://localhost:3000/chatbot"></iframe>
</div>
<script>
    const chatbotWindow = document.querySelector('.iframe-container');
    const openButton = document.querySelector('.openButton');

    function handleClick(button) {
        button.style.display = 'none';
        chatbotWindow.style.display = 'block';
    }

    function handleClose() {
        chatbotWindow.style.display = 'none';
        openButton.style.display = 'flex';
    }
</script>
