/* ========================================================
   DISCX MAIN APPLICATION LAYOUT (Screenshots #2 & #3)
   ======================================================== */
.discx-app {
  display: flex;
  width: 100vw;
  height: 100vh;
  background-color: var(--bg-darkest);
  overflow: hidden;
}

/* 1. Far-Left Server Sidebar */
.server-sidebar {
  width: 72px;
  min-width: 72px;
  background-color: var(--bg-darkest);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0;
  gap: 8px;
  border-right: 1px solid var(--border-subtle);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 20;
}

.server-item-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.server-pill {
  position: absolute;
  left: 0;
  width: 4px;
  height: 0px;
  background: #ffffff;
  border-radius: 0 4px 4px 0;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.server-item-wrapper:hover .server-pill {
  height: 20px;
}
.server-item-wrapper.active .server-pill {
  height: 40px;
  background: var(--accent-indigo);
  box-shadow: 0 0 10px rgba(108, 99, 255, 0.8);
}

.server-btn {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  position: relative;
}

.server-btn:hover {
  background-color: var(--bg-tertiary);
  color: #ffffff;
  border-radius: 12px;
  transform: translateY(-1px);
}

.server-item-wrapper.active .server-btn {
  background: var(--accent-gradient);
  color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(108, 99, 255, 0.4);
}

.server-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.server-separator {
  width: 32px;
  height: 2px;
  background: var(--border-subtle);
  border-radius: 1px;
  margin: 4px 0;
}

.server-btn.add-server-btn:hover {
  background-color: rgba(16, 185, 129, 0.15);
  color: var(--status-online);
  border-color: rgba(16, 185, 129, 0.3);
}

/* 2. Channel Sidebar Column */
.channel-sidebar {
  width: 240px;
  min-width: 240px;
  background-color: var(--bg-primary);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  height: 100%;
  z-index: 15;
}

.server-header {
  height: 60px;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 0.2s ease;
  position: relative;
}

.server-header:hover {
  background: var(--bg-hover);
}

.server-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.server-header-name {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.server-boost-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
}

.boost-progress {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.boost-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: var(--radius-full);
}

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

.channel-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

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

.channel-nav-item.active {
  background: var(--bg-active);
  color: #ffffff;
  font-weight: 600;
}

.channel-nav-item .nav-badge {
  margin-left: auto;
  font-size: 10px;
  padding: 1px 6px;
  background: var(--accent-blue);
  color: #fff;
  border-radius: var(--radius-full);
}

.channel-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
}

.channel-category-header:hover {
  color: var(--text-secondary);
}

.channel-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

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

.channel-item.active {
  background: rgba(76, 111, 255, 0.15);
  color: #ffffff;
  font-weight: 600;
}

.channel-item .channel-icon {
  color: var(--text-muted);
  font-size: 16px;
}
.channel-item.active .channel-icon {
  color: var(--accent-blue);
}

/* Voice Connected User Tree */
.voice-participants-tree {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-left: 26px;
  margin-top: 4px;
}

.voice-participant-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
}

.voice-participant-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
}

.voice-participant-row.speaking {
  color: var(--status-online);
}
.voice-participant-row.speaking .voice-participant-avatar {
  box-shadow: 0 0 0 2px var(--status-online);
}

/* Bottom User Bar */
.user-mini-bar {
  height: 56px;
  background-color: var(--bg-darkest);
  border-top: 1px solid var(--border-subtle);
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-mini-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-md);
  transition: background 0.2s ease;
  overflow: hidden;
}

.user-mini-profile:hover {
  background: var(--bg-hover);
}

.avatar-wrapper {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
}

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

.status-indicator {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--bg-darkest);
}

.status-online { background-color: var(--status-online); }
.status-idle { background-color: var(--status-idle); }
.status-dnd { background-color: var(--status-dnd); }
.status-offline { background-color: var(--status-offline); }

.user-mini-details {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.user-mini-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-mini-status {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-mini-controls {
  display: flex;
  align-items: center;
  gap: 2px;
}

.mini-icon-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

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

.mini-icon-btn.muted {
  color: var(--status-dnd);
}

/* 3. Main Center Chat / Stage Column */
.main-stage-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: var(--bg-secondary);
  overflow: hidden;
  position: relative;
}

.main-stage-header {
  height: 60px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  background-color: var(--bg-secondary);
  z-index: 10;
}

.header-left-info {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
}

.header-channel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

.header-channel-topic {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-left: 12px;
  border-left: 1px solid var(--border-subtle);
}

.header-right-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.header-search-bar:hover {
  border-color: var(--border-light);
  color: var(--text-secondary);
}

.search-shortcut {
  font-size: 10px;
  padding: 1px 5px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
}

/* 4. Right Widget Column (Active Voice, Shares, Events) */
.right-widget-column {
  width: 260px;
  min-width: 260px;
  background-color: var(--bg-primary);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 14px;
  overflow-y: auto;
}

.widget-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.widget-see-all {
  font-size: 11px;
  color: var(--text-link);
  cursor: pointer;
}

.widget-room-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

.widget-room-button {
  width: 100%;
  border: 1px solid transparent;
  color: inherit;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
}

.widget-room-button:hover {
  border-color: rgba(108, 99, 255, 0.28);
  background: rgba(108, 99, 255, 0.1);
}

.widget-avatar-fallback,
.widget-avatar-more {
  width: 22px;
  height: 22px;
  margin-left: -6px;
  display: grid;
  place-items: center;
  border: 2px solid var(--bg-tertiary);
  border-radius: 50%;
  color: #ffffff;
  background: linear-gradient(145deg, #6c63ff, #4c6fff);
  font-size: 8px;
  font-weight: 800;
}

.widget-avatar-fallback:first-child { margin-left: 0; }
.widget-avatar-more { background: var(--bg-card); color: var(--text-secondary); }

.widget-empty-state {
  min-height: 54px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 10px;
  text-align: center;
}

.widget-empty-state svg { width: 15px; height: 15px; }

.widget-live-share {
  width: 100%;
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
}

.widget-share-preview {
  flex: 0 0 38px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: #a8a3ff;
  background: radial-gradient(circle at center, rgba(108, 99, 255, .32), #080c16);
}

.widget-share-preview svg { width: 15px; height: 15px; }
.widget-share-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.widget-share-copy div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fff; font-size: 10px; font-weight: 700; }
.widget-share-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); font-size: 9px; }
.widget-live-dot { padding: 2px 4px; border-radius: 4px; color: #ff8f8f; background: rgba(239, 68, 68, .14); font-size: 7px; font-weight: 900; }

.widget-room-title {
  font-size: 13px;
  font-weight: 600;
}

.widget-room-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.avatar-stack {
  display: flex;
  align-items: center;
}

.avatar-stack img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--bg-tertiary);
  margin-left: -6px;
}
.avatar-stack img:first-child {
  margin-left: 0;
}

/* 5. Far Right Members Sidebar */
.members-sidebar {
  width: 220px;
  min-width: 220px;
  background-color: var(--bg-darkest);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  gap: 16px;
  overflow-y: auto;
}

.members-header {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.members-close-btn {
  display: none;
}

.member-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
}

.member-row:hover {
  background: var(--bg-hover);
}

.member-name-tag {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.member-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.member-activity {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.invite-members-btn {
  margin-top: auto;
  width: 100%;
}

/* Persistent Voice Connected Bar (Bottom DM / App) */
.voice-connected-bar {
  background: #0D1629;
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-lg);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  margin: 0 16px 12px 16px;
}

.voice-connected-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.voice-wave-icon {
  color: var(--status-online);
}

.voice-connected-text {
  display: flex;
  flex-direction: column;
}

.voice-status-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--status-online);
}

.voice-channel-name {
  font-size: 11px;
  color: var(--text-muted);
}
