/* App Main Grid */
.app-layout {
  display: grid;
  grid-template-columns: 72px 240px 1fr;
  height: 100vh;
  width: 100vw;
  background-color: var(--bg-primary);
}

/* 1. Server Sidebar Navigation */
.sidebar-servers {
  background-color: var(--bg-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0;
  border-right: 1px solid var(--border-glass);
  gap: 8px;
  overflow-y: auto;
}

.server-icon {
  width: 48px;
  height: 48px;
  border-radius: 24px;
  background-color: var(--bg-secondary);
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  transition: var(--transition-fast);
  color: var(--text-muted);
}

.server-icon:hover, .server-icon.active {
  border-radius: 16px;
  background-color: var(--primary);
  color: #fff;
  box-shadow: 0 0 15px var(--primary-glow);
}

.server-icon::before {
  content: '';
  position: absolute;
  left: -12px;
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background-color: var(--text-main);
  transition: var(--transition-fast);
  opacity: 0;
  transform: scale(0);
}

.server-icon:hover::before {
  opacity: 0.7;
  transform: scale(1) translateY(0);
  height: 20px;
}

.server-icon.active::before {
  opacity: 1;
  transform: scale(1) translateY(0);
  height: 36px;
  left: -12px;
}

.server-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.server-separator {
  width: 32px;
  height: 2px;
  background-color: var(--bg-tertiary);
  margin: 4px 0;
}

/* 2. Channel/Conversations Panel */
.sidebar-channels {
  background-color: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-glass);
}

.panel-header {
  height: 48px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid var(--border-glass);
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 0.95rem;
  justify-content: space-between;
}

.channels-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.channel-category {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.category-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-subtle);
  padding: 4px 8px;
  letter-spacing: 0.05em;
  cursor: pointer;
}

.category-title:hover {
  color: var(--text-muted);
}

.channel-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
  gap: 8px;
  user-select: none;
}

.channel-item:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-main);
}

.channel-item.active {
  background-color: hsla(47, 95%, 50%, 0.15);
  color: var(--text-main);
  border-left: 2px solid var(--primary);
}

/* User status bar at bottom of sidebar */
.panel-footer {
  height: 52px;
  background-color: var(--bg-primary);
  border-top: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  padding: 0 8px;
  gap: 8px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 18px;
  background-color: var(--bg-tertiary);
  position: relative;
  flex-shrink: 0;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: 5px;
  border: 2px solid var(--bg-primary);
}

.status-dot.online { background-color: var(--success); }
.status-dot.idle { background-color: var(--warning); }
.status-dot.dnd { background-color: var(--danger); }
.status-dot.offline { background-color: var(--text-subtle); }

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-tag {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-actions {
  display: flex;
  gap: 4px;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--text-muted);
  transition: var(--transition-fast);
  background: none;
  border: none;
  cursor: pointer;
}

.icon-btn:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-main);
}
