/* ===== Slider kiểu Messenger (mượt + ẩn thanh cuộn) ===== */
.cm2-chat-slider-wrap {
  position: relative;
  padding: 8px 0;
}
.chat-slider-container {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  white-space: nowrap;
  border-radius: 10px;
  background: #f8f9fa;
  padding: 10px;
  scrollbar-width: none;        /* Firefox */
}
.chat-slider-container::-webkit-scrollbar { display: none; } /* Chrome/Safari */

.chat-slider {
  display: inline-flex;
  gap: 12px;
  scroll-snap-type: x proximity;
  user-select: none;            /* hỗ trợ drag */
}

/* User item */
.chat-user {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 70px;
  scroll-snap-align: start;
  cursor: grab;
}
.chat-user:active { cursor: grabbing; }

/* Avatar */
.chat-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #007bff;
  background: #eaeaea; /* màu nền khi lazy */
  display: block;
}
.chat-user p {
  font-size: 13px;
  text-align: center;
  margin: 0;
  max-width: 80px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Nút điều hướng (tuỳ chọn) */
.cm2-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px; height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,.06);
  cursor: pointer;
  display: grid; place-items: center;
}
.cm2-nav:hover { background: rgba(0,0,0,.12); }
.cm2-nav:active { background: rgba(0,0,0,.18); }
.cm2-prev { left: 6px; }
.cm2-next { right: 6px; }

/* Fade mép như Messenger */
.cm2-fade-left,
.cm2-fade-right {
  position: absolute;
  top: 0; bottom: 0;
  width: 22px;
  pointer-events: none; /* ❗ đảm bảo không chặn click */
}
.cm2-fade-left  { left: 0;  background: linear-gradient(90deg, #f8f9fa, transparent); }
.cm2-fade-right { right: 0; background: linear-gradient(-90deg, #f8f9fa, transparent); }

/* ===== Notification popup list ===== */
#notification-messages .notification-item,
#notification2-messages .notification-item {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 8px;
  padding: 8px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  align-items: center;
}
#notification-messages .notification-item.unread,
#notification2-messages .notification-item.unread {
  background:#fff7f0;
}
#notification-messages .notification-item img,
#notification2-messages .notification-item img {
  width: 70px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  display:block;
}
#notification-messages .notification-content h4,
#notification2-messages .notification-content h4 {
  font-size: 14px;
  margin: 0 0 2px;
  font-weight: 600;
}
#notification-messages .notification-content p,
#notification2-messages .notification-content p {
  font-size: 13px;
  margin: 0 0 2px;
  color:#333;
}
#notification-messages .notification-content span,
#notification2-messages .notification-content span {
  font-size: 12px;
  color: #777;
}

/* ===== FIX: overlay ẩn không chặn ===== */
.share-options.hidden,
#notification-messages.hidden,
#notification2-messages.hidden {
  display: none !important;
  pointer-events: none !important;
}

/* ===== Mobile Fix: bỏ cursor grab ===== */
@media (hover: none) and (pointer: coarse) {
  .chat-user {
    cursor: default !important;   /* ❗ không bị hiểu là drag trên Android */
  }
}

/* ===== Chỉ áp dụng cho Safari iOS ===== */
@supports (-webkit-touch-callout: none) {
  .chat-slider-container {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: auto; /* iOS không hỗ trợ smooth tốt */
  }
  .chat-user p {
    font-size: 12.5px;
    line-height: 1.3;
  }
  .cm2-fade-left,
  .cm2-fade-right {
    width: 28px; /* rộng hơn một chút để che mép trên Safari */
  }
  #notification2-messages .notification-content span {
    font-size: 11.5px;
    color: #888;
  }
}
