/* Style for the open button */
#open-chatbot-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #ff793b;
    padding: 12px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    font-size: 4px; /* Adjust icon size */
    z-index: 10;
}

/* Container for the chat window */
#chat-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 650px;
    height: 430px;
    max-width: 70%;
    max-height: 80%;
    min-width: 20%;
    min-height: 20%;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
    resize: none;
}

#chat-container .resize-handle {
    position: absolute;
    background-color: rgba(0, 0, 0, 0);
    z-index: 100;
}

/* For visual handles, adjust these as needed */
#chat-container .resize-handle:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

/* Specific edges */
#chat-container .resize-handle.top { top: 0; left: 0; right: 0; height: 10px; cursor: ns-resize; }
#chat-container .resize-handle.left { top: 0; bottom: 0; left: 0; width: 10px; cursor: ew-resize; }

/* Header section for the chat window */
#chat-container #chat-header {
    background-color: #ff793b;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    padding: 10px;
    text-align: center;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    position: relative;
}

/* Close button inside chat header */
#chat-container #close-chatbot-btn {
    position: absolute;
    top: 5px;
    right: 10px;
    background-color: rgba(255, 255, 255, 0.7);
    color: #ff793b;
    font-size: 16px;
    border: none;
    cursor: pointer;
    z-index: 15;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Chat messages area */
#chat-container #chat-box {
    display: flex;
    flex-grow: 1;
    flex-direction: column-reverse;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin: 10px;
    background-color: #f9f9f9;
    font-size: 15px;
    color: #333;
}

#chat-container #chat-info-message {
    background-color: #ffe4c4;
    color: #333;
    font-size: 14px;
    font-style: italic;
    padding: 10px;
    text-align: center;
    border-bottom: 1px solid #ddd;
}

/* Individual message styling */
#chat-container .message {
    padding: 8px;
    border-radius: 5px;
    margin: 5px 0;
    max-width: 80%;
}

#chat-container .user-message {
    background-color: #ffa073;
    text-align: right;
    margin-left: auto;
    margin-right: 0;
    align-self: flex-end;
    color: #000000;
}

#chat-container .bot-message {
    background-color: #f0f0f0;
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 10px;
    word-wrap: break-word;
    font-size: 15px;
    white-space: normal;
    scroll-behavior: smooth;
}

#chat-container .bot-message a {
    color: #ff6e42;
    font-weight: bold;
}

/* Ensure hover effects for links */
#chat-container .bot-message a:hover {
    color: #ff8a66;
}

/* Formatting for code blocks and tables inside bot messages */
#chat-container .bot-message pre {
    white-space: pre;
    background-color: #e0e0e0;
    padding: 10px;
    border-radius: 10px;
    max-width: 100%;
    overflow-x: auto;
    font-family: monospace;
    color: #333;
}

#chat-container .bot-message table, #chat-container .bot-message .graph {
    white-space: nowrap;
    overflow-x: auto;
    display: block;
    max-width: 100%;
}

/* Input area */
#chat-container #user-input {
    flex-grow: 1;
    padding: 8px;
    border-radius: 5px;
    border: 1px solid rgba(212, 195, 197, 0.6);
    margin-right: 10px;
    font-size: 15px;
}

#chat-container #send-btn {
    padding: 8px 15px;
    border-radius: 5px;
    border: none;
    background-color: #ff793b;
    color: white;
    cursor: pointer;
    font-size: 13px;
}

/* Flex container for input and button */
#chat-container .input-container {
    display: flex;
    align-items: center;
    padding: 10px 10px;
}

/* Add hover effects for better interaction */
#chat-container #send-btn:hover {
    background-color: #e66b32;
}

/* Chat visibility for smaller screens */
@media (max-width: 768px) {
    #chat-container {
        width: 90%;
        bottom: 10px;
        right: 10px;
    }
}