/* ===================================================================
   File: webonology-chatbot.css
   Description: Basic styling for the floating chatbot widget.
   =================================================================== */

#webonology-chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    font-family: Arial, sans-serif;
}

/* The floating toggle button */
#webonology-chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #0073e6; /* Webonology's primary color */
    color: white;
    border: none;
    cursor: pointer;
    font-size: 24px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#webonology-chatbot-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

/* The main chat window */
#webonology-chatbot-window {
    width: 350px;
    height: 500px;
    border: 1px solid #ddd;
    border-radius: 10px;
    background-color: white;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header with title and close button */
.chat-header {
    background-color: #0073e6;
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    margin: 0;
    font-size: 18px;
}

#webonology-chatbot-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
}

/* Message display area */
.chat-messages {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Styling for individual messages */
.chat-message {
    padding: 10px 15px;
    border-radius: 15px;
    max-width: 80%;
    word-wrap: break-word;
    line-height: 1.4;
}

.chat-message.ai {
    background-color: #f1f0f0;
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

.chat-message.user {
    background-color: #0073e6;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

/* Input form and button */
#webonology-chat-form {
    display: flex;
    padding: 15px;
    border-top: 1px solid #ddd;
}

#webonology-chat-input {
    flex-grow: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 10px 15px;
    outline: none;
    font-size: 14px;
}

#webonology-chat-form button {
    background-color: #0073e6;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 10px 20px;
    margin-left: 10px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#webonology-chat-form button:hover {
    background-color: #005bb5;
}

@media (max-width: 768px) {
    #webonology-chatbot-container {
        /* Ensure the container is visible and positioned correctly */
        display: block !important;
        position: fixed;
        bottom: 10px;
        right: 10px;
        z-index: 10000; /* Use a very high z-index to prevent it from being hidden */
    }

    #webonology-chatbot-toggle {
        /* You can adjust the size of the button on mobile if you want */
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    #webonology-chatbot-window {
        /* Position the chat window correctly relative to the button */
        right: 10px;
        bottom: 70px;
        width: 90vw; /* Make it wider on mobile */
        height: 80vh; /* Make it taller on mobile */
        max-width: 400px;
        max-height: 600px;
    }
}