/*
 * user-detail.css — Kullanıcı ayrıntıları penceresi. Kimlik + durum satırı +
 * sekmeler sabit, içerik kayar; yükseklik sabit (sekme değişince zıplamaz).
 * Döngü yok. Tasarım: docs/design-system.md §7.35
 */

.dlg.ud { height: min(88vh, 800px); max-height: none; }

/* ---- kimlik: kapak (banner) + üstüne binen avatar ---- */
.ud-hero {
  position: relative;
  flex-shrink: 0;
}
.ud-cover {
  position: relative;
  height: clamp(88px, 15vh, 140px);
  overflow: hidden;
  background:
    radial-gradient(120% 140% at 15% 0%, color-mix(in srgb, var(--accent) 38%, transparent) 0%, transparent 60%),
    linear-gradient(180deg, #1c161a 0%, #141013 100%);
}
.ud-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Kapağın altı pencere yüzeyine erir; isim her banner'da okunur */
.ud-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 16, 19, 0) 45%, rgba(20, 16, 19, 0.85) 92%, #141013 100%);
}
.ud-hero-row {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 16px;
  margin-top: -44px;
  padding: 0 64px 16px 24px;
}
/* Kapak üstünde kapat düğmesi okunur kalsın */
.ud-hero .dlg-x { background: rgba(10, 7, 9, 0.55); color: #ffffff; }
.ud-ava {
  position: relative;
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  flex-shrink: 0;
  border-radius: 20px;
  background: #221b20;
  box-shadow: 0 0 0 4px #141013;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--wf-text-2);
}
.ud-ava img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.ud-ava i {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #4a4245;
  box-shadow: 0 0 0 3px #141013;
}
.ud-ava i.is-on { background: var(--wf-success); }
.ud-id { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding-bottom: 4px; }
.ud-name { display: flex; align-items: center; gap: 9px; min-width: 0; }
.ud-name h3 {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--wf-font-display);
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.005em;
}
.ud-role {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  height: 24px;
  padding: 0 9px 0 7px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--c) 15%, transparent);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--c);
}
.ud-role svg, .ud-role .ri-img { width: 13px; height: 13px; }
.ud-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-width: 0; font-size: 0.86rem; color: var(--wf-text-3); }
.ud-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 2px 6px;
  margin-left: -6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font: inherit;
  color: var(--wf-text-2);
  cursor: pointer;
  transition: background-color var(--wf-dur-hover) ease, color var(--wf-dur-hover) ease;
}
.ud-copy svg { width: 13px; height: 13px; opacity: 0.6; flex-shrink: 0; }

/* ---- tek bakışta durum ---- */
.ud-facts {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  flex-shrink: 0;
  margin: 0 24px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.ud-fact {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
  padding: 12px 16px 13px;
}
.ud-fact + .ud-fact { box-shadow: -1px 0 0 rgba(255, 255, 255, 0.06); }
.ud-fact > span { font-size: 0.74rem; font-weight: 500; color: var(--wf-text-4); }
.ud-fact > b {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.35;
}
.ud-fact > b svg, .ud-fact > b .ri-img { width: 14px; height: 14px; flex-shrink: 0; }
.ud-fact > em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  font-style: normal;
  font-size: 0.76rem;
  line-height: 1.35;
  color: var(--wf-text-4);
}
.ud-tier { color: var(--c); }
.ud-muted { color: var(--wf-text-3); }
.ud-ok { color: #86efac; }
.ud-warn { color: #fde68a; }
.ud-state { color: var(--wf-text-2); }
.ud-state i { width: 7px; height: 7px; border-radius: 50%; background: #4a4245; flex-shrink: 0; }
.ud-state.is-on { color: var(--wf-text-1); }
.ud-state.is-on i { background: var(--wf-success); box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.15); }
.ud-state.is-banned { color: #fda4af; }
.ud-inline-btn {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  color: #fde68a;
  text-decoration: underline;
  text-decoration-color: rgba(253, 230, 138, 0.35);
  text-underline-offset: 3px;
  cursor: pointer;
}
.ud-ban {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin: 10px 24px 0;
  padding: 9px 10px 9px 13px;
  border-radius: 11px;
  background: rgba(251, 113, 133, 0.08);
  font-size: 0.84rem;
  color: #fecdd3;
}
.ud-ban > svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--wf-danger); }
.ud-ban > span { flex: 1; min-width: 0; }
.ud-ban b { color: #ffe4e6; }

/* ---- sekmeler ---- */
.ud-tabs {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  margin: 14px 24px 0;
  padding-bottom: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.ud-tabs button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--wf-text-3);
  cursor: pointer;
  transition: color var(--wf-dur-hover) ease;
}
.ud-tabs button em {
  font-style: normal;
  font-size: 0.74rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--wf-text-4);
}
/* Etkin sekme: altta fildişi çizgi */
.ud-tabs button[aria-selected='true'] { color: var(--wf-text-1); }
.ud-tabs button[aria-selected='true']::after {
  content: '';
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: #f4ecea;
}

/* ---- içerik ---- */
.ud .dlg-body { padding: 18px 24px 22px; }
.ud-panel[hidden] { display: none; }
.ud-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ud-card {
  min-width: 0;
  padding: 14px 16px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.055);
}
.ud-panel > .ud-card + .ud-card,
.ud-grid + .ud-card { margin-top: 12px; }

.ud-dl { margin: 0; }
.ud-dl > div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 38px;
  padding: 4px 0;
}
.ud-dl > div + div { border-top: 1px solid rgba(255, 255, 255, 0.045); }
.ud-dl dt { font-size: 0.8rem; font-weight: 500; color: var(--wf-text-4); }
.ud-dl dd {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 0;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--wf-text-1);
}
.ud-dl dd em { font-style: normal; font-size: 0.78rem; color: var(--wf-text-4); }
.ud-ellipsis { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ud-mono { font-family: var(--wf-font-mono, ui-monospace, monospace); font-size: 0.8rem; color: var(--wf-text-2); }
.ud-link {
  flex-shrink: 0;
  margin-left: auto;
  padding: 3px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--wf-text-3);
  cursor: pointer;
  transition: background-color var(--wf-dur-hover) ease, color var(--wf-dur-hover) ease;
}

.ud-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ud-stat {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
  padding: 11px 12px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.025);
}
.ud-stat-ico {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--c) 14%, transparent);
  color: var(--c);
}
.ud-stat-ico svg { width: 15px; height: 15px; }
.ud-stat b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--wf-font-display);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}
.ud-stat > span:last-child { font-size: 0.74rem; color: var(--wf-text-4); }

.ud-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.ud-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 3px 10px 3px 4px;
  border: 0;
  border-radius: 9px;
  background: color-mix(in srgb, var(--c, #f4ecea) 11%, transparent);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: color-mix(in srgb, var(--c, #f4ecea) 70%, #ffffff);
}
.ud-pill .reward-badge { --badge-size: 22px; }
.ud-pill .reward-aura-stack { display: none; }
.ud-social { padding-left: 9px; cursor: pointer; }
.ud-social svg { width: 15px; height: 15px; color: var(--c); }
.ud-social span { color: var(--wf-text-1); }
.ud-social em { font-style: normal; font-weight: 500; color: var(--wf-text-4); }
.ud-bio { font-size: 0.88rem; line-height: 1.6; color: var(--wf-text-2); overflow-wrap: anywhere; }

.ud-row { display: flex; align-items: center; gap: 12px; }
.ud-row-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.ud-row-text b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.9rem; font-weight: 700; line-height: 1.35; }
.ud-row-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.78rem; line-height: 1.4; color: var(--wf-text-4); }
.ud-feat-group { margin: 14px 0 8px; font-size: 0.76rem; font-weight: 600; color: var(--wf-text-4); }
.ud-feat-group:first-child { margin-top: 0; }

.ud-meter {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.025);
}
.ud-meter-text { display: flex; align-items: baseline; gap: 10px; }
.ud-meter-text b { font-family: var(--wf-font-display); font-size: 1.1rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.ud-meter-text span { font-size: 0.8rem; color: var(--wf-text-3); }
.ud-meter-bar { height: 4px; overflow: hidden; border-radius: 2px; background: rgba(255, 255, 255, 0.07); }
.ud-meter-bar i { display: block; height: 100%; transform-origin: left center; background: #7cc4ff; }
.ud-meter.is-full .ud-meter-bar i { background: var(--wf-warning); }
.ud-meter.is-full .ud-meter-text span { color: #fde68a; }

.ud-list { display: flex; flex-direction: column; }
.ud-item { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 0; }
.ud-item + .ud-item { border-top: 1px solid rgba(255, 255, 255, 0.045); }
.ud-item-ico {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--wf-text-3);
}
.ud-item-ico svg { width: 15px; height: 15px; }
.ud-ev.green { color: var(--wf-success); background: rgba(52, 211, 153, 0.1); }
.ud-ev.gold { color: #f0c36a; background: rgba(240, 195, 106, 0.1); }
.ud-ev.red { color: var(--wf-danger); background: rgba(251, 113, 133, 0.1); }
.ud-ev.blue { color: #7cc4ff; background: rgba(124, 196, 255, 0.1); }
.ud-item time { flex-shrink: 0; font-size: 0.78rem; color: var(--wf-text-4); font-variant-numeric: tabular-nums; }
.ud-dot { width: 8px; height: 8px; margin: 0 12px; flex-shrink: 0; border-radius: 50%; background: #4a4245; }
.ud-dot.is-on { background: var(--wf-success); box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.15); }
.ud-icon-btn {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--wf-text-4);
  cursor: pointer;
  transition: background-color var(--wf-dur-hover) ease, color var(--wf-dur-hover) ease;
}
.ud-icon-btn svg { width: 15px; height: 15px; }
.ud-empty { padding: 14px 2px; font-size: 0.86rem; color: var(--wf-text-4); }
.dlg-foot-note svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 6px; }

@media (hover: hover) and (pointer: fine) {
  .ud-copy:hover { background: rgba(255, 255, 255, 0.06); color: var(--wf-text-1); }
  .ud-tabs button[aria-selected='false']:hover { color: var(--wf-text-1); }
  .ud-link:hover { background: rgba(255, 255, 255, 0.07); color: var(--wf-text-1); }
  .ud-icon-btn:hover { background: rgba(251, 113, 133, 0.1); color: #fda4af; }
  .ud-social:hover { background: color-mix(in srgb, var(--c) 18%, transparent); }
  .ud-inline-btn:hover { text-decoration-color: currentColor; }
}

@media (max-width: 900px) {
  .ud-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ud-fact:nth-child(4) { box-shadow: none; }
  .ud-fact:nth-child(n + 4) { border-top: 1px solid rgba(255, 255, 255, 0.06); }
  .ud-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  /* Telefonda pencerenin tamamı kayar; sekmeler üstte, işlemler altta yapışık */
  .dlg.ud { height: 94dvh; overflow-y: auto; overscroll-behavior: contain; }
  .ud .dlg-body { flex: none; overflow: visible; }
  .ud-tabs { position: sticky; top: 0; z-index: 2; background: #141013; }
  .ud .dlg-foot { position: sticky; bottom: 0; z-index: 2; background: #17131a; }
  .ud-fact { padding: 9px 12px 10px; }
  .ud-cover { height: 84px; }
  .ud-hero-row { margin-top: -32px; padding: 0 16px 12px; gap: 12px; }
  .ud-ava { width: 60px; height: 60px; border-radius: 16px; }
  .ud-name h3 { font-size: 1.2rem; }
  .ud-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0 16px; }
  .ud-fact:nth-child(n) { box-shadow: none; border-top: 0; }
  .ud-fact:nth-child(even) { box-shadow: -1px 0 0 rgba(255, 255, 255, 0.06); }
  .ud-fact:nth-child(n + 3) { border-top: 1px solid rgba(255, 255, 255, 0.06); }
  .ud-fact:last-child { grid-column: 1 / -1; box-shadow: none; }
  .ud-ban { margin: 10px 16px 0; }
  .ud-tabs { margin: 12px 16px 0; overflow-x: auto; scrollbar-width: none; }
  .ud-tabs::-webkit-scrollbar { display: none; }
  .ud .dlg-body { padding: 14px 16px 18px; }
  .ud-stats { grid-template-columns: minmax(0, 1fr); }
  .ud-dl > div { grid-template-columns: 92px minmax(0, 1fr); }
}
