/* ---------------- tokens ----------------
   Paleta tirada da propria logo: superficies em roxo-marinho escuro e a
   marca no degrade do "N" (#e2a5fa -> #4f22cb).
   ---------------------------------------- */
:root {
  --rail: #0d0b17;
  --sidebar: #141221;
  --chat: #1d182d;
  --modal: #1d182d;
  --modal-alt: #141221;
  --input: #272038;
  --input-alt: #0d0b17;
  --hover: rgba(149, 69, 243, 0.12);
  --active: rgba(149, 69, 243, 0.2);
  --selected: rgba(149, 69, 243, 0.26);
  --divider: #2e2545;
  --text: #d8d3e6;
  --text-bright: #f4f1fb;
  --text-muted: #948ead;
  --text-faint: #8b84ad;
  --link: #5ac8fa;
  --brand: #9545f3;
  --brand-hover: #7c2ff0;
  --brand-soft: #b15bf8;
  --brand-light: #e495f9;
  --brand-deep: #4c1cd4;
  --brand-gradient: linear-gradient(150deg, #e495f9 0%, #9545f3 45%, #4c1cd4 100%);
  --brand-glow: rgba(149, 69, 243, 0.42);
  --green: #23a55a;
  --yellow: #f0b232;
  /* destaque do dono do servidor: precisa de valor diferente em cada tema */
  --owner: #f0b232;
  --red: #f23f43;
  --danger: #d93b40;
  --danger-hover: #a12828;
  --mention-bg: rgba(149, 69, 243, 0.18);
  --mention-border: #9545f3;
  --shadow-low: 0 1px 0 rgba(0, 0, 0, 0.3), 0 1.5px 0 rgba(0, 0, 0, 0.1);
  --shadow-high: 0 8px 20px rgba(0, 0, 0, 0.45);
  --radius: 8px;
  --font: "gg sans", "Segoe UI", Roboto, "Helvetica Neue", Ubuntu, Cantarell, sans-serif;
  --mono: "Consolas", "Cascadia Code", "Fira Code", Menlo, Monaco, monospace;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --rail: #e4e2ee;
  --sidebar: #f2f1f8;
  --chat: #ffffff;
  --modal: #ffffff;
  --modal-alt: #f2f1f8;
  --input: #eae8f4;
  --input-alt: #e4e2ee;
  --hover: rgba(149, 69, 243, 0.09);
  --active: rgba(149, 69, 243, 0.15);
  --selected: rgba(149, 69, 243, 0.2);
  --divider: #e0dcec;
  --text: #2c2b3d;
  --text-bright: #14131f;
  --text-muted: #5d5b73;
  --text-faint: #6c6a84;
  --link: #0a6ea8;
  --owner: #8a5a00;
  --mention-bg: rgba(149, 69, 243, 0.14);
  --shadow-low: 0 1px 0 rgba(20, 19, 31, 0.08);
  --shadow-high: 0 8px 20px rgba(20, 19, 31, 0.16);
  color-scheme: light;
}

/* ---------------- reset ---------------- */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.375;
  color: var(--text);
  background: var(--chat);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
}

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

img { max-width: 100%; display: block; }

ul, ol { margin: 0; padding: 0; list-style: none; }

h1, h2, h3, h4, p { margin: 0; }

.hidden { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------------- scrollbars ---------------- */
.scroll { overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--rail) transparent; }
.scroll::-webkit-scrollbar { width: 8px; height: 8px; }
.scroll::-webkit-scrollbar-track { background: transparent; }
.scroll::-webkit-scrollbar-thumb { background: var(--rail); border-radius: 4px; }
.scroll-thin::-webkit-scrollbar { width: 4px; }

/* ---------------- utilitarios ---------------- */
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--divider);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in {
  from { opacity: 0; transform: scale(0.94) translateY(6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
