/* ═══════════════════════════════════════════════════
   Skritka – User Popout Cards
   Mini profile cards for chat avatars & sidebar members
   ═══════════════════════════════════════════════════ */

/* ─── Popout Container ─── */
.user-popout {
  position: fixed;
  z-index: 1100;
  width: 300px;
  background: var(--bg-dark);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: visible;
  animation: popoutIn 120ms ease-out;
  border: 1px solid var(--bg-lighter);
}

@keyframes popoutIn {
  from { opacity: 0; transform: scale(0.95) translateY(-4px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ─── Banner ─── */
.popout-banner {
  height: 60px;
  position: relative;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow: hidden;
}

.popout-banner-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
}

.popout-action-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  backdrop-filter: blur(4px);
}

.popout-action-btn:hover {
  background: rgba(0, 0, 0, 0.7);
}

.popout-action-btn:disabled {
  cursor: default;
  opacity: 0.7;
}

.popout-action-btn .material-symbols-outlined {
  font-size: 18px;
}

.popout-add-friend {
  color: var(--green);
}

.popout-add-friend.pending,
.popout-friend-status.pending {
  color: var(--yellow);
}

.popout-friend-status {
  color: var(--green);
}

.popout-friend-dropdown {
  position: fixed;
  background: var(--bg-dark);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  padding: 4px;
  min-width: 160px;
  z-index: 1200;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.popout-friend-dropdown .popout-ctx-item:hover {
  background: var(--red);
  color: #fff;
}

/* ─── Avatar ─── */
.popout-avatar-section {
  margin-top: -28px;
  padding: 0 16px;
  position: relative;
  z-index: 1;
}

.popout-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 22px;
  color: #fff;
  border: 4px solid var(--bg-dark);
  position: relative;
}

.popout-status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 3px solid var(--bg-dark);
  background: var(--text-muted);
}

.popout-status-dot.online {
  background: var(--green);
}

.popout-status-dot.away,
.popout-status-dot.idle {
  background: var(--yellow);
}

.popout-status-dot.busy {
  background: var(--red);
}

.popout-status-dot.invisible {
  background: var(--text-muted);
}

/* ─── Body ─── */
.popout-body {
  padding: 8px 16px 12px;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  background: var(--bg-dark);
}

.popout-names {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 4px;
}

.popout-display-name {
  font-weight: 700;
  font-size: 16px;
  color: var(--text-primary);
  line-height: 1.2;
}

.popout-username {
  font-size: 12px;
  color: var(--text-secondary);
}

.popout-badges {
  display: flex;
  gap: 4px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.popout-badge {
  display: flex;
  align-items: center;
}

.popout-divider {
  height: 1px;
  background: var(--bg-lighter);
  margin: 10px 0;
}

/* ─── Sections ─── */
.popout-section {
  margin-bottom: 10px;
}

.popout-section h5 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin: 0 0 6px 0;
  letter-spacing: 0.02em;
}

.popout-about {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.4;
  margin: 0;
  word-wrap: break-word;
}

/* ─── Mutual Icons ─── */
.popout-mutuals {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.popout-mutual-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 11px;
  color: #fff;
  cursor: default;
  flex-shrink: 0;
}

.popout-mutual-overflow {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-lighter);
}

/* ─── Context Menu (3-dot) ─── */
.popout-context-menu {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 46px;
  right: 8px;
  width: 200px;
  padding: 4px 0;
  background: var(--bg-dark);
  border: 1px solid var(--bg-lighter);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 100;
}

.popout-ctx-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--text-primary);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background var(--transition);
  position: relative;
}

.popout-ctx-item:hover {
  background: var(--bg-hover);
}

.popout-ctx-item .material-symbols-outlined {
  font-size: 18px;
  color: var(--text-secondary);
}

.popout-invite-arrow {
  margin-left: auto;
  font-size: 16px !important;
}

.popout-ctx-divider {
  height: 1px;
  background: var(--bg-lighter);
  margin: 2px 10px;
}

/* ─── Invite Submenu ─── */
.popout-invite-submenu {
  display: flex;
  flex-direction: column;
  padding: 0 0 0 12px;
  background: var(--bg-dark);
}

.popout-server-invite {
  font-size: 12px;
  padding: 6px 10px !important;
}

.popout-server-icon {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
  color: #fff;
  flex-shrink: 0;
}

.popout-submenu-empty {
  padding: 8px 14px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ─── Clickable avatars/names in chat ─── */
.message-avatar[data-action],
.message-author[data-action] {
  cursor: pointer;
}

.message-avatar[data-action]:hover {
  filter: brightness(1.15);
}

.message-author[data-action]:hover {
  text-decoration: underline;
}

/* ─── Clickable members in sidebar ─── */
.member-item[data-action] {
  cursor: pointer;
}

/* ═══════════════════════════════════════════════════
   User Menu Popout (self-profile from user panel)
   ═══════════════════════════════════════════════════ */

.user-menu-popout {
  position: fixed;
  z-index: 1200;
  width: 300px;
  background: var(--bg-dark);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: userMenuIn 120ms ease-out;
  border: 1px solid var(--bg-lighter);
}

@keyframes userMenuIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.user-menu-banner {
  height: 60px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  position: relative;
}

.user-menu-avatar-section {
  margin-top: -24px;
  padding: 0 14px;
  position: relative;
  z-index: 1;
}

.user-menu-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 20px;
  color: #fff;
  border: 4px solid var(--bg-dark);
  position: relative;
}

.user-menu-status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 3px solid var(--bg-dark);
  background: var(--text-muted);
}

.user-menu-status-dot.online    { background: var(--green); }
.user-menu-status-dot.away,
.user-menu-status-dot.idle      { background: var(--yellow); }
.user-menu-status-dot.busy      { background: var(--red); }
.user-menu-status-dot.invisible { background: var(--text-muted); }

.user-menu-body {
  padding: 6px 14px 10px;
}

.user-menu-names {
  display: flex;
  flex-direction: column;
  margin-bottom: 2px;
}

.user-menu-display-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--text-primary);
  line-height: 1.2;
}

.user-menu-username {
  font-size: 12px;
  color: var(--text-secondary);
}

.user-menu-badges {
  display: flex;
  gap: 4px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.user-menu-about {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin: 4px 0 0;
  word-wrap: break-word;
  max-height: 48px;
  overflow: hidden;
}

.user-menu-divider {
  height: 1px;
  background: var(--bg-lighter);
  margin: 8px 0;
}

/* ─── User Menu Action Buttons ─── */
.user-menu-actions {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 6px 6px;
}

.user-menu-action {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: none;
  background: none;
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  width: 100%;
  text-align: left;
  transition: background var(--transition);
  position: relative;
}

.user-menu-action:hover {
  background: var(--bg-hover);
}

.user-menu-action .material-symbols-outlined {
  font-size: 18px;
  color: var(--text-secondary);
}

.user-menu-action-right {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.um-status-chevron {
  transition: transform 150ms ease;
}

/* ─── Status Submenu (inline inside popout) ─── */
.user-menu-status-submenu {
  display: none;
  flex-direction: column;
  padding: 2px 0 0;
  margin-top: 4px;
  border-top: 1px solid var(--bg-lighter);
}

.user-menu-status-submenu.show {
  display: flex;
}

.status-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: none;
  background: none;
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: background var(--transition);
}

.status-option:hover {
  background: var(--bg-hover);
}

.status-option-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-option-dot.online    { background: var(--green); }
.status-option-dot.away,
.status-option-dot.idle      { background: var(--yellow); }
.status-option-dot.busy      { background: var(--red); }
.status-option-dot.invisible { background: var(--text-muted); }

.status-option-check {
  margin-left: auto;
  font-size: 16px !important;
  color: var(--green);
}
