#ai-chatbox {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 400px;
    max-height: 500px;
    background: white;
    border: 1px solid #ccc;
    border-radius: 10px;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
    display: none;
    flex-direction: column;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 14px;
    z-index: 1000; /* Ensure chatbox stays on top */
}

#ai-chat-header {
    background: #244465;
    color: white;
    padding: 10px;
    text-align: center;
    font-weight: bold;
    position: relative;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

#ai-chat-close {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
}

#ai-chat-body {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    max-height: 350px;
    display: flex;
    flex-direction: column;
}

#ai-chat-footer {
    font-size: 10px;
    color: #888;
    text-align: right;
    margin-top: 5px;
}

.chat-message {
    padding: 8px;
    margin: 5px;
    border-radius: 10px;
    max-width: 80%;
    word-wrap: break-word;
}

.chat-message.user {
    background: #244465;
    color: white;
    text-align: right;
    align-self: flex-end;
}

.chat-message.bot {
    background: #f1f1f1;
    color: black;
    text-align: left;
    align-self: flex-start;
}

#ai-chat-input {
    display: flex;
    flex-direction: column;
    padding: 10px;
    border-top: 1px solid #ccc;
}

#ai-chat-input textarea {
    width: 100%;
    height: 60px;
    resize: none;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
}

#ai-chat-input button {
    background: #244465;
    color: white;
    border: none;
    padding: 8px 10px;
    cursor: pointer;
    margin-top: 5px;
    border-radius: 5px;
}

#ai-chat-icon {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #244465;
    color: white;
    padding: 15px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    text-align: center;
    z-index: 950; /* Lower z-index so it stays below the chatbox */
}

/* Responsive adjustments for mobile devices */
@media only screen and (max-width: 600px) {
    #ai-chatbox {
        width: 90% !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        right: auto !important;
        bottom: 20px !important;
    }
    #ai-chat-icon {
        left: 50% !important;
        transform: translateX(-50%) !important;
        right: auto !important;
        bottom: 20px !important;
    }
}
