.chat-visit-msg-form {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 16px;
    position: fixed;
    bottom: 35px; /* Positions it above the bottom navigation */
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    box-sizing: border-box;
    z-index: 9999;
    max-width: 625px;
}

.chat-visit-msg-form-actions {
    display: flex;
    width: 100%;
    align-items: start;
    gap: 12px;
    justify-content: start;
}

.chat-visit-msg-form-input-wrapper {
    display: flex;
    min-width: 240px;
    flex-direction: column;
    color: var(--Gray-500, #667085);
    white-space: nowrap;
    justify-content: start;
    flex: 1;
    flex-basis: 0%;
    font: 400 16px Inter, sans-serif;
}

.chat-visit-msg-form-input-container {
    display: flex;
    width: 100%;
    flex-direction: column;
    justify-content: start;
}

.chat-visit-msg-form-input-group {
    position: relative;
    display: flex;
    width: 100%;
}

.chat-visit-msg-form-input {
    width: 100%;
    padding: 10px 40px 10px 14px; /* Add right padding for icon */
    border-radius: 8px;
    border: 1px solid var(--Gray-300, #d0d5dd);
    background: var(--Base-White, #fff);
    box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05);
}

.chat-visit-msg-form-input:focus,
.chat-visit-msg-form-input:active {
    outline: none;
    border-color: var(--Gray-300, #d0d5dd);
    box-shadow: none;
}

/* Image Upload Icon */
.chat-visit-msg-form-image-icon {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    font-size: 20px;
    color: #007bff;
    cursor: pointer;
}

.chat-visit-msg-form-image-icon:hover {
    color: #0056b3;
}

/* Hide the file input */
#chat_image {
    display: none;
}

.chat-visit-msg-form-send-button-wrapper {
    border-radius: 8px;
    display: flex;
    align-items: start;
    justify-content: start;
}

.chat-visit-msg-form-send-button {
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    border: 1px solid var(--Blue-light-500, #0ba5ec);
    background: var(--Blue-light-500, #0ba5ec);
    box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05);
    display: flex;
    width: 37px;
    gap: 8px;
    overflow: hidden;
    height: 37px;
    padding: 0 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.chat-visit-msg-form-send-icon {
    aspect-ratio: 1;
    object-fit: contain;
    object-position: center;
    width: 20px;
    height: 20px;
    align-self: stretch;
    margin: auto 0;
}

.chat-visit-msg-form-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.user-info {
    position: fixed;
    bottom: 100px; /* Above the chat input */
    left: 50%;
    transform: translateX(-50%);
    background: rgba(27, 127, 204, .8);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    z-index: 9999;
}

/* Chat Container */
.chat-container {
    width: 98%;
    margin: 20px auto;
    padding: 15px;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    height: 500px;
    min-height: 800px;
    padding-bottom: 55px;
}

/* General Styles */
.direct-chat-msg {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
}

.direct-chat-infos {
    font-size: 12px;
    color: #888;
}

/* Chat Message Styles */
.direct-chat-text {
    max-width: 60%;
    padding: 10px 15px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1);
}

/* Left (Received) Messages */
.direct-chat-msg .direct-chat-text {
    background-color: #f1f1f1;
    color: #333;
    align-self: flex-start;
}

/* Right (Sent) Messages */
.direct-chat-msg.right .direct-chat-text {
    background-color: #007bff;
    color: white;
    align-self: flex-end;
}

/* Timestamp Styling */
.direct-chat-infos .direct-chat-timestamp {
    font-size: 12px;
    color: #aaa;
    display: block;
    margin-top: 3px;
}

/* Centered Timestamps */
.direct-chat-infos[style*="text-align: center"] .direct-chat-timestamp {
    text-align: center;
    display: block;
    margin: 10px 0;
}


/* Remove background if message contains an image */
.direct-chat-msg .direct-chat-text:has(img),
.direct-chat-msg.right .direct-chat-text:has(img) {
    background-color: transparent;
    padding: 0;
    box-shadow: none;
}

/* Responsive Design */
@media (max-width: 600px) {
    .chat-container {
        width: 95%;
    }
    .direct-chat-text {
        max-width: 85%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .chat-visit-msg-form-send-button {
        transition: none;
    }
}
