/* app/static/css/navigations/sidebar-friends.css */
/* Sidebar Friends Panel - Steam-style Online Status */

/* ============================================================
   FRIENDS HEADER
   ============================================================ */

.menu-header .online-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  margin-left: 8px;
  background: var(--success-color);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 10px;
  vertical-align: middle;
}

/* ============================================================
   FRIEND ITEM
   ============================================================ */

.menu-item.friend-item {
  margin: 0;
}

.menu-item.friend-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  transition: all 0.2s ease;
}

.menu-item.friend-item a:hover {
  background: var(--sidebar-hover-bg);
  padding-left: 20px;
}

/* ============================================================
   FRIEND AVATAR
   ============================================================ */

.friend-avatar-wrapper {
  position: relative;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
}

.friend-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    var(--sidebar-accent),
    var(--primary-color)
  );
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
}

/* ============================================================
   STATUS DOT
   ============================================================ */

.status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--sidebar-bg);
  transition: all 0.3s ease;
}

.status-dot.online {
  background: var(--success-color);
  box-shadow: 0 0 8px rgba(var(--success-color-rgb), 0.6);
  animation: pulse-online 2s ease-in-out infinite;
}

.status-dot.offline {
  background: var(--text-secondary);
  opacity: 0.5;
}

@keyframes pulse-online {
  0%,
  100% {
    box-shadow: 0 0 8px rgba(var(--success-color-rgb), 0.6);
  }
  50% {
    box-shadow: 0 0 16px rgba(var(--success-color-rgb), 0.8);
  }
}

/* ============================================================
   FRIEND INFO
   ============================================================ */

.friend-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0; /* Allow text truncation */
  flex: 1;
}

.friend-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--sidebar-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.friend-status {
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-item.friend-item a:hover .friend-name {
  color: var(--sidebar-accent);
}

/* ============================================================
   COLLAPSED SIDEBAR STATE
   ============================================================ */

.sidebar.collapsed .friend-avatar-wrapper {
  margin: 0 auto;
}

.sidebar.collapsed .friend-info {
  display: none;
}

.sidebar.collapsed .menu-item.friend-item a {
  justify-content: center;
  padding: 10px;
}

.sidebar.collapsed .menu-item.friend-item a:hover {
  padding-left: 10px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
  .friend-avatar-wrapper {
    width: 32px;
    height: 32px;
  }

  .friend-avatar {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
  }

  .status-dot {
    width: 10px;
    height: 10px;
  }

  .friend-name {
    font-size: 0.85rem;
  }

  .friend-status {
    font-size: 0.7rem;
  }
}

/* ============================================================
   THEME SUPPORT
   ============================================================ */

[data-theme="dark"] .status-dot.online {
  border-color: var(--sidebar-bg);
}

[data-theme="light"] .status-dot.online {
  border-color: var(--sidebar-bg);
}

/* ============================================================
   LOADING STATE (Optional)
   ============================================================ */

.friend-item.loading .friend-avatar {
  animation: skeleton-loading 1.5s ease-in-out infinite;
}

@keyframes skeleton-loading {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}
