/* Global chat page styles (login.html overrides body on its own) */
:root {
  /* This is what chat.js changes */
  --ui-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  margin: 0;
  font-family: var(--ui-font);
  background: #020617; /* slate-950-ish */
  color: #e5e7eb;
}

/* Top-level layout: sidebar + main chat */
#chat-layout {
  display: flex;
  height: 100vh;
}

/* ---- Left sidebar: active user list ---- */
#user-list-panel {
  width: 20%;
  min-width: 200px;
  max-width: 260px;
  background: #030712; /* very dark */
  border-right: 1px solid #1f2937;
  padding: 16px 12px;
  box-sizing: border-box;
}

#user-list-panel h3 {
  margin: 0 0 10px 0;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9ca3af;
}

#userList {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.9rem;
}

#userList li {
  padding: 4px 6px;
  border-radius: 4px;
  margin-bottom: 4px;
  background: #0b1120;
  border: 1px solid #111827;
}

/* ---- Main chat container ---- */
#chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px;
  box-sizing: border-box;

  max-width: 900px;
  margin: 0 auto;
}

/* Header: title + font picker + current user + logout */
#chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

#chat-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

#chat-header h2 {
  margin: 0;
  font-size: 1.25rem;
}

/* Font dropdown styling */
#font-label {
  font-size: 0.85rem;
  color: #9ca3af;
  opacity: 0.9;
}

#fontSelect {
  padding: 6px 8px;
  border-radius: 4px;
  border: 1px solid #4b5563;
  background: #020617;
  color: #f9fafb;
  font-weight: 600;
}

#fontSelect:focus {
  outline: none;
  border-color: #2563eb;
}

#chat-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: #9ca3af;
}

#currentUserWrapper {
  opacity: 0.85;
}

/* Messages area */
#messages {
  flex: 1;
  min-height: 0;
  background: #020617;
  border: 1px solid #1f2937;
  border-radius: 6px;
  padding: 8px 10px;
  overflow-y: auto;
  margin-bottom: 10px;
  font-size: 0.95rem;
}

/* Chat & system messages */
.chat-message,
.system-message {
  margin: 0px 0;
  padding: 0px 6px;
  border-radius: 4px;

  /* IMPORTANT: inherit so the font dropdown changes everything */
  font-family: inherit;

  white-space: pre-wrap;
}

.chat-message {
  background: #0b1120;
}

.system-message {
  background: #111827;
  opacity: 0.9;

  /* all system messages in this color */
  color: #ebab34;
}

/* Relative time text */
.time {
  display: inline-block;
  color: #9ca3af;
  opacity: 0.75;
  font-size: 0.95em;

  /* inherit so it changes too */
  font-family: inherit;
}

.private-message {
  color: #ff6b6b;
  font-weight: 600;
}

/* Input row */
#input-row {
  display: flex;
  gap: 8px;
}

#messageInput {
  flex: 1;
  padding: 8px;
  border-radius: 4px;
  border: 1px solid #4b5563;
  background: #020617;
  color: #f9fafb;

  /* inherit so it changes too */
  font-family: inherit;
}

#messageInput:focus {
  outline: none;
  border-color: #2563eb;
}

#sendBtn,
#logoutBtn {
  padding: 8px 12px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;

  /* inherit so it changes too */
  font-family: inherit;
}

#sendBtn {
  background: #22c55e;
  color: #022c22;
}

#sendBtn:hover {
  background: #16a34a;
}

#logoutBtn {
  background: #ef4444;
  color: #fee2e2;
}

#logoutBtn:hover {
  background: #b91c1c;
}

.hidden {
  display: none;
}
