/* web/public/css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

/* ── Variables ───────────────────────────────── */
:root {
  --bg:          #0f0808;
  --bg2:         #160c0c;
  --surface:     #1e1010;
  --surface2:    #271414;
  --border:      rgba(180,30,30,.25);
  --red:         #8B0000;
  --red-mid:     #a31212;
  --red-bright:  #c0392b;
  --red-glow:    rgba(139,0,0,.35);
  --accent:      #e05252;
  --text:        #f0e8e8;
  --text-muted:  #9a8080;
  --text-dim:    #6a5050;
  --sidebar-w:   240px;
  --radius:      8px;
  --font:        'Poppins', sans-serif;
}

/* ── Reset ───────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body {
  margin: 0;
  padding: 0;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #000000;
  color: var(--text);
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }

/* ── Scrollbar ───────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--red); border-radius: 3px; }

/* ── Sidebar ─────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, #490101 0%, #020101 100%);
  border-right: 1px solid rgba(255,255,255,0.1);
  display: flex;
  flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 50;
}

.sidebar-logo {
  padding: 1.6rem 1.4rem 1.2rem;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo .logo-text {
  font-size: 1.1rem; font-weight: 800;
  letter-spacing: .04em; color: var(--accent);
  display: block;
}
.sidebar-logo .logo-sub {
  font-size: .68rem; color: var(--text-dim);
  letter-spacing: .12em; text-transform: uppercase;
}

.sidebar-user {
  display: flex; align-items: center; gap: .75rem;
  padding: 1rem 1.4rem;
  border-bottom: 1px solid var(--border);
}
.sidebar-user img {
  width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid var(--red);
  object-fit: cover;
}
.sidebar-user .uname { font-size: .82rem; font-weight: 600; }
.sidebar-user .urole { font-size: .65rem; color: var(--accent); text-transform: uppercase; letter-spacing: .1em; }

.sidebar-nav { flex: 1; padding: .8rem 0; overflow-y: auto; }
.nav-label {
  font-size: .6rem; font-weight: 600; letter-spacing: .2em;
  text-transform: uppercase; color: var(--text-dim);
  padding: .6rem 1.4rem .3rem;
}
.nav-item {
  display: flex; align-items: center; gap: .7rem;
  padding: .6rem 1.4rem; font-size: .83rem; font-weight: 500;
  color: var(--text-muted); cursor: pointer;
  transition: background .2s, color .2s;
  border-left: 3px solid transparent;
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: .7; }
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.active {
  background: rgba(139,0,0,.18);
  color: var(--accent); border-left-color: var(--red-bright);
}
.nav-item.active svg { opacity: 1; }

.sidebar-footer {
  padding: 1rem 1.4rem;
  border-top: 1px solid var(--border);
}
.sidebar-footer a {
  display: flex; align-items: center; gap: .6rem;
  font-size: .78rem; color: var(--text-dim);
  transition: color .2s;
}
.sidebar-footer a:hover { color: var(--accent); }

/* ── Main Content ─────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex; flex-direction: column;
  min-height: 100vh;
}

.topbar {
  padding: 1.2rem 2rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(15,8,8,.8);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 40;
}
.topbar-title { font-size: 1rem; font-weight: 700; }
.topbar-breadcrumb { font-size: .75rem; color: var(--text-dim); margin-top: .15rem; }
.status-pill {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .35rem .85rem; border-radius: 20px;
  font-size: .72rem; font-weight: 600; letter-spacing: .05em;
}
.status-pill.online  { background: rgba(34,197,94,.12); color: #4ade80; border: 1px solid rgba(34,197,94,.25); }
.status-pill.offline { background: rgba(239,68,68,.12);  color: #f87171; border: 1px solid rgba(239,68,68,.25); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; }
.status-pill.online  .status-dot { background: #4ade80; box-shadow: 0 0 6px #4ade80; animation: pulse-green 2s infinite; }
.status-pill.offline .status-dot { background: #f87171; }

@keyframes pulse-green {
  0%,100% { box-shadow: 0 0 4px #4ade80; }
  50%      { box-shadow: 0 0 10px #4ade80; }
}

.content { padding: 2rem; flex: 1; }

/* ── Cards ────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.6rem;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem;
}
.card-title { font-size: .85rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.card-icon {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(139,0,0,.25); color: var(--accent);
}
.card-icon svg { width: 18px; height: 18px; }

/* ── Stat Cards ───────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem; margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  position: relative; overflow: hidden;
  transition: border-color .25s, transform .2s;
}
.stat-card:hover { border-color: var(--red-mid); transform: translateY(-2px); }
.stat-card::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--red), var(--accent));
}
.stat-num { font-size: 1.9rem; font-weight: 800; color: var(--accent); line-height: 1.1; }
.stat-label { font-size: .72rem; color: var(--text-muted); font-weight: 500; letter-spacing: .06em; text-transform: uppercase; margin-top: .25rem; }
.stat-sub { font-size: .7rem; color: var(--text-dim); margin-top: .4rem; }

/* ── Table ────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: .83rem; }
thead tr { background: var(--surface2); }
th {
  padding: .7rem 1rem; text-align: left;
  font-size: .68rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--text-dim);
  border-bottom: 1px solid var(--border);
}
td {
  padding: .75rem 1rem; border-bottom: 1px solid rgba(180,30,30,.1);
  color: var(--text-muted); vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: rgba(139,0,0,.08); }

/* ── Toggle Switch ────────────────────────────── */
.toggle { position: relative; display: inline-block; width: 40px; height: 22px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 22px; transition: .25s;
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 16px; height: 16px; border-radius: 50%;
  left: 2px; bottom: 2px;
  background: var(--text-dim); transition: .25s;
}
.toggle input:checked + .toggle-slider { background: rgba(139,0,0,.4); border-color: var(--red-mid); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); background: var(--accent); box-shadow: 0 0 6px var(--red-glow); }

/* ── Badge ────────────────────────────────────── */
.badge {
  display: inline-block; padding: .2rem .6rem;
  border-radius: 4px; font-size: .65rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
}
.badge-red    { background: rgba(139,0,0,.25); color: var(--accent); border: 1px solid rgba(139,0,0,.4); }
.badge-green  { background: rgba(34,197,94,.1); color: #4ade80; border: 1px solid rgba(34,197,94,.25); }
.badge-gray   { background: rgba(100,100,100,.15); color: var(--text-dim); border: 1px solid rgba(100,100,100,.25); }
.badge-blue   { background: rgba(59,130,246,.12); color: #60a5fa; border: 1px solid rgba(59,130,246,.25); }
.badge-yellow { background: rgba(234,179,8,.1); color: #facc15; border: 1px solid rgba(234,179,8,.25); }

/* ── Log item ─────────────────────────────────── */
.log-item {
  display: flex; align-items: flex-start; gap: .85rem;
  padding: .75rem 0; border-bottom: 1px solid rgba(180,30,30,.08);
}
.log-item:last-child { border-bottom: none; }
.log-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: .4rem; }
.log-dot.command { background: #60a5fa; }
.log-dot.error   { background: #f87171; box-shadow: 0 0 6px #f87171; }
.log-dot.system  { background: var(--accent); }
.log-dot.join    { background: #4ade80; }
.log-dot.leave   { background: #facc15; }
.log-title  { font-size: .82rem; font-weight: 600; }
.log-detail { font-size: .74rem; color: var(--text-dim); margin-top: .1rem; }
.log-time   { font-size: .68rem; color: var(--text-dim); margin-left: auto; flex-shrink: 0; }

/* ── Buttons ──────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .55rem 1.2rem; border-radius: 6px;
  font-family: var(--font); font-size: .78rem; font-weight: 600;
  letter-spacing: .04em; cursor: pointer; border: none; transition: all .2s;
}
.btn-red   { background: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-bright); box-shadow: 0 4px 16px var(--red-glow); }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--red-mid); color: var(--accent); }
.btn svg { width: 14px; height: 14px; }

/* ── Section title ────────────────────────────── */
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.2rem; }
.section-title { font-size: .9rem; font-weight: 700; }
.section-sub   { font-size: .75rem; color: var(--text-dim); margin-top: .15rem; }

/* ── Filter tabs ──────────────────────────────── */
.filter-tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.filter-tab {
  padding: .35rem .9rem; border-radius: 20px;
  font-size: .72rem; font-weight: 600; cursor: pointer;
  border: 1px solid var(--border); color: var(--text-muted);
  background: transparent; font-family: var(--font);
  transition: all .2s;
}
.filter-tab:hover { border-color: var(--red-mid); color: var(--accent); }
.filter-tab.active { background: var(--red); border-color: var(--red); color: #fff; }

/* ── Login page ───────────────────────────────── */
.login-wrap {
  min-height: 100vh; width: 100%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(139,0,0,.18) 0%, transparent 70%);
}
.login-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2.8rem 2.4rem;
  width: 100%; max-width: 380px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
}
.login-logo { font-size: 1.4rem; font-weight: 800; color: var(--accent); letter-spacing: .06em; margin-bottom: .3rem; }
.login-sub  { font-size: .78rem; color: var(--text-dim); margin-bottom: 2rem; }
.login-error {
  background: rgba(139,0,0,.2); border: 1px solid rgba(139,0,0,.4);
  border-radius: 6px; padding: .7rem 1rem;
  font-size: .78rem; color: #f87171; margin-bottom: 1.2rem;
}
.btn-discord {
  display: flex; align-items: center; justify-content: center; gap: .7rem;
  width: 100%; padding: .85rem; border-radius: 8px;
  background: #5865F2; color: #fff;
  font-family: var(--font); font-size: .88rem; font-weight: 700;
  cursor: pointer; border: none; transition: background .2s, transform .2s;
  text-decoration: none;
}
.btn-discord:hover { background: #4752c4; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(88,101,242,.35); }
.btn-discord svg { width: 22px; height: 22px; }
.login-note { font-size: .68rem; color: var(--text-dim); margin-top: 1.2rem; }

/* ── Animations ───────────────────────────────── */
@keyframes fadeIn { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }
.fade-in { animation: fadeIn .35s ease both; }

/* ── Responsive ───────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .main { margin-left: 0; }
}
