/*
 * dm-moderation.css — DM Moderasyonu. Liste: Kullanıcılar kalıbı (.usr) +
 * dört özet kutusu. Sohbet penceresi: solda katılımcılar ve sohbet bilgisi,
 * sağda gün ayraçlı, gönderene göre gruplanmış salt okunur döküm. Döngü yok.
 * Tasarım: docs/design-system.md §7.37
 */

#view-dm-moderation {
  font-family: var(--wf-font-text);
  color: var(--wf-text-1);
}
.usr.dmm {
  --usr-cols: minmax(230px, 1.5fr) minmax(220px, 2.3fr) 64px 140px 104px 132px;
}
#view-dm-moderation button:focus-visible {
  outline: 2px solid rgba(244, 236, 234, 0.6);
  outline-offset: -2px;
}

/* ============================================================
   [LİSTE] çift avatar + adlar · son mesaj · sayı · durum · zaman
   ============================================================ */
.dmm-pair {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 10px 0;
}
/* İki avatar çapraz üst üste: aynı satırda iki kişi olduğu bir bakışta okunur */
.dmm-avas { position: relative; width: 50px; height: 40px; flex-shrink: 0; }
.dmm-avas .usr-ava {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  font-size: 0.66rem;
}
.dmm-avas .usr-ava:first-child { top: 0; left: 0; }
.dmm-avas .usr-ava:last-child { right: 0; bottom: 0; background: #2a2227; box-shadow: 0 0 0 2.5px #110d0f; }
.dmm-names { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 0.9rem; line-height: 1.4; }
.dmm-names b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; color: var(--wf-text-1); }
.dmm-names svg { width: 13px; height: 13px; flex-shrink: 0; color: var(--wf-text-4); }

.dmm-last {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  font-size: 0.86rem;
  color: var(--wf-text-3);
}
.dmm-from { flex-shrink: 0; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--wf-text-2); }
.dmm-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dmm-edited { flex-shrink: 0; font-style: normal; font-size: 0.72rem; color: var(--wf-text-4); }
.dmm-row.is-unread .dmm-text { color: var(--wf-text-1); }
.dmm mark,
.dmt mark { padding: 0 2px; border-radius: 4px; background: rgba(240, 180, 90, 0.22); color: #f6c98a; }

.dmm-count b {
  font-family: var(--wf-font-display);
  font-size: 0.95rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--wf-text-1);
}
.dmm-state { display: inline-flex; align-items: center; gap: 7px; font-size: 0.84rem; font-weight: 600; white-space: nowrap; }
.dmm-state svg { width: 15px; height: 15px; }
.dmm-state.is-read { color: var(--wf-text-3); }
.dmm-state.is-read svg { color: #7cc4ff; }
.dmm-state.is-unread { color: #f6c98a; }
.dmm-state i { width: 7px; height: 7px; border-radius: 50%; background: #f0b45a; box-shadow: 0 0 0 3px rgba(240, 180, 90, 0.15); }

/* ============================================================
   [SOHBET PENCERESİ] solda katılımcılar, sağda döküm
   ============================================================ */
.dlg.dmt { height: min(86vh, 820px); }
.dmt .dlg-head .dmm-avas.is-lg { width: 60px; height: 46px; }
.dmt .dmm-avas.is-lg .usr-ava { width: 34px; height: 34px; border-radius: 11px; font-size: 0.76rem; }
.dmt .dmm-avas.is-lg .usr-ava:last-child { box-shadow: 0 0 0 3px #141013; }
.dmt-and { margin: 0 2px; font-family: var(--wf-font-text); font-size: 0.95rem; font-weight: 500; color: var(--wf-text-3); }
.dmt .dlg-body {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  padding: 0;
  overflow: hidden;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.dmt-side,
.dmt-log {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: auto;
  scrollbar-color: auto;
}
.dmt-side::-webkit-scrollbar,
.dmt-log::-webkit-scrollbar { width: 12px; }
.dmt-side::-webkit-scrollbar-button,
.dmt-log::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
.dmt-side::-webkit-scrollbar-thumb,
.dmt-log::-webkit-scrollbar-thumb {
  border: 4px solid transparent;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1) padding-box;
}
.dmt-side {
  display: flex;
  flex-direction: column;
  padding: 16px 16px 18px 22px;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}
.dmt-people { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
/* Sol şerit rengi = o kişinin baloncuk rengi (gri: sol, mavi: sağ) */
.dmt-person {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 10px 6px 10px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}
.dmt-person::before {
  content: '';
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #9b8f86;
}
.dmt-person.is-b::before { background: #7cc4ff; }
.dmt-person .usr-ava { width: 40px; height: 40px; }
.dmt-person .usr-ava i { box-shadow: 0 0 0 2.5px #1b171a; }
.dmt-person-text { display: flex; flex-direction: column; flex: 1; min-width: 0; font-size: 0.78rem; line-height: 1.45; color: var(--wf-text-3); }
.dmt-person-text > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dmt-person-text b { font-size: 0.9rem; font-weight: 700; color: var(--wf-text-1); }
.dmt-person-meta { font-size: 0.74rem; color: var(--wf-text-4); }
.dmt-role { margin-left: 6px; font-weight: 700; color: var(--c); }
.dmt-facts { display: flex; flex-direction: column; margin: 0 0 16px; }
.dmt-facts div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.82rem;
}
.dmt-facts div:last-child { border-bottom: 0; }
.dmt-facts dt { color: var(--wf-text-3); }
.dmt-facts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; color: var(--wf-text-1); }

/* Döküm */
.dmt-log { padding: 6px 22px 20px; }
.dmt-older { display: flex; margin: 10px auto 2px; }
.dmt-start { padding: 12px 0 0; font-size: 0.76rem; text-align: center; color: var(--wf-text-4); }
.dmt-day {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 6px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--wf-text-4);
}
.dmt-day::before,
.dmt-day::after { content: ''; flex: 1; height: 1px; background: rgba(255, 255, 255, 0.06); }
.dmt-group { display: flex; align-items: flex-end; gap: 10px; max-width: 78%; margin-top: 12px; }
.dmt-group.is-b { flex-direction: row-reverse; margin-left: auto; }
.dmt-ava {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.07);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--wf-text-2);
}
.dmt-ava img { width: 100%; height: 100%; object-fit: cover; }
.dmt-stack { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.is-b .dmt-stack { align-items: flex-end; }
.dmt-who { padding: 0 4px 1px; font-size: 0.76rem; font-weight: 600; color: var(--wf-text-3); }
.dmt-msg {
  max-width: 100%;
  padding: 8px 12px 5px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
}
.is-a .dmt-msg { border-bottom-left-radius: 5px; }
.is-b .dmt-msg { border-bottom-right-radius: 5px; background: rgba(124, 196, 255, 0.13); }
.dmt .dmt-msg p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--wf-text-1);
}
.dmt-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 1px;
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  color: var(--wf-text-4);
}
.dmt-meta em { font-style: normal; }
.dmt-tick { display: grid; }
.dmt-tick svg { width: 14px; height: 14px; }
.dmt-tick.is-read { color: #7cc4ff; }

/* ============================================================
   [DUYARLI]
   ============================================================ */
@media (max-width: 1360px) {
  .usr.dmm { --usr-cols: minmax(210px, 1.4fr) minmax(200px, 2fr) 60px 132px 100px 124px; }
}
@media (max-width: 1180px) {
  .usr.dmm { --usr-cols: minmax(200px, 1.4fr) minmax(180px, 2fr) 128px 96px 124px; }
  .dmm .dmm-h-num, .dmm .dmm-count { display: none; }
}
@media (max-width: 960px) {
  .dmt .dlg-body { grid-template-columns: 240px minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .dmm .usr-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 12px;
    row-gap: 6px;
    padding: 12px 12px 12px 14px;
  }
  .dmm .dmm-pair { flex: 1 1 calc(100% - 48px); padding: 0; }
  .dmm .usr-actions { flex: 0 0 auto; order: 1; }
  .dmm .dmm-last { flex: 1 1 100%; order: 2; }
  .dmm .dmm-count, .dmm .dmm-state, .dmm .usr-seen { display: inline-flex; flex: 0 0 auto; order: 3; font-size: 0.8rem; }
  .dmm .dmm-count b { font-family: var(--wf-font-text); font-size: 0.8rem; color: var(--wf-text-2); }
  .dmm .dmm-count::after { content: '\00a0mesaj'; color: var(--wf-text-3); }
  .dmm .usr-seen { margin-left: auto; color: var(--wf-text-3); }

  .dlg.dmt { height: calc(100dvh - 24px); }
  .dmt .dlg-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .dmt-side { padding: 10px 14px; border-right: 0; border-bottom: 1px solid rgba(255, 255, 255, 0.06); overflow: visible; }
  .dmt-side .dlg-sec-title,
  .dmt-facts,
  .dmt-person-meta { display: none; }
  .dmt-people { flex-direction: row; margin: 0; }
  .dmt-person { flex: 1 1 0; padding: 8px 4px 8px 12px; gap: 9px; }
  .dmt-person .usr-ava { width: 32px; height: 32px; border-radius: 10px; }
  .dmt-log { padding: 4px 14px 16px; }
  .dmt-group { max-width: 90%; }
}
@media (max-width: 480px) {
  .dmt-person .usr-icon-btn { display: none; }
}
