/* ================================
   Simple Chat Plugin CSS
   ================================ */
:root {
  --font-ui: Helvetica, Arial, sans-serif;
}

#simple-chat-box {
  margin-bottom: 10px;
  border-radius: 8px;
  font-family: "Helvetica", sans-serif !important;
  font-size: 14px !important;
  line-height: 1.5;
}

#search-results {
  min-height: 70vh;
  max-height: 70vh;
  overflow-y: auto;
}
button#do-search-msg,
button#search-user-chat-magnifying-glass {
  padding: 0;
  margin: 0;
  background: none;
}

/* Tin nhắn */
.msg {
  /*margin: 6px 0;*/
}

/* ====== 1-1 CHAT ====== */
.direct-message-wrapper .msg.basic-other-msg .bubble {
  /*background: #e9ecef;*/
  border-bottom-left-radius: 4px;
  max-width: 350px;
}

.direct-message-wrapper .msg.basic-user-msg .bubble {
  /*background: #ededed;*/
  border-bottom-right-radius: 4px;
  max-width: 310px;
}

 

.msg .bubble {
  padding: 8px 12px;
  border-radius: 16px;

  line-height: 1.4;
  word-wrap: break-word;
}

.msg.basic-user-msg .bubble {
  /*background: #ededed;*/
  max-width: 310px;
  border-bottom-right-radius: 4px;
}

.msg.basic-other-msg .bubble {
  /*background: #e9ecef;*/
  border-bottom-left-radius: 4px;
  max-width: 350px;
}

/* Input form */
.simple-chat-form {
  display: flex;
  flex-direction: column;
  border: 1px solid #8e8e8e4f;
  border-radius: 8px;
  padding: 6px;
margin: 0 15px;
}

.simple-chat-input-wrapper {
  display: flex;
  align-items: center;
}



.simple-chat-input-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

.simple-chat-upload-btn,
.simple-chat-send-btn {
  background: #4a7d9100;
  color: #000;
  border: none;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
/*
.select-to-chat.fullscreen .simple-chat-upload-btn,
.select-to-chat.fullscreen .simple-chat-send-btn {
  color: #fff;
}
*/
.simple-chat-upload-btn:hover,
.simple-chat-send-btn:hover {
  background: #ddd;
}

/* Preview file */
.simple-chat-file-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.preview-item {
  position: relative;
  display: inline-block;
}

.preview-item img {
  max-width: 100px;
  max-height: 100px;
  border-radius: 6px;
  border: 1px solid #8e8e8e4f;
}

.preview-item a {
  display: inline-block;
  padding: 4px 8px;
  background: #f1f1f1;
  border-radius: 4px;
  text-decoration: none;
  font-size: 12px;
  color: #333;
}

.preview-item .remove-file {
  position: absolute;
  top: -6px;
  right: -6px;
  background: red;
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  width: 18px;
  height: 18px;
  font-size: 12px;
  line-height: 16px;
  padding: 0;
}

.sc-open-chat-btn {
  position: relative;
  display: inline-block;
  background: linear-gradient(135deg, #5b92af, #3d5f73);
  color: #fff;
  border-radius: 5px;
  height: 35px;
  border: none;
  font-family: Helvetica, sans-serif;
  font-size: 16px;
  cursor: pointer;
  transition:
    background 0.3s ease,
    transform 0.2s ease,
    box-shadow 0.3s ease;
  padding: 5px 15px;
  overflow: hidden;
  box-shadow:
    inset 0 3px 5px rgb(255 255 255 / 0.3),
    0 2px 4px rgb(0 0 0 / 0.3);
  margin: 0;
}

/* 🔹 Popup khung chat/messenger dạng panel (góc phải) */
.sc-chat-panel,
.sc-messenger-panel,
.create-group-popup {
  position: fixed;
  bottom: 5px;
  right: 5px; /* Cách mép phải 20px */
  width: 350px;
  background: #fff;
  border: 1px solid #8e8e8e4f;
  border-radius: 8px 8px 0 0;
  display: none; /* Mặc định ẩn */
  flex-direction: column;
  z-index: 10000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

/* 🔹 Header chat */
.sc-chat-header,
.sc-messenger-header {
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #8e8e8e4f;
  font-weight: bold;
  align-items: center;
}

.chat-header-left {
  display: flex;
  align-items: center; /* căn giữa các phần tử con theo chiều cao */
  gap: 8px; /* khoảng cách giữa các item */
}

.sc-chat-close,
.sc-messenger-close,
.close-select-chat,
.select-to-chat-close,
.open-create-group,
#create-group-close,
#clear-user-search,
#chat-close-notifications {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  padding: 0;
  margin: 0;
  color: black;
}

.sc-chat-close:hover,
.sc-messenger-close:hover,
.close-select-chat:hover,
.select-to-chat-close:hover,
.open-create-group:hover,
#create-group-close:hover {
  background: #f0f0f0; /* màu nền khi hover */
  color: #333; /* đổi màu icon/text */
  border-radius: 4px; /* bo góc nhẹ nếu cần */
}

/* 🔹 Nội dung */
.sc-chat-body {
  flex: 1;
  overflow-y: auto;
}

/* 🔹 Sidebar danh sách user trong Messenger */
.sc-messenger-user-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sc-messenger-user-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  cursor: pointer;
  border-radius: 4px;
}

.sc-messenger-user-list li:hover {
  background: #f0f0f0;
}

.sc-messenger-user-list img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

img.sc-messenger-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 50%;
}

button#sc-open-messenger {
  margin: 0;
  padding: 0;
  background: none;
}

#sc-messenger-user-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Style từng item */
#sc-messenger-user-list li.sc-messenger-item {
  display: flex;
  align-items: center; /* ✅ căn giữa avatar + text theo chiều dọc */
  gap: 8px; /* khoảng cách avatar - text */
  padding: 6px 10px;
  cursor: pointer;
  border-radius: 4px;
}

#sc-messenger-user-list li.sc-messenger-item:hover {
  background: #f0f0f0;
}

.chat-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0; /* ngăn bị co khi dùng flex */
  margin-right: 10px;
  border: 1px solid rgba(0, 0, 0, 0.2);
}

img#sc-chat-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  margin-right: 8px;
  object-fit: cover;
  border: 1px solid rgba(0, 0, 0, 0.2);
}

/* Nút bút ✎ ở góc phải dưới */
.sc-create-group-btn {
  position: fixed;
  bottom: 20px;
  right: 140px;
  background: #4a7d91;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 22px;
  cursor: pointer;
  z-index: 1000;
  margin: 0;
  padding: 0;
}
.sc-create-group-btn:hover {
  background: #3a6b7d;
}

/* Popup */
.select-to-chat {
  position: fixed;
  bottom: 10px;
  right: 10px;

  background: #fff;
  border-radius: 8px;
  z-index: 40;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
  display: none;
  overflow: hidden;
  transition: width 0.3s ease;
}

.select-to-chat.collapsed {
  width: 270px;
}
#sc-user-search.collapsed {
  width: 70px !important;
  transition: width 0.3s ease;
}

.select-to-chat-header {
  padding: 10px;
  border-bottom: 1px solid #8e8e8e4f;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.select-to-chat-body {
  display: flex;
}

.select-to-chat-body label {
  padding: 6px;
  display: flex;
  align-items: center;
}

/* Sidebar trái */
.chat-sidebar {

    width: 270px;
    height: 70vh;
    border-right: 1px solid #8e8e8e4f;
    box-sizing: border-box;
    
}

/* Nội dung chat phải */
.sc-chat-main {
  flex: 1; /* chiếm phần còn lại */
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  height: 70vh;
  border-right: 1px solid rgb(0 0 0 / .1);
}

.select-to-chat.fullscreen .sc-chat-main-body {
    height: calc(100vh - 110px) !important;  
}

.sc-chat-main-body {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-direction: column;
    height: calc(70vh - 70px);
}

/* Vùng hiển thị tin nhắn */
.scrollable-simple-chat-box {
  flex: 1;
  overflow-y: auto;
}


.sc-chat-main.collapsed {
  flex: 0 0 0 !important;
  max-width: 0 !important;
  overflow: hidden;
}
.select-to-chat.collapsed {
  width: 270px; /* chỉ hiện danh sách */
}

.sc-chat-main-head {
  display: flex;
  justify-content: space-between;
  padding: 10px;
      border-bottom: 1px solid #8e8e8e4f
}
.select-to-chat.fullscreen .sc-chat-main-head {
/*background-color: #292929;*/
} 

.sc-chat-main-head-user {
  display: flex;
}
/* Chat box co giãn full */
#simple-chat-box {
  flex: 1;
  overflow-y: auto;
}

/* Checkbox bình thường */
input.group-user-checkbox,
input.group-checkbox,
input.remove-user-checkbox {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  width: 20px;
  height: 20px;
  border: 1px solid #aaa;
  border-radius: 50%;
  position: relative;
  cursor: pointer;
  background: #fff;
  vertical-align: middle;
  margin-right: 6px;
  transition: all 0.2s ease;
}

/* Hover + Focus */
input.group-user-checkbox:hover:not(:disabled),
input.group-checkbox:hover:not(:disabled),
input.remove-user-checkbox:hover:not(:disabled) {
  border-color: #666;
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.15);
}
input.group-user-checkbox:focus,
input.group-checkbox:focus,
input.remove-user-checkbox:focus {
  outline: none;
  box-shadow: 0 0 3px rgba(59, 121, 127, 0.6);
}

/* Checked */
input.group-user-checkbox:checked,
input.group-checkbox:checked,
input.remove-user-checkbox:checked {
  background-color: #3b797f;
  border-color: #3b797f;
}
input.group-user-checkbox:checked::after,
input.group-checkbox:checked::after,
input.remove-user-checkbox::after {
  content: "\2714";
  color: #fff;
  font-size: 14px;
  position: absolute;
  top: -2px;
  left: 4px;
}

/* ✅ Disabled */
input.group-user-checkbox:disabled,
input.group-checkbox:disabled,
input.remove-user-checkbox:disabled {
  background-color: #eee; /* nền xám nhạt */
  border-color: #ccc;
  cursor: not-allowed;
}
input.group-user-checkbox:checked:disabled,
input.group-checkbox:checked:disabled,
input.remove-user-checkbox:checked:disabled {
  background-color: #bbb; /* nền xám đậm hơn */
  border-color: #aaa;
}
input.group-user-checkbox:checked:disabled::after,
input.group-checkbox:checked:disabled::after,
input.remove-user-checkbox:checked:disabled::after {
  color: #eee; /* tick nhạt */
}

input#group-name {
    border: none;
    padding: 8px 10px;
    width: 80%;
    box-sizing: border-box;
}
 
.search-user-chat {
  display: flex;
  align-items: center;
}
.search-user-chat label,
.search-user-chat input,
.search-user-chat .user-list {
  display: inline-block;
  vertical-align: middle; /* căn giữa dọc */
}


.user-item,
.group-item {
  display: flex;
  align-items: center;
  padding: 3px;
  cursor: pointer;
      margin: 5px 0;
}

.select-to-chat.fullscreen .chat-item.user-item {

    opacity: 0.9;
    border-radius: 8px;
    /*background-color: #171717;*/
}
.chat-item.user-item {
    
    position: relative;
    transition: 0.25s;
}

/* ✅ Ảnh bìa cho user có cover */
.chat-item.user-item.has-cover {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 8px;
}

/* ✅ Lấy URL từ data-cover để làm background-image */
.chat-item.user-item.has-cover {
    background-image: var(--cover-img);
}

/* ✅ Overlay mờ để text rõ */
.chat-item.user-item.has-cover::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.15);
    pointer-events: none;
}

.user-one-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  margin-right: 10px;
  object-fit: cover;
  border: 1px solid rgba(0, 0, 0, 0.2);
}
.user-name {
  font-size: 14px;
}

span.sc-chat-title {
  display: inline-block; /* cần để width có hiệu lực */
  max-width: 250px; /* giới hạn chiều rộng */
  white-space: nowrap; /* không xuống dòng */
  overflow: hidden; /* ẩn phần dư */
  text-overflow: ellipsis; /* thay thế bằng dấu ... */
  vertical-align: middle; /* căn chỉnh cho đẹp (tuỳ) */
  font-weight: 400;
  font-size: 16px;
}

button#sc-chat-dropdown-toggle {
  padding: 0;
  margin: 0;
  background: none;
  color: black;
}

.select-to-chat.fullscreen #sc-chat-dropdown-toggle {
    /*color: white;*/
}

.sc-chat-main-head-right {
  position: relative; /* ✅ để menu căn theo vùng này */
      display: flex;
}

#sc-chat-dropdown-menu {
  list-style: none; /* bỏ dấu chấm trước <li> */
  padding: 0; /* bỏ padding mặc định */
  margin: 0; /* bỏ margin mặc định */
}
#sc-chat-dropdown-menu li a {
  font-weight: 400;
  padding: 6px 12px;
}

/* Tag user đã chọn */
.user-tag {
  display: inline-flex;
  align-items: center;
  background: #f0f0f0;
  border-radius: 20px;
  padding: 2px 8px;
  margin: 3px;
  font-size: 13px;
  color: #333;
}

.user-tag .tag-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  margin-right: 6px;
  flex-shrink: 0;
}

.user-tag .remove-user {
  background: transparent;
  border: none;
  color: #666;
  margin-left: 6px;
  font-size: 14px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

.user-tag .remove-user:hover {
  color: red;
}

/* Input search nằm cùng dòng với tag */
#sc-user-search {
  border: none;
  outline: none;
  font-size: 13px;
  margin: 3px;
}

button#sc-chat-back,
button#sc-chat-content-back,
button#hide-sc-chat-main,
button#toggle-fullscreen-chat,
button#sc-chat-pin,
button#sc-chat-pin-thread,
button#sc-chat-mark,
button#close-marked-popup,
button#search-messages,
#close-pinned-popup,
search-user-chat-magnifying-glass {
  margin: 0;
  padding: 5px;
  background: none;
  color: black;
}

.sc-chat-main.hidden {
  display: none !important;
}

.group-avatar-wrapper {
  display: grid;
  grid-template-columns: repeat(2, 18px);
  grid-template-rows: repeat(2, 18px);
  width: 37px;
  height: 37px;
  position: relative;
  margin-right: 10px;
}

.group-avatar-circle {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  overflow: hidden;
  background: #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  object-fit: cover;
}

.group-avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.group-avatar-count {
  background: #bfbfbf;
  color: #2b2b2b;
}

.group-avatar-circle.empty {
  background: transparent;
}

.unread-dot {
  width: 10px;
  height: 10px;
  background-color: #4a7d91;
  border-radius: 50%;
  margin-left: auto;
}

.chat-text {
  display: flex;
  flex-direction: column;
}

.chat-last {
  font-size: 12px;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
  font-family: var(--font-ui);
}
span.chat-name {
    font-family: var(--font-ui);
    white-space: nowrap;
    /* overflow: hidden; */
     text-overflow: ellipsis;
    text-shadow: 0 0 5px #ffffff, 0 0 5px #40f5f9, 0 0 1px #ffffff; 
}
/*
.select-to-chat.fullscreen .member-item.no-cover .member-name,
.select-to-chat.fullscreen .member-item .member-name, 
.select-to-chat.fullscreen .chat-item.user-item.no-cover .chat-name,
.select-to-chat.fullscreen .chat-item.user-item .chat-name {
  color: #00e0ff;
  text-shadow:
    0 0 5px #007e8f,
    0 0 10px #00aaff,
    0 0 20px #003877;
}
*/
.menu-head-chat {
  position: absolute;
  top: 50px; /* chỉnh theo chiều cao header */
  right: 0;
  background: #fff;
  border: 1px solid #8e8e8e4f;
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  min-width: 180px;
  font-family: var(--font-ui);
      color: black;
}
.menu-head-chat ul {
  list-style: none;
  padding: 0;
  margin: 0;
  font-weight: 400;
}
.menu-head-chat li {
  padding: 8px 12px;
  cursor: pointer;
}
.menu-head-chat li:hover {
  background: #f3f3f3;
}

.simple-chat-emoji-btn {
  padding: 0;
  margin: 0;
  background: none;
}

.emoji-picker {
  z-index: 99999 !important; /* đảm bảo nổi lên trên */
}
.emoji-picker.light,
.emoji-picker__wrapper {
  z-index: 99999 !important;
}
body .emoji-picker,
body .emoji-picker__wrapper {
  z-index: 999999 !important;
}


.edit-msg-emoji-popup {
    background: #fff;
    max-height: 350px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, 24px);
    gap: 4px;
    z-index: 99999;
}


.group-chat-emoji-popup  {
  position: absolute;
top: 70px;
    right: 10px;
  background: #fff;
  border: 1px solid #8e8e8e4f;
  padding: 6px;
  width: 340px;
  max-height: 350px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, 24px);
  gap: 4px;
  z-index: 99999;
  border-radius: 8px;
}
.main-chat-emoji-popup {
  position: absolute;
bottom: 70px;
    right: 10px;
  background: #fff;
  border: 1px solid #8e8e8e4f;
  padding: 6px;
  width: 340px;
  max-height: 350px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, 24px);
  gap: 4px;
  z-index: 99999;
  border-radius: 8px;
}



.emoji-tabs {
  display: flex;
  border-bottom: 1px solid #8e8e8e4f;
}
.emoji-tab {
  flex: 1;
  padding: 4px;
  cursor: pointer;
  background: #f5f5f5;
  border: none;
  font-size: 20px;
}
.emoji-tab.active {
  background: #fff;
  font-weight: bold;
}
 
 
.emoji-content .emoji-item {
  cursor: pointer;
  font-size: 16px;
}
.emoji-content .emoji-item img {
  max-width: 28px;
  max-height: 28px;
}
.main-chat-emoji-popup span,
.group-chat-emoji-popup span  {
  cursor: pointer;
  font-size: 20px;
}
.chat-sticker {
  max-width: 100px;
  max-height: 100px;
  vertical-align: middle;
  border-radius: 6px;
}

.bubble.emoji-only {
  background: none !important;
  line-height: 1.2;
  padding: 0;
}

/* Emoji mặc định */
.emoji-content[data-tab="default"] {
  display: grid;
  grid-template-columns: repeat(auto-fill, 28px);
  gap: 4px;
  overflow-y: auto;
  flex: 1;
}

/* Sticker Ami (to, 5 cột) */
.emoji-content[data-tab="ami"],
.emoji-content[data-tab="bedui"],
.emoji-content[data-tab="pepe"] {
  display: grid;
  grid-template-columns: repeat(5, 1fr); /* đúng 5 cột */
  gap: 8px;
  padding: 6px;
  overflow-y: auto;
}

.emoji-content[data-tab="ami"] .emoji-item img,
.emoji-content[data-tab="bedui"] .emoji-item img,
.emoji-content[data-tab="pepe"] .emoji-item img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 6px;
}

.bubble.sticker-only {
  background: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  display: flex;
}

#popup-menu-list .menu-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px;
}

#popup-menu-list .menu-head .menu-close {
  cursor: pointer;
  color: #999;
  font-size: 14px;
}
#popup-menu-list .menu-head .menu-close:hover {
  color: #333;
}

#popup-menu-list .menu-items li {
  padding: 6px 12px;
  cursor: pointer;
}
#popup-menu-list .menu-items li:hover {
  background: #f5f5f5;
}

.msg-time {
  font-size: 11px;
  color: #888;
  font-family: var(--font-ui);
  font-weight: 400;
  margin-top: 5px;
}

#create-group-submit,
#add-to-group-submit,
#add-member-submit {
  width: 100%;
  padding: 10px;
  border: none;
  color: #fff;
  font-weight: bold;
  border-radius: 6px;
  cursor: pointer;
  margin: 0;
  margin-top: 10px;
}
input.group-checkbox {
  margin-right: 10px;
}

.chat-back-btn {
  margin-bottom: 15px;
  border: none;
  padding: 6px 12px;
  cursor: pointer;
  border-radius: 4px;
}
.chat-back-btn:hover {
  background: #ddd;
}
.message-highlight {
  background: #fff8b3;
  transition: background 1s ease;
}

 

#search-counter {
  display: none;
  font-size: 12px;
  color: #555;
  margin-top: 4px;
  text-align: right;
}

.group-members ul {
  list-style: none; /* bỏ chấm */
  margin: 0;
  padding: 0;
}

.group-members li {
  display: flex;
  align-items: center;
  padding: 6px 0px;
}

#member-popup ul {
  list-style: none;
  margin: 0;
  padding: 5px 0;
}

#member-popup li {
  padding: 8px 15px;
  cursor: pointer;
}

#member-popup li:hover {
  background: #f0f0f0;
}

input.remove-user-checkbox {
  margin-right: 10px;
}

.new-owner-radio {
  margin-right: 10px;
}

#confirm-transfer-owner,
#cancel-transfer-owner {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background 0.2s;
}

/* Nút confirm */
#confirm-transfer-owner {
  background-color: #4caf50; /* xanh */
  color: white;
}
#confirm-transfer-owner:hover {
  background-color: #45a049;
}

/* Nút cancel */
#cancel-transfer-owner {
  background-color: #f1f1f1;
  color: #333;
}
#cancel-transfer-owner:hover {
  background-color: #ddd;
}

.member-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.member-text {
  display: flex;
  flex-direction: column;
}

.member-name {
    font-weight: 500;
    max-width: 200px;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-family: var(--font-ui);
    text-shadow: 0 0 4px rgba(255, 255, 255, 0.9), 0 0 8px rgba(255, 255, 255, 0.6);
}
.member-role {
  font-size: 12px;
  color: #777;
}

.chat-placeholder {
  padding: 15px;
}

.placeholder-msg {
  display: flex;
  align-items: flex-start;
  margin: 10px 0;
}

.placeholder-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #eee;
  margin-right: 8px;
  flex-shrink: 0;
  animation: shimmer 1.5s infinite;
}

.placeholder-msg.me {
  justify-content: flex-end;
}

.placeholder-msg.me .placeholder-bubble {
  margin-right: 0;
  margin-left: auto;
}

.placeholder-bubble {
  height: 18px;
  border-radius: 14px;
  background: linear-gradient(90deg, #eee 25%, #ddd 50%, #eee 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.placeholder-bubble.short {
  width: 40%;
}
.placeholder-bubble.medium {
  width: 60%;
}
.placeholder-bubble.long {
  width: 75%;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.chatlist-placeholder {
  padding: 5px;
}

.chatlist-placeholder-item {
  display: flex;
  align-items: center;
  margin: 12px 0;
}

.chatlist-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-right: 10px;
  background: #eee;
  animation: chatlist-shimmer 1.5s infinite;
}

.chatlist-line {
  height: 14px;
  border-radius: 8px;
  flex: 1;
  background: linear-gradient(90deg, #eee 25%, #ddd 50%, #eee 75%);
  background-size: 200% 100%;
  animation: chatlist-shimmer 1.5s infinite;
}

.chatlist-line-short {
  width: 40%;
}
.chatlist-line-medium {
  width: 70%;
}

@keyframes chatlist-shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.unread-text {
    font-size: 12px;
    text-align: right;
}
.chat-item.user-item.has-cover,
.member-item.has-cover {
    color: #ffffff;
}

.chat-meta {
  display: flex;
  align-items: right;
  gap: 6px;
  font-size: 12px;
  margin-left: auto;
  flex-direction: column-reverse;
}
.chat-time {
  white-space: nowrap;
}


.rename-group,
.add-description-group {
  display: none; /* mặc định ẩn */
  position: fixed; /* overlay */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%); /* căn giữa màn hình */
  width: 400px; /* tùy chỉnh */
  max-width: 400px;
  max-height: 70vh;
  min-height: 400px;
  overflow-y: auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
  z-index: 1000; /* nằm trên cùng */
  padding: 20px;
}

/* nền tối mờ phía sau */
.chat-popup-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

.body-popup-group-chat {
    padding: 10px;
}

.chat-popup-head {
    justify-content: space-between;
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 50px;
    padding: 0 12px;
    border-bottom: 1px solid #8e8e8e4f;
    flex-shrink: 0;
    box-sizing: border-box;
}

div#sc-chat-popup {
  min-height: 200px;
}

/* --- 🧩 Cấu trúc bong bóng --- */
.bubble {
  position: relative;
}

/* --- 💬 Nút reaction (👍 hoặc emoji) --- */
.bubble .msg-reaction-btn {
  display: none;
  position: absolute;
  bottom: -16px;
  right: 4px;
  width: 28px;
  height: 28px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  opacity: 0;
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
  text-align: center;
  line-height: 28px;
  font-size: 17px;
  z-index: 1;
}

/* --- 👆 Hover bong bóng → hiện nút 👍 (chưa có reaction) --- */
.msg:hover .msg-reaction-btn,
.chat-message:hover .msg-reaction-btn {
  display: block;
  opacity: 0 !important;
}

/* Nếu đã có reaction thì luôn hiển thị */
.bubble .msg-reaction-btn.always-visible {
  display: flex !important;
  justify-content: center;
  align-items: center;
  opacity: 1 !important;
  transform: none;
  pointer-events: auto;
}

/* Khi hover emoji sẵn có → phóng nhẹ nhưng không xê dịch */
.bubble .msg-reaction-btn.always-visible:hover {
  transform: scale(1.1);
}

/* Ảnh emoji (nếu có dạng <img>) căn giữa trong khung */
.bubble .msg-reaction-btn img {
  width: 18px;
  height: 18px;
  display: block;
  margin: auto;
  pointer-events: none;
}

/* --- 🎨 Picker cảm xúc (menu chọn emoji) --- */
.msg-reaction-picker span {
  font-size: 20px;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.msg-reaction-picker span:hover {
  transform: scale(1.2);
}

.msg-reaction-summary {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-right: 4px;
  font-size: 12px;
  color: #888;
}

.msg-reaction-tooltip {
  display: none;
  position: absolute;
  bottom: 130%;
  left: 50px;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.4;
  white-space: pre-line; /* ✅ Cho xuống dòng */
  text-align: left;
  min-width: 120px;
  z-index: 1000;
}

.msg-reaction-summary:hover .msg-reaction-tooltip {
  display: block;
  animation: fadeIn 0.15s ease-in-out;
}

/* Buttons */
.rename-group .popup-btns {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 15px;
}

.rename-group .popup-btns .btn {
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
  margin: 0;
}

.rename-group .popup-btns .btn-primary {
  color: #fff;
}
.rename-group .popup-btns .btn-primary:hover {
  background: #0069d9;
}

.rename-group .popup-btns .btn-secondary {
  background: #e0e0e0;
  color: #333;
}
.rename-group .popup-btns .btn-secondary:hover {
  background: #d5d5d5;
}

.add-description-group .popup-btns {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 15px;
}

.add-description-group .popup-btns .btn {
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  margin: 0;
}

.add-description-group .popup-btns .btn-primary {
  background-color: #4a7d91;
  color: #fff;
}
.add-description-group .popup-btns .btn-primary:hover {
  background: #0069d9;
}
.add-description-group .popup-btns .btn-secondary {
  background: #e0e0e0;
  color: #333;
}
.add-description-group .popup-btns .btn-secondary:hover {
  background: #d5d5d5;
}

textarea#group-description-text {
  max-width: 97%;
  min-height: 500px;
}

.sc-start-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 100%;
  color: #555;
}

.sc-start-placeholder img {
  width: 120px;
  height: auto;
  margin-bottom: 20px;
  opacity: 0.9;
}

.sc-start-placeholder h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 6px;
}

.sc-start-placeholder p {
  font-size: 14px;
  color: #777;
}

.sc-start-placeholder img {
  animation:
    fadeIn 1s ease,
    floatY 3s ease-in-out infinite;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 0.9;
    transform: translateY(0);
  }
}

@keyframes floatY {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

.view-profile-user-chat {
  text-align: center;
  border-bottom: 1px solid #8e8e8e4f;
  padding: 12px 0;
}

.view-profile-user-chat .author-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.view-profile-user-chat .author-details {
  text-align: center;
}

.view-profile-user-chat .follow-info {
  font-size: 13px;
  color: #666;
  margin-top: 4px;
}

.view-profile-user-chat .follow-info span {
  margin: 0 6px;
  cursor: pointer;
}

.view-profile-user-chat .follow-info span:hover {
  text-decoration: underline;
}

.chat-content-area {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}

.chat-user-header {
  text-align: center;
  padding: 10px 0;
  border-bottom: 1px solid #8e8e8e4f;
  background: #fff;
  flex-shrink: 0;
}

#simple-chat-scroll {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

 

.chat-loading-placeholder {
  text-align: center;
  padding: 8px;
  color: #888;
  font-size: 13px;
  animation: fadeIn 0.3s ease;
}
.msg-action-menu {
  font-family: var(--font-ui);
  white-space: nowrap;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
}
.msg-action-item {
  padding: 8px 14px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.msg-action-item:hover {
  background: #f3f3f3;
}

.chat-message,
.message-item {
  position: relative;
}

/* 🧱 Mỗi tin nhắn là 1 dòng */
.msg {
  position: relative;
  transition: background-color 0.2s ease;
  border-radius: 8px;
}
.msg {
  box-sizing: border-box;
  border: 1px solid transparent; /* tạo chỗ trống sẵn */
  border-radius: 8px;
  transition: all 0.15s ease;
}

.group-message-wrapper,
.direct-message-wrapper,
.view-thread-panel .msg[data-context="thread"] {
    padding: 2px 15px;
}

.direct-message-wrapper:hover,
.group-message-wrapper:hover,
.view-thread-panel .msg[data-context="thread"]:hover {
  background: #f0f0f0;
}

.select-to-chat.fullscreen .pinned-msg-item:hover,
.select-to-chat.fullscreen .marked-msg-item:hover {
  background: #ededed;
  border-radius: 8px;
}
 

.select-to-chat.fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100vh !important;
  z-index: 40;
  background: #fff;
  border-radius: 0;
}

.select-to-chat.fullscreen .chat-sidebar,
.select-to-chat.fullscreen .sc-chat-main {
  height: calc(100vh - 40px) !important; /* trừ phần header 70px */
      /*background: #080808;*/
    /*color: white;*/
}

.select-to-chat.fullscreen .msg.basic-user-msg .bubble {
  max-width: 100%;
  padding: 0;
  
}

.select-to-chat.fullscreen .msg.basic-other-msg .bubble {
  max-width: 100%;

  padding: 0;
}

.select-to-chat.fullscreen
  .msg.basic-user-msg
  .bubble:not(.highlight-pulse):not(.message-highlight),
.select-to-chat.fullscreen
  .msg.basic-other-msg
  .bubble:not(.highlight-pulse):not(.message-highlight) {
  background: none !important;
}

/* Khi fullscreen, KHÔNG remove nền nếu đang highlight */
.select-to-chat.fullscreen .msg .bubble.highlight-pulse,
.select-to-chat.fullscreen .msg .bubble.message-highlight {
  background-color: rgba(255, 247, 150, 0.9) !important; /* vàng sáng */
  box-shadow: 0 0 10px rgba(255, 220, 40, 0.7);
  padding: 0;
  color: black;
  border-radius: 8px;
}

.select-to-chat.fullscreen .msg.basic-other-msg .msg-quote-line,
.select-to-chat.fullscreen .msg.basic-user-msg .msg-quote-line {
  left: -30px !important;
}
.select-to-chat.fullscreen .msg-quote-inner {
  left: 20px !important;
}

.select-to-chat.fullscreen .msg.basic-user-msg .chat-avatar,
.select-to-chat.fullscreen .msg.basic-other-msg .chat-avatar {
  width: 40px;
  height: 40px;
}
.select-to-chat.fullscreen #simple-chat-box {
  background-color: none !important;
}

.select-to-chat.fullscreen .msg.basic-user-msg {
  justify-content: flex-start;

}

.chat-popup-close,
.thread-chat-popup-close {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
  font-size: 18px;
  color: #666;  
  padding: 0;
  margin: 0;  
}


.chat-popup-close:hover,
.thread-chat-popup-close:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #000;
}

.attachments-filter {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.attachments-filter button {
  border: 1px solid #8e8e8e4f;
  border-radius: 6px;
  padding: 5px;
  cursor: pointer;
  transition: all 0.2s;
  background: white;
  color: black;
  margin: 0;
      line-height: 1.8;
}
.attachments-filter button:hover {
  background: #e1e1e1;
  color: black;
}

.attachments-filter button.active {
  background: #a5a5a5;
  color: #fff;
  border-color: #8d8d8d;
}
.attachments-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin-bottom: 20px;
}
.attach-item.file,
.attach-item.link {
  grid-column: 1 / -1; /* full width row */
}
.attach-date {
  margin: 8px 0 8px;
  color: #555;
  border-bottom: 1px solid #8e8e8e4f;
  padding-bottom: 3px;
}
.link-preview-box {
    border: 1px solid #8e8e8e4f;
    border-radius: 6px;
    padding: 8px;
    background: #fafafa;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
    line-height: 1.2;
    text-align: left;
    margin: 10px 0 0;
}

span#sc-chat-title {
  line-height: 28px;
  font-family: var(--font-ui);


  
}
.start-chat-placeholder {
  margin: 0 auto;
  text-align: center;
}

@keyframes fadeScaleIn {
  0% {
    opacity: 0;
    transform: scale(0.95);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.attach-item.image {
  /* ví dụ cho ô vuông, tùy chỉnh theo layout */
  width: 100%;
  aspect-ratio: 1/1; /* hoặc set height cố định */
  overflow: hidden;   /* bắt buộc để ảnh không tràn ra */
  border-radius: 8px; /* nếu muốn bo góc */
 
}

/* a phủ toàn khung */
.attach-item.image > a {
  display: block;
  width: 100%;
  height: 100%;
}

/* img phủ và crop theo khung */
.attach-item.image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;   /* KHẨU PHƯƠNG: cover để luôn đầy */
  object-position: center center; /* canh giữa */
  -o-object-fit: cover; /* cho trình duyệt cũ (Opera) */
}

.msg-reaction-picker {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid #8e8e8e4f;
  border-radius: 8px;
  padding: 4px 6px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
  animation: fadeScaleIn 0.15s ease-out;
  transform-origin: bottom center; /* 👈 xuất hiện từ dưới nút lên */
  z-index: 2147483647;
}

.msg-reaction-emojis {
  display: flex;
  gap: 5px;
}

.msg-reaction-more {
  font-size: 13px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.15s ease;
}

.msg-reaction-more:hover {
  opacity: 1;
}

.bubble {
  display: flex;
  flex-direction: column;
}

.msg-name {
  display: block; /* ép chiếm 1 dòng riêng */
  font-weight: 600;
  font-family: var(--font-ui);
}

.bubble img.chat-sticker {
  display: block; /* ép sticker xuống dòng, chiếm full */
  margin-top: 4px;
  max-width: 100px; /* tùy mày muốn thu nhỏ sticker không */
  display: inline-flex;
  justify-content: flex-start;
  align-items: center;
  padding: 4px;
  box-sizing: border-box;
}

.chat-last .chat-sticker {
  width: 12px !important;
  height: 12px !important;
  vertical-align: middle !important;
  object-fit: contain !important;
}

.msg.highlighted {
  background-color: rgba(255, 255, 150, 0.5);
  transition: background-color 0.6s ease;
}
.msg-quote {
  display: flex;
}

.msg-quote-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  height: 17px;
  bottom: 2px;
}

.msg-quote-line {
  position: absolute;
  top: -2px;
  left: -20px;
  width: 32px;
  height: 32px;
  opacity: 0.2;
  pointer-events: none;
}

.msg-quote-avatar {
  flex-shrink: 0;
}
.msg-quote-avatar img {
  width: 17px;
  height: 17px;
  object-fit: cover;
  border-radius: 50%;
  top: 1px;
}

.msg-quote-name {
  color: #0073aa;
}
.msg-quote-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 250px;
}

.msg .msg-content {
  display: flex;
  flex-direction: column;
}

.msg .msg-quote {
  margin-left: 30px; /* căn thẳng lề với bubble */
  margin-bottom: 4px;
}

.msg .msg-row {
  display: flex;
}

.basic-bubble-text {
  font-size: 14px;
  line-height: 1.6;
  word-wrap: break-word;
  white-space: pre-wrap;
}
#mention-suggestions {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border: 1px solid #8e8e8e4f;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  z-index: 99999;
  width: 280px;
  height: 70vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.mention-search-inner {
  padding: 6px;
  border-bottom: 1px solid #8e8e8e4f;
  background: #fafafa;
  position: sticky;
  top: 0;
}

.mention-list {
  flex: 1;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 0;
}

.mention-item:hover {
  background: #f2f2f2;
}
.mention-search-inner {
  position: relative;
}

.mention-search-inner::before {
  content: "\f002";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  position: absolute;
  top: 50%;
  left: 10px;
  transform: translateY(-50%);
  font-size: 14px;
  color: #888;
}

#mention-filter {
  width: 85%;
  padding: 6px 10px 6px 28px; /* chừa chỗ cho icon */
  border: 1px solid #8e8e8e4f;
  border-radius: 4px;
}

#mention-suggestions .mention-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-bottom: 1px solid #8e8e8e4f;
}

#mention-suggestions .mention-header span {
  font-weight: 600;
  font-size: 14px;
}

#mention-suggestions #close-mention-suggestions {
  border: none;
  background: transparent;
  font-size: 16px;
  cursor: pointer;
  color: #999;
  transition: color 0.15s ease;
  padding: 0;
  margin: 0;
}

#mention-suggestions #close-mention-suggestions:hover {
  color: #333;
}

.mention-highlight {
  color: #0073aa;
  font-weight: 600;
  border-radius: 4px;
  padding: 0 3px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mention-highlight:hover {
  background: rgba(0, 115, 170, 0.15);
  text-decoration: underline;
}

.simple-chat-input {
  display: inline-block;
  flex: 1;
  min-height: 40px;
  max-height: 520px;
  padding: 6px 10px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  resize: none;
  overflow-y: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  transition: height 0.1s ease;
}

.simple-chat-input:empty:before {
  content: attr(placeholder);
}

.mention-tag {
  color: #0073aa;
  font-weight: 600;
  background: rgba(0, 115, 170, 0.1);
  border-radius: 4px;
  padding: 0 3px;
  cursor: pointer;
}
.basic-msg-text {
  font-family: var(--font-ui);
  line-height: 1.8;
  margin-top: 4px;
}

/* Ẩn mặc định trong khung tin nhắn */
.msg .msg-reaction-btn {
  display: none;
  position: absolute;
  top: 35px;
  right: 4px;
  width: 28px;
  height: 28px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  opacity: 0;
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
  text-align: center;
  line-height: 28px;
  font-size: 17px;
  z-index: 1;
}

/* Hover vào bubble thì hiện */
.msg .bubble:hover .msg-reaction-btn {
  opacity: 1;
  transform: scale(1);
}

/* Hover vào phần file/link cũng hiện như bubble */
.msg .ai-file-slider:hover .msg-reaction-btn {
  opacity: 1;
  transform: scale(1);
}

.msg-reaction-summary-wrap {
  display: flex;
}


.simple-chat-input img.emoji {
  display: inline-block;
  vertical-align: middle;
}

/* === Reply Preview Box === */
#reply-preview {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid #8e8e8e4f;
  background: #f7f7f7;
  border-radius: 8px;
  padding: 6px 10px 6px 12px;
  margin-bottom: 8px;
  position: relative;
  overflow: hidden;
}

#reply-preview .reply-header {
  font-weight: 600;
  color: #333;
  font-size: 13px;
}

#reply-preview .reply-header span {
  color: var(--chat-accent, #0073aa);
}

#reply-preview .reply-text {
  font-size: 13px;
  color: #555;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: calc(100% - 24px);
}

#reply-preview #cancel-reply {
  position: absolute;
  top: 4px;
  right: 6px;
  border: none;
  background: none;
  color: #888;
  font-size: 14px;
  cursor: pointer;
  transition: color 0.2s ease;
}

#reply-preview #cancel-reply:hover {
  color: #222;
}

/* 💀 Dark mode (tự động khi có class .dark hoặc data-theme=dark) */
.dark #reply-preview,
[data-theme="dark"] #reply-preview {
  background: #2a2a2a;
  border-left-color: #3ea6ff;
}

.dark #reply-preview .reply-header,
[data-theme="dark"] #reply-preview .reply-header {
  color: #ddd;
}

.dark #reply-preview .reply-text,
[data-theme="dark"] #reply-preview .reply-text {
  color: #aaa;
}

.sc-pinned-popup,
.sc-pinned-popup-thread {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}
.sc-pinned-popup.hidden {
  display: none;
}
.sc-pinned-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}
.sc-pinned-panel {
  position: relative;
  background: #fff;
  border-radius: 12px;
  width: 600px;
  max-height: 80vh;
  min-height: 30vh;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  animation: fadeIn 0.2s ease;
  color: black;
}
.sc-pinned-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #8e8e8e4f;
  font-weight: 600;
}
.sc-pinned-list {
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sc-pinned-list .msg {
  border-bottom: 1px solid #f2f2f2;
  padding-bottom: 6px;
}
#close-pinned-popup,
.close-pinned-thread {
  border: none;
  cursor: pointer;
  font-size: 16px;
  opacity: 0.8;
    padding: 0;
    margin: 0;
    background: none;
    color: grey;  
}
#close-pinned-popup:hover {
  opacity: 1;
}

.pinned-msg-item .bubble {
  background: #fffbe6;
}

/* Vàng đậm, rõ nét hơn */
.bubble.highlight-pulse {
  position: relative;
  z-index: 10;
  background-color: rgba(
    255,
    247,
    150,
    0.9
  ) !important; /* vàng sáng rõ ràng hơn */
  box-shadow: 0 0 10px rgba(255, 220, 40, 0.7);
  transition:
    background-color 0.6s ease,
    box-shadow 0.6s ease;
  animation: highlightFade 2s ease-in-out forwards;
  border-radius: 8px;
}

/* Làm nhạt dần nhẹ nhàng sau vài giây */
@keyframes highlightFade {
  0% {
    background-color: rgba(255, 247, 150, 0.9);
    box-shadow: 0 0 14px rgba(255, 230, 80, 0.8);
  }
  80% {
    background-color: rgba(255, 247, 150, 0.6);
    box-shadow: 0 0 8px rgba(255, 220, 40, 0.4);
  }
  100% {
    background-color: transparent;
    box-shadow: none;
  }
}

.sc-return-current {
  text-align: center;
  padding: 10px 0;
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
}

#back-to-current {
  color: #000000;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  padding: 8px 12px;
  background-color: #c9c9c9;
  border: 1px solid gray;
}

#back-to-current:hover {
  background: #ddd;
}

#back-to-current:active {
  background: #111;
}

.sc-marked-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  color: black;
}
.sc-marked-popup.hidden {
  display: none;
}
.sc-marked-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
}
.sc-marked-panel {
  position: relative;
  background: #fff;
  width: 600px;
  min-height: 30vh;
  max-height: 80%;
  overflow-y: auto;
  border-radius: 10px;
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
  z-index: 10001;
  display: flex;
  flex-direction: column;
}
.sc-marked-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  font-weight: bold;
  border-bottom: 1px solid #8e8e8e4f;
}
.sc-marked-list {
  padding: 10px 16px;
}

#chat-ai-footer {
  position: fixed;
  right: 230px;
  bottom: 20px;
  z-index: 5;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  cursor: pointer;
}

#sc-open-messenger-footer {
  position: fixed;
  right: 80px;
  bottom: 20px;
  z-index: 5;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  cursor: pointer;
}

/* Style cơ bản của icon tròn */
.chat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 50px;
  padding: 8px 14px;
  text-decoration: none;
  transition: all 0.3s ease;
}

/* Icon SVG */
.chat-icon svg {
  width: 22px;
  height: 22px;
  fill: #fff;
  flex-shrink: 0;
}

/* Text trong nút */
.chat-icon span {
  color: #fff;
  font-size: 16x;
  user-select: none;
}

/* 🔹 AI Assistant */
#chat-ai-footer .chat-icon {
  background: #4a7d91;
}
#chat-ai-footer .chat-icon:hover {
  background: #5d9ab1;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

/* 🔹 Chat Người */
#sc-open-messenger-footer .chat-icon {
  position: relative;
  background: #4a7d91;
}
#sc-open-messenger-footer .chat-icon:hover {
  background: #5d9ab1;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

span#sc-messenger-count {
  color: #ffffff;
  font-weight: 400;
}

.notification-messenger-count {
  position: absolute;
  top: -10px;
  right: -10px;
  background-color: #4a7d9187;
  color: #ffffff;
  padding: 0 8px;
  border-radius: 5px;
  font-size: 14px;
  z-index: 2;
  display: none;
}

.list-chat-empty-placeholder {
  text-align: center;
  padding: 40px 10px;
  color: #888;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

 

/* đảm bảo header luôn cao và ổn định */
.sc-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 40px; /* hoặc auto */
  padding: 0 12px;
  border-bottom: 1px solid #8e8e8e4f;
  flex-shrink: 0;
  box-sizing: border-box;
      border: 1px solid #8e8e8e4f;
}

/* nhóm trái + phải chia đều */
.sc-chat-header .chat-header-left,
.sc-chat-header .chat-header-right {
  display: flex;
  align-items: center;
}

/* icon trong header */
.sc-chat-header button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: background 0.2s ease;
}

.sc-chat-header button:hover {
  background: #f3f3f3;
  border-radius: 6px;
}

/* input search chiếm phần còn lại */
.search-user-chat {
  display: flex;
  align-items: center;
  flex: 1;
  margin-top: 5px;
}

.search-user-chat input {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid #8e8e8e4f;
  border-radius: 6px;
}

.select-to-chat.fullscreen .select-to-chat-body {
  display: flex;
  flex-direction: row;
  height: 100%;
  position: relative;
}

/* 🧩 View Member nằm như 1 cột flex thật */
.select-to-chat.fullscreen .view-list-member,
.select-to-chat.fullscreen .add-member-to-group,
.select-to-chat.fullscreen .remove-member-from-group,
.select-to-chat.fullscreen .transfer-ownership-popup,
.select-to-chat.fullscreen .user-common-groups,
.select-to-chat.fullscreen .add-user-to-group,
.select-to-chat.fullscreen .create-group-chat,
.select-to-chat.fullscreen .view-attach-file,
.select-to-chat.fullscreen .sc-search-box,
.select-to-chat.fullscreen .edit-message-popup,
.select-to-chat.fullscreen .basic-profile-chat {
  position: relative; /* bỏ absolute */
  flex: 0 0 290px;  
  /*background: #080808;
  color: white;*/
  display: none;
  flex-direction: column;
  height: 100%;
  animation: slideInRight 0.25s ease-out;
  z-index: 10;
  border-right: 1px solid #8e8e8e4f;
}

 

.select-to-chat.fullscreen .view-list-member.active,
.select-to-chat.fullscreen .add-member-to-group.active,
.select-to-chat.fullscreen .remove-member-from-group.active,
.select-to-chat.fullscreen .transfer-ownership-popup.active,
.select-to-chat.fullscreen .user-common-groups.active,
.select-to-chat.fullscreen .add-user-to-group.active,
.select-to-chat.fullscreen .create-group-chat.active,
.select-to-chat.fullscreen .view-attach-file.active,
.select-to-chat.fullscreen .sc-search-box.active,
.select-to-chat.fullscreen .edit-message-popup.active,
.select-to-chat.fullscreen .view-thread-panel.active,
.select-to-chat.fullscreen .basic-profile-chat.active {
  display: flex;
}

.select-to-chat.fullscreen .sc-chat-main {
    /*max-width: 600px;*/
    margin: 0 auto;
    width: 100%;
 
    /*color: white;
    border: 1px solid #8e8e8e4f;
background: linear-gradient(to bottom, #000, #3b3b3b);*/
 
}
 
 

 
#sc-user-list::-webkit-scrollbar,
#group-chat-list::-webkit-scrollbar,
#simple-chat-box::-webkit-scrollbar,
#render-view-list-member::-webkit-scrollbar,
#add-member-group-list::-webkit-scrollbar,
#remove-member-group-list::-webkit-scrollbar,
#transfer-owner-list::-webkit-scrollbar,
#render-user-common-groups::-webkit-scrollbar,
#group-list-add::-webkit-scrollbar,
#group-user-list::-webkit-scrollbar,
#render-view-attach-file::-webkit-scrollbar,
#search-results-panel::-webkit-scrollbar,
.scrollable-livestream-chat::-webkit-scrollbar,
.scrollable-thread-replies::-webkit-scrollbar {
  width: 5px;
}


/* === Scrollbar Thumb (phần trượt) === */
#sc-user-list::-webkit-scrollbar-thumb,
#group-chat-list::-webkit-scrollbar-thumb,
#simple-chat-box::-webkit-scrollbar-thumb,
#render-view-list-member::-webkit-scrollbar-thumb,
#add-member-group-list::-webkit-scrollbar-thumb,
#remove-member-group-list::-webkit-scrollbar-thumb,
#transfer-owner-list::-webkit-scrollbar-thumb,
#render-user-common-groups::-webkit-scrollbar-thumb,
#group-list-add::-webkit-scrollbar-thumb,
#group-user-list::-webkit-scrollbar-thumb,
#render-view-attach-file::-webkit-scrollbar-thumb,
#search-results-panel::-webkit-scrollbar-thumb,
.scrollable-livestream-chat::-webkit-scrollbar-thumb,
.scrollable-thread-replies::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

/* === Scrollbar Track (phần rãnh phía sau) === */
#sc-user-list::-webkit-scrollbar-track,
#group-chat-list::-webkit-scrollbar-track,
#simple-chat-box::-webkit-scrollbar-track,
#render-view-list-member::-webkit-scrollbar-track,
#add-member-group-list::-webkit-scrollbar-track,
#remove-member-group-list::-webkit-scrollbar-track,
#transfer-owner-list::-webkit-scrollbar-track,
#render-user-common-groups::-webkit-scrollbar-track,
#group-list-add::-webkit-scrollbar-track,
#group-user-list::-webkit-scrollbar-track,
#render-view-attach-file::-webkit-scrollbar-track,
#search-results-panel::-webkit-scrollbar-track,
.scrollable-livestream-chat::-webkit-scrollbar-track,
.scrollable-thread-replies::-webkit-scrollbar-track {
  background: transparent;
}

/* === Scrollbar Buttons (mũi tên lên/xuống) === */
#sc-user-list::-webkit-scrollbar-button:single-button:vertical:decrement,
#group-chat-list::-webkit-scrollbar-button:single-button:vertical:decrement,
#simple-chat-box::-webkit-scrollbar-button:single-button:vertical:decrement,
#render-view-list-member::-webkit-scrollbar-button:single-button:vertical:decrement,
#add-member-group-list::-webkit-scrollbar-button:single-button:vertical:decrement,
#remove-member-group-list::-webkit-scrollbar-button:single-button:vertical:decrement,
#transfer-owner-list::-webkit-scrollbar-button:single-button:vertical:decrement,
#render-user-common-groups::-webkit-scrollbar-button:single-button:vertical:decrement,
#group-list-add::-webkit-scrollbar-button:single-button:vertical:decrement,
#group-user-list::-webkit-scrollbar-button:single-button:vertical:decrement,
#render-view-attach-file::-webkit-scrollbar-button:single-button:vertical:decrement,
#search-results-panel::-webkit-scrollbar-button:single-button:vertical:decrement,
.scrollable-livestream-chat::-webkit-scrollbar-button:single-button:vertical:decrement,
.scrollable-thread-replies::-webkit-scrollbar-button:single-button:vertical:decrement {
  height: 14px;
  background: #f3f3f3 url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><polygon points='0,6 5,0 10,6' fill='%23999'/></svg>") no-repeat center;
  background-size: 10px 6px;
  border-radius: 4px 4px 0 0;
}

/* === Scrollbar Button (mũi tên xuống) === */
#sc-user-list::-webkit-scrollbar-button:single-button:vertical:increment,
#group-chat-list::-webkit-scrollbar-button:single-button:vertical:increment,
#simple-chat-box::-webkit-scrollbar-button:single-button:vertical:increment,
#render-view-list-member::-webkit-scrollbar-button:single-button:vertical:increment,
#add-member-group-list::-webkit-scrollbar-button:single-button:vertical:increment,
#remove-member-group-list::-webkit-scrollbar-button:single-button:vertical:increment,
#transfer-owner-list::-webkit-scrollbar-button:single-button:vertical:increment,
#render-user-common-groups::-webkit-scrollbar-button:single-button:vertical:increment,
#group-list-add::-webkit-scrollbar-button:single-button:vertical:increment,
#group-user-list::-webkit-scrollbar-button:single-button:vertical:increment,
#render-view-attach-file::-webkit-scrollbar-button:single-button:vertical:increment,
#search-results-panel::-webkit-scrollbar-button:single-button:vertical:increment,
.scrollable-livestream-chat::-webkit-scrollbar-button:single-button:vertical:increment,
.scrollable-thread-replies::-webkit-scrollbar-button:single-button:vertical:increment {
  height: 14px;
  background: #f3f3f3 url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><polygon points='0,0 5,6 10,0' fill='%23999'/></svg>") no-repeat center;
  background-size: 10px 6px;
  border-radius: 0 0 4px 4px;
}

.container::-webkit-scrollbar {
  display: none; /* Chrome, Safari */
}
.select-to-chat:not(.fullscreen) .view-list-member,
.select-to-chat:not(.fullscreen) .add-member-to-group,
.select-to-chat:not(.fullscreen) .remove-member-from-group,
.select-to-chat:not(.fullscreen) .transfer-ownership-popup,
.select-to-chat:not(.fullscreen) .user-common-groups,
.select-to-chat:not(.fullscreen) .add-user-to-group,
.select-to-chat:not(.fullscreen) .create-group-chat,
.select-to-chat:not(.fullscreen) .view-attach-file,
.select-to-chat:not(.fullscreen) .sc-search-box,
.select-to-chat:not(.fullscreen) .edit-message-popup,
.select-to-chat:not(.fullscreen) .view-thread-panel {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 400px;
  max-height: 70vh;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  min-height: 50vh;
  overflow: hidden;
}

.select-to-chat:not(.fullscreen) .view-list-member.active,
.select-to-chat:not(.fullscreen) .add-member-to-group.active,
.select-to-chat:not(.fullscreen) .remove-member-from-group.active,
.select-to-chat:not(.fullscreen) .transfer-ownership-popup.active,
.select-to-chat:not(.fullscreen) .user-common-groups.active,
.select-to-chat:not(.fullscreen) .add-user-to-group.active,
.select-to-chat:not(.fullscreen) .create-group-chat.active,
.select-to-chat:not(.fullscreen) .view-attach-file.active,
.select-to-chat:not(.fullscreen) .sc-search-box.active,
.select-to-chat:not(.fullscreen) .edit-message-popup.active,
.select-to-chat:not(.fullscreen) .view-thread-panel.active,
.select-to-chat:not(.fullscreen) .basic-profile-chat.active {
  display: flex;
  flex-direction: column;
}

.select-to-chat:not(.fullscreen) .chat-popup-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

.member-search-box,
.search-add-member,
.search-remove-member,
.search-transfer-owner,
.common-member-search-input,
.group-name-search,
.search-user-chat-for-group,
.search-messages-user-group,
.search-messages-forum {
  position: relative;
}

 

#member-search-clear,
#search-add-member-clear,
#search-remove-member-clear,
#search-transfer-member-clear,
#common-member-search-clear,
#create-group-search-clear,
#add-user-to-group-clear,
#create-group-search-clear,
#clear-search-msg,
#clear-search-msg-forum {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #888;
  font-size: 16px;
  cursor: pointer;
  display: none; /* ẩn mặc định */
  padding: 0;
  margin: 0;
}

#member-search-clear:hover,
#search-add-member-clear:hover,
#search-remove-member-clear:hover,
#search-transfer-member-clear:hover,
#common-member-search-clear:hover,
#add-user-to-group-clear:hover,
#create-group-search-clear:hover,
#clear-search-msg:hover {
  color: #333;
}

/* 🔹 Popup (normal mode) */
.select-to-chat:not(.fullscreen) .scrollable-member-list,
.select-to-chat:not(.fullscreen) .scrollable-add-member-list,
.select-to-chat:not(.fullscreen) .scrollable-remove-member-list,
.select-to-chat:not(.fullscreen) .scrollable-transfer-member-list,
.select-to-chat:not(.fullscreen) .scrollable-common-member-list,
.select-to-chat:not(.fullscreen) .scrollable-add-user-to-group,
.select-to-chat:not(.fullscreen) .scrollable-create-member-list,
.select-to-chat:not(.fullscreen) .scrollable-view-attach-file,
.select-to-chat:not(.fullscreen) .scrollable-thread-replies,
.select-to-chat:not(.fullscreen) .scrollable-basic-profile-chat,
.select-to-chat:not(.fullscreen) .scrollable-livestream-chat {
  max-height: 40vh;
  min-height: 250px;
  overflow-y: auto;
}

.select-to-chat:not(.fullscreen) .scrollable-sc-user-list,
.select-to-chat:not(.fullscreen) .scrollable-group-chat-list {
  max-height: 70vh;
  overflow-y: auto;
  padding: 0 10px;
}

 

.select-to-chat.collapsed .scrollable-sc-user-list,
.select-to-chat.collapsed .scrollable-group-chat-list {
  border-right: none;
}
/* 🔹 Sidebar (fullscreen mode) */
.select-to-chat.fullscreen .scrollable-add-member-list,
.select-to-chat.fullscreen .scrollable-remove-member-list,
.select-to-chat.fullscreen .scrollable-transfer-member-list,
.select-to-chat.fullscreen .scrollable-common-member-list,
.select-to-chat.fullscreen .scrollable-add-user-to-group,
.select-to-chat.fullscreen .scrollable-create-member-list,
.select-to-chat.fullscreen .scrollable-view-attach-file,
.select-to-chat.fullscreen .search-results-panel,
.select-to-chat.fullscreen .scrollable-basic-profile-chat {
  flex: 1; /* chiếm hết phần còn lại của sidebar */
  overflow-y: auto;
  padding-right: 6px; /* tránh che bởi thanh cuộn */
  max-height: 70vh; /* bỏ giới hạn vh */
  min-height: 250px;
}

.select-to-chat.fullscreen .scrollable-member-list {
  flex: 1; /* chiếm hết phần còn lại của sidebar */
  overflow-y: auto;
  padding-right: 6px; /* tránh che bởi thanh cuộn */
  max-height: 85vh; /* bỏ giới hạn vh */
  min-height: 250px;
}


.select-to-chat.fullscreen .scrollable-sc-user-list,
.select-to-chat.fullscreen .scrollable-group-chat-list {
  flex: 1; /* chiếm hết phần còn lại của sidebar */
  overflow-y: auto;
    padding: 0 10px;
  max-height: 95vh; /* bỏ giới hạn vh */
   
}
.select-to-chat.fullscreen .member-item {
/*background-color: #171717;*/
   
}

.member-item {
    position: relative;
    overflow: hidden;
    transition: 0.25s;
}

/* ✅ Nếu có cover */
.member-item.has-cover {
    background-image: var(--cover-img);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* ✅ Overlay giúp chữ dễ đọc */
.member-item.has-cover::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.15);
    pointer-events: none;
}

.member-item {
    display: flex;
    align-items: center;
    padding: 6px 10px;
    margin: 5px 0;
    opacity: 0.9;
    border-radius: 8px;
    padding: 3px;
}

.add-member-to-group {
  display: flex;
  flex-direction: column;
  height: 80vh;
  max-height: 80vh;
}


.msg-edited {
  font-size: 11px;
  color: #888;
  margin-left: 4px;
}

.msg-recalled {
  color: #999;
  font-style: italic;
  background: #f5f5f5;
  border-radius: 6px;
  padding: 6px 10px;
}


 
 
/* === Header === */
.sc-edit-header {
  font-size: 16px;
  font-weight: 600;
  color: #222;
  text-align: center;
  margin-bottom: 8px;
}

/* === Input === */
.sc-edit-input {
  width: 90%;
  min-height: 90px;
  border: 1px solid #8e8e8e4f;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  resize: vertical;
  outline: none;
  transition: border 0.2s;
}
.sc-edit-input:focus {
  border-color: #0073aa;
}

/* === Buttons === */
.sc-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.sc-edit-actions button {
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}

 
.sc-edit-save:hover {
  background: #005c87;
}

.sc-edit-cancel {
  background: #eee;
  color: #333;
  transition: background 0.2s;
}
.sc-edit-cancel:hover {
  background: #ddd;
}

/* === Animations === */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes popupSlide {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.edit-message-input {
  overflow-y: auto;
  min-height: 100px;
  border: 1px solid #8e8e8e4f; 
  outline: none;  
  border-radius: 8px;
  padding: 6px;
}
 
 
.body-popup-edit-message {
  position: relative;
}
#edit-msg-cancel,
#edit-msg-save,
#edit-msg-emoji-btn {
    background: white;
    color: black;
    border: 1px solid #8e8e8e4f;
}

.body-popup-edit-message {
    padding: 10px;
} 

button#sc-edit-emoji-btn {
    background: none;
    padding: 0;
    margin: 0;
}


.msg-thread-preview {
  font-size: 13px;
  color: #0073aa;
  margin-top: 6px;
  cursor: pointer;
}
.msg-thread-preview:hover {
  text-decoration: underline;
}

 

/* Tiêu đề trong tin nhắn group */
.msg-title {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 3px;
  color: #004aad;
  word-break: break-word;
}

button#home-page-3dbrute {
    padding: 0;
    color: black;
    margin: 0;
}

/* ===============================
   📌 Group Post Form Styling
   =============================== */

 

.group-post-form .post-input {
  display: block;
  width: 95%;
  padding: 8px 10px;
  margin-bottom: 8px;
  border-radius: 6px;
  border: 1px solid #8e8e8e4f;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s ease;
}

.group-post-form .post-input:focus {
  border-color: #0073aa;
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}



.group-post-form .post-tags {
  font-style: italic;
  color: #444;
}

/* Nút Create Post */
#create-post-btn {
  display: none;
  text-align: center;
}

#create-post-btn button {
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease;
    text-transform: uppercase;
    background-color: #fff;
    color: red;
    padding: 8px;
    margin: 0;
    margin-left: 20px;
}

 

/* Responsive tweak */
@media (max-width: 600px) {
  .group-post-form .post-input {
    width: 100%;
  }
  #create-post-btn button {
    font-size: 18px;
    padding: 8px 12px;
  }
}

.msg-tags {
  margin: 4px 0 6px;
}

.msg-tag {
  display: inline-block;
  background: #f0f2f5;
  color: #555;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 12px;
  margin-right: 4px;
}

.forum-item {
  border-left: 3px solid #4a90e2;
  background: #f9fbff;
}
.forum-item .forum-icon {
  color: #4a90e2;
  font-size: 20px;
  margin-right: 8px;
}

form#group-post-form {
    width: 87%;
    margin: 0 auto;
    padding-top: 10px;
    margin-top: 10px;
}




/* === Profile container === */
.chat-author-head {
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #8e8e8e4f;
  padding-bottom: 10px;
  margin: 12px;
  text-align: center;
}
.chat-author-name {
    font-size: 20px;
}
img.chat-author-avatar {
    border-radius: 50%;
    object-fit: cover;
    aspect-ratio: 1 / 1;
    text-align: center;
    max-height: 150px;
}
.chat-author-bio {
    line-height: 2;
}
.chat-author-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.msg-action-menu {
  pointer-events: auto;
}
.msg-reaction-picker {
  pointer-events: auto;
}
.group-parent .chat-name {
  font-weight: 600;
}

.group-child {
    opacity: 0.9;
    border-radius: 8px;
    border: 1px solid #8e8e8e4f;
    margin-bottom: 5px;
}
.select-to-chat.fullscreen .group-child {
    /*background-color: #171717;*/
} 

 

.chat-left-menu {
  width: 50px;
  border-right: 1px solid #8e8e8e4f;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 10px;
  gap: 10px;
}

.chat-menu-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 12px;
  background: none;
  cursor: pointer;
  font-size: 22px;
  color: #555;
  transition: all 0.2s ease;
  padding: 0;
}
.chat-menu-btn:hover {
  background: #eee;
}
.chat-menu-btn.active {
  background: #4a7d91;
  color: white;
}

.hash-prefix {
    margin-right: 10px;
    font-size: 16px;
} 
.group-chat-text {
    display: inline-flex;  
}

.group-cover {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  margin: 10px 0;
}

.group-cover-img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  display: block;
}

.group-cover-title {
  position: absolute;
  bottom: 6px;
  left: 10px;
  color: white;
  font-weight: 600;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}

/* Avatar container */
.chat-avatar-container {
  position: relative; /* Đảm bảo dấu tròn được căn chỉnh theo ảnh */
  width: 30px;  /* Kích thước của avatar */
  height: 30px;
  display: inline-block;
  margin-right: 8px;
}

/* Avatar */
.avatar-list-chat {
  width: 100%;  /* Đảm bảo ảnh chiếm hết diện tích của phần tử cha */
  height: 100%;
  border-radius: 50%; /* Avatar hình tròn */
  display: block; /* Đảm bảo ảnh được hiển thị đúng */
 
    box-sizing: border-box;  
}

/* Dấu tròn trạng thái */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #aeaeae;
    position: absolute;
    top: 0;
    right: 0;
    border: 1px solid #fff;
    z-index: 10;
}

.status-dot.online {
  background-color: #38d538; /* Màu xanh cho trạng thái online */
}


.placeholder-group-chat-list {
    display: flex;
    flex-direction: column;
    gap: 20px; /* Khoảng cách giữa các dòng */
    padding: 10px;
}
.placeholder-cover-image {
    height: 100px; /* Chiều cao ảnh bìa */
    background-color: #e0e0e0;
    border-radius: 8px;
    margin-bottom: 20px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    animation: loading-shimmer 1.5s infinite ease-in-out;
}
.placeholder-item-title {
    height: 20px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    animation: loading-shimmer 1.5s infinite ease-in-out;
    border-radius: 8px;
}

.chat-section-header{
        padding: 10px 14px;
        font-weight: 700;
        font-size: 13px;
        text-transform: uppercase;
        color: #666;
        letter-spacing: .5px;
}
span.chat-popup-head-title {
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    color: #666;
}
.select-to-chat.fullscreen .search-messages-forum{
  width: 310px;
} 

.search-messages-forum {
  width: 110px;
  margin-left: 20px;
} 


input#search-keyword-chat-forum {
    width: 90%;
}
.chat-notification-count {
    position: absolute;
    top: 0;
    right: 0;
    background-color: red;
    color: white;
    font-size: 12px;
    font-weight: bold;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    text-align: center;
    line-height: 18px;
    display: none; /* Ẩn mặc định nếu không có thông báo */
}

#btn-notifications {
    position: relative;
}
/* Popup Modal Styling */
.chat-notifications-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    max-height: 400px;
    background-color: #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 8px;
    overflow-y: auto;
    z-index: 1000;
}

.chat-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#chat-close-notifications {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
}

.chat-notification-item {
    padding: 10px;
    border-bottom: 1px solid #ddd;
    margin-bottom: 5px;
}

.chat-notification-item:hover {
    background-color: #f1f1f1;
}