﻿:root {
  --bg-dark: #0f172a;
  --bg-sidebar: #090d16;
  --bg-chat: #131d31;
  --bg-card: rgba(30, 41, 59, 0.7);
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border: rgba(255, 255, 255, 0.08);
  --online: #10b981;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: 'Inter', sans-serif;
  height: 100vh;
  overflow: hidden;
}

.app-container {
  display: flex;
  height: 100vh;
}

/* SIDEBAR */
.sidebar {
  width: 280px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 15px;
}
.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand h2 { font-size: 18px; font-weight: 700; color: #fff; }
.user-status-badge { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.online { background: var(--online); box-shadow: 0 0 8px var(--online); }
.admin-badge { background: #ef4444; color: #fff; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 4px; }

.nav-section { margin-bottom: 25px; }
.nav-section h3 { font-size: 11px; text-transform: uppercase; color: var(--text-muted); letter-spacing: 1px; margin-bottom: 10px; }

.channel-btn, .dm-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
}
.channel-btn:hover, .dm-btn:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }
.channel-btn.active, .dm-btn.active { background: var(--accent); color: #fff; font-weight: 600; }
.ch-icon { font-weight: 700; font-size: 16px; opacity: 0.7; }
.badge { background: #38bdf8; color: #000; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 10px; margin-left: auto; }

.dm-meta { display: flex; flex-direction: column; overflow: hidden; }
.dm-name { font-weight: 600; color: #fff; font-size: 13px; }
.dm-preview { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unread-dot { width: 6px; height: 6px; background: #38bdf8; border-radius: 50%; margin-left: auto; }

/* CHAT MAIN */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-chat);
}
.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 25px;
  background: rgba(15, 23, 42, 0.8);
  border-bottom: 1px solid var(--border);
}
.chat-header h3 { font-size: 18px; font-weight: 700; color: #fff; }
.ch-sub { font-size: 12px; color: var(--text-muted); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: #fff; padding: 6px 14px; border-radius: 6px; font-size: 13px; cursor: pointer; }
.btn-outline:hover { background: rgba(255,255,255,0.08); }

.messages-container {
  flex: 1;
  padding: 25px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.message-bubble {
  display: flex;
  gap: 12px;
  max-width: 80%;
  animation: fadeIn 0.2s ease;
}
.message-bubble.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg-avatar { font-size: 24px; }
.msg-content-wrapper { display: flex; flex-direction: column; }
.msg-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 12px; color: var(--text-muted); }
.msg-author { font-weight: 600; color: #fff; }
.msg-bubble-box {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--border);
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  color: #f1f5f9;
}
.message-bubble.mine .msg-bubble-box {
  background: #2563eb;
  border-color: #3b82f6;
  color: #fff;
}

.chat-input-container {
  padding: 15px 25px;
  background: rgba(15, 23, 42, 0.9);
  border-top: 1px solid var(--border);
}
.chat-input-container form { display: flex; gap: 10px; }
.chat-input-container input {
  flex: 1;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  color: #fff;
  font-size: 14px;
  outline: none;
}
.chat-input-container input:focus { border-color: var(--accent); }
.send-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.send-btn:hover { background: var(--accent-hover); }

/* RIGHT PANEL */
.right-panel {
  width: 320px;
  background: var(--bg-sidebar);
  border-left: 1px solid var(--border);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.panel-box h3 { font-size: 13px; text-transform: uppercase; color: var(--text-muted); letter-spacing: 1px; margin-bottom: 12px; }

.survey-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}
.survey-card h4 { font-size: 14px; margin-bottom: 12px; color: #fff; line-height: 1.4; }
.survey-options { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.survey-opt-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  padding: 10px 12px;
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  transition: all 0.2s;
}
.survey-opt-btn:hover { background: rgba(59, 130, 246, 0.15); border-color: var(--accent); }
.survey-opt-btn.voted { border-color: var(--accent); font-weight: 600; }
.vote-progress {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  background: rgba(59, 130, 246, 0.25);
  z-index: 1;
}
.opt-label, .opt-pct { position: relative; z-index: 2; }
.survey-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); }
.tag { background: rgba(16, 185, 129, 0.2); color: #10b981; padding: 2px 6px; border-radius: 4px; font-weight: 600; }
.tag.admin { background: rgba(239, 68, 68, 0.2); color: #ef4444; }

.online-users-list { display: flex; flex-direction: column; gap: 10px; }
.user-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }