/* ============================================
   CSURF.GG — Main Stylesheet v5 — TACTICAL
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:ital,wght@0,400;0,600;0,700;0,900;1,700&family=JetBrains+Mono:wght@400;500;700&family=Barlow:wght@300;400;500;600&display=swap');

:root {
  /* Core palette — near-black with green tactical accent */
  --bg:        #070809;
  --bg2:       #0b0d0f;
  --surface:   #0f1114;
  --surface2:  #141719;
  --surface3:  #1a1d21;
  --surface4:  #20242a;

  /* Borders */
  --b1: rgba(255,255,255,0.055);
  --b2: rgba(255,255,255,0.10);
  --b3: rgba(255,255,255,0.17);

  /* Accent — electric green, CS2 HUD-inspired */
  --a:       #3d9eff;
  --a2:      #60b4ff;
  --a3:      #1a7fd4;
  --aglow:   rgba(61,158,255,0.22);
  --adim:    rgba(61,158,255,0.08);
  --asubt:   rgba(61,158,255,0.04);

  /* Secondary accent — orange for warnings/hot servers */
  --hot:     #ff6b35;
  --hotdim:  rgba(255,107,53,0.12);

  --red:     #ff3d55;
  --reddim:  rgba(255,61,85,0.1);

  /* Text */
  --t:       rgba(255,255,255,0.40);
  --tdim:    rgba(255,255,255,0.20);
  --tmid:    rgba(255,255,255,0.58);
  --tbr:     rgba(255,255,255,0.88);
  --tw:      #ffffff;

  /* Typography */
  --display: 'Rajdhani', sans-serif;
  --mono:    'JetBrains Mono', monospace;
  --body:    'Rajdhani', sans-serif;

  /* Layout */
  --sidebar-w: 256px;
  --hh:        56px;
  --r:         6px;
  --rsm:       4px;
  --rlg:       12px;
  --rxl:       18px;
}

[data-theme="light"] {
  --bg:       #eef0f5;
  --bg2:      #f5f6fa;
  --surface:  #ffffff;
  --surface2: #f0f2f8;
  --surface3: #e6e9f2;
  --surface4: #dde1ee;
  --b1: rgba(0,0,0,0.06);
  --b2: rgba(0,0,0,0.11);
  --b3: rgba(0,0,0,0.18);
  --a:    #1a6fcc;
  --a2:   #1255a0;
  --a3:   #0d3d80;
  --aglow: rgba(26,111,204,0.2);
  --adim:  rgba(26,111,204,0.08);
  --asubt: rgba(26,111,204,0.04);
  --t:     rgba(0,0,0,0.45);
  --tdim:  rgba(0,0,0,0.25);
  --tmid:  rgba(0,0,0,0.60);
  --tbr:   rgba(0,0,0,0.85);
  --tw:    #080a0d;
  --red:   #cc1f33;
  --reddim: rgba(204,31,51,0.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--t);
  font-family: var(--body);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ══════════════════════════════════
   SIDEBAR — Premium v5
══════════════════════════════════ */

.sidebar-overlay {
  display: none; position: fixed; inset: 0; z-index: 400;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.sidebar-overlay.open { display: block; }

.sidebar {
  position: fixed; top: 0; left: 0;
  width: var(--sidebar-w); height: 100vh; z-index: 500;
  display: flex; flex-direction: column; overflow: hidden;

  /* Layered dark glass */
  background:
    linear-gradient(160deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0) 60%),
    linear-gradient(180deg, #0c0e14 0%, #080a0f 100%);
  border-right: 1px solid rgba(255,255,255,0.07);
  box-shadow: 4px 0 40px rgba(0,0,0,0.5);

  transform: translateX(calc(-1 * var(--sidebar-w)));
  transition: transform .36s cubic-bezier(.22,1,.36,1);
}
.sidebar.open { transform: translateX(0); }

/* Blue accent line on right edge */
.sidebar::after {
  content: ''; position: absolute; top: 0; right: 0; bottom: 0; width: 1px;
  background: linear-gradient(180deg,
    transparent 0%, rgba(61,158,255,0.5) 20%,
    rgba(61,158,255,0.5) 80%, transparent 100%);
  pointer-events: none;
}

/* ── HEADER ── */
.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 18px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex; align-items: center; gap: 11px;
  cursor: pointer; user-select: none; text-decoration: none;
}

.sidebar-logo-mark {
  width: 34px; height: 34px; flex-shrink: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(61,158,255,0.18), rgba(61,158,255,0.06));
  border: 1px solid rgba(61,158,255,0.25);
  display: flex; align-items: center; justify-content: center;
  transition: all .22s;
  box-shadow: 0 2px 12px rgba(61,158,255,0.15), inset 0 1px 0 rgba(255,255,255,0.08);
}
.sidebar-logo-mark svg { width: 17px; height: 17px; color: var(--a); }
.sidebar-logo:hover .sidebar-logo-mark {
  background: linear-gradient(135deg, rgba(61,158,255,0.28), rgba(61,158,255,0.1));
  box-shadow: 0 4px 20px rgba(61,158,255,0.3), inset 0 1px 0 rgba(255,255,255,0.1);
  border-color: rgba(61,158,255,0.45);
}

.sidebar-logo-text {
  font-family: var(--display); font-size: 19px; font-weight: 800;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--tw); line-height: 1;
  transition: color .15s;
}
.sidebar-logo-text span { color: var(--a); }
.sidebar-logo:hover .sidebar-logo-text { color: #fff; }

.sidebar-close {
  width: 30px; height: 30px; flex-shrink: 0;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s; color: var(--tdim);
}
.sidebar-close svg { width: 14px; height: 14px; }
.sidebar-close:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.15);
  color: var(--tbr);
  transform: rotate(90deg);
}

/* ── NAV ── */
.sidebar-nav {
  flex: 1; overflow-y: auto;
  padding: 8px 10px 16px;
  display: flex; flex-direction: column; gap: 2px;
}
.sidebar-nav::-webkit-scrollbar { width: 2px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* Group */
.nav-group {
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  margin-bottom: 2px;
}
.nav-group:last-child { border-bottom: none; }

.nav-group-label {
  font-family: var(--mono); font-size: 8.5px; font-weight: 700;
  letter-spacing: 3px; text-transform: uppercase;
  color: rgba(255,255,255,0.2);
  padding: 10px 8px 6px;
  display: flex; align-items: center; gap: 8px;
}
.nav-group-label::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, rgba(255,255,255,0.08) 0%, transparent 100%);
}

/* Nav item */
.nav-item {
  display: flex; align-items: center; gap: 0;
  padding: 0; margin: 1px 0; cursor: pointer;
  border-radius: 9px; overflow: hidden;
  transition: all .16s; position: relative;
  border: 1px solid transparent;
}

.nav-item-icon {
  width: 38px; height: 38px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px; margin: 3px; transition: all .16s;
}
.nav-item-icon svg { width: 15px; height: 15px; color: rgba(255,255,255,0.3); transition: color .16s; }

.nav-item-label {
  flex: 1; font-size: 13px; font-weight: 500;
  color: rgba(255,255,255,0.5); font-family: var(--body);
  padding-right: 10px; transition: color .16s;
  letter-spacing: 0.1px;
}

/* Badge (LIVE etc) */
.nav-item-badge {
  font-family: var(--mono); font-size: 8px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
  background: rgba(61,158,255,0.15);
  color: var(--a); border: 1px solid rgba(61,158,255,0.25);
  padding: 2px 6px; border-radius: 4px;
  margin-right: 8px; flex-shrink: 0;
  animation: pip 2s ease-in-out infinite;
}

/* Hover state */
.nav-item:hover {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.06);
}
.nav-item:hover .nav-item-icon svg { color: rgba(255,255,255,0.7); }
.nav-item:hover .nav-item-label { color: rgba(255,255,255,0.85); }

/* Active state */
.nav-item.active {
  background: linear-gradient(90deg,
    rgba(61,158,255,0.13) 0%,
    rgba(61,158,255,0.06) 60%,
    rgba(61,158,255,0.02) 100%);
  border-color: rgba(61,158,255,0.18);
}
.nav-item.active .nav-item-icon {
  background: rgba(61,158,255,0.14);
  box-shadow: 0 0 12px rgba(61,158,255,0.15);
}
.nav-item.active .nav-item-icon svg { color: var(--a); }
.nav-item.active .nav-item-label { color: #fff; font-weight: 600; }

/* Active left glow stripe */
.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 20%; bottom: 20%;
  width: 2.5px; border-radius: 0 3px 3px 0;
  background: var(--a);
  box-shadow: 0 0 10px var(--a), 0 0 20px rgba(61,158,255,0.4);
}

/* Hover right arrow */
.nav-item::after {
  content: '';
  position: absolute; right: 12px; top: 50%;
  width: 5px; height: 5px;
  border-top: 1.5px solid rgba(61,158,255,0.4);
  border-right: 1.5px solid rgba(61,158,255,0.4);
  transform: translateY(-50%) rotate(45deg);
  opacity: 0; transition: opacity .16s, right .16s;
}
.nav-item:hover::after { opacity: 1; right: 10px; }
.nav-item.active::after { display: none; }

/* ── FOOTER ── */
.sidebar-footer {
  flex-shrink: 0; margin: 0 10px 12px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
}
.sidebar-footer-brand {
  font-family: var(--display); font-size: 13px; font-weight: 800;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--a); margin-bottom: 3px;
}
.sidebar-footer-sub {
  font-family: var(--mono); font-size: 9px;
  color: rgba(255,255,255,0.2); letter-spacing: 0.3px; line-height: 1.5;
}

/* ── HEADER ── */
header {
  border-bottom: 1px solid var(--b1); padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between;
  height: var(--hh); position: sticky; top: 0;
  background: rgba(7,8,9,0.92);
  backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  z-index: 100;
}
[data-theme="light"] header { background: rgba(238,240,245,0.92); }

header::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--a) 30%, transparent 60%);
  opacity: 0.12; pointer-events: none;
}

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

.hamburger {
  display: flex; flex-direction: column; gap: 4px;
  cursor: pointer; padding: 7px; border: none;
  background: none; border-radius: var(--rsm); transition: all .12s;
}
.hamburger:hover { background: rgba(255,255,255,0.04); }
.hamburger span { display: block; width: 15px; height: 1.5px; background: var(--tmid); border-radius: 1px; }
.hamburger:hover span { background: var(--tbr); }

.logo { display: flex; align-items: center; cursor: pointer; user-select: none; text-decoration: none; }
.logo-wordmark {
  font-family: var(--display); font-size: 22px; font-weight: 900;
  letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--tw); line-height: 1;
}
.logo-wordmark span { color: var(--a); }

.header-right {
  display: flex; align-items: center; gap: 14px;
  font-size: 9px; color: var(--tdim);
  font-family: var(--mono); letter-spacing: 1px; text-transform: uppercase;
}
.header-right > span { display: flex; align-items: center; gap: 4px; }
.server-count { color: var(--a); font-weight: 700; }

.live-pip {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--a); box-shadow: 0 0 6px var(--a);
  animation: pip 2s ease-in-out infinite; display: inline-block;
}
@keyframes pip { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:0.3;transform:scale(0.7)} }

/* ── PAGE SYSTEM ── */
.page { display: none; }
.page.active { display: block; }
main { max-width: 1440px; margin: 0 auto; padding: 32px; }

/* ── BUTTONS ── */
.btn {
  padding: 7px 14px; font-family: var(--body);
  font-size: 12px; font-weight: 600; cursor: pointer;
  border: 1px solid; transition: all .15s;
  white-space: nowrap; border-radius: var(--rsm);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.btn-primary { background: var(--a); border-color: var(--a); color: #000; font-weight: 700; }
.btn-primary:hover { background: #60b4ff; border-color: #60b4ff; box-shadow: 0 0 20px var(--aglow); }
.btn-ghost { background: transparent; border-color: var(--b2); color: var(--tmid); }
.btn-ghost:hover { border-color: var(--b3); color: var(--tbr); background: rgba(255,255,255,0.04); }
.btn-danger { background: transparent; border-color: rgba(255,61,85,0.2); color: var(--red); font-size: 11px; padding: 4px 9px; }
.btn-danger:hover { background: var(--reddim); border-color: rgba(255,61,85,0.4); }

.btn-hero {
  padding: 13px 30px; font-family: var(--display);
  font-size: 16px; font-weight: 700; letter-spacing: 2px;
  cursor: pointer; border: 1px solid; transition: all .2s;
  border-radius: var(--rsm); text-transform: uppercase;
}
.btn-hero-primary { background: var(--a); border-color: var(--a); color: #000; }
.btn-hero-primary:hover {
  background: #fff; border-color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 32px var(--aglow), 0 0 0 1px rgba(57,255,143,0.3);
}
.btn-hero-ghost { background: rgba(255,255,255,0.04); color: var(--tmid); border-color: var(--b2); }
.btn-hero-ghost:hover { border-color: var(--b3); color: var(--tbr); background: rgba(255,255,255,0.07); }

/* ── TOAST ── */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--surface3); border: 1px solid var(--b2);
  color: var(--tbr); padding: 11px 18px;
  font-size: 12px; font-weight: 500; z-index: 9000;
  animation: toast-in .2s ease; max-width: 280px;
  font-family: var(--body); border-radius: var(--r);
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  letter-spacing: 0.2px;
}
@keyframes toast-in { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:none} }

/* ── FOOTER ── */
.site-footer {
  border-top: 1px solid var(--b1); padding: 28px 32px; text-align: center;
  font-family: var(--mono); font-size: 9px; color: var(--tdim); line-height: 2; letter-spacing: 0.5px;
}
.site-footer span { color: var(--a); }
.site-footer-inner {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.site-footer-text { line-height: 2; }
.footer-discord-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: #5865F2; color: #fff !important; text-decoration: none;
  padding: 8px 20px; border-radius: 6px; font-size: 11px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase; transition: background 0.2s, transform 0.15s;
}
.footer-discord-btn:hover { background: #4752c4; transform: translateY(-1px); }

/* ── ANIMATIONS ── */
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.2} }
@keyframes fade-up { from{opacity:0;transform:translateY(20px)} to{opacity:1;transform:none} }
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-10px)} }
@keyframes row-in { from{opacity:0;transform:translateX(-6px)} to{opacity:1;transform:none} }
@keyframes scanline {
  0% { background-position: 0 0; }
  100% { background-position: 0 100vh; }
}
@keyframes sweep { from{left:-100%} to{left:200%} }

/* ── SEARCH ── */
.header-search { position: relative; display: flex; align-items: center; }
.header-search-icon { position: absolute; left: 10px; width: 12px; height: 12px; color: var(--tdim); pointer-events: none; z-index: 1; }
.header-search-input {
  background: rgba(255,255,255,0.04); border: 1px solid var(--b1);
  border-radius: var(--rsm); color: var(--tbr);
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.5px;
  padding: 5px 10px 5px 28px; width: 150px; outline: none; transition: all 0.2s;
}
[data-theme="light"] .header-search-input { background: rgba(0,0,0,0.04); }
.header-search-input::placeholder { color: var(--tdim); }
.header-search-input:focus { border-color: var(--a); background: var(--adim); width: 200px; box-shadow: 0 0 0 3px var(--asubt); }

.search-dropdown {
  display: none; position: absolute; top: calc(100% + 8px); right: 0;
  width: 270px; background: var(--surface2); border: 1px solid var(--b2);
  border-radius: var(--r); box-shadow: 0 14px 44px rgba(0,0,0,0.55); z-index: 999; overflow: hidden;
}
.search-dropdown.visible { display: block; }
.search-result-item { display: flex; align-items: center; gap: 10px; padding: 9px 13px; cursor: pointer; border-bottom: 1px solid var(--b1); transition: background .1s; }
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover, .search-result-item.active { background: var(--surface3); }
.search-result-icon { width: 26px; height: 26px; background: var(--adim); border-radius: var(--rsm); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--a); }
.search-result-icon svg { width: 11px; height: 11px; }
.search-result-title { font-size: 12px; font-weight: 600; color: var(--tbr); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--body); }
.search-result-desc { font-size: 10px; color: var(--tdim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--mono); }
.search-no-results { padding: 18px 13px; text-align: center; color: var(--tdim); font-size: 11px; font-family: var(--mono); }
.search-result-item mark { background: var(--adim); color: var(--a); border-radius: 2px; padding: 0 2px; }

.theme-toggle {
  background: none; border: 1px solid var(--b1); border-radius: var(--rsm);
  padding: 4px 8px; cursor: pointer; font-size: 12px; line-height: 1; transition: all .15s;
  display: flex; align-items: center;
}
.theme-toggle:hover { border-color: var(--b2); background: rgba(255,255,255,0.04); }

@media(max-width:600px){
  main { padding: 16px; }
  header { padding: 0 14px; }
  .header-right > span:nth-child(3), .header-right > span:nth-child(4) { display: none; }
}
