#chat-box {
    border: 1px solid #ccc;
    width: 300px;
    position: fixed;
    bottom: 0;
    right: 0;
    background: #fff;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

#chat-messages {
    height: 250px;
    overflow-y: scroll;
    padding: 10px;
    background: #f7f7f7;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

#chat-form {
    display: flex;
    border-top: 1px solid #ccc;
    background: #fff;
}

#chat-input {
    flex: 1;
    padding: 10px;
    border: none;
    border-right: 1px solid #ccc;
    outline: none;
}

#chat-form button {
    padding: 10px;
    border: none;
    background: #0073AA;
    color: #fff;
    cursor: pointer;
}

#chat-form button:hover {
    background: #005880;
}

.user-message,
.admin-message {
    position: relative;
    display: inline-block;
    max-width: 75%;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 10px;
    line-height: 1.4;
    clear: both;
}

/* User messages (right side, green bubble) */
.user-message {
    background: #dcf8c6;
    color: #333;
    align-self: flex-end; /* push to right side in a column layout */
    margin-left: auto;
}

/* Admin messages (left side, grey bubble) */
.admin-message {
    background: #ececec;
    color: #333;
    align-self: flex-start; /* push to left side in a column layout */
    margin-right: auto;
}

/* Triangular "tail" for user message bubbles */
.user-message::after {
    content: "";
    position: absolute;
    right: -8px; 
    top: 15px;
    width: 0; 
    height: 0; 
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 8px solid #dcf8c6;
}

/* Triangular "tail" for admin message bubbles */
.admin-message::after {
    content: "";
    position: absolute;
    left: -8px;
    top: 15px;
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 8px solid #ececec;
}

/* Optional styling for the user/admin labels inside the bubble */
.user-message strong,
.admin-message strong {
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
    font-size: 0.9em;
    opacity: 0.7;
}

#open-chat-button {
    padding: 10px 15px;
    background: #0073AA;
    color: #fff;
    border: none;
    cursor: pointer;
}

#open-chat-button:hover {
    background: #005880;
}