:root {
  --bg-servers: #1e1f22;
  --bg-channels: #2b2d31;
  --bg-chat: #313338;
  --bg-input: #383a40;
  --header-primary: #f2f3f5;
  --header-secondary: #b5bac1;
  --text-normal: #dbdee1;
  --text-muted: #949ba4;
  --interactive-normal: #b5bac1;
  --interactive-hover: #dbdee1;
  --interactive-active: #fff;
  --channel-hover: #35373c;
  --message-hover: #2e3035;
  --accent-primary: #5865f2;
  --accent-hover: #4752c4;
  --font-display: "Whitney", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-display);
  background-color: var(--bg-chat);
  color: var(--text-normal);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

/* LOGIN SCREEN */
.login-screen {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  background-image: url("https://discord.com/assets/f9e99a868f03c4f9.png"); /* Background pattern lookalike */
  background-size: cover;
  background-position: center;
}

.login-box {
  background: #313338;
  padding: 32px;
  border-radius: 5px;
  box-shadow: 0 2px 10px 0 rgba(0,0,0,0.2);
  width: 100%;
  max-width: 480px;
  text-align: center;
}

.login-box h1 {
  color: var(--header-primary);
  margin-bottom: 8px;
}

.login-box p {
  color: var(--header-secondary);
  margin-bottom: 20px;
}

.login-box input {
  width: 100%;
  padding: 10px;
  background-color: #1e1f22;
  border: none;
  border-radius: 3px;
  color: var(--text-normal);
  margin-bottom: 20px;
  height: 40px;
  font-size: 16px;
}

.login-box button {
  width: 100%;
  background-color: var(--accent-primary);
  color: white;
  padding: 10px;
  border: none;
  border-radius: 3px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.login-box button:hover {
  background-color: var(--accent-hover);
}

.hidden {
  display: none !important;
}

/* APP LAYOUT - 3 Columns (Servers | Channels | Chat | Members) */
.discord-app {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* 1. SERVERS SIDEBAR */
.servers-sidebar {
  width: 72px;
  background-color: var(--bg-servers);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0;
  overflow-y: auto;
  flex-shrink: 0;
}

.server-icon {
  width: 48px;
  height: 48px;
  background-color: #313338;
  border-radius: 50%;
  margin-bottom: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s ease-out;
  color: var(--text-normal);
  font-size: 20px;
  position: relative;
}

.server-icon:hover, .server-icon.active {
  border-radius: 16px;
  background-color: var(--accent-primary);
  color: white;
}

.server-icon.active::before {
  content: '';
  position: absolute;
  left: -16px;
  width: 8px;
  height: 40px;
  border-radius: 0 4px 4px 0;
  background-color: white;
}

.server-separator {
  width: 32px;
  height: 2px;
  background-color: #35363C;
  margin: 8px 0;
}

.add-server {
  background-color: #313338;
  color: #23A559;
}
.add-server:hover {
  background-color: #23A559;
  color: white;
}

/* 2. CHANNELS SIDEBAR */
.channels-sidebar {
  width: 240px;
  background-color: var(--bg-channels);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.server-header {
  height: 48px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 0 rgba(0,0,0,0.2);
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s;
}

.server-header:hover {
  background-color: rgba(255,255,255,0.05);
}

.channels-list {
  flex: 1;
  padding: 8px;
  overflow-y: auto;
}

.channel-category {
    font-size: 12px;
    font-weight: bold;
    color: var(--text-muted);
    margin-top: 16px;
    margin-bottom: 4px;
    padding-left: 8px;
    cursor: default;
}

.channel-item {
  display: flex;
  align-items: center;
  padding: 6px 8px;
  border-radius: 4px;
  margin-bottom: 2px;
  color: var(--text-muted);
  cursor: pointer;
}

.channel-item:hover {
  background-color: var(--channel-hover);
  color: var(--text-normal);
}

.channel-item.active {
  background-color: rgba(79, 84, 92, 0.6); /* Slightly lighter */
  color: white;
}

.channel-item i {
  margin-right: 6px;
  color: #80848E;
}

.user-area {
  background-color: #232428;
  height: 52px;
  padding: 0 8px;
  display: flex;
  align-items: center;
}

.user-avatar-small {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  margin-right: 8px;
  background-color: var(--accent-primary);
  position: relative;
}

/* Status indicator dot */
.user-avatar-small::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    background-color: #23A559;
    border-radius: 50%;
    border: 3px solid #232428;
}


.user-info {
  flex: 1;
  overflow: hidden;
}

.user-name-display {
  font-size: 14px;
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-status {
  font-size: 11px;
  color: var(--text-muted);
}

.user-controls i {
  padding: 8px;
  cursor: pointer;
  border-radius: 4px;
}
.user-controls i:hover {
  background-color: var(--channel-hover);
}


/* 3. CHAT AREA */
.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-chat);
  position: relative;
  min-width: 0; /* Important for flex text wrapping */
}

.chat-header {
  height: 48px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 0 rgba(0,0,0,0.2);
}

.header-left {
  display: flex;
  align-items: center;
  font-weight: bold;
}

.header-left i {
  color: var(--text-muted);
  margin-right: 8px;
}

.channel-topic {
    margin-left: 16px;
    font-weight: normal;
    color: var(--text-muted);
    font-size: 14px;
    border-left: 1px solid var(--text-muted);
    padding-left: 16px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--interactive-normal);
}

.messages-wrapper {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
}

.message-group {
  display: flex;
  margin-top: 17px;
  padding: 2px 0;
  position: relative;
}

.message-group:hover {
    background-color: rgba(0,0,0,0.02); /* Very subtle hover */
}

/* Reactions Wrapper */
.message-content {
    width: 100%;
}

.message-group:hover .message-actions {
    display: flex;
}

.message-actions {
    display: none;
    position: absolute;
    top: -10px;
    right: 16px;
    background-color: var(--bg-chat);
    border: 1px solid #232428;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    padding: 2px;
}

.action-btn {
    padding: 4px 6px;
    cursor: pointer;
    color: var(--interactive-normal);
}
.action-btn:hover {
    background-color: var(--message-hover);
    color: var(--interactive-hover);
}


/* Tags and Replies */
.hashtag {
    color: #A0C7FF;
    background-color: rgba(88, 101, 242, 0.1);
    border-radius: 3px;
    padding: 0 2px;
    cursor: pointer;
}

.reply-context {
    display: flex;
    align-items: center;
    color: var(--text-muted);
    font-size: 12px;
    margin-bottom: 4px;
    margin-left: 50px;
    position: relative;
}

.reply-context::before {
    content: '';
    position: absolute;
    left: -36px;
    top: 50%;
    width: 30px;
    height: 2px;
    border-top: 2px solid #4F545C;
    border-left: 2px solid #4F545C;
    border-top-left-radius: 6px;
    /* This creates the L shape spine */
     border: none; /* Reset */
     border-left: 2px solid #4e5058;
     border-top: 2px solid #4e5058;
     border-top-left-radius: 6px;
     height: 12px;
     width: 32px;
     top: 10px;
}


.message-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-right: 16px;
  margin-top: 2px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  font-weight: bold;
  flex-shrink: 0;
  cursor: pointer;
}

.message-header {
  display: flex;
  align-items: baseline;
}

.message-username {
  font-weight: bold;
  margin-right: 6px;
  cursor: pointer;
}
.message-username:hover {
    text-decoration: underline;
}

.message-timestamp {
  font-size: 12px;
  color: var(--text-muted);
}

.message-text {
  color: var(--text-normal);
  white-space: pre-wrap;
  margin-top: 2px;
  line-height: 1.375rem;
}

/* Reactions on Message */
.message-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.reaction-chip {
    background-color: #2b2d31;
    border-radius: 8px;
    padding: 2px 6px;
    font-size: 12px;
    cursor: pointer;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 4px;
}

.reaction-chip:hover {
    border-color: var(--text-muted);
}
.reaction-chip.voted {
    background-color: rgba(88, 101, 242, 0.15);
    border-color: var(--accent-primary);
}


/* Input Area */
.message-input-area {
  padding: 0 16px 24px 16px;
  margin-top: 10px;
}

.input-form {
  background-color: var(--bg-input);
  border-radius: 8px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  height: 44px;
}

.reply-preview {
    background-color: #2b2d31;
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 8px 8px 0 0;
    margin-bottom: -5px; /* Pull input up */
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #35363C;
}

.input-form input {
  background: transparent;
  border: none;
  color: var(--text-normal);
  flex: 1;
  padding: 10px;
  font-size: 15px;
  outline: none;
}

.upload-btn, .emoji-btn {
    color: var(--interactive-normal);
    cursor: pointer;
    padding: 0 10px;
}
.upload-btn:hover, .emoji-btn:hover {
    color: var(--interactive-hover);
}


/* 4. MEMBERS SIDEBAR */
.members-sidebar {
    width: 240px;
    background-color: var(--bg-channels); /* Same as channels */
    flex-shrink: 0;
    padding: 16px 8px;
    overflow-y: auto;
}

.members-group {
    font-size: 12px;
    font-weight: bold;
    color: var(--text-muted);
    padding: 8px 8px 4px 8px;
    margin-top: 8px;
}

.member-item {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-muted);
    opacity: 0.9;
}

.member-item:hover {
    background-color: var(--channel-hover);
    opacity: 1;
    color: var(--text-normal);
}

.member-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 12px;
    position: relative;
}

.member-status-dot {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    background-color: #23A559; /* Online */
    border-radius: 50%;
    border: 3px solid var(--bg-channels);
}

.member-name {
    font-weight: 500;
}
  display: flex;
  height: 100vh;
  width: 100%;
}

/* SERVERS NOTIFICATON BAR (LEFTMOST) */
.servers-sidebar {
  width: 72px;
  background-color: var(--bg-servers);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 12px;
  overflow-y: auto;
  flex-shrink: 0;
}

.server-icon {
  width: 48px;
  height: 48px;
  background-color: #313338;
  border-radius: 50%;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-normal);
  font-weight: 500;
  cursor: pointer;
  transition: 0.2s;
  position: relative;
}

.server-icon:hover {
  border-radius: 16px;
  background-color: var(--accent-primary);
  color: white;
}

.server-icon.active {
  background-color: var(--accent-primary);
  border-radius: 16px;
  color: white;
}

.server-icon.active::before {
  content: '';
  position: absolute;
  left: -16px;
  top: 10px;
  bottom: 10px;
  width: 8px;
  background: white;
  border-radius: 0 4px 4px 0;
}

/* CHANNELS SIDEBAR */
.channels-sidebar {
  width: 240px;
  background-color: var(--bg-channels);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.channels-header {
  height: 48px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  color: var(--header-primary);
  box-shadow: 0 1px 0 rgba(4,4,5,0.2),0 1.5px 0 rgba(6,6,7,0.05),0 2px 0 rgba(4,4,5,0.05);
  font-size: 15px;
}

.channels-list {
  flex: 1;
  padding: 8px;
  overflow-y: auto;
}

.channel-category {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 8px;
  margin-top: 8px;
}

.channel-item {
  padding: 6px 8px;
  margin-bottom: 2px;
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
}

.channel-item:hover {
  background-color: var(--channel-hover);
  color: var(--interactive-hover);
}

.channel-item.active {
  background-color: #3f4147;
  color: white;
}

.hashtag {
  font-size: 20px;
  margin-right: 6px;
  color: #80848e;
}

.user-panel {
  background-color: #232428;
  height: 52px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  font-size: 14px;
}

.user-avatar-small {
  width: 32px;
  height: 32px;
  background-color: var(--accent-primary);
  border-radius: 50%;
  margin-right: 8px;
  /* background-image set in js */
  background-size: cover;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-id {
  font-size: 12px;
  color: var(--text-muted);
}

/* MAIN CHAT AREA */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-chat);
  position: relative;
  min-width: 0;
}

.chat-header {
  height: 48px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  box-shadow: 0 1px 0 rgba(4,4,5,0.2),0 1.5px 0 rgba(6,6,7,0.05),0 2px 0 rgba(4,4,5,0.05);
  z-index: 10;
  color: var(--header-primary);
}

.chat-header h3 {
  margin: 0 8px 0 0;
  font-size: 16px;
}

.topic {
  color: var(--text-muted);
  font-size: 14px;
  border-left: 1px solid var(--text-muted);
  padding-left: 10px;
}

/* MESSAGES */
.messages-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  padding-bottom: 0;
  display: flex;
  flex-direction: column;
}

/* Scrollbar styling */
.messages-list::-webkit-scrollbar, .channels-list::-webkit-scrollbar, .servers-sidebar::-webkit-scrollbar {
    width: 8px;
    background-color: #2b2d31;
}
.messages-list::-webkit-scrollbar-thumb, .channels-list::-webkit-scrollbar-thumb, .servers-sidebar::-webkit-scrollbar-thumb {
    background-color: #1a1b1e;
    border-radius: 4px;
}

.welcome-message {
  margin-top: auto;
  margin-bottom: 20px;
  padding: 16px;
}

.welcome-message h2 {
  background-color: #41434a;
  display: inline-block;
  font-size: 32px;
  border-radius: 50%;
  padding: 10px;
  margin: 0 0 10px 0;
  color: white;
  width: 60px;
  height: 60px;
  text-align: center;
  line-height: 40px;
}

.message-group {
  margin-top: 17px;
  display: flex;
  padding: 2px 0;
}

.message-group:hover {
  background-color: rgba(4, 4, 5, 0.07);
}

.message-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-right: 16px;
  cursor: pointer;
  flex-shrink: 0;
  background-color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: white;
  font-size: 18px;
}

.message-content {
  flex: 1;
  min-width: 0;
}

.message-header {
  display: flex;
  align-items: center;
  margin-bottom: 2px;
}

.message-username {
  font-size: 16px;
  font-weight: 500;
  color: var(--header-primary);
  margin-right: 0.5rem;
  cursor: pointer;
}

.message-username:hover {
  text-decoration: underline;
}

.message-timestamp {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 0.25rem;
}

.message-text {
  color: var(--text-normal);
  font-size: 1rem;
  line-height: 1.375rem;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* INPUT AREA */
.chat-input-area {
  padding: 0 16px 24px;
  margin-top: 10px;
}

.input-wrapper {
  background-color: var(--bg-input);
  border-radius: 8px;
  padding: 0 16px;
  display: flex;
  align-items: center;
}

#message-input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-normal);
  padding: 11px 0;
  height: 44px;
  font-size: 1rem;
  outline: none;
}

.upload-btn {
  background: #b5bac1;
  border-radius: 50%;
  border: none;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 16px;
  cursor: pointer;
  color: var(--bg-input);
  font-weight: 900;
  font-size: 18px;
  padding-bottom: 2px;
}

.upload-btn:hover {
  color: #dbdee1;
}

/* MEMBERS SIDEBAR */
.members-sidebar {
  width: 240px;
  background-color: var(--bg-channels);
  display: none; /* Hidden on small screens or just to simplify */
  padding: 24px 8px 0 16px;
}

@media (min-width: 800px) {
  .members-sidebar {
    display: block;
  }
}

.member-category {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
}

.member-item {
  display: flex;
  align-items: center;
  padding: 5px 8px;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0.8;
}

.member-item:hover {
  background-color: var(--channel-hover);
  opacity: 1;
}

.member-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #f23f43; /* Bot color red */
  margin-right: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  font-weight: bold;
}

.member-name {
  font-weight: 500;
  color: var(--header-primary);
}

/* =============================================
   ADDITIONAL STYLES FOR NEW FEATURES
   ============================================= */

/* Auth Buttons */
.auth-buttons {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.btn-primary {
  flex: 1;
  background-color: var(--accent-primary);
  color: white;
  padding: 12px;
  border: none;
  border-radius: 3px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-primary:hover {
  background-color: var(--accent-hover);
}

.btn-secondary {
  flex: 1;
  background-color: #3ba55c;
  color: white;
  padding: 12px;
  border: none;
  border-radius: 3px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-secondary:hover {
  background-color: #2d8049;
}

.error-text {
  color: #F23F43;
  margin-top: 10px;
  font-size: 14px;
  min-height: 20px;
}

.login-logo {
  font-size: 60px;
  color: var(--accent-primary);
  margin-bottom: 16px;
}

/* View Contents */
.view-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
}

/* Home Icon */
.home-icon {
  background-color: var(--accent-primary) !important;
  color: white !important;
}

/* Friends View */
.friends-header {
  padding: 12px;
}

.btn-add-friend {
  width: 100%;
  padding: 8px 12px;
  background-color: var(--accent-primary);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-add-friend:hover {
  background-color: var(--accent-hover);
}

.friends-section {
  padding: 16px;
}

.friends-section h3 {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.friend-item, .friend-request-item {
  display: flex;
  align-items: center;
  padding: 10px 8px;
  border-radius: 8px;
  margin-bottom: 2px;
  cursor: pointer;
}

.friend-item:hover, .friend-request-item:hover {
  background-color: var(--channel-hover);
}

.friend-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 18px;
  position: relative;
}

.friend-name {
  flex: 1;
  font-weight: 600;
  color: var(--header-primary);
}

.friend-status {
  color: var(--text-muted);
  font-size: 12px;
  margin-right: 12px;
}

.status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 3px solid var(--bg-channels);
  background-color: #80848E;
}

.status-dot.online { background-color: #23A559; }
.status-dot.idle { background-color: #F0B232; }
.status-dot.dnd { background-color: #F23F43; }
.status-dot.offline { background-color: #80848E; }

.btn-dm, .btn-remove, .btn-accept, .btn-reject {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background-color: var(--bg-input);
  color: var(--text-normal);
  cursor: pointer;
  margin-left: 8px;
  font-size: 14px;
}

.btn-accept { background-color: #23A559; color: white; }
.btn-reject { background-color: #F23F43; color: white; }
.btn-dm:hover { background-color: var(--accent-primary); }
.btn-remove:hover { background-color: #F23F43; }

/* DM List */
.dm-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  margin: 2px 8px;
}

.dm-item:hover {
  background-color: var(--channel-hover);
}

.dm-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  margin-right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
}

.dm-info {
  flex: 1;
  overflow: hidden;
}

.dm-name {
  font-weight: 600;
  font-size: 14px;
}

.dm-preview {
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Header Buttons */
.header-btn {
  padding: 4px 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  border-radius: 4px;
}

.header-btn:hover {
  background-color: var(--channel-hover);
  color: var(--text-normal);
}

.header-btn.active {
  background-color: var(--channel-hover);
  color: white;
}

.header-btn.btn-add {
  background-color: #23A559;
  color: white;
}

.header-btn.btn-add:hover {
  background-color: #2d8049;
}

/* Friends List Container */
.friends-list-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

/* Member Status Dot */
.member-status-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 3px solid var(--bg-channels);
  background-color: #23A559;
}

.member-status-dot.online { background-color: #23A559; }
.member-status-dot.idle { background-color: #F0B232; }
.member-status-dot.dnd { background-color: #F23F43; }
.member-status-dot.offline { background-color: #80848E; }

.member-avatar {
  position: relative;
}

.owner-crown {
  position: absolute;
  top: -8px;
  right: -4px;
  color: #F0B232;
  font-size: 10px;
}

.members-group {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
  text-transform: uppercase;
}

/* =============================================
   ADMIN PANEL STYLES
   ============================================= */

.admin-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background-color: var(--bg-channels);
  border-radius: 8px;
  padding: 20px;
}

.stat-card h3 {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  margin: 0 0 8px 0;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--header-primary);
}

.stat-sub {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 4px;
}

.admin-section {
  background-color: var(--bg-channels);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 24px;
}

.admin-section h2 {
  color: var(--header-primary);
  margin: 0 0 16px 0;
  font-size: 18px;
}

.admin-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.filter-btn {
  padding: 8px 16px;
  background-color: var(--bg-input);
  border: none;
  border-radius: 4px;
  color: var(--text-normal);
  cursor: pointer;
  font-size: 14px;
}

.filter-btn:hover {
  background-color: var(--channel-hover);
}

.filter-btn.active {
  background-color: var(--accent-primary);
  color: white;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th {
  text-align: left;
  padding: 12px 8px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  border-bottom: 1px solid var(--bg-input);
}

.admin-table td {
  padding: 12px 8px;
  border-bottom: 1px solid var(--bg-input);
  color: var(--text-normal);
}

.admin-table tr:hover {
  background-color: rgba(255,255,255,0.02);
}

.admin-table tr.banned {
  background-color: rgba(242, 63, 67, 0.1);
}

.admin-table tr.admin {
  background-color: rgba(88, 101, 242, 0.1);
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mini-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 12px;
  font-weight: bold;
}

.badge {
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  margin-left: 4px;
}

.badge.admin {
  background-color: var(--accent-primary);
  color: white;
}

.badge.banned {
  background-color: #F23F43;
  color: white;
}

.btn-small {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.btn-danger {
  background-color: #F23F43;
  color: white;
}

.btn-danger:hover {
  background-color: #d63539;
}

.btn-success {
  background-color: #23A559;
  color: white;
}

.btn-success:hover {
  background-color: #1e8e4c;
}

/* Mention Styles */
.mention {
  color: #A0C7FF;
  background-color: rgba(88, 101, 242, 0.3);
  border-radius: 3px;
  padding: 0 2px;
  cursor: pointer;
}

.mention:hover {
  background-color: var(--accent-primary);
  color: white;
}

/* Edited indicator */
.edited {
  color: var(--text-muted);
  font-size: 10px;
  margin-left: 4px;
}

/* Dropdown icon */
.dropdown-icon {
  color: var(--text-muted);
  font-size: 12px;
}

/* Search bar improvements */
.search-bar {
  display: flex;
  align-items: center;
  background-color: var(--bg-servers);
  border-radius: 4px;
  padding: 0 8px;
}

.search-bar input {
  background: transparent;
  border: none;
  color: var(--text-normal);
  padding: 6px 8px;
  outline: none;
  width: 150px;
}

.search-bar input::placeholder {
  color: var(--text-muted);
}

.search-bar i {
  color: var(--text-muted);
  font-size: 14px;
}

/* Reaction chip */
.reaction-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  background-color: var(--bg-input);
  border-radius: 4px;
  margin-right: 4px;
  margin-top: 4px;
  cursor: pointer;
  border: 1px solid transparent;
}

.reaction-chip:hover {
  border-color: var(--accent-primary);
}

.reaction-chip.voted {
  background-color: rgba(88, 101, 242, 0.3);
  border-color: var(--accent-primary);
}

.reaction-chip .count {
  color: var(--text-muted);
  font-size: 12px;
}

/* Message reactions container */
.message-reactions {
  display: flex;
  flex-wrap: wrap;
  margin-top: 4px;}

/* =============================================
   CONTEXT MENUS
   ============================================= */
.context-menu {
  position: fixed;
  background-color: #111214;
  border-radius: 4px;
  padding: 6px 8px;
  min-width: 188px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.24);
  z-index: 1000;
  animation: contextFadeIn 0.1s ease;
}

@keyframes contextFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.context-item {
  display: flex;
  align-items: center;
  padding: 6px 8px;
  border-radius: 2px;
  color: var(--interactive-normal);
  font-size: 14px;
  cursor: pointer;
  gap: 10px;
}

.context-item:hover {
  background-color: var(--accent-primary);
  color: white;
}

.context-item.danger {
  color: #F23F43;
}

.context-item.danger:hover {
  background-color: #F23F43;
  color: white;
}

.context-item i {
  width: 18px;
  text-align: center;
}

.context-separator {
  height: 1px;
  margin: 4px;
  background-color: #2e3035;
}

/* =============================================
   MODALS
   ============================================= */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
  animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-overlay.fullscreen {
  background-color: var(--bg-chat);
}

.modal-overlay.fullscreen .modal-content {
  width: 100%;
  height: 100%;
  max-width: none;
  border-radius: 0;
}

.modal-content {
  background-color: var(--bg-channels);
  border-radius: 8px;
  max-width: 480px;
  width: 90%;
  animation: modalSlideIn 0.2s ease;
}

@keyframes modalSlideIn {
  from { transform: translateY(-20px); }
  to { transform: translateY(0); }
}

.confirm-dialog, .invite-modal, .create-server-modal, .join-server-modal, .server-settings {
  padding: 24px;
  text-align: center;
}

.confirm-dialog h3, .invite-modal h2, .create-server-modal h2, .join-server-modal h2, .server-settings h2 {
  margin: 0 0 8px 0;
  color: var(--header-primary);
}

.confirm-dialog p, .invite-modal p, .create-server-modal p, .join-server-modal p {
  color: var(--text-muted);
  margin: 0 0 20px 0;
}

.dialog-actions, .modal-actions, .settings-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}

.btn-cancel {
  padding: 10px 20px;
  background: transparent;
  border: none;
  color: var(--text-normal);
  font-size: 14px;
  cursor: pointer;
  border-radius: 3px;
}

.btn-cancel:hover {
  text-decoration: underline;
}

.btn-confirm {
  padding: 10px 20px;
  background-color: #F23F43;
  color: white;
  border: none;
  border-radius: 3px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.btn-confirm:hover {
  background-color: #d63539;
}

.btn-save {
  padding: 10px 20px;
  background-color: var(--accent-primary);
  color: white;
  border: none;
  border-radius: 3px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.btn-save:hover {
  background-color: var(--accent-hover);
}

/* Invite Modal */
.invite-link-box {
  display: flex;
  background-color: var(--bg-servers);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}

.invite-link-box input {
  flex: 1;
  padding: 12px;
  background: transparent;
  border: none;
  color: var(--text-normal);
  font-size: 14px;
}

.btn-copy {
  padding: 12px 16px;
  background-color: var(--accent-primary);
  color: white;
  border: none;
  font-weight: 500;
  cursor: pointer;
}

.btn-copy:hover {
  background-color: var(--accent-hover);
}

.invite-code {
  color: var(--text-muted);
  font-size: 12px;
}

/* Add Server Modal */
.add-server-modal {
  padding: 24px;
}

.add-server-modal h2 {
  text-align: center;
  margin: 0 0 24px 0;
  color: var(--header-primary);
}

.server-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.server-option {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background-color: var(--bg-servers);
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: border-color 0.2s;
}

.server-option:hover {
  border-color: var(--text-muted);
}

.option-icon {
  width: 48px;
  height: 48px;
  background-color: var(--accent-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
}

.server-option h3 {
  margin: 0;
  color: var(--header-primary);
  font-size: 16px;
}

.server-option p {
  margin: 4px 0 0 0;
  color: var(--text-muted);
  font-size: 12px;
}

/* Create/Join Server Modals */
.create-server-modal input, .join-server-modal input {
  width: 100%;
  padding: 12px;
  background-color: var(--bg-servers);
  border: none;
  border-radius: 4px;
  color: var(--text-normal);
  font-size: 16px;
  margin-bottom: 8px;
}

.hint {
  color: var(--text-muted);
  font-size: 12px;
}

/* Settings Field */
.settings-field {
  text-align: left;
  margin-bottom: 16px;
}

.settings-field label {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.settings-field input {
  width: 100%;
  padding: 12px;
  background-color: var(--bg-servers);
  border: none;
  border-radius: 4px;
  color: var(--text-normal);
  font-size: 16px;
}

/* =============================================
   USER PROFILE MODAL
   ============================================= */
.profile-modal {
  width: 340px;
  background-color: #232428;
  border-radius: 8px;
  overflow: hidden;
}

.profile-banner {
  height: 60px;
}

.profile-avatar-large {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 6px solid #232428;
  margin: -40px 0 0 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: bold;
  color: white;
}

.profile-info {
  padding: 8px 16px 16px;
}

.profile-name {
  margin: 0;
  font-size: 20px;
  color: var(--header-primary);
}

.profile-tag {
  color: var(--text-muted);
  font-size: 16px;
  font-weight: normal;
}

.profile-bio {
  color: var(--text-normal);
  font-size: 14px;
  margin: 8px 0;
}

.profile-section {
  background-color: var(--bg-servers);
  border-radius: 8px;
  padding: 12px;
  margin-top: 12px;
}

.profile-section h3 {
  margin: 0 0 4px 0;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 700;
}

.profile-section p {
  margin: 0;
  color: var(--text-normal);
  font-size: 14px;
}

.profile-actions {
  display: flex;
  gap: 8px;
  padding: 16px;
  background-color: var(--bg-servers);
}

.btn-profile {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-profile.btn-primary {
  background-color: var(--accent-primary);
  color: white;
}

.btn-profile.btn-primary:hover {
  background-color: var(--accent-hover);
}

.btn-profile.btn-secondary {
  background-color: var(--bg-input);
  color: var(--text-normal);
}

.btn-profile.btn-secondary:hover {
  background-color: var(--channel-hover);
}

/* =============================================
   SETTINGS MODAL (FULLSCREEN)
   ============================================= */
.settings-container {
  display: flex;
  height: 100vh;
  width: 100%;
  background-color: var(--bg-channels);
}

.settings-nav {
  width: 218px;
  min-width: 218px;
  background-color: var(--bg-channels);
  padding: 60px 6px 20px 20px;
  display: flex;
  flex-direction: column;
  margin-left: auto;
}

.settings-close-area {
  flex: 1;
  min-width: 60px;
  cursor: pointer;
  position: relative;
}

.settings-close-area::after {
  content: '✕';
  position: absolute;
  top: 60px;
  left: 20px;
  width: 36px;
  height: 36px;
  border: 2px solid var(--text-muted);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 18px;
}

.settings-category {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  margin-top: 12px;
}

.settings-item {
  padding: 6px 10px;
  border-radius: 4px;
  color: var(--interactive-normal);
  cursor: pointer;
  font-size: 14px;
  margin-bottom: 2px;
}

.settings-item:hover {
  background-color: var(--channel-hover);
  color: var(--interactive-hover);
}

.settings-item.active {
  background-color: var(--channel-hover);
  color: white;
}

.settings-item.danger {
  color: #F23F43;
}

.settings-item.danger:hover {
  background-color: rgba(242, 63, 67, 0.1);
}

.settings-separator {
  height: 1px;
  margin: 8px 10px;
  background-color: var(--channel-hover);
}

.settings-content {
  flex: 1;
  background-color: var(--bg-chat);
  display: flex;
  flex-direction: column;
  max-width: 740px;
  padding: 60px 40px 80px 40px;
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.settings-header h2 {
  margin: 0;
  color: var(--header-primary);
  font-size: 20px;
}

.settings-close {
  padding: 8px 12px;
  background-color: transparent;
  border: 1px solid var(--text-muted);
  border-radius: 50px;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-close:hover {
  border-color: var(--text-normal);
  color: var(--text-normal);
}

.settings-body {
  flex: 1;
}

.account-card {
  background-color: var(--bg-servers);
  border-radius: 8px;
  overflow: hidden;
}

.account-banner {
  height: 100px;
}

.account-info {
  display: flex;
  align-items: flex-end;
  padding: 16px;
  margin-top: -32px;
}

.account-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 6px solid var(--bg-servers);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: bold;
  color: white;
  margin-right: 16px;
}

.account-details {
  flex: 1;
}

.account-details h3 {
  margin: 0;
  color: var(--header-primary);
  font-size: 20px;
}

.account-details .tag {
  color: var(--text-muted);
  font-weight: normal;
}

.btn-edit-profile {
  padding: 8px 16px;
  background-color: var(--accent-primary);
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.btn-edit-profile:hover {
  background-color: var(--accent-hover);
}

.account-fields {
  padding: 16px;
  border-top: 1px solid var(--bg-chat);
}

.field {
  margin-bottom: 16px;
}

.field:last-child {
  margin-bottom: 0;
}

.field label {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.field-value {
  color: var(--text-normal);
  font-size: 16px;
}

/* =============================================
   TOAST NOTIFICATIONS
   ============================================= */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background-color: #232428;
  color: var(--text-normal);
  padding: 12px 20px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.24);
  z-index: 2000;
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast-success i {
  color: #23A559;
}

.toast-error i {
  color: #F23F43;
}

/* =============================================
   EMOJI PICKER
   ============================================= */
.emoji-picker {
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.emoji-item {
  font-size: 24px;
  padding: 8px;
  text-align: center;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.1s;
}

.emoji-item:hover {
  background-color: var(--channel-hover);
}

/* =============================================
   MESSAGE IMPROVEMENTS
   ============================================= */
.message-tag {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: normal;
  margin-left: 2px;
}

.message-compact {
  display: flex;
  align-items: flex-start;
  padding: 2px 0 2px 56px;
  position: relative;
}

.message-compact:hover {
  background-color: rgba(0,0,0,0.02);
}

.compact-timestamp {
  position: absolute;
  left: 0;
  width: 48px;
  text-align: right;
  color: var(--text-muted);
  font-size: 11px;
  opacity: 0;
}

.message-compact:hover .compact-timestamp {
  opacity: 1;
}

.message-content-wrapper {
  flex: 1;
  min-width: 0;
}

.reply-context {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 4px;
}

.reply-context i {
  color: var(--text-muted);
}

.reply-avatar {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: white;
  font-weight: bold;
}

.reply-username {
  color: var(--header-secondary);
  font-weight: 500;
  margin-right: 4px;
}

.reply-text-preview {
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* =============================================
   FRIENDS LIST IMPROVEMENTS
   ============================================= */
.friends-header-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--channel-hover);
}

.friends-tab-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.friend-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.friend-tag {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: normal;
}

.btn-icon {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background-color: var(--bg-servers);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
}

.btn-icon:hover {
  background-color: var(--channel-hover);
  color: var(--text-normal);
}

.btn-icon.btn-accept {
  background-color: transparent;
  color: #23A559;
}

.btn-icon.btn-accept:hover {
  background-color: #23A559;
  color: white;
}

.btn-icon.btn-reject, .btn-icon.btn-cancel {
  background-color: transparent;
  color: #F23F43;
}

.btn-icon.btn-reject:hover, .btn-icon.btn-cancel:hover {
  background-color: #F23F43;
  color: white;
}

/* Add Friend Form */
.add-friend-form {
  max-width: 600px;
}

.add-friend-form h3 {
  color: var(--header-primary);
  font-size: 16px;
  margin: 0 0 8px 0;
}

.add-friend-form > p {
  color: var(--text-muted);
  margin: 0 0 16px 0;
}

.add-friend-input {
  display: flex;
  background-color: var(--bg-servers);
  border-radius: 8px;
  padding: 4px;
}

.add-friend-input input {
  flex: 1;
  padding: 12px;
  background: transparent;
  border: none;
  color: var(--text-normal);
  font-size: 16px;
  outline: none;
}

.btn-send-request {
  padding: 10px 16px;
  background-color: var(--accent-primary);
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

.btn-send-request:hover {
  background-color: var(--accent-hover);
}

.btn-send-request:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.add-friend-hint {
  margin-top: 12px;
  font-size: 14px;
}

.add-friend-hint.success {
  color: #23A559;
}

.add-friend-hint.error {
  color: #F23F43;
}

/* Empty states */
.empty-state, .empty-friends {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 80px;
  margin-bottom: 20px;
  opacity: 0.5;
}

.empty-state h2, .empty-state h3 {
  color: var(--header-primary);
  margin: 0 0 8px 0;
}

.empty-friends p {
  margin: 0;
}

/* Loading state */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text-muted);
}

/* Error state */
.error-state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: #F23F43;
}

/* Welcome message styling */
.welcome-message {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-top: auto;
  margin-bottom: 16px;
  padding: 16px;
}

.welcome-icon {
  width: 68px;
  height: 68px;
  background-color: #41434a;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: white;
  margin-bottom: 12px;
}

.welcome-message h1 {
  margin: 0 0 8px 0;
  color: var(--header-primary);
  font-size: 24px;
}

.welcome-message p {
  margin: 0;
  color: var(--text-muted);
}

/* =============================================
   SERVER DROPDOWN MENU
   ============================================= */
.server-dropdown {
  background-color: #111214;
  border-radius: 4px;
  padding: 6px 8px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.24);
  z-index: 1000;
  animation: contextFadeIn 0.1s ease;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 2px;
  color: var(--interactive-normal);
  font-size: 14px;
  cursor: pointer;
}

.dropdown-item:hover {
  background-color: var(--accent-primary);
  color: white;
}

.dropdown-item.danger {
  color: #F23F43;
}

.dropdown-item.danger:hover {
  background-color: #F23F43;
  color: white;
}

.dropdown-item i {
  width: 18px;
  text-align: center;
}

.dropdown-separator {
  height: 1px;
  margin: 4px 0;
  background-color: #2e3035;
}

/* Server Header clickable */
.server-header {
  height: 48px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 0 rgba(0,0,0,0.2);
  cursor: pointer;
  transition: background-color 0.1s;
}

.server-header:hover {
  background-color: rgba(79, 84, 92, 0.3);
}

.server-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--header-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =============================================
   CREATE CHANNEL MODAL
   ============================================= */
.create-channel-modal, .create-category-modal {
  padding: 24px;
}

.create-channel-modal h2, .create-category-modal h2 {
  margin: 0 0 16px 0;
  color: var(--header-primary);
  text-align: center;
}

.channel-type-selector {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.type-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background-color: var(--bg-servers);
  border-radius: 4px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.15s;
}

.type-option:hover {
  background-color: var(--channel-hover);
}

.type-option.selected {
  border-color: var(--accent-primary);
  background-color: rgba(88, 101, 242, 0.1);
}

.type-option i {
  font-size: 24px;
  color: var(--text-muted);
  width: 32px;
  text-align: center;
}

.type-option strong {
  display: block;
  color: var(--header-primary);
  font-size: 14px;
}

.type-option p {
  margin: 2px 0 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

/* Buttons for creating channels/categories */
.btn-create-channel, .btn-create-category, .btn-add-category {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: calc(100% - 16px);
  margin: 8px;
  padding: 8px 12px;
  background-color: transparent;
  border: 1px dashed var(--text-muted);
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-create-channel:hover, .btn-create-category:hover, .btn-add-category:hover {
  background-color: var(--channel-hover);
  border-color: var(--text-normal);
  color: var(--text-normal);
}

.empty-channels {
  padding: 8px;
}

/* Category in channel list */
.channel-category {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  padding: 16px 8px 4px 4px;
  cursor: pointer;
}

.channel-category:hover {
  color: var(--text-normal);
}

.channel-category i.fa-chevron-down {
  font-size: 10px;
  margin-right: 4px;
  transition: transform 0.15s;
}

.channel-category .add-channel {
  opacity: 0;
  font-size: 14px;
  cursor: pointer;
  transition: opacity 0.1s;
}

.channel-category:hover .add-channel {
  opacity: 1;
}

.channel-category .add-channel:hover {
  color: var(--header-primary);
}

/* =============================================
   PROFILE MODAL FIX (no gray space)
   ============================================= */
.profile-modal {
  width: 340px;
  max-width: 340px;
  background-color: #232428;
  border-radius: 8px;
  overflow: hidden;
}

.modal-overlay .modal-content:has(.profile-modal) {
  background: transparent;
  max-width: 340px;
  width: auto;
}

/* User avatar clickable in members list */
.member-item {
  cursor: pointer;
}

.member-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 14px;
}

/* Header icons clickable */
.header-icon {
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.15s;
}

.header-icon:hover {
  color: var(--header-primary);
}

.header-icon.active {
  color: var(--header-primary);
}

/* =============================================
   NOTIFICATION BADGES
   ============================================= */
.server-icon {
  position: relative;
}

.notification-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background-color: #F23F43;
  color: white;
  font-size: 11px;
  font-weight: 700;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-servers);
}

.notification-badge.hidden {
  display: none;
}

/* =============================================
   SETTINGS FIX - Remove gray space
   ============================================= */
.modal-overlay.fullscreen {
  background-color: transparent;
}

.modal-overlay.fullscreen .modal-content {
  width: 100%;
  height: 100%;
  max-width: none;
  border-radius: 0;
  background: transparent;
}

.settings-container {
  display: flex;
  height: 100vh;
  width: 100%;
  background-color: var(--bg-channels);
}

.settings-content {
  flex: 1;
  background-color: var(--bg-chat);
  display: flex;
  flex-direction: column;
  max-width: 740px;
  padding: 60px 40px 80px 40px;
}

.settings-close-area {
  flex: 1;
  min-width: 60px;
  background-color: var(--bg-chat);
  cursor: pointer;
  position: relative;
}

/* =============================================
   INVITE PAGE - For non-logged users
   ============================================= */
.invite-page {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #5865f2 0%, #3a45a5 50%, #2c3e50 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.invite-card {
  background-color: var(--bg-secondary);
  border-radius: 8px;
  padding: 32px;
  width: 440px;
  max-width: 90vw;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  text-align: center;
}

.invite-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #5865f2, #7289da);
  border-radius: 50%;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
}

.invite-card h2 {
  color: var(--text-primary);
  margin-bottom: 8px;
  font-size: 24px;
}

.invite-card p {
  color: var(--text-muted);
  margin-bottom: 24px;
}

.invite-code-display {
  background-color: var(--bg-tertiary);
  padding: 12px 16px;
  border-radius: 4px;
  margin-bottom: 24px;
  font-family: monospace;
  font-size: 14px;
  color: var(--text-secondary);
  word-break: break-all;
}

.invite-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.invite-form input {
  padding: 12px 16px;
  background-color: var(--bg-tertiary);
  border: none;
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 16px;
}

.invite-form input:focus {
  outline: 2px solid var(--brand-color);
}

.invite-buttons {
  display: flex;
  gap: 12px;
}

.invite-buttons button {
  flex: 1;
  padding: 12px 20px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.invite-buttons .btn-login {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

.invite-buttons .btn-login:hover {
  background-color: var(--bg-hover);
}

.invite-buttons .btn-register {
  background-color: var(--brand-color);
  color: white;
}

.invite-buttons .btn-register:hover {
  background-color: #4752c4;
}

/* =============================================
   DM LIST IMPROVEMENTS
   ============================================= */
.dm-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  margin: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.15s;
  position: relative;
}

.dm-item:hover {
  background-color: var(--bg-modifier-hover);
}

.dm-item.active {
  background-color: var(--bg-modifier-selected);
}

.dm-avatar-container {
  position: relative;
  margin-right: 12px;
  flex-shrink: 0;
}

.dm-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5865f2, #7289da);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: white;
  font-weight: 600;
}

.dm-status-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 3px solid var(--bg-channels);
  background-color: #747f8d;
}

.dm-status-dot.online {
  background-color: #3ba55c;
}

.dm-status-dot.idle {
  background-color: #faa61a;
}

.dm-status-dot.dnd {
  background-color: #ed4245;
}

.dm-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dm-username {
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dm-status-text {
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dm-close-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.15s;
}

.dm-item:hover .dm-close-btn {
  display: flex;
}

.dm-close-btn:hover {
  color: var(--text-primary);
  background-color: var(--bg-modifier-hover);
}

.empty-dm-list {
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

/* DM Section Header */
.dm-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 10px 4px 18px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.dm-section-header:hover {
  color: var(--text-secondary);
}

/* =============================================
   MESSAGES IMPROVEMENTS
   ============================================= */
.messages-wrapper {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.messages-scroll-content {
  margin-top: auto;
  padding: 16px;
}

.message-group {
  position: relative;
  padding: 2px 48px 2px 72px;
  margin-top: 16px;
  border-radius: 4px;
}

.message-group:hover {
  background-color: var(--bg-modifier-hover);
}

.message-group:hover .message-actions-bar {
  display: flex;
}

.message-actions-bar {
  display: none;
  position: absolute;
  top: -16px;
  right: 16px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--bg-modifier-accent);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.msg-action {
  background: none;
  border: none;
  padding: 6px 8px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.msg-action:hover {
  background-color: var(--bg-modifier-hover);
  color: var(--text-primary);
}

.msg-action[data-action="delete"]:hover {
  color: var(--danger-color);
}

/* =============================================
   MODERATION MODALS
   ============================================= */
.moderation-modal {
  padding: 20px;
  max-width: 440px;
}

.moderation-modal h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.moderation-modal h2 i {
  color: var(--brand-color);
}

.moderation-modal p {
  color: var(--text-muted);
  margin-bottom: 20px;
}

.moderation-modal textarea {
  width: 100%;
  padding: 12px;
  background-color: var(--bg-tertiary);
  border: none;
  border-radius: 4px;
  color: var(--text-primary);
  font-family: inherit;
  resize: vertical;
}

.moderation-modal textarea:focus {
  outline: 2px solid var(--brand-color);
}

.moderation-modal select {
  width: 100%;
  padding: 12px;
  background-color: var(--bg-tertiary);
  border: none;
  border-radius: 4px;
  color: var(--text-primary);
  cursor: pointer;
}

.btn-danger {
  background-color: var(--danger-color);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.2s;
}

.btn-danger:hover {
  background-color: #c0392b;
}

/* =============================================
   ROLE MANAGEMENT
   ============================================= */
.roles-manager {
  max-width: 600px;
}

.roles-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.roles-header p {
  color: var(--text-muted);
}

.roles-list-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.role-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background-color: var(--bg-tertiary);
  border-radius: 4px;
  transition: background-color 0.15s;
}

.role-item:hover {
  background-color: var(--bg-modifier-hover);
}

.role-color-preview {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
}

.role-name {
  flex: 1;
  color: var(--text-primary);
  font-weight: 500;
}

.role-members {
  color: var(--text-muted);
  font-size: 13px;
}

.role-actions {
  display: flex;
  gap: 8px;
}

.role-checkbox {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background-color: var(--bg-tertiary);
  border-radius: 4px;
  cursor: pointer;
  margin-bottom: 8px;
}

.role-checkbox:hover {
  background-color: var(--bg-modifier-hover);
}

.role-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--brand-color);
}

.role-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.permissions-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 200px;
  overflow-y: auto;
  padding: 8px;
  background-color: var(--bg-tertiary);
  border-radius: 4px;
}

.permission-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: background-color 0.15s;
}

.permission-checkbox:hover {
  background-color: var(--bg-modifier-hover);
}

.permission-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--brand-color);
}

/* =============================================
   BANS LIST
   ============================================= */
.bans-manager {
  max-width: 600px;
}

.bans-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.ban-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background-color: var(--bg-tertiary);
  border-radius: 4px;
}

.ban-user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.ban-user .mini-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
}

.ban-reason {
  color: var(--text-muted);
  font-size: 13px;
  flex: 1;
}

/* =============================================
   DANGER ZONE
   ============================================= */
.danger-zone {
  padding: 20px;
  background-color: rgba(237, 66, 69, 0.1);
  border: 1px solid var(--danger-color);
  border-radius: 8px;
}

.danger-zone h3 {
  color: var(--danger-color);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.danger-zone p {
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* =============================================
   UPLOAD MENU
   ============================================= */
.upload-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.15s;
}

.upload-btn:hover {
  color: var(--text-primary);
  background-color: var(--bg-modifier-hover);
}

.upload-btn i {
  font-size: 20px;
}

.upload-menu {
  background-color: var(--bg-floating);
  border-radius: 8px;
  padding: 8px;
  min-width: 200px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  z-index: 10000;
}

.upload-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.15s;
}

.upload-option:hover {
  background-color: var(--brand-color);
  color: white;
}

.upload-option i {
  width: 20px;
  text-align: center;
}

/* =============================================
   EMOJI BUTTON
   ============================================= */
.emoji-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.15s;
}

.emoji-btn:hover {
  color: var(--text-primary);
}

/* =============================================
   INPUT FORM IMPROVEMENTS
   ============================================= */
.input-form {
  display: flex;
  align-items: center;
  background-color: var(--bg-tertiary);
  border-radius: 8px;
  padding: 0 8px;
}

.input-form #message-input {
  flex: 1;
  background: none;
  border: none;
  padding: 12px 8px;
  color: var(--text-primary);
  font-size: 15px;
}

.input-form #message-input:focus {
  outline: none;
}

.input-form #message-input::placeholder {
  color: var(--text-muted);
}

/* =============================================
   SERVER DROPDOWN IMPROVEMENTS
   ============================================= */
.server-dropdown {
  background-color: var(--bg-floating);
  border-radius: 4px;
  padding: 6px 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 10000;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 14px;
  transition: all 0.1s;
}

.dropdown-item:hover {
  background-color: var(--brand-color);
  color: white;
}

.dropdown-item.danger {
  color: var(--danger-color);
}

.dropdown-item.danger:hover {
  background-color: var(--danger-color);
  color: white;
}

.dropdown-separator {
  height: 1px;
  background-color: var(--bg-modifier-accent);
  margin: 4px 0;
}

/* =============================================
   ROLES MODAL
   ============================================= */
.roles-modal {
  max-width: 400px;
}

.roles-modal .roles-list {
  max-height: 300px;
  overflow-y: auto;
}