/* Chat Icon (the floating icon to open chat) */
#chat-icon {
    position: fixed;
    /* bottom: 20px; old code*/
    bottom: 45px;
    right: 80px;
    width: 50px;
    height: 50px;
    /* background: #007bff; */
    color: white;
    font-size: 24px;
    text-align: center;
    line-height: 50px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    overflow: hidden;
    /* Always stays on top */
}
#chat-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures the image fits well */
    border-radius: 50%;
}

/* Chat Container - Hidden by default */
#chat-container {
    display: none;
    position: fixed;
    /* bottom: 80px;  old code as upper*/
    bottom: 100px;
    right: 20px;
    width: 350px;
    /* Adjust as needed */
    height: 580px;
    /* Adjust as needed */
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    flex-direction: column;
    z-index: 1000;
    /* Ensures chatbot stays on top */
    font-family: "Arial", sans-serif;
}

/* Chat Header */
#chat-header {
    background: #007bff;
    color: white;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#chat-header .header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

#chat-header .avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

#chat-close {
    cursor: pointer;
    font-size: 18px;
}

/* Chat Messages Area */
#chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px;
    background: #f6f6f6;
    /* Slightly grey background */
    display: flex;
    flex-direction: column;
    gap: 10px;
    /* spacing between message bubbles */
}

/* Date Separator (optional) */
.date-separator {
    text-align: center;
    font-size: 12px;
    color: #888;
    margin: 10px 0;
}

/* Chat Footer (input area) */
#chat-footer {
    padding: 10px;
    border-top: 1px solid #ddd;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Chat Input */
#chat-input {
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 10px;
    width: 100%;
    outline: none;
}

/* Send Button (if used) */

#chat-send {
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 10px 20px;
    cursor: pointer;
}


/* Message Bubbles */
.message-bubble {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 18px;
    position: relative;
    font-size: 14px;
    line-height: 1.4;
}

/* Arrow for the bubble (right side) */
.message-bubble.user-message::after {
    content: "";
    position: absolute;
    right: -8px;
    top: 10px;
    width: 0;
    height: 0;
    border-left: 8px solid #007bff;
    /* same color as bubble */
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    margin-left: 20px;
    margin-top: 2px;
}

/* Arrow for the bubble (left side) */
.message-bubble.bot-message::after {
    content: "";
    position: absolute;
    left: -8px;
    top: 10px;
    width: 0;
    height: 0;
    border-right: 8px solid #fff;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    margin-top: 2px;
}

/* User Message Bubble */
.user-message {
    background: #007bff;
    color: #fff;
    margin-left: auto;
}

/* Bot Message Bubble */
.bot-message {
    background: #fff;
    color: #333;
    margin-right: auto;
    align-self: flex-start;
    padding: 5px 10px;
    border-radius: 10px;
    width: 100%;
    margin-top: 5px;
    margin-bottom: 15px;
}

/* Loader bubble uses bot style as well */
.loader-bubble {
    background: #fff;
    color: #333;
    margin-right: auto;
    font-style: italic;
    opacity: 0.7;
}