/* ============================================================
 * header.css — Discord kanal üst barı + hesap çubuğu
 * ============================================================ */

/* ---- Kanal üst barı ---- */
.chat-topbar {
  display: flex; align-items: center; gap: 8px;
  height: 48px; min-height: 48px;
  padding: 0 8px 0 16px;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 var(--border);
  flex-shrink: 0; z-index: 2;
}
.chat-topbar .room-header {
  flex: 1; min-width: 0; padding: 0; background: none; border: none;
  height: auto; box-shadow: none;
  display: flex; align-items: center; gap: 8px; overflow: hidden;
}
#roomIcon { color: var(--muted); font-size: 20px; font-weight: 400; flex-shrink: 0; }
.rh-name {
  color: var(--head); font-size: 14px; font-weight: 700; line-height: 20px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}

/* DM için avatar + bilgi */
.rh-dm-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0; overflow: hidden; position: relative;
}
.rh-dm-avatar img { width: 100%; height: 100%; object-fit: cover; }
.rh-dm-dot {
  position: absolute; bottom: -1px; right: -1px;
  width: 9px; height: 9px; border-radius: 50%;
  border: 2px solid var(--topbar-bg); background: var(--offline);
}
.rh-dm-dot.online { background: var(--online); }
.rh-dm-dot.away   { background: var(--idle); }
.rh-dm-dot.dnd    { background: var(--dnd); }
.rh-dm-name  { font-size: 14px; font-weight: 700; color: var(--head); line-height: 1.2; }
.rh-dm-status { font-size: 11px; color: var(--muted); }
.rh-dm-info  { display: flex; flex-direction: column; gap: 0; }

/* ---- Sağ ikon butonları ---- */
.rh-actions { display: flex; align-items: center; gap: 0; flex-shrink: 0; }
.rh-act {
  width: 36px; height: 36px;
  background: none; border: none;
  color: var(--muted); cursor: pointer; padding: 0;
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  transition: color .1s;
}
.rh-act:hover { color: var(--head); }
.rh-act.active { color: var(--head); }

/* ---- Mobil header (sadece mobil) ---- */
header {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: 0 12px; height: 48px;
  display: flex; align-items: center;
  flex-shrink: 0; gap: 8px;
}
.h-btn {
  background: none; border: none; color: var(--muted);
  cursor: pointer; padding: 5px; border-radius: 4px;
  display: flex; align-items: center;
}
.h-btn:hover { color: var(--head); background: var(--hover); }
.h-me { display: flex; align-items: center; gap: 6px; overflow: hidden; flex-shrink: 1; }
.h-me-mobile { display: none; }
.h-me-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px; color: #fff; flex-shrink: 0;
}
.h-me-name {
  font-size: 13px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100px;
}

/* ---- Hesap çubuğu (sol alt, Discord birebir) ---- */
.account-bar {
  margin-top: auto; position: relative;
  display: flex; align-items: center;
  height: 52px; padding: 0 8px;
  background: var(--account-bg); flex-shrink: 0;
  border-top: 1px solid var(--border);
}
.ab-user {
  display: flex; align-items: center; gap: 8px;
  flex: 1; min-width: 0; height: 42px;
  padding: 0 4px; border-radius: 4px; cursor: pointer;
  transition: background .1s;
}
.ab-user:hover { background: var(--hover); }
.ab-avatar-wrap { position: relative; flex-shrink: 0; margin-left: 2px; }
.ab-avatar-wrap .h-me-avatar {
  width: 32px; height: 32px;
  overflow: hidden; font-size: 13px;
}
.ab-avatar-wrap .h-me-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ab-avatar-wrap .status-dot-btn {
  position: absolute; bottom: -2px; right: -2px;
  width: 10px; height: 10px; border-radius: 50%;
  border: 3px solid var(--account-bg);
  cursor: pointer; box-sizing: content-box;
}
.ab-info { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.ab-info .h-me-name { font-size: 14px; font-weight: 600; color: var(--head); max-width: 100%; }
.ab-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ab-controls { display: flex; align-items: center; flex-shrink: 0; }
.ab-btn {
  background: none; border: none; color: var(--muted);
  cursor: pointer; width: 32px; height: 32px;
  border-radius: 4px; display: flex; align-items: center; justify-content: center;
  transition: color .1s, background .1s;
}
.ab-btn:hover { color: var(--head); background: var(--hover); }
.ab-btn.muted { color: var(--dnd); }
.account-bar .status-menu { display: none !important; }

/* ---- Durum noktası butonu ---- */
.status-dot-btn { border-radius: 50%; border: 2px solid var(--border); cursor: pointer; flex-shrink: 0; }
.status-dot-btn.online  { background: var(--online); }
.status-dot-btn.away    { background: var(--idle); }
.status-dot-btn.dnd     { background: var(--dnd); }
.status-dot-btn.offline { background: var(--offline); }
.status-menu {
  position: absolute; bottom: 54px; left: 8px;
  background: var(--popout-bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 4px;
  box-shadow: 0 6px 20px rgba(0,0,0,.4);
  display: none; z-index: 100; min-width: 150px;
}
.status-menu.open { display: block; }
.status-opt {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: 4px;
  cursor: pointer; font-size: 14px; color: var(--text);
}
.status-opt:hover { background: var(--hover); }
.status-opt .sd { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }

/* ---- Server Rail ikonları ---- */
.server-rail { padding: 12px 0; gap: 8px; }
.srv-icon {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--panel); color: var(--text);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 20px; font-weight: 700;
  position: relative; flex-shrink: 0; overflow: hidden;
  transition: border-radius .2s ease, background .2s, color .2s;
}
.srv-icon img { width: 100%; height: 100%; object-fit: cover; }
.srv-icon:hover { border-radius: 16px; background: var(--accent); color: #fff; }
.srv-icon.active { border-radius: 16px; background: var(--accent); color: #fff; }
.srv-icon::before {
  content: ""; position: absolute; left: -16px; top: 50%;
  width: 4px; border-radius: 0 4px 4px 0; background: #fff;
  transition: height .2s, top .2s;
  height: 0; transform: translateY(-50%);
}
.srv-icon:hover::before { height: 20px; }
.srv-icon.active::before { height: 40px; }
.srv-add {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--panel); color: var(--green);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 24px; font-weight: 400; flex-shrink: 0;
  border: none; transition: border-radius .2s, background .2s, color .2s;
}
.srv-add:hover { border-radius: 16px; background: var(--green); color: #fff; }
