/**
 * ============================================================
 *  MixPanel CS 1.6 — Layout Styles
 * ============================================================
 *  Template by Templuxo — https://templuxo.com
 * ============================================================
 */

/* ── App Shell ─────────────────────────────────────────────── */
#app {
  display: flex;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

/* ── Animated Background Grid (warmer, CS 1.6 radar style) ── */
#app::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(77,159,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(77,159,255,0.025) 1px, transparent 1px);
  background-size: 40px 40px;
  animation: grid-pan 20s linear infinite;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black 0%, transparent 100%);
}

/* ── Warm vignette around edges ───────────────────────────── */
#app::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(ellipse at 50% 50%, transparent 50%, rgba(6,8,16,0.6) 100%);
}

/* ── Sidebar ────────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-1);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 10;
  flex-shrink: 0;
}

/* Subtle inner glow on sidebar */
#sidebar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(180deg, rgba(77,159,255,0.03) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

/* ── Sidebar logo ──────────────────────────────────────────── */
.sidebar-logo {
  padding: 20px 18px 18px;
  border-bottom: 1px solid var(--border-1);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.logo-mark {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--accent) 0%, #2A6FCC 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 16px;
  color: var(--bg-void);
  flex-shrink: 0;
  box-shadow: 0 0 20px rgba(77,159,255,0.35), 0 2px 8px rgba(0,0,0,0.4);
}
.logo-text {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  color: var(--tx-1);
  letter-spacing: 0.06em;
  text-shadow: 0 0 16px rgba(77,159,255,0.1);
}
.logo-sub {
  font-size: 10px;
  color: var(--tx-3);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-top: -2px;
}

/* ── Sidebar server badge ──────────────────────────────────── */
.sidebar-server {
  margin: 14px 14px 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  transition: var(--trans-fast);
  position: relative;
  z-index: 1;
}
.sidebar-server:hover { border-color: var(--border-2); background: var(--bg-overlay); }
.srv-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  flex-shrink: 0;
  box-shadow: 0 0 10px var(--ok);
  animation: pulse-dot 2.5s ease infinite;
}
.srv-indicator.offline { background: var(--err); box-shadow: 0 0 6px var(--err); animation: none; }
.srv-ip {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--tx-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.srv-map {
  font-size: 10px;
  color: var(--tx-3);
  font-family: var(--font-mono);
}

/* ── Sidebar section label ─────────────────────────────────── */
.sidebar-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--tx-4);
  padding: 16px 18px 5px;
  position: relative;
  z-index: 1;
}

/* ── Sidebar nav ───────────────────────────────────────────── */
.sidebar-nav {
  flex: 1;
  padding: 0 10px;
  overflow-y: auto;
  position: relative;
  z-index: 1;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: var(--trans-fast);
  color: var(--tx-3);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  margin-bottom: 2px;
  position: relative;
  user-select: none;
}
.nav-item:hover {
  background: var(--bg-hover);
  color: var(--tx-2);
}
.nav-item.active {
  background: var(--accent-bg);
  color: var(--accent);
  border-color: var(--border-acc);
  box-shadow: inset 3px 0 0 var(--accent);
}
.nav-item.active .nav-icon {
  filter: drop-shadow(0 0 6px var(--accent));
}
.nav-icon {
  font-size: 16px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tx-3);
}
.nav-item.active .nav-icon,
.nav-item:hover .nav-icon {
  color: var(--accent);
}
.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: var(--bg-void);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
  box-shadow: 0 0 8px rgba(77,159,255,0.3);
}

/* ── Sidebar profile ───────────────────────────────────────── */
.sidebar-profile {
  padding: 12px 14px;
  border-top: 1px solid var(--border-1);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.profile-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: #fff;
  flex-shrink: 0;
  position: relative;
  box-shadow: 0 0 10px rgba(77,159,255,0.2);
}
.profile-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--tx-1);
  line-height: 1;
  margin-bottom: 2px;
}
.profile-elo {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  text-shadow: 0 0 8px rgba(77,159,255,0.2);
}
.profile-actions {
  margin-left: auto;
  display: flex;
  gap: 4px;
}
.icon-btn {
  background: none;
  border: none;
  color: var(--tx-3);
  font-size: 14px;
  padding: 4px 5px;
  cursor: pointer;
  border-radius: var(--r-sm);
  transition: var(--trans-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-btn:hover { color: var(--accent); background: var(--bg-hover); }

/* ── Main Content ───────────────────────────────────────────── */
#main {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  z-index: 1;
}

/* ── Page Container ─────────────────────────────────────────── */
.page {
  display: none;
  padding: 28px;
  opacity: 0;
  transform: translateY(8px);
  min-height: 100vh;
}
.page.active {
  display: block;
  animation: page-in 0.35s var(--ease) forwards;
}

.page-header {
  margin-bottom: 24px;
}
.page-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--tx-1);
  letter-spacing: 0.04em;
  line-height: 1;
  text-shadow: 0 0 20px rgba(77,159,255,0.08);
}
.page-sub {
  font-size: 13px;
  color: var(--tx-3);
  margin-top: 5px;
}

/* ── Grid Layouts ────────────────────────────────────────────── */
.grid      { display: grid; gap: 16px; }
.grid-2    { grid-template-columns: 1fr 1fr; }
.grid-3    { grid-template-columns: 1fr 1fr 1fr; }
.grid-4    { grid-template-columns: repeat(4, 1fr); }
.grid-1-2  { grid-template-columns: 1fr 2fr; }
.grid-2-1  { grid-template-columns: 2fr 1fr; }
.grid-3-2  { grid-template-columns: 3fr 2fr; }

/* ── Tabs ───────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 3px;
  background: var(--bg-surface);
  border: 1px solid var(--border-1);
  border-radius: var(--r-lg);
  padding: 4px;
  margin-bottom: 20px;
}
.tab-item {
  flex: 1;
  padding: 8px 12px;
  text-align: center;
  border-radius: var(--r-md);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--tx-3);
  transition: var(--trans-fast);
  user-select: none;
  letter-spacing: 0.03em;
}
.tab-item:hover { color: var(--tx-2); }
.tab-item.active {
  background: var(--accent-bg);
  color: var(--accent);
  box-shadow: 0 0 10px rgba(77,159,255,0.08);
}

/* ── Divider ────────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--border-1);
  margin: 16px 0;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 800px) {
  :root { --sidebar-w: 56px; }
  .sidebar-label, .nav-item span:not(.nav-icon):not(.nav-badge),
  .logo-text, .logo-sub, .sidebar-server .srv-ip, .sidebar-server .srv-map,
  .sidebar-profile .profile-name, .sidebar-profile .profile-elo { display: none; }
  .nav-item { justify-content: center; padding: 10px; }
  .nav-icon { width: auto; }
  .page { padding: 16px; }
  .grid-2, .grid-3, .grid-1-2, .grid-2-1, .grid-3-2 { grid-template-columns: 1fr; }
}
