.chat-container {
    height: 80vh;
    display: flex;
    flex-direction: column;
}

.chat-header {
    background: white;
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;

}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 2px 5px;
}

.chat-header-info:hover {
    cursor: pointer;
    border-radius: 10px;
    background-color: var(--bs-secondary-bg)  ;
}

.chat-header-info img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.chat-header-title h6 {
    margin: 0;
    font-weight: 600;
}

.chat-header-title small {
    color: #666;
    font-size: 12px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #fafafa;
    display: flex;
    /* Giữ nguyên chiều dọc nhưng đảo ngược vị trí bắt đầu */
    flex-direction: column-reverse;
}

/* Thêm dòng này để các group tin nhắn không bị đảo ngược nội dung bên trong */
.chat-messages > * {
    flex-shrink: 0;
}

.message-group {
    margin-bottom: 20px;
}

.message-date {
    display: flex;
    justify-content: center;
    margin: 20px 0 10px 0;
    width: 100%;
}

.message-date span {
    background: #e3e3e3;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    color: #666;
}

.message {
    display: flex;
    margin-bottom: 15px;
    gap: 10px;
}

.message.sent {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
}

.message-content {
    max-width: 70%;
}

.message.sent .message-content {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.message-bubble {
    padding: 10px 15px;
    border-radius: 18px;
    margin-bottom: 4px;
    word-wrap: break-word;
}

.message.received .message-bubble {
    background: white;
    border: 1px solid #e0e0e0;
    border-top-left-radius: 4px;
}

.message.sent .message-bubble {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-top-right-radius: 4px;
}

.message-time {
    font-size: 11px;
    color: #999;
    padding: 0 5px;
}

.chat-input {
    background: white;
    border-top: 1px solid #e0e0e0;
    padding: 15px 20px;
}

.chat-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-input-group input {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    padding: 10px 20px;
    outline: none;
}

.chat-input-group input:focus {
    border-color: #5e72e4;
}

.btn-send {
    background: #5e72e4;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.btn-send:hover {
    background: #4c63d2;
}

.user-list {
    /* height: calc(100vh - 100px); */
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.user-list-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
}

.user-list-header input {
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 8px 15px;
    font-size: 14px;
}

#createGroupBtn {
    border-radius: 50%;
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-list-body {
    overflow-y: auto;
    height: calc(100% - 60px);
}

.user-item {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.2s;
}

.user-item:hover {
    background: #f8f9fa;
}

.user-item.active {
    background: #e3f2fd;
}

.user-item img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.user-item-info {
    flex: 1;
}

.user-item-info h6 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.user-badge {
    width: 20px;
    height: 20px;
    background: #f44336;
    color: white;
    border-radius: 50%;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.dropdown-menu {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.logo-brand {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 16px;
    flex-shrink: 0;
}

.chat-room-item {
    position: relative;
}

.chat-room-item .badge {
    font-size: 10px;
    padding: 2px 6px;
}

.user-list-body::-webkit-scrollbar {
    width: 6px;
}

.user-list-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.user-list-body::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.user-list-body::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Group creation modal styles */
.member-item:hover {
    background-color: #f8f9fa;
}

.member-item.selected {
    background-color: #e3f2fd;
}

.selected-member-item {
    background-color: white;
}

.selected-member-item:hover {
    background-color: #f8f9fa;
}

#memberList::-webkit-scrollbar,
#selectedMembers::-webkit-scrollbar {
    width: 6px;
}

#memberList::-webkit-scrollbar-track,
#selectedMembers::-webkit-scrollbar-track {
    background: #f1f1f1;
}

#memberList::-webkit-scrollbar-thumb,
#selectedMembers::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

#memberList::-webkit-scrollbar-thumb:hover,
#selectedMembers::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.remove-member-btn {
    width: 24px;
    height: 24px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Modal css */
#chatRoomInfoModal .modal-content {
    background-color: #fff;
}

#chatRoomInfoModal #roomIcon {
    color: #0d6efd;
}

#chatRoomInfoModal #memberList .list-group-item {
    border: 0;
    border-bottom: 1px solid #f1f1f1;
}

#chatRoomInfoModal #memberList .list-group-item:last-child {
    border-bottom: 0;
}

#chatRoomInfoModal hr {
    opacity: 0.15;
}


.member-item:hover {
    background-color: #f8f9fa;
}

.member-item .dropdown-toggle::after {
    display: none; /* ẩn mũi tên */
}
