body {
    background-color: #f8f9fa;
}


#divCancelReplyToChat {
    justify-content: end;
    margin-bottom: .25rem;
    display: none;
}


#divCancelReplyToChat > svg {
    height: 1rem;
    width: 1rem;
    cursor: pointer;
    fill: gray;
}

#divCancelReplyToChat.show {
    display: flex;
}

#divChatInputMsgToReply{
    background-color: #f4f4f4;
    border-radius: .5rem;
    box-shadow: 0 0 1px 0 inset gray;
    margin-bottom: .5rem;
    max-height: 0rem;
    display: none;
    overflow: hidden;
    color: gray;
}


#divChatInputMsgToReply.show {
    padding: .5rem;
    display: block;
    max-height: 5rem;
}

#divMsgOptionPopover {
    position: fixed;
    top: 2rem;
    right: 1rem;
    width: 200px;
    background-color: #3b82f6;
    box-shadow: 0 0 3px black;
    border-radius: .5rem;
    padding: .5rem 0;
    color: white;
    display: none;
}

#divMsgOptionPopover.show {
    display: block;
}

#divMsgOptionPopover.clientMsg {
    color: gray;
    background-color: white;
}

#divMsgOptionPopover.clientMsg > div:hover {
    background-color: lightgray;
}

#divMsgOptionPopover.clientMsg > div >svg {
    fill: gray;
}

#divMsgOptionPopover > div {
    padding: .5rem 1rem;
    display: flex;
    gap: 1rem;
    cursor: pointer;
}

#divMsgOptionPopover > div:hover {
    background-color: #4a8bf7
}

#divMsgOptionPopover > div > svg {
    height: 1.5rem;
    width: 1.5rem;
    fill: white;
}



.card {
    border-radius: 0.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin: 1rem 0;
}

.conversation-list {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.conversation-header {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.conversations-container {
    flex: 1;
    height: 600px;
    max-height: 600px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 15px;
    scrollbar-width: thin;
    scroll-behavior: smooth;
}

.conversation-group {
    padding: 0.5rem 1rem;
}

.group-title {
    color: #3b82f6;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    margin-bottom: 0.5rem;
}

.conversation-item {
    display: flex;
    padding: 0.5rem;
    border-radius: 0.375rem;
    cursor: pointer;
    margin-bottom: 0.25rem;
    position: relative; /* Added for absolute positioning of indicator */
}

.conversation-item:hover {
    background-color: #f8f9fa;
}

.conversation-item.active {
    background-color: #e9f2ff;
}

/* Enhanced sidebar indicator */
.sidebar-indicator-activesection {
    position: absolute;
    width: 4px;
    height: 100%; /* Changed from fixed height to 100% */
    top: 0;
    left: 0; /* Changed from fixed position to left edge */
    background: #3f8cff;
    border-radius: 2px;
    opacity: 0; /* Hidden by default */
    transition: opacity 0.2s ease; /* Smooth transition */
}

.conversation-item.active .sidebar-indicator-activesection {
    opacity: 1; /* Show only for active items */
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 0.75rem;
    flex-shrink: 0;
    margin-left: 8px; /* Added to create space for the indicator */
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.conversation-details {
    flex: 1;
    min-width: 0;
}

.conversation-name {
    font-weight: 500;
    margin-bottom: 0.125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-preview {
    font-size: 0.875rem;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-time {
    font-size: 0.75rem;
    color: #6c757d;
    white-space: nowrap;
}

.unread-badge {
    background-color: #ef4444;
    color: white;
    border-radius: 9999px;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-header {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info {
    display: flex;
    align-items: center;
}

.user-details h5 {
    margin-bottom: 0.125rem;
}

.user-details p {
    margin-bottom: 0;
    font-size: 0.875rem;
    color: #6c757d;
}

.chat-actions {
    display: flex;
    gap: 0.5rem;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.date-divider {
    text-align: center;
    margin: 1rem 0;
}

.date-divider span {
    background-color: #f8f9fa;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    color: #6c757d;
}

.message {
    display: flex;
    margin-bottom: 1rem;
    max-width: 80%;
}

.message.outgoing {
    margin-left: auto;
    flex-direction: row-reverse;
}

.message-content {
    background-color: #f1f5f9;
    padding: 0.75rem;
    border-radius: 0.5rem;
    border-top-left-radius: 0;
    position: relative;
}



.message-content p.msgToReply {
    max-height: 5rem;
    overflow: hidden;
    color: gray;
    box-shadow: 0 0 1px gray inset;
    padding: .5rem;
    background-color: white;
    border-radius: .25rem;
    cursor: pointer;
}

.message-content svg.chatMsgOption {
    position: absolute;
    height: 1.5rem;
    width: 1.5rem;
    right: .5rem;
    top: .5rem;
    display: none;
    cursor: pointer;
    fill: gray;
}

.msgReplyEnabled .message-content:hover svg.chatMsgOption {
   display: block;
}



.message.outgoing .message-content {
    background-color: #3b82f6;
    color: white;
    border-radius: 0.5rem;
    border-top-right-radius: 0;
}

.message.outgoing .message-content svg {
    fill: white;
}

.message.outgoing .message-content p.msgToReply{
    background-color: #6ca1f7;
    color: white;
}

.message-sender {
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.message-time {
    font-size: 0.75rem;
    color: #6c757d;
}

.message.outgoing .message-time {
    font-size: 0.75rem;
    color: #6c757d;
}

.message-attachment {
    margin-top: 0.5rem;
    background-color: rgba(255, 255, 255, 0.2);
    padding: 0.5rem;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
}

.message-attachment i {
    margin-right: 0.5rem;
}

.chat-input {
    padding: 1rem;
    border-top: 1px solid #e9ecef;
}

.input-container {
    display: flex;
    align-items: center;
    background-color: #f1f5f9;
    border-radius: 9999px;
    padding: 0.25rem;
}

.input-container button {
    background: none;
    border: none;
    color: #6c757d;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-container button:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.input-container input {
    flex: 1;
    border: none;
    background: none;
    padding: 0.5rem;
    outline: none;
}

.send-button {
    background-color: #3b82f6 !important;
    color: white !important;
}

.send-button:hover {
    background-color: #2563eb !important;
}

@media (max-width: 991.98px) {
    .border-right {
        border-right: none !important;
        border-bottom: 1px solid #e9ecef;
    }
}

.messenger-add{
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 14px;
    background: #3F8CFF;
}

.messenger-search{
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 14px;
    background: #F4F9FD;
}

.conversation_title{
    color: #0A1629;
    font-family: Nunito Sans;
    font-size: 28px;
    font-style: normal;
    font-weight: 700;
    line-height: 26px;
}

.search_chat{
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 14px;
    background: #F4F9FD;
}

.pin_chat {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 14px;
    background: #F4F9FD;
}

.messenger-fix-unselected{
    position: relative;
    height: 24px;
    background: url(https://codia-f2c.s3.us-west-1.amazonaws.com/image/2025-04-12/Picd8z2pWM.png) no-repeat center;
}

.chat_option{
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 14px;
    background: #F4F9FD;
}

.message.outgoing > div:nth-child(2) {
    margin-right: 12px;
    max-width: 80%; /* optional to prevent overly wide messages */
}

.user-name {
    color: #0A1629;
    font-family: "Nunito Sans";
    font-size: 16px;
    font-style: normal;
    font-weight: 700;
    line-height: 24px;
}

.d-grid{
    display: grid !important;
}

#emoji-picker {
    list-style-type: none;
    position: absolute;
    z-index: 100;
    background: rgb(255, 255, 255);
    box-shadow: rgba(0, 0, 0, 0.05) 0px 0.48px 2.41px -0.38px, rgba(0, 0, 0, 0.17) 0px 4px 20px -0.75px;
    border-radius: 8px;
    margin: 0px;
    min-width: 180px;
    overflow: hidden;
    display: none;
    padding: 4px;
    transform-origin: center center;
    right: 3em;
    bottom: 70px;
}

.chat-actions .btn {
    padding: 0.75rem 0.4rem;
    font-size: 0.85rem;
    line-height: 1;
}
