﻿/* â”€â”€â”€ Members pane â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
#members-pane {
  width: 240px;
  flex-shrink: 0;
  background: var(--surface0);
  border-left: 1px solid var(--surface1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  user-select: none;
}

.members-pane-header {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--subtext0);
  border-bottom: 1px solid var(--surface1);
  flex-shrink: 0;
  gap: 0.5rem;
}
.members-pane-header-title {
  flex: 1;
}
.members-pane-header-counts {
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0;
  text-transform: none;
  font-size: 0.72rem;
}
.members-pane-header-count {
  display: flex;
  align-items: center;
  gap: 4px;
}
.members-pane-header-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.members-pane-header-dot.online  { background: #3ba55c; }
.members-pane-header-dot.offline { background: #747f8d; }

#members-pane-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0;
}

.members-pane-group-label {
  padding: 1rem 0.75rem 0.25rem;
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--subtext0);
}

.members-pane-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  margin: 1px 0.3rem;
  cursor: default;
  transition: background 0.1s;
}
.members-pane-row:hover { background: var(--surface1); }

.members-pane-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  overflow: hidden;
}
.members-pane-avatar img { width: 100%; height: 100%; object-fit: cover; }

.members-pane-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--subtext0);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.icon-btn.active {
  color: var(--primary-text);
  background: var(--surface1);
}

/* ─── Status badges ──────────────────────────────── */
.avatar-wrap {
  position: relative;
  flex-shrink: 0;
  display: inline-flex;
}
.status-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid var(--surface0);
  transition: width 0.2s ease, height 0.2s ease, border-radius 0.2s ease,
              bottom 0.2s ease, right 0.2s ease, border 0.2s ease;
}
.status-badge[data-status="online"]    { background: #57f287; }
.status-badge[data-status="invisible"] { background: #747f8d; }
.status-badge[data-status="offline"]   { background: #747f8d; }

/* Offline: small black dot in the centre */
.status-badge[data-status="offline"]::after,
.status-badge[data-status="invisible"]::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #000;
}

/* Idle: crescent moon — yellow circle with a surface-coloured bite taken out */
.status-badge[data-status="idle"] { background: #faa61a; }
.status-badge[data-status="idle"]::after {
  content: '';
  position: absolute;
  top: -1px;
  right: -1px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--surface0);
}

/* DND: red circle with a black dash through the centre */
.status-badge[data-status="dnd"] { background: #ed4245; }
.status-badge[data-status="dnd"]::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 2px;
  border-radius: 1px;
  background: #000;
}

/* Typing: morphs badge into a wide pill with three animated dots */
.status-badge[data-typing="true"] {
  width: 22px;
  height: 9px;
  border-radius: 5px;
  border: none;
  bottom: -3px;
  right: -5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  overflow: hidden;
  transform: translateZ(0); /* force compositing layer so overflow clips cleanly */
}
.status-badge[data-typing="true"]::after { display: none; }
.status-badge[data-typing="true"] .typing-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #000;
  flex-shrink: 0;
  image-rendering: pixelated;
  animation: typing-bounce 1.2s ease-in-out infinite;
}
.status-badge[data-typing="true"] .typing-dot:nth-child(2) { animation-delay: 0.2s; }
.status-badge[data-typing="true"] .typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30%           { transform: translateY(-2px); }
}

/* Status dot for context menu items */
.status-dot {
  position: relative;
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot[data-status="online"]    { background: #57f287; }
.status-dot[data-status="invisible"] { background: #747f8d; }
.status-dot[data-status="offline"]   { background: #747f8d; }

/* Idle dot: crescent */
.status-dot[data-status="idle"] { background: #faa61a; }
.status-dot[data-status="idle"]::after {
  content: '';
  position: absolute;
  top: -1px;
  right: -1px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--surface0);
}

/* DND dot: dash */
.status-dot[data-status="dnd"] { background: #ed4245; }
.status-dot[data-status="dnd"]::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 2px;
  border-radius: 1px;
  background: #000;
}

.member-owner-crown {
  display: inline-flex;
  align-items: center;
  margin-left: 3px;
  color: #faa61a;
  vertical-align: middle;
}

/* ─── Profile popup ──────────────────────────────────────────────── */
#profile-popup {
  position: fixed;
  z-index: 500;
  width: 280px;
  background: var(--surface0);
  border: 1px solid var(--surface1);
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  overflow: hidden;
  animation: modal-in 0.12s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.pp-banner {
  height: 72px;
  overflow: hidden;
  position: relative;
}
.pp-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pp-banner-default { background: var(--surface2); }

.pp-body {
  padding: 0 14px 14px;
}

.pp-avatar-row {
  margin-top: -28px;
  margin-bottom: 8px;
}

.pp-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--surface2);
  border: 4px solid var(--surface0);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  flex-shrink: 0;
}
.pp-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Make the status badge larger in the popup */
#profile-popup .status-badge {
  width: 14px;
  height: 14px;
  border-width: 3px;
  bottom: 1px;
  right: 1px;
}

.pp-display-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pp-username {
  font-size: 0.8rem;
  color: var(--subtext0);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pp-custom-status {
  font-size: 0.78rem;
  color: var(--subtext1);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pp-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--subtext0);
  margin: 10px 0 4px;
}

.pp-bio {
  font-size: 0.82rem;
  color: var(--subtext1);
  line-height: 1.45;
  word-break: break-word;
}

.pp-member-since {
  font-size: 0.82rem;
  color: var(--subtext1);
}

.pp-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}

.pp-role-pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--subtext0);
  color: var(--subtext0);
  background: transparent;
}

.pp-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 12px;
}

.pp-action-btn {
  font-size: 0.82rem;
  padding: 0.3rem 0.8rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

/* Clickable avatars / author names in chat */
.avatar.clickable            { cursor: pointer; }
.message-author.clickable    { cursor: pointer; }
.avatar.clickable:hover      { opacity: 0.85; }
.message-author.clickable:hover { text-decoration: underline; }
.members-pane-row.clickable  { cursor: pointer; }

