/* @tag trong tin + danh sach chon thanh vien + trinh phat tin nhan thoai */

/* ---------- @ten / @All trong tin nhan ---------- */
.msg-mention { color: var(--primary); font-weight: 600; }
.msg-mention.is-me { background: rgba(0, 104, 255, .12); border-radius: 4px; padding: 0 2px; }
.msg.out .msg-mention { color: #fff; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .55); text-underline-offset: 2px; }
.msg.out .msg-mention.is-me { background: rgba(255, 255, 255, .2); }

/* ---------- Danh sach chon thanh vien khi go "@" ---------- */
.mention-popup {
  margin: 0 16px 6px; max-height: 280px; overflow-y: auto; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); flex-shrink: 0;
  animation: mention-in .14s var(--ease);
}
@keyframes mention-in { from { opacity: 0; transform: translateY(6px); } }
.mention-item {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 14px;
}
.mention-item:hover { background: var(--surface-hover); }
.mention-item.active { background: var(--primary-soft); }
.mention-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--grad-soft); color: var(--primary); font-weight: 700; font-size: 13px;
}
.mention-avatar.all { background: var(--grad); color: #fff; font-size: 15px; }
.mention-avatar img { width: 100%; height: 100%; object-fit: cover; }
.mention-name { font-weight: 600; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mention-hint { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
.mention-empty { padding: 10px; font-size: 13px; color: var(--muted); }

/* ---------- Trinh phat tin nhan thoai ---------- */
.msg-voice {
  display: flex; align-items: center; gap: 10px; min-width: 230px; max-width: 300px; padding: 2px 0;
}
.voice-play-btn {
  width: 34px; height: 34px; border-radius: 50%; border: none; flex-shrink: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--grad); color: #fff; box-shadow: var(--glow); transition: transform .15s var(--ease);
}
.voice-play-btn:hover { transform: scale(1.07); }
.voice-play-btn svg { margin-left: 1px; }
.msg-voice.playing .voice-play-btn svg { margin-left: 0; }
.voice-wave { flex: 1; height: 26px; display: flex; align-items: center; gap: 2px; cursor: pointer; }
.voice-wave span {
  flex: 1; min-width: 2px; border-radius: 2px; background: rgba(0, 104, 255, .28);
  transition: background .15s;
}
.voice-wave span.played { background: var(--primary); }
.voice-time { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--text-2); min-width: 32px; text-align: right; }
.voice-download {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted); opacity: .7; transition: opacity .15s, background .15s;
}
.voice-download:hover { opacity: 1; background: rgba(0, 104, 255, .08); color: var(--primary); }
.msg.out .voice-play-btn { background: #fff; color: var(--primary); box-shadow: none; }
.msg.out .voice-wave span { background: rgba(255, 255, 255, .4); }
.msg.out .voice-wave span.played { background: #fff; }
.msg.out .voice-time, .msg.out .voice-download { color: rgba(255, 255, 255, .9); text-decoration: none; }

/* Trinh phat ghi am khong tran bong bong (nhat la tin gui di) */
.msg-voice { min-width: 0; width: min(270px, 52vw); max-width: 100%; }
.voice-wave { min-width: 0; overflow: hidden; }
:where(.modal-box) button:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; filter: none; }
