/* ============================================
   HackVsHack — Dark Cyberpunk Design System
   ============================================ */

/* ---------- CSS Variables ---------- */
:root {
  /* Backgrounds */
  --bg-deepest: #0a0a0f;
  --bg-deep: #0f0f17;
  --bg-dark: #12121a;
  --bg-card: #1a1a2e;
  --bg-elevated: #1e1e34;
  --bg-hover: #24243e;

  /* Borders */
  --border-subtle: #1e1e32;
  --border-default: #252540;
  --border-strong: #35355a;

  /* Text */
  --text-primary: #e8e8f0;
  --text-secondary: #a0a0b8;
  --text-muted: #6a6a80;
  --text-faint: #4a4a60;

  /* Accents */
  --purple: #6c5ce7;
  --purple-light: #a29bfe;
  --purple-glow: rgba(108, 92, 231, 0.35);
  --cyan: #00cec9;
  --cyan-light: #81ecec;
  --cyan-glow: rgba(0, 206, 201, 0.3);

  /* Semantic */
  --success: #00b894;
  --warning: #fdcb6e;
  --danger: #ff7675;
  --info: #74b9ff;

  /* Gradients */
  --gradient-accent: linear-gradient(135deg, #6c5ce7, #00cec9);
  --gradient-purple: linear-gradient(135deg, #6c5ce7, #a29bfe);
  --gradient-card: linear-gradient(145deg, rgba(26, 26, 46, 0.8), rgba(18, 18, 26, 0.9));
  --gradient-glass: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.01));

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 24px;
  --radius-full: 50%;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-glow-purple: 0 0 20px rgba(108,92,231,0.25);
  --shadow-glow-cyan: 0 0 20px rgba(0,206,201,0.2);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;

  /* Typography */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Outfit', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Layout */
  --container-max: 1280px;
  --sidebar-width: 320px;
  --navbar-height: 64px;
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-deepest);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

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

a {
  color: var(--purple-light);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover {
  color: var(--cyan-light);
}

ul, ol { list-style: none; }

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  border: none;
  outline: none;
  background: none;
}

button { cursor: pointer; }

::selection {
  background: var(--purple);
  color: #fff;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-deep);
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--purple);
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
}
h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.375rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

p { margin-bottom: var(--space-md); color: var(--text-secondary); }
strong { font-weight: 600; color: var(--text-primary); }
small { font-size: 0.8125rem; color: var(--text-muted); }

.text-gradient {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-purple { color: var(--purple-light); }
.text-cyan { color: var(--cyan); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }

/* ---------- Layout Utilities ---------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

.main-content {
  flex: 1;
  padding: var(--space-xl) 0;
  min-height: calc(100vh - var(--navbar-height) - 200px);
}

.content-with-sidebar {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: var(--space-xl);
  align-items: start;
}

/* ---------- Navbar ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(15, 15, 23, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
}

.navbar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-accent);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--navbar-height);
  gap: var(--space-lg);
}

.navbar-logo {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
  white-space: nowrap;
}
.navbar-logo:hover {
  filter: brightness(1.2);
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.navbar-links a {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.9375rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  position: relative;
}
.navbar-links a:hover,
.navbar-links a.active {
  color: var(--text-primary);
  background: rgba(108, 92, 231, 0.1);
}
.navbar-links a.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--gradient-accent);
  border-radius: 1px;
}

.navbar-search {
  position: relative;
  flex-shrink: 0;
}
.navbar-search input {
  width: 220px;
  padding: var(--space-sm) var(--space-md);
  padding-left: 36px;
  background: var(--bg-dark);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-pill);
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: all var(--transition-base);
}
.navbar-search input::placeholder { color: var(--text-faint); }
.navbar-search input:focus {
  width: 280px;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px var(--purple-glow);
}
.navbar-search .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  font-size: 0.875rem;
  pointer-events: none;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.user-menu {
  position: relative;
}

.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
  cursor: pointer;
}
.user-menu-trigger:hover {
  background: var(--bg-hover);
}

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-xs);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition-base);
  z-index: 100;
}
.user-menu-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.user-menu-dropdown a,
.user-menu-dropdown button {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.875rem;
  text-align: left;
  transition: all var(--transition-fast);
}
.user-menu-dropdown a:hover,
.user-menu-dropdown button:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.user-menu-dropdown .divider {
  height: 1px;
  background: var(--border-default);
  margin: var(--space-xs) 0;
}
.user-menu-dropdown .logout-btn:hover {
  color: var(--danger);
}

/* Mobile hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  z-index: 1001;
}
.hamburger span {
  width: 100%;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition-base);
}
.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
}
.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 10px 24px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.9375rem;
  transition: all var(--transition-base);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--gradient-accent);
  color: #fff;
  box-shadow: 0 4px 15px var(--purple-glow);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px var(--purple-glow);
  color: #fff;
  filter: brightness(1.1);
}
.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
}
.btn-secondary:hover {
  border-color: var(--purple);
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.btn-ghost {
  color: var(--text-secondary);
  padding: 8px 16px;
}
.btn-ghost:hover {
  background: rgba(108,92,231,0.1);
  color: var(--purple-light);
}

.btn-danger {
  background: rgba(255,118,117,0.15);
  color: var(--danger);
  border: 1px solid rgba(255,118,117,0.25);
}
.btn-danger:hover {
  background: rgba(255,118,117,0.25);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8125rem;
}

.btn-lg {
  padding: 14px 32px;
  font-size: 1.0625rem;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-md);
}

/* ---------- Cards ---------- */
.card {
  background: var(--gradient-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: all var(--transition-base);
}
.card:hover {
  border-color: var(--border-strong);
}

.card-glass {
  background: var(--gradient-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}

.card-glow {
  position: relative;
}
.card-glow::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: var(--gradient-accent);
  z-index: -1;
  opacity: 0;
  transition: opacity var(--transition-base);
}
.card-glow:hover::before {
  opacity: 0.5;
}

/* ---------- Forms ---------- */
.form-group {
  margin-bottom: var(--space-lg);
}
.form-group label {
  display: block;
  margin-bottom: var(--space-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-control {
  width: 100%;
  padding: 12px var(--space-md);
  background: var(--bg-deep);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9375rem;
  transition: all var(--transition-base);
}
.form-control::placeholder { color: var(--text-faint); }
.form-control:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px var(--purple-glow);
}
.form-control:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

textarea.form-control {
  min-height: 140px;
  resize: vertical;
  line-height: 1.7;
}

.form-error {
  color: var(--danger);
  font-size: 0.8125rem;
  margin-top: var(--space-xs);
}

.form-hint {
  color: var(--text-muted);
  font-size: 0.8125rem;
  margin-top: var(--space-xs);
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-admin {
  background: rgba(255, 118, 117, 0.15);
  color: var(--danger);
  border: 1px solid rgba(255,118,117,0.25);
}
.badge-mod {
  background: rgba(108, 92, 231, 0.15);
  color: var(--purple-light);
  border: 1px solid rgba(108,92,231,0.25);
}
.badge-member {
  background: rgba(0, 206, 201, 0.1);
  color: var(--cyan);
  border: 1px solid rgba(0,206,201,0.2);
}
.badge-pinned {
  background: rgba(253, 203, 110, 0.15);
  color: var(--warning);
  border: 1px solid rgba(253,203,110,0.25);
}
.badge-locked {
  background: rgba(106, 106, 128, 0.15);
  color: var(--text-muted);
  border: 1px solid rgba(106,106,128,0.2);
}
.badge-new {
  background: rgba(0, 184, 148, 0.15);
  color: var(--success);
  border: 1px solid rgba(0,184,148,0.2);
}

/* ---------- Avatars ---------- */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid var(--border-default);
  flex-shrink: 0;
}
.avatar-sm { width: 28px; height: 28px; }
.avatar-md { width: 40px; height: 40px; }
.avatar-lg { width: 64px; height: 64px; }
.avatar-xl { width: 96px; height: 96px; border-width: 3px; }

.avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-accent);
  color: #fff;
  font-weight: 700;
  font-family: var(--font-heading);
}

.online-indicator {
  position: relative;
}
.online-indicator::after {
  content: '';
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 10px;
  height: 10px;
  background: var(--success);
  border: 2px solid var(--bg-dark);
  border-radius: var(--radius-full);
}

/* ---------- Alerts / Toasts ---------- */
.alert {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-lg);
  font-size: 0.9375rem;
  animation: slideDown 0.3s ease;
}

.alert-success {
  background: rgba(0, 184, 148, 0.1);
  border: 1px solid rgba(0, 184, 148, 0.2);
  color: var(--success);
}
.alert-error {
  background: rgba(255, 118, 117, 0.1);
  border: 1px solid rgba(255, 118, 117, 0.2);
  color: var(--danger);
}
.alert-warning {
  background: rgba(253, 203, 110, 0.1);
  border: 1px solid rgba(253, 203, 110, 0.2);
  color: var(--warning);
}
.alert-info {
  background: rgba(116, 185, 255, 0.1);
  border: 1px solid rgba(116, 185, 255, 0.2);
  color: var(--info);
}

.alert-close {
  margin-left: auto;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity var(--transition-fast);
  font-size: 1.125rem;
}
.alert-close:hover { opacity: 1; }

.toast-container {
  position: fixed;
  top: calc(var(--navbar-height) + var(--space-md));
  right: var(--space-lg);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.toast {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.4s ease;
  min-width: 280px;
  max-width: 420px;
}
.toast.toast-leaving {
  animation: slideOutRight 0.3s ease forwards;
}

/* ---------- Hero Section ---------- */
.hero {
  text-align: center;
  padding: var(--space-3xl) 0 var(--space-2xl);
  position: relative;
}
.hero::before {
  content: '';
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(108,92,231,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.hero h1 {
  font-size: 3rem;
  margin-bottom: var(--space-md);
}
.hero p {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto;
}

/* ---------- Category Grid ---------- */
.categories-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.category-card {
  display: grid;
  grid-template-columns: 56px 1fr auto auto;
  gap: var(--space-lg);
  align-items: center;
  padding: var(--space-lg);
  background: var(--gradient-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
}
.category-card:hover {
  border-color: var(--purple);
  box-shadow: var(--shadow-glow-purple);
  transform: translateY(-2px);
}

.category-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  background: rgba(108, 92, 231, 0.1);
  border: 1px solid rgba(108,92,231,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.category-info h3 {
  margin-bottom: var(--space-xs);
  font-size: 1.125rem;
}
.category-info h3 a {
  color: var(--text-primary);
}
.category-info h3 a:hover {
  color: var(--purple-light);
}
.category-info p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
}

.category-stats {
  text-align: center;
  padding: 0 var(--space-lg);
  border-left: 1px solid var(--border-subtle);
  min-width: 100px;
}
.category-stats .stat-value {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}
.category-stats .stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.category-latest {
  min-width: 200px;
  padding-left: var(--space-lg);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.category-latest .latest-title {
  font-size: 0.875rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 160px;
}
.category-latest .latest-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ---------- Thread List ---------- */
.thread-list {
  display: flex;
  flex-direction: column;
}

.thread-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--space-md);
  align-items: center;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition-fast);
}
.thread-item:hover {
  background: rgba(108,92,231,0.04);
}
.thread-item:last-child {
  border-bottom: none;
}

.thread-item.pinned {
  background: rgba(253,203,110,0.03);
  border-left: 3px solid var(--warning);
}
.thread-item.locked {
  opacity: 0.7;
}

.thread-title {
  font-size: 1rem;
  font-weight: 600;
}
.thread-title a {
  color: var(--text-primary);
}
.thread-title a:hover {
  color: var(--purple-light);
}

.thread-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

.thread-stats {
  display: flex;
  gap: var(--space-lg);
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
  min-width: 140px;
}
.thread-stats span {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.thread-stats .count {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 1rem;
}

.thread-last-reply {
  min-width: 160px;
  text-align: right;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.thread-last-reply a {
  color: var(--text-secondary);
  font-weight: 500;
}

/* ---------- Post Cards (Thread View) ---------- */
.post-card {
  display: grid;
  grid-template-columns: 180px 1fr;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--space-lg);
  background: var(--bg-dark);
}

.post-author {
  padding: var(--space-lg);
  background: var(--bg-card);
  border-right: 1px solid var(--border-default);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
}
.post-author .avatar {
  margin-bottom: var(--space-xs);
}
.post-author .username {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-primary);
}
.post-author .user-stats {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.post-body {
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
}
.post-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: var(--space-md);
  margin-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.post-content {
  flex: 1;
  line-height: 1.75;
  color: var(--text-secondary);
}
.post-content p {
  margin-bottom: var(--space-md);
}
.post-content blockquote {
  border-left: 3px solid var(--purple);
  padding: var(--space-md);
  margin: var(--space-md) 0;
  background: rgba(108,92,231,0.06);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--text-secondary);
}
.post-content code {
  background: var(--bg-deepest);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--cyan);
}
.post-content pre {
  background: var(--bg-deepest);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: var(--space-md) 0;
}
.post-content pre code {
  padding: 0;
  background: none;
}
.post-actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-subtle);
}

/* ---------- Reply Form ---------- */
.reply-form {
  margin-top: var(--space-xl);
}
.reply-form h3 {
  margin-bottom: var(--space-md);
}
.reply-form textarea {
  min-height: 180px;
}

/* ---------- Sidebar ---------- */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.sidebar-widget {
  background: var(--gradient-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.sidebar-widget-header {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.sidebar-widget-body {
  padding: var(--space-md) var(--space-lg);
}

.online-users-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.online-user {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.875rem;
}
.online-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: var(--radius-full);
  animation: pulse 2s infinite;
  flex-shrink: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}
.stat-item {
  text-align: center;
  padding: var(--space-sm);
}
.stat-item .stat-value {
  font-family: var(--font-heading);
  font-size: 1.375rem;
  font-weight: 700;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-item .stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.recent-members-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}
.breadcrumb a {
  color: var(--text-muted);
}
.breadcrumb a:hover {
  color: var(--purple-light);
}
.breadcrumb .separator {
  color: var(--text-faint);
  font-size: 0.75rem;
}

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  margin-top: var(--space-xl);
}
.pagination a,
.pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 var(--space-sm);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}
.pagination a {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
}
.pagination a:hover {
  border-color: var(--purple);
  color: var(--purple-light);
  background: rgba(108,92,231,0.1);
}
.pagination .active {
  background: var(--gradient-accent);
  color: #fff;
  border: none;
  font-weight: 600;
}
.pagination .disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ---------- Footer ---------- */
.footer {
  background: var(--bg-deep);
  border-top: 1px solid var(--border-subtle);
  padding: var(--space-2xl) 0 var(--space-lg);
  margin-top: auto;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.footer-brand {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer-links {
  display: flex;
  gap: var(--space-lg);
}
.footer-links a {
  color: var(--text-muted);
  font-size: 0.875rem;
}
.footer-links a:hover {
  color: var(--purple-light);
}

.footer-bottom {
  text-align: center;
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-subtle);
  font-size: 0.8125rem;
  color: var(--text-faint);
}

.footer-stats {
  display: flex;
  justify-content: center;
  gap: var(--space-xl);
  margin-top: var(--space-md);
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.footer-stats span {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

/* ---------- Auth Pages ---------- */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--navbar-height));
  padding: var(--space-xl);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--gradient-glass);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  position: relative;
  overflow: hidden;
}
.auth-card::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  height: 3px;
  background: var(--gradient-accent);
}

.auth-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}
.auth-header .logo {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-sm);
}
.auth-header p {
  color: var(--text-muted);
  margin: 0;
}

.auth-form .btn-primary {
  width: 100%;
  padding: 14px;
  font-size: 1rem;
  margin-top: var(--space-sm);
}

.auth-footer {
  text-align: center;
  margin-top: var(--space-lg);
  font-size: 0.875rem;
  color: var(--text-muted);
}
.auth-footer a {
  color: var(--purple-light);
  font-weight: 500;
}

/* ---------- Profile Page ---------- */
.profile-header {
  display: flex;
  gap: var(--space-xl);
  align-items: center;
  padding: var(--space-xl);
  background: var(--gradient-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-xl);
  position: relative;
  overflow: hidden;
}
.profile-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: var(--gradient-accent);
  opacity: 0.1;
}

.profile-info {
  position: relative;
}
.profile-info h1 {
  font-size: 1.75rem;
  margin-bottom: var(--space-xs);
}
.profile-info .profile-meta {
  display: flex;
  gap: var(--space-lg);
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: var(--space-sm);
}

.profile-stats-bar {
  display: flex;
  gap: var(--space-xl);
  padding: var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-xl);
}
.profile-stat {
  text-align: center;
  flex: 1;
}
.profile-stat .value {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}
.profile-stat .label {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ---------- Admin Dashboard ---------- */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}
.admin-stat-card {
  background: var(--gradient-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  position: relative;
  overflow: hidden;
}
.admin-stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 60px;
  height: 60px;
  background: var(--gradient-accent);
  opacity: 0.05;
  border-radius: 0 0 0 60px;
}
.admin-stat-card .stat-value {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.admin-stat-card .stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

/* ---------- Table ---------- */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
}
table {
  width: 100%;
  border-collapse: collapse;
}
thead {
  background: var(--bg-card);
}
th {
  padding: var(--space-md) var(--space-lg);
  text-align: left;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-default);
}
td {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.9375rem;
  color: var(--text-secondary);
}
tr:last-child td { border-bottom: none; }
tr:hover td {
  background: rgba(108,92,231,0.03);
}

/* ---------- Error Page ---------- */
.error-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--navbar-height));
  padding: var(--space-xl);
  text-align: center;
}
.error-card {
  max-width: 500px;
}
.error-code {
  font-family: var(--font-heading);
  font-size: 7rem;
  font-weight: 800;
  line-height: 1;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-md);
}
.error-title {
  font-size: 1.5rem;
  margin-bottom: var(--space-sm);
}
.error-message {
  color: var(--text-muted);
  margin-bottom: var(--space-xl);
}

/* ---------- Search Page ---------- */
.search-header {
  margin-bottom: var(--space-xl);
}
.search-header h1 {
  margin-bottom: var(--space-md);
}
.search-bar-full {
  position: relative;
}
.search-bar-full input {
  width: 100%;
  padding: 16px 24px;
  padding-left: 52px;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: 1.0625rem;
  transition: all var(--transition-base);
}
.search-bar-full input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px var(--purple-glow);
}
.search-bar-full .search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  font-size: 1.125rem;
}

.search-results {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}
.search-result-item {
  padding: var(--space-lg);
  background: var(--gradient-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  transition: all var(--transition-fast);
}
.search-result-item:hover {
  border-color: var(--purple);
}
.search-result-item h3 {
  margin-bottom: var(--space-xs);
}
.search-result-item h3 a { color: var(--text-primary); }
.search-result-item h3 a:hover { color: var(--purple-light); }
.search-result-item .result-snippet {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}
.search-result-item .result-meta {
  font-size: 0.8125rem;
  color: var(--text-faint);
}

/* ---------- Empty States ---------- */
.empty-state {
  text-align: center;
  padding: var(--space-3xl) var(--space-xl);
  color: var(--text-muted);
}
.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  opacity: 0.4;
}
.empty-state h3 {
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}
.empty-state p {
  max-width: 400px;
  margin: 0 auto;
}

/* ---------- Section Headers ---------- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
  gap: var(--space-md);
}
.section-header h2 {
  font-size: 1.375rem;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* ---------- Thread Header ---------- */
.thread-header {
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border-default);
}
.thread-header h1 {
  font-size: 1.75rem;
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}
.thread-header .thread-header-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ---------- Admin Actions ---------- */
.admin-actions {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

/* ---------- Animations ---------- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(100px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes slideOutRight {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(100px); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
@keyframes glow {
  0%, 100% { box-shadow: 0 0 5px var(--purple-glow); }
  50% { box-shadow: 0 0 20px var(--purple-glow), 0 0 40px rgba(108,92,231,0.1); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.animate-fade-in { animation: fadeIn 0.5s ease; }
.animate-fade-in-up { animation: fadeInUp 0.5s ease; }
.animate-slide-up { animation: slideUp 0.6s ease; }
.animate-glow { animation: glow 3s ease-in-out infinite; }

/* Staggered children */
.stagger-children > *:nth-child(1) { animation-delay: 0ms; }
.stagger-children > *:nth-child(2) { animation-delay: 50ms; }
.stagger-children > *:nth-child(3) { animation-delay: 100ms; }
.stagger-children > *:nth-child(4) { animation-delay: 150ms; }
.stagger-children > *:nth-child(5) { animation-delay: 200ms; }
.stagger-children > *:nth-child(6) { animation-delay: 250ms; }
.stagger-children > *:nth-child(7) { animation-delay: 300ms; }
.stagger-children > *:nth-child(8) { animation-delay: 350ms; }

/* ---------- Page-Specific: Category ---------- */
.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
  padding: var(--space-lg);
  background: var(--gradient-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
}
.category-header h1 {
  font-size: 1.5rem;
}
.category-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

/* ---------- Page-Specific: New Thread ---------- */
.new-thread-form {
  max-width: 720px;
}
.new-thread-form .card {
  padding: var(--space-xl);
}

/* ---------- Latest Threads ---------- */
.latest-threads {
  margin-top: var(--space-xl);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .content-with-sidebar {
    grid-template-columns: 1fr;
  }
  .sidebar {
    order: 2;
  }
  .category-card {
    grid-template-columns: 48px 1fr;
  }
  .category-stats,
  .category-latest {
    display: none;
  }
  .admin-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --navbar-height: 56px;
  }
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.375rem; }
  .container { padding: 0 var(--space-md); }

  .hamburger { display: flex; }

  .navbar-links,
  .navbar-search {
    display: none;
  }
  .navbar-links.mobile-open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10,10,15,0.98);
    backdrop-filter: blur(20px);
    padding: var(--space-xl);
    gap: var(--space-xs);
    z-index: 999;
    animation: fadeIn 0.2s ease;
  }
  .navbar-links.mobile-open a {
    padding: var(--space-md);
    font-size: 1.125rem;
    border-bottom: 1px solid var(--border-subtle);
  }

  .hero h1 { font-size: 2rem; }
  .hero { padding: var(--space-xl) 0; }

  .post-card {
    grid-template-columns: 1fr;
  }
  .post-author {
    flex-direction: row;
    border-right: none;
    border-bottom: 1px solid var(--border-default);
    padding: var(--space-md);
    gap: var(--space-md);
    text-align: left;
  }

  .profile-header {
    flex-direction: column;
    text-align: center;
  }

  .thread-stats {
    min-width: auto;
    gap: var(--space-md);
  }
  .thread-last-reply { display: none; }

  .thread-item {
    grid-template-columns: auto 1fr;
  }

  .category-header {
    flex-direction: column;
    gap: var(--space-md);
    text-align: center;
  }

  .auth-card {
    padding: var(--space-lg);
  }

  .profile-stats-bar {
    gap: var(--space-md);
    flex-wrap: wrap;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .admin-stats-grid {
    grid-template-columns: 1fr;
  }
  .pagination {
    flex-wrap: wrap;
  }
  .error-code {
    font-size: 5rem;
  }
}

/* ---------- Utility Classes ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
