/* Discord Bot Client - Pixel-Perfect Discord Theme */
:root {
  --bg-primary: #313338;
  --bg-secondary: #2b2d31;
  --bg-secondary-alt: #232428;
  --bg-tertiary: #1e1f22;
  --channeltextarea-bg: #383a40;
  --bg-mod-subtle: rgba(255, 255, 255, 0.04);
  --bg-mod-hover: rgba(255, 255, 255, 0.07);
  --bg-mod-active: rgba(255, 255, 255, 0.1);
  --bg-message-hover: #2e3035;

  --accent-blurple: #5865f2;
  --accent-blurple-hover: #4752c4;
  --accent-green: #23a55a;
  --accent-yellow: #f0b232;
  --accent-red: #f23f43;

  --text-normal: #dbdee1;
  --text-muted: #949ba4;
  --text-header: #f2f3f5;
  --text-link: #00a8fc;
  --text-positive: #23a55a;
  --text-danger: #f23f43;

  --interactive-normal: #949ba4;
  --interactive-hover: #dbdee1;
  --interactive-active: #ffffff;
  --interactive-muted: #4e5058;

  --font-main: "gg sans", "Noto Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-code: "Consolas", "Andale Mono WT", "Andale Mono", "Lucida Console", "Courier New", monospace;

  --status-online: #23a55a;
  --status-idle: #f0b232;
  --status-dnd: #f23f43;
  --status-offline: #80848e;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-tertiary);
  color: var(--text-normal);
  font-family: var(--font-main);
  font-size: 15px;
  line-height: 1.4;
  overflow: hidden;
  user-select: text;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  border: none;
  outline: none;
  background: none;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #1a1b1e;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #111214;
}

#app-container {
  display: flex;
  width: 100vw;
  height: 100vh;
  position: relative;
}

/* =========================================================
   1. LEFT SERVER RAIL
   ========================================================= */
#guild-rail {
  width: 72px;
  background-color: var(--bg-tertiary);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0;
  flex-shrink: 0;
  user-select: none;
  z-index: 10;
}

.rail-item {
  position: relative;
  width: 72px;
  height: 48px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  margin-bottom: 8px;
}

.rail-icon {
  width: 48px;
  height: 48px;
  border-radius: 24px;
  background-color: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-normal);
  transition: border-radius 0.2s cubic-bezier(0.2, 0, 0, 1), background-color 0.2s, color 0.2s;
  overflow: hidden;
  font-weight: 600;
  font-size: 15px;
}

.rail-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rail-item .pill {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 0;
  border-radius: 0 4px 4px 0;
  background-color: #ffffff;
  transition: height 0.15s ease-out;
}

.rail-item:hover .pill {
  height: 20px;
}

.rail-item:hover .rail-icon {
  border-radius: 16px;
  background-color: var(--accent-blurple);
  color: #ffffff;
}

.rail-item.active .pill {
  height: 40px;
}

.rail-item.active .rail-icon {
  border-radius: 16px;
  background-color: var(--accent-blurple);
  color: #ffffff;
}

.discord-logo-icon svg {
  width: 28px;
  height: 28px;
}

.rail-separator {
  width: 32px;
  height: 2px;
  background-color: #35363c;
  border-radius: 1px;
  margin: 4px 0 8px 0;
}

.guild-list-scroll {
  width: 100%;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.guild-list-scroll::-webkit-scrollbar {
  display: none;
}

.rail-item.add-action .rail-icon {
  background-color: var(--bg-primary);
  color: var(--accent-green);
}
.rail-item.add-action:hover .rail-icon {
  background-color: var(--accent-green);
  color: #ffffff;
  border-radius: 16px;
}

/* =========================================================
   2. CHANNELS SIDEBAR
   ========================================================= */
#sidebar-channels {
  width: 240px;
  background-color: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  user-select: none;
  border-top-left-radius: 8px;
  overflow: hidden;
}

#guild-header {
  height: 48px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(0, 0, 0, 0.24);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: background-color 0.15s;
}

#guild-header:hover {
  background-color: var(--bg-mod-subtle);
}

#guild-header-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-header);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-chevron {
  color: var(--interactive-normal);
  flex-shrink: 0;
}

.intent-banner {
  background: rgba(240, 178, 50, 0.15);
  border-left: 3px solid var(--accent-yellow);
  color: #ffdc88;
  padding: 8px 12px;
  font-size: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.intent-banner.hidden {
  display: none;
}

.channel-list-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.channel-category {
  padding: 12px 4px 4px 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.category-arrow {
  width: 12px;
  height: 12px;
  transition: transform 0.2s ease;
}
.channel-category.collapsed .category-arrow {
  transform: rotate(-90deg);
}

.channel-item {
  display: flex;
  align-items: center;
  padding: 6px 8px;
  border-radius: 4px;
  margin: 1px 0;
  color: var(--interactive-normal);
  cursor: pointer;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  gap: 8px;
  transition: background-color 0.1s, color 0.1s;
}

.channel-item:hover {
  background-color: var(--bg-mod-subtle);
  color: var(--interactive-hover);
}

.channel-item.active {
  background-color: var(--bg-mod-active);
  color: var(--interactive-active);
}

.channel-icon {
  font-size: 18px;
  font-weight: 600;
  color: var(--interactive-muted);
  width: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.channel-item.active .channel-icon {
  color: var(--interactive-active);
}

.channel-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.empty-channels-state {
  color: var(--text-muted);
  font-size: 13px;
  padding: 20px 12px;
  text-align: center;
}

/* User Panel */
#user-panel {
  height: 52px;
  background-color: var(--bg-secondary-alt);
  display: flex;
  align-items: center;
  padding: 0 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  gap: 8px;
}

.user-avatar-wrap {
  position: relative;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

#bot-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--bg-tertiary);
  object-fit: cover;
}

.status-indicator {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--bg-secondary-alt);
}
.status-indicator.online { background-color: var(--status-online); }
.status-indicator.offline { background-color: var(--status-offline); }

.user-info {
  flex: 1;
  overflow: hidden;
  line-height: 1.2;
}

.user-name-line {
  display: flex;
  align-items: center;
  gap: 4px;
}

#bot-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-header);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bot-badge {
  background-color: var(--accent-blurple);
  color: #ffffff;
  font-size: 9px;
  font-weight: 700;
  border-radius: 3px;
  padding: 1px 4px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

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

.user-actions {
  display: flex;
  align-items: center;
}

.icon-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--interactive-normal);
  border-radius: 4px;
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s;
}

.icon-btn:hover {
  color: var(--interactive-hover);
  background-color: var(--bg-mod-subtle);
}

/* =========================================================
   3. CHAT AREA
   ========================================================= */
#chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-primary);
  min-width: 0;
  height: 100%;
}

#chat-header {
  height: 48px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(0, 0, 0, 0.24);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
  z-index: 5;
}

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

.channel-hash-icon {
  font-size: 22px;
  font-weight: 600;
  color: var(--interactive-muted);
}

#current-channel-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-header);
  white-space: nowrap;
}

.header-divider {
  width: 1px;
  height: 16px;
  background-color: rgba(255, 255, 255, 0.1);
  margin: 0 4px;
}

.channel-topic {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.header-icon-btn {
  color: var(--interactive-normal);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}
.header-icon-btn:hover, .header-icon-btn.active {
  color: var(--interactive-active);
}

#chat-viewport {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  padding: 0 0 16px 0;
}

#messages-container {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 100%;
}

.welcome-channel-splash {
  padding: 24px 16px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.welcome-hash-circle {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background-color: var(--channeltextarea-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
}

.welcome-channel-splash h2 {
  font-size: 28px;
  color: var(--text-header);
  font-weight: 700;
}

.welcome-channel-splash p {
  color: var(--text-muted);
  font-size: 14px;
}

/* Message Rows */
.message-row {
  position: relative;
  display: flex;
  padding: 3px 16px;
  margin-top: 14px;
  gap: 16px;
  transition: background-color 0.1s;
}

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

.message-row.compact-row {
  margin-top: 0;
  padding-top: 2px;
  padding-bottom: 2px;
}

.msg-avatar-wrap {
  width: 40px;
  flex-shrink: 0;
}

.msg-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--bg-secondary-alt);
  object-fit: cover;
  cursor: pointer;
}

.compact-row .msg-avatar-wrap {
  display: none;
}
.compact-row {
  padding-left: 72px;
}

.compact-row .compact-timestamp {
  position: absolute;
  left: 16px;
  top: 2px;
  font-size: 10px;
  color: var(--text-muted);
  display: none;
  width: 46px;
  text-align: right;
  line-height: 1.5;
}
.compact-row:hover .compact-timestamp {
  display: block;
}

.msg-content-wrap {
  flex: 1;
  min-width: 0;
}

.msg-header {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 2px;
}

.msg-author {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-header);
  cursor: pointer;
}
.msg-author:hover {
  text-decoration: underline;
}

.msg-timestamp {
  font-size: 11px;
  color: var(--text-muted);
}

.msg-reference-quote {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
  position: relative;
}

.msg-reference-quote::before {
  content: "";
  display: inline-block;
  width: 24px;
  height: 10px;
  border-left: 2px solid #4e5058;
  border-top: 2px solid #4e5058;
  border-top-left-radius: 4px;
  margin-right: 2px;
  margin-top: 4px;
}

.msg-reference-quote .ref-avatar {
  width: 16px;
  height: 16px;
  border-radius: 50%;
}

.msg-body {
  font-size: 14px;
  color: var(--text-normal);
  line-height: 1.375rem;
  word-break: break-word;
  white-space: pre-wrap;
}

.msg-body a {
  color: var(--text-link);
  text-decoration: none;
}
.msg-body a:hover {
  text-decoration: underline;
}

.msg-body code {
  background-color: var(--bg-secondary-alt);
  padding: 2px 4px;
  border-radius: 3px;
  font-family: var(--font-code);
  font-size: 13px;
}

.msg-body pre {
  background-color: var(--bg-tertiary);
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  padding: 8px 12px;
  margin: 6px 0;
  overflow-x: auto;
  font-family: var(--font-code);
  font-size: 13px;
}

.msg-body blockquote {
  border-left: 4px solid #4e5058;
  padding-left: 10px;
  margin: 4px 0;
  color: var(--text-muted);
}

.msg-body .mention {
  background: rgba(88, 101, 242, 0.2);
  color: #c9cdfb;
  border-radius: 3px;
  padding: 1px 4px;
  font-weight: 500;
}

.msg-body .spoiler {
  background-color: #232428;
  color: transparent;
  border-radius: 3px;
  padding: 0 3px;
  cursor: pointer;
  user-select: none;
}
.msg-body .spoiler.revealed {
  color: var(--text-normal);
  background-color: rgba(255, 255, 255, 0.08);
  user-select: text;
}

.edited-tag {
  font-size: 10px;
  color: var(--text-muted);
  margin-left: 4px;
}

/* Attachments */
.msg-attachments {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.att-img {
  max-width: 400px;
  max-height: 300px;
  border-radius: 6px;
  cursor: pointer;
  object-fit: contain;
  background-color: #1a1b1e;
  transition: transform 0.1s;
}
.att-img:hover {
  filter: brightness(0.95);
}

.att-file-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: var(--bg-secondary);
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  padding: 8px 12px;
  max-width: 380px;
}

.att-file-box a {
  color: var(--text-link);
  font-weight: 500;
  text-decoration: none;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.att-file-box a:hover {
  text-decoration: underline;
}

.att-file-size {
  font-size: 11px;
  color: var(--text-muted);
}

/* Embeds */
.msg-embeds {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.embed-card {
  display: flex;
  background-color: var(--bg-secondary);
  border-radius: 4px;
  border-left: 4px solid var(--accent-blurple);
  max-width: 520px;
  padding: 10px 14px;
  flex-direction: column;
  gap: 6px;
}

.embed-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-header);
}

.embed-desc {
  font-size: 13px;
  color: var(--text-normal);
  line-height: 1.35;
}

.embed-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin-top: 4px;
}

.embed-field-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-header);
}
.embed-field-value {
  font-size: 12px;
  color: var(--text-muted);
}

.embed-image {
  max-width: 100%;
  border-radius: 4px;
  margin-top: 6px;
}

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

/* Message Action Floating Toolbar */
.msg-actions-toolbar {
  position: absolute;
  right: 16px;
  top: -14px;
  background-color: var(--bg-secondary);
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  display: none;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  z-index: 4;
}

.message-row:hover .msg-actions-toolbar {
  display: flex;
}

.msg-action-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--interactive-normal);
  cursor: pointer;
  transition: color 0.1s, background-color 0.1s;
}
.msg-action-btn:hover {
  color: var(--interactive-hover);
  background-color: var(--bg-mod-subtle);
}
.msg-action-btn.delete:hover {
  color: var(--accent-red);
}

/* Chat Input Wrapper */
#chat-input-wrapper {
  padding: 0 16px 20px 16px;
  flex-shrink: 0;
  position: relative;
}

.reply-banner {
  background-color: var(--bg-secondary-alt);
  padding: 6px 12px;
  border-radius: 8px 8px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
  border-left: 2px solid var(--accent-blurple);
}
.reply-banner.hidden {
  display: none;
}

.reply-banner-content {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reply-cancel-btn {
  color: var(--interactive-normal);
  cursor: pointer;
  font-weight: 700;
  padding: 2px 6px;
}
.reply-cancel-btn:hover {
  color: var(--accent-red);
}

.file-staging-bar {
  background-color: var(--bg-secondary);
  padding: 8px 12px;
  border-radius: 8px 8px 0 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.file-staging-bar.hidden {
  display: none;
}

.staged-file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--bg-primary);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--text-normal);
}

.remove-staged-btn {
  cursor: pointer;
  color: var(--text-muted);
  font-weight: 700;
}
.remove-staged-btn:hover {
  color: var(--accent-red);
}

.chat-input-box {
  background-color: var(--channeltextarea-bg);
  border-radius: 8px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  min-height: 44px;
}

.input-action-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--interactive-normal);
  cursor: pointer;
  border-radius: 50%;
  transition: color 0.15s, background-color 0.15s;
  flex-shrink: 0;
}
.input-action-btn:hover {
  color: var(--interactive-hover);
  background-color: var(--bg-mod-subtle);
}

.send-btn {
  color: var(--accent-blurple);
}
.send-btn:hover {
  color: var(--accent-blurple-hover);
}

#message-input {
  flex: 1;
  padding: 10px 8px;
  resize: none;
  max-height: 140px;
  color: var(--text-normal);
  line-height: 1.35;
  font-size: 14px;
}
#message-input::placeholder {
  color: var(--text-muted);
}

.typing-indicator {
  position: absolute;
  bottom: 2px;
  left: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}
.typing-indicator.hidden {
  display: none;
}

.typing-dots {
  display: flex;
  align-items: center;
  gap: 2px;
}
.typing-dots span {
  width: 4px;
  height: 4px;
  background-color: var(--text-muted);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out both;
}
.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* =========================================================
   4. MEMBERS SIDEBAR
   ========================================================= */
#sidebar-members {
  width: 240px;
  background-color: var(--bg-secondary);
  flex-shrink: 0;
  overflow-y: auto;
  user-select: none;
  transition: width 0.2s ease, opacity 0.2s ease;
}
#sidebar-members.collapsed {
  width: 0;
  opacity: 0;
  pointer-events: none;
}

.members-scroll {
  padding: 16px 8px;
}

.member-role-group {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  padding: 8px 8px 4px 8px;
}

.member-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.1s;
}
.member-item:hover {
  background-color: var(--bg-mod-subtle);
}

.member-avatar-wrap {
  position: relative;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.member-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--bg-secondary-alt);
  object-fit: cover;
}

.member-info {
  flex: 1;
  overflow: hidden;
  line-height: 1.2;
}

.member-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-normal);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* =========================================================
   5. LOGIN MODAL
   ========================================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
  transition: opacity 0.2s;
}
.modal-overlay.hidden {
  display: none;
}

.modal-box {
  background-color: var(--bg-primary);
  width: 100%;
  max-width: 480px;
  border-radius: 8px;
  padding: 32px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  animation: modalPop 0.2s ease-out;
}

@keyframes modalPop {
  from { transform: scale(0.94); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  text-align: center;
  margin-bottom: 20px;
}

.discord-logo-large {
  width: 54px;
  height: 54px;
  margin: 0 auto 12px auto;
}

.modal-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-header);
  margin-bottom: 6px;
}

.modal-sub {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}

.login-error-alert {
  background: rgba(242, 63, 67, 0.15);
  border: 1px solid var(--accent-red);
  color: #ff9da0;
  border-radius: 4px;
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 16px;
}
.login-error-alert.hidden {
  display: none;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.form-label .required {
  color: var(--accent-red);
}

.token-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background-color: var(--bg-tertiary);
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.3);
  margin-bottom: 14px;
}
.token-input-wrapper:focus-within {
  border-color: var(--accent-blurple);
}

#token-input {
  flex: 1;
  padding: 12px 14px;
  font-family: var(--font-code);
  font-size: 13px;
  color: var(--text-normal);
}

.toggle-eye-btn {
  padding: 10px;
  color: var(--interactive-normal);
  cursor: pointer;
}
.toggle-eye-btn:hover {
  color: var(--interactive-hover);
}

.checkbox-row {
  margin-bottom: 14px;
}

.custom-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-normal);
  cursor: pointer;
  user-select: none;
}

.modal-hint {
  background-color: var(--bg-secondary);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 24px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.modal-hint b {
  color: var(--text-header);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.btn-primary {
  background-color: var(--accent-blurple);
  color: #ffffff;
  padding: 12px 24px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s;
}
.btn-primary:hover {
  background-color: var(--accent-blurple-hover);
}

.btn-secondary {
  background-color: transparent;
  color: var(--text-normal);
  padding: 12px 18px;
  border-radius: 4px;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-secondary:hover {
  text-decoration: underline;
}

.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.btn-spinner.hidden {
  display: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* =========================================================
   6. LIGHTBOX OVERLAY
   ========================================================= */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  backdrop-filter: blur(5px);
}
.lightbox-overlay.hidden {
  display: none;
}

.lightbox-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 90vw;
  max-height: 90vh;
}

#lightbox-img {
  max-width: 85vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.lightbox-bar {
  display: flex;
  gap: 12px;
}

/* =========================================================
   7. DIRECT MESSAGES & FRIENDS VIEW STYLES
   ========================================================= */
.sidebar-subview {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}
.sidebar-subview.hidden {
  display: none !important;
}

.main-subview {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: 100%;
  min-width: 0;
}
.main-subview.hidden {
  display: none !important;
}

.dm-search-header {
  height: 48px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.24);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.dm-search-btn {
  width: 100%;
  height: 28px;
  background-color: var(--bg-tertiary);
  border-radius: 4px;
  padding: 0 10px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: background-color 0.15s;
}
.dm-search-btn:hover {
  background-color: #1a1b1e;
  color: var(--interactive-hover);
}

.dm-nav-list {
  padding: 8px 8px 0 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  height: 42px;
  border-radius: 4px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 15px;
  font-weight: 500;
  color: var(--interactive-normal);
  cursor: pointer;
  transition: background-color 0.1s, color 0.1s;
}
.nav-item:hover {
  background-color: var(--bg-mod-subtle);
  color: var(--interactive-hover);
}
.nav-item.active {
  background-color: var(--bg-mod-active);
  color: var(--interactive-active);
}

.nav-icon {
  flex-shrink: 0;
}

.dm-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 12px 6px 16px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.dm-create-btn {
  color: var(--interactive-normal);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  border-radius: 3px;
}
.dm-create-btn:hover {
  color: var(--interactive-active);
}

.dm-list-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.dm-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--interactive-normal);
  margin-bottom: 1px;
  transition: background-color 0.1s, color 0.1s;
}
.dm-item:hover {
  background-color: var(--bg-mod-subtle);
  color: var(--interactive-hover);
}
.dm-item.active {
  background-color: var(--bg-mod-active);
  color: var(--interactive-active);
}

.dm-avatar-wrap {
  position: relative;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.dm-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background-color: var(--bg-secondary-alt);
}

.dm-item-info {
  flex: 1;
  overflow: hidden;
  line-height: 1.2;
}

.dm-name {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--interactive-normal);
}
.dm-item:hover .dm-name, .dm-item.active .dm-name {
  color: var(--interactive-active);
}

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

.dm-close-btn {
  position: absolute;
  right: 8px;
  display: none;
  font-size: 14px;
  font-weight: 700;
  color: var(--interactive-normal);
  padding: 2px 6px;
  border-radius: 3px;
  cursor: pointer;
}
.dm-item:hover .dm-close-btn {
  display: block;
}
.dm-close-btn:hover {
  color: var(--accent-red);
}

/* Friends View */
#friends-header {
  height: 48px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(0, 0, 0, 0.24);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

#friends-header .header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-icon {
  color: var(--interactive-muted);
}

.header-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-header);
}

.friends-tabs {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tab-btn {
  font-size: 14px;
  font-weight: 500;
  color: var(--interactive-normal);
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.1s, color 0.1s;
}
.tab-btn:hover {
  background-color: var(--bg-mod-subtle);
  color: var(--interactive-hover);
}
.tab-btn.active {
  background-color: var(--bg-mod-active);
  color: var(--interactive-active);
}
.tab-btn.green {
  color: var(--accent-green);
}
.tab-btn.green.active {
  background-color: var(--accent-green);
  color: #ffffff;
}

.friends-content-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 24px 30px;
}

.friends-section {
  margin-bottom: 28px;
}

.section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-header);
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.section-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.add-dm-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: var(--bg-tertiary);
  border-radius: 8px;
  padding: 10px 14px;
  border: 1px solid rgba(0, 0, 0, 0.3);
}
.add-dm-box:focus-within {
  border-color: var(--accent-blurple);
}

.add-dm-box input {
  flex: 1;
  font-size: 14px;
  color: var(--text-normal);
}

.add-dm-status {
  margin-top: 8px;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 4px;
}
.add-dm-status.error {
  background: rgba(242, 63, 67, 0.15);
  color: #ff9da0;
  border: 1px solid var(--accent-red);
}
.add-dm-status.success {
  background: rgba(35, 165, 90, 0.15);
  color: #8ce1ab;
  border: 1px solid var(--accent-green);
}

.friends-cards-grid {
  display: flex;
  flex-direction: column;
  margin-top: 10px;
}

.friend-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: background-color 0.15s;
}
.friend-card:hover {
  background-color: var(--bg-mod-subtle);
}

.friend-card-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.friend-card-avatar-wrap {
  position: relative;
  width: 40px;
  height: 40px;
}

.friend-card-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background-color: var(--bg-secondary-alt);
}

.friend-card-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-header);
}

.friend-card-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.friend-card-btn {
  background-color: var(--bg-secondary-alt);
  color: var(--interactive-normal);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.friend-card-btn:hover {
  background-color: var(--accent-blurple);
  color: #ffffff;
}

/* =========================================================
   8. QUICK SWITCHER & STATUS POPOUT
   ========================================================= */
.quick-switcher-box {
  width: 570px;
  background-color: var(--bg-primary);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalPop 0.15s ease-out;
}

#quick-switcher-input {
  background-color: var(--bg-tertiary);
  color: var(--text-header);
  font-size: 16px;
  padding: 16px 20px;
  border: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.3);
}

.quick-switcher-results {
  max-height: 360px;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.quick-switcher-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--interactive-normal);
  transition: background-color 0.1s, color 0.1s;
}
.quick-switcher-item:hover, .quick-switcher-item.selected {
  background-color: var(--bg-mod-subtle);
  color: var(--interactive-active);
}

.quick-switcher-icon {
  font-size: 18px;
  font-weight: 700;
  width: 20px;
  text-align: center;
  color: var(--interactive-muted);
}

.quick-switcher-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-normal);
}

.quick-switcher-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
}

.quick-switcher-footer {
  background-color: var(--bg-secondary-alt);
  padding: 10px 16px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid rgba(0, 0, 0, 0.2);
}
.quick-switcher-footer kbd {
  background: rgba(255, 255, 255, 0.1);
  padding: 1px 4px;
  border-radius: 3px;
  color: var(--text-normal);
}

/* Status Popout */
.status-popout {
  position: fixed;
  bottom: 56px;
  left: 80px;
  width: 270px;
  background-color: var(--bg-secondary-alt);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  padding: 8px;
  z-index: 1200;
  border: 1px solid rgba(0, 0, 0, 0.3);
}
.status-popout.hidden {
  display: none;
}

.status-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.1s;
}
.status-option:hover {
  background-color: var(--bg-mod-subtle);
}

.status-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-header);
}

.status-desc {
  font-size: 11px;
  color: var(--text-muted);
}

.status-divider {
  height: 1px;
  background-color: rgba(255, 255, 255, 0.08);
  margin: 6px 0;
}

.activity-setter {
  padding: 6px 4px;
}

.activity-row {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

#activity-type-select {
  background-color: var(--bg-tertiary);
  color: var(--text-normal);
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 12px;
  border: 1px solid rgba(0, 0, 0, 0.3);
}

#activity-name-input {
  flex: 1;
  background-color: var(--bg-tertiary);
  color: var(--text-normal);
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 12px;
  border: 1px solid rgba(0, 0, 0, 0.3);
}

.small-btn {
  width: 100%;
  padding: 6px 0;
  font-size: 12px;
}


