:root {
  --bg-primary: #0f1015;
  --bg-secondary: #16181f;
  --bg-card: rgba(26, 29, 38, 0.85);
  --bg-card-hover: rgba(33, 38, 50, 0.95);
  --bg-glass: rgba(22, 24, 31, 0.75);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(58, 184, 143, 0.35);
  --text-primary: #f0f2f5;
  --text-secondary: #9aa1b0;
  --text-muted: #656c7d;
  
  --accent-cyan: #319ad7;
  --accent-green: #3ab88f;
  --accent-green-glow: rgba(58, 184, 143, 0.25);
  --accent-red: #ef4444;
  --accent-yellow: #f59e0b;
  --accent-purple: #8b5cf6;
  
  --font-family: 'Ubuntu', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px rgba(58, 184, 143, 0.2);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-family);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(58, 184, 143, 0.07) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(49, 154, 215, 0.07) 0%, transparent 40%),
    linear-gradient(to bottom, #0f1015, #14161d);
  background-attachment: fixed;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: #2a2e3d;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-green);
}

/* Header & Navbar */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 16, 21, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  color: inherit;
}

.brand-logo {
  height: 42px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}

.brand-badge {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: linear-gradient(135deg, rgba(58, 184, 143, 0.2), rgba(49, 154, 215, 0.2));
  color: var(--accent-green);
  border: 1px solid rgba(58, 184, 143, 0.3);
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
}

/* Nav Actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}

.btn-server-ip {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border: 1px solid var(--border-color);
}
.btn-server-ip:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}
.btn-server-ip .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { opacity: 0.7; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1.15); }
  100% { opacity: 0.7; transform: scale(0.95); }
}

.btn-primary {
  background: linear-gradient(135deg, #3ab88f, #2e9f7a);
  color: #fff;
  box-shadow: 0 4px 15px rgba(58, 184, 143, 0.3);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #43cda0, #35b088);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(58, 184, 143, 0.4);
}

.btn-secondary {
  background: rgba(49, 154, 215, 0.15);
  color: #5bbff7;
  border: 1px solid rgba(49, 154, 215, 0.3);
}
.btn-secondary:hover {
  background: rgba(49, 154, 215, 0.25);
  color: #fff;
  transform: translateY(-1px);
}

/* Hero Section */
.hero-section {
  position: relative;
  padding: 3rem 1.5rem 2rem;
  text-align: center;
  overflow: hidden;
  border-bottom: 1px solid var(--border-color);
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0.12;
  background-size: cover;
  background-position: center;
  pointer-events: none;
}

.hero-content {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}

.hero-title {
  font-size: 2.4rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 40%, #a5b4fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 1.75rem;
}

/* Search Bar */
.search-wrapper {
  position: relative;
  max-width: 650px;
  margin: 0 auto;
}

.search-input {
  width: 100%;
  padding: 1rem 3.2rem 1rem 3.2rem;
  font-size: 1.05rem;
  font-family: inherit;
  color: #fff;
  background: rgba(22, 24, 31, 0.9);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  transition: var(--transition);
  outline: none;
}
.search-input:focus {
  border-color: var(--accent-green);
  background: rgba(26, 29, 38, 0.98);
  box-shadow: 0 0 0 3px var(--accent-green-glow), var(--shadow-card);
}
.search-input::placeholder {
  color: var(--text-muted);
}

.search-icon {
  position: absolute;
  left: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-clear {
  position: absolute;
  right: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: none;
  padding: 0.2rem;
  font-size: 1.1rem;
}
.search-clear:hover {
  color: #fff;
}

/* Filter Tags / Quick Links */
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}
.chip:hover, .chip.active {
  background: rgba(58, 184, 143, 0.15);
  border-color: var(--accent-green);
  color: #fff;
}

/* Main Layout */
.main-container {
  max-width: 1400px;
  margin: 2rem auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  align-items: start;
}

/* Sidebar Navigation */
.sidebar {
  position: sticky;
  top: 85px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-card);
  max-height: calc(100vh - 110px);
  overflow-y: auto;
}

.sidebar-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  padding-left: 0.5rem;
}

.sidebar-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
  border-left: 3px solid transparent;
}
.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  border-left-color: var(--text-muted);
}
.sidebar-link.active {
  background: linear-gradient(90deg, rgba(58, 184, 143, 0.15), transparent);
  color: var(--accent-green);
  border-left-color: var(--accent-green);
  font-weight: 600;
}
.sidebar-link .icon {
  font-size: 1.1rem;
}

/* Rules Content Area */
.rules-content {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  min-width: 0;
}

.rule-category {
  scroll-margin-top: 100px;
}

.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.category-title {
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: #fff;
}
.category-title .cat-icon {
  color: var(--accent-green);
}

.category-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
}

/* Rule Card */
.rule-cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.rule-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.35rem 1.5rem;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.rule-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent-green);
  opacity: 0.6;
  transition: var(--transition);
}

.rule-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 35px -8px rgba(0, 0, 0, 0.6);
}

.rule-card:hover::before {
  opacity: 1;
  width: 6px;
}

.rule-card.highlighted {
  border-color: var(--accent-green);
  box-shadow: var(--shadow-glow);
  animation: glowPulse 2s ease-out;
}

@keyframes glowPulse {
  0% { box-shadow: 0 0 35px rgba(58, 184, 143, 0.7); }
  100% { box-shadow: var(--shadow-card); }
}

.rule-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.rule-title-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.rule-title {
  font-size: 1.18rem;
  font-weight: 700;
  color: #fff;
}

.rule-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
}

.badge-ban {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-jail {
  background: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-info {
  background: rgba(49, 154, 215, 0.15);
  color: #7dd3fc;
  border: 1px solid rgba(49, 154, 215, 0.3);
}

.badge-perm {
  background: rgba(168, 85, 247, 0.2);
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.4);
}

/* Copy button */
.rule-copy-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: var(--transition);
}
.rule-copy-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.rule-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 0.85rem;
}

/* Examples / Boxes */
.rule-examples {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin-top: 0.85rem;
}

.example-box {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}

.example-positive {
  background: rgba(58, 184, 143, 0.08);
  border: 1px solid rgba(58, 184, 143, 0.2);
  color: #a7f3d0;
}
.example-positive .example-title {
  color: var(--accent-green);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.3rem;
}

.example-negative {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #fecaca;
}
.example-negative .example-title {
  color: var(--accent-red);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.3rem;
}

/* Command list table */
.cmd-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.75rem;
  font-size: 0.92rem;
}
.cmd-table th {
  text-align: left;
  padding: 0.65rem 0.85rem;
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
}
.cmd-table td {
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
}
.cmd-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}
.cmd-code {
  font-family: monospace;
  background: rgba(58, 184, 143, 0.15);
  color: var(--accent-green);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-weight: 700;
}

/* No results state */
.no-results {
  display: none;
  text-align: center;
  padding: 4rem 1.5rem;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-color);
}
.no-results h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}
.no-results p {
  color: var(--text-muted);
}

/* Footer */
.site-footer {
  margin-top: 4rem;
  background: #0b0c10;
  border-top: 1px solid var(--border-color);
  padding: 3rem 1.5rem 2rem;
  color: var(--text-muted);
}

.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}
.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: var(--transition);
}
.footer-links a:hover {
  color: var(--accent-green);
}

/* Toast alert */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: #1e222d;
  color: #fff;
  border: 1px solid var(--accent-green);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.3s ease forwards;
  pointer-events: auto;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 960px) {
  .main-container {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
  }
  .rule-examples {
    grid-template-columns: 1fr;
  }
  .hero-title {
    font-size: 1.85rem;
  }
}
