/* ============================================
   DISPUTO FORUM - Main Stylesheet
   ============================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* --- CSS Variables (Design Tokens) --- */
:root {
  /* Primary — Orange #f5943d */
  --primary: #f5943d;
  --primary-light: #f8ac65;
  --primary-dark: #d97b25;
  --primary-glow: rgba(245, 148, 61, 0.2);

  /* Accent — Gray #494949 */
  --accent: #494949;
  --accent-light: #6e6e6e;
  --accent-dark: #333333;

  /* Warm */
  --warm: #f5943d;
  --warm-light: #f8b87a;

  /* Background — Warm Neutral */
  --bg-primary: #f2f0ed;
  --bg-secondary: #e8e5e0;
  --bg-tertiary: #ddd9d3;
  --bg-card: #ffffff;
  --bg-card-hover: #faf8f6;
  --bg-elevated: #ffffff;

  /* Text */
  --text-primary: #1a1a2e;
  --text-secondary: #4a4a6a;
  --text-muted: #8888a8;
  --text-inverse: #ffffff;

  /* Borders */
  --border: rgba(0, 0, 0, 0.08);
  --border-light: rgba(0, 0, 0, 0.12);
  --border-active: rgba(245, 148, 61, 0.4);

  /* Status */
  --online: #4CAF50;
  --offline: #9e9e9e;
  --warning: #FFB74D;
  --danger: #ef5350;
  --success: #4CAF50;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 20px rgba(245, 148, 61, 0.1);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 50%;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition: 0.25s ease;
  --transition-slow: 0.4s ease;

  /* Spacing */
  --header-height: 70px;
}

/* --- Dark Theme --- */
[data-theme="dark"] {
  --bg-primary: #1a1a1a;
  --bg-secondary: #222222;
  --bg-tertiary: #2a2a2a;
  --bg-card: #2c2c2c;
  --bg-card-hover: #353535;
  --bg-elevated: #333333;

  --text-primary: #f0ece8;
  --text-secondary: #b8b0a8;
  --text-muted: #7a7570;
  --text-inverse: #1a1a1a;

  --border: rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.12);

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 28px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(245, 148, 61, 0.15);
}

[data-theme="dark"] .header {
  background: rgba(26, 26, 26, 0.9);
}

[data-theme="dark"] .topic-row:hover,
[data-theme="dark"] .forum-table-header {
  background: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .nav-link:hover,
[data-theme="dark"] .btn-ghost:hover,
[data-theme="dark"] .search-toggle,
[data-theme="dark"] .post-action-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .search-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .tag {
  background: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .footer {
  background: #151515;
}

[data-theme="dark"] .footer-social a {
  background: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .editor-toolbar,
[data-theme="dark"] .editor-textarea,
[data-theme="dark"] .form-input,
[data-theme="dark"] .form-select,
[data-theme="dark"] .hero-search input {
  background: #1a1a1a;
}

[data-theme="dark"] ::-webkit-scrollbar-track {
  background: #1a1a1a;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: #444;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Theme toggle button */
.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.theme-toggle:hover {
  background: rgba(0, 0, 0, 0.08);
  color: var(--primary);
}

[data-theme="dark"] .theme-toggle {
  background: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .theme-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Smooth transitions for theme change */
body,
.header,
.footer,
.widget,
.category-card,
.forum-table,
.post-card,
.thread-header,
.reply-editor,
.auth-card,
.profile-info-card,
.profile-cover {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a:hover {
  color: var(--accent);
}

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

ul,
ol {
  list-style: none;
}

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  outline: none;
}

input,
textarea,
select {
  font-family: inherit;
  outline: none;
}

/* --- Container --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.container-wide {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ============================================
   HEADER / NAVIGATION 
   ============================================ */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(242, 240, 237, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  height: var(--header-height);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: white;
  box-shadow: 0 4px 15px rgba(245, 148, 61, 0.3);
}

.nav-main {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  position: relative;
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.04);
}

.nav-link.active {
  color: var(--primary-light);
  background: var(--primary-glow);
}

.nav-link .badge {
  background: var(--danger);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  line-height: 1.2;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-toggle {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all var(--transition-fast);
}

.search-toggle:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-primary);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  transition: all var(--transition);
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 4px 15px rgba(245, 148, 61, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(245, 148, 61, 0.4);
  color: white;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary-light);
  background: var(--primary-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 14px;
}

.btn-ghost:hover {
  background: rgba(0, 0, 0, 0.03);
  color: var(--text-primary);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: var(--text-inverse);
  font-weight: 700;
}

.btn-accent:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(245, 148, 61, 0.2);
  color: var(--text-inverse);
}

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

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
}

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

.user-avatar-sm {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: 2px solid var(--primary);
  object-fit: cover;
}

/* Mobile Menu */
.mobile-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 1.2rem;
  align-items: center;
  justify-content: center;
}

/* ============================================
   HERO / BANNER SECTION 
   ============================================ */
.hero {
  position: relative;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 50%, var(--bg-secondary) 100%);
  padding: 60px 0 50px;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(245, 148, 61, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -40%;
  right: -5%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(90, 90, 90, 0.06) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--text-primary), var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 550px;
  margin: 0 auto 30px;
  line-height: 1.7;
}

.hero-search {
  max-width: 560px;
  margin: 0 auto;
  position: relative;
}

.hero-search input {
  width: 100%;
  padding: 16px 24px 16px 50px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 1rem;
  transition: all var(--transition);
}

.hero-search input::placeholder {
  color: var(--text-muted);
}

.hero-search input:focus {
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}

.hero-search .search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.1rem;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 35px;
}

.hero-stat {
  text-align: center;
}

.hero-stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
}

.hero-stat-value.purple {
  color: var(--primary-light);
}

.hero-stat-value.teal {
  color: var(--accent);
}

.hero-stat-value.pink {
  color: var(--warm);
}

.hero-stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 2px;
}

/* ============================================
   FORUM CATEGORIES SECTION 
   ============================================ */
.section {
  padding: 40px 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title .icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.section-title .icon.purple {
  background: var(--primary-glow);
  color: var(--primary-light);
}

.section-title .icon.teal {
  background: rgba(90, 90, 90, 0.15);
  color: var(--accent);
}

.section-title .icon.pink {
  background: rgba(255, 140, 46, 0.15);
  color: var(--warm);
}

/* Category Card */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.category-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.category-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0;
  transition: opacity var(--transition);
}

.category-card:hover {
  border-color: var(--border-active);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.category-card:hover::before {
  opacity: 1;
}

.category-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 16px;
}

.category-icon.purple {
  background: linear-gradient(135deg, rgba(245, 148, 61, 0.2), rgba(245, 148, 61, 0.05));
  color: var(--primary-light);
}

.category-icon.teal {
  background: linear-gradient(135deg, rgba(90, 90, 90, 0.2), rgba(90, 90, 90, 0.05));
  color: var(--accent);
}

.category-icon.pink {
  background: linear-gradient(135deg, rgba(255, 140, 46, 0.2), rgba(255, 140, 46, 0.05));
  color: var(--warm);
}

.category-icon.orange {
  background: linear-gradient(135deg, rgba(255, 170, 100, 0.2), rgba(255, 170, 100, 0.05));
  color: #ffaa64;
}

.category-icon.green {
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.2), rgba(76, 175, 80, 0.05));
  color: var(--accent-light);
}

.category-icon.blue {
  background: linear-gradient(135deg, rgba(116, 185, 255, 0.2), rgba(116, 185, 255, 0.05));
  color: #74b9ff;
}

.category-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.category-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
}

.category-meta {
  display: flex;
  gap: 16px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.category-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.category-meta i {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ============================================
   FORUM TOPIC LIST TABLE 
   ============================================ */
.forum-table {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.forum-table-header {
  display: grid;
  grid-template-columns: 1fr 100px 100px 180px;
  padding: 14px 24px;
  background: rgba(0, 0, 0, 0.02);
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.topic-row {
  display: grid;
  grid-template-columns: 1fr 100px 100px 180px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  align-items: center;
  transition: background var(--transition-fast);
}

.topic-row:last-child {
  border-bottom: none;
}

.topic-row:hover {
  background: rgba(0, 0, 0, 0.02);
}

.topic-info {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.topic-avatar {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  object-fit: cover;
  border: 2px solid var(--border);
}

.topic-details {
  min-width: 0;
}

.topic-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color var(--transition-fast);
}

.topic-title:hover {
  color: var(--primary-light);
}

.topic-badges {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.topic-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.topic-badge.pinned {
  background: rgba(245, 148, 61, 0.15);
  color: var(--primary-light);
}

.topic-badge.hot {
  background: rgba(255, 140, 46, 0.15);
  color: var(--warm);
}

.topic-badge.solved {
  background: rgba(76, 175, 80, 0.15);
  color: var(--success);
}

.topic-badge.closed {
  background: rgba(99, 110, 114, 0.2);
  color: var(--text-muted);
}

.topic-starter {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.topic-starter a {
  color: var(--text-secondary);
  font-weight: 500;
}

.topic-count {
  text-align: center;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.topic-count small {
  display: block;
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 2px;
}

.topic-last-activity {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topic-last-activity img {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.topic-last-activity-info {
  min-width: 0;
}

.topic-last-activity-info a {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topic-last-activity-info time {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ============================================
   SIDEBAR 
   ============================================ */
.main-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.widget-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.widget-header i {
  color: var(--primary-light);
}

.widget-body {
  padding: 16px 20px;
}

/* Online Users Widget */
.online-users {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.online-user {
  position: relative;
}

.online-user img {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border);
  transition: all var(--transition-fast);
}

.online-user img:hover {
  border-color: var(--primary);
  transform: scale(1.1);
}

.online-user .online-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  background: var(--online);
  border: 2px solid var(--bg-card);
  border-radius: var(--radius-full);
}

/* Stats Widget */
.stats-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-item-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-item-label i {
  color: var(--text-muted);
  width: 16px;
  text-align: center;
}

.stat-item-value {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Recent Replies Widget */
.recent-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.recent-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.recent-item img {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  margin-top: 2px;
}

.recent-item-content {
  min-width: 0;
}

.recent-item-title {
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--text-primary);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.recent-item-meta {
  font-size: 0.73rem;
  color: var(--text-muted);
}

/* Tags Widget */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.tag:hover {
  border-color: var(--primary);
  color: var(--primary-light);
  background: var(--primary-glow);
}

/* ============================================
   SINGLE TOPIC / THREAD VIEW 
   ============================================ */
.thread-header {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 20px;
}

.thread-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 12px;
  line-height: 1.3;
}

.thread-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.thread-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.thread-meta-item i {
  font-size: 0.8rem;
}

/* Reply / Post Card */
.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 160px 1fr;
}

.post-card.op {
  border-color: var(--border-active);
}

.post-author {
  padding: 20px 16px;
  border-right: 1px solid var(--border);
  text-align: center;
  background: rgba(0, 0, 0, 0.015);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.post-author-avatar {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border-light);
  object-fit: cover;
}

.post-author-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
}

.post-author-name a {
  color: var(--primary);
}

.post-author-name a:hover {
  color: var(--primary-light);
}

.post-author-role {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.03);
}

.post-author-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.post-content {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
}

.post-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.post-body {
  flex: 1;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.post-content-area {
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.post-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.post-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.post-number {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.post-body {
  flex: 1;
  font-size: 0.92rem;
  line-height: 1.75;
  color: var(--text-secondary);
}

.post-body p {
  margin-bottom: 12px;
}

.post-body p:last-child {
  margin-bottom: 0;
}

.post-body blockquote {
  border-left: 3px solid var(--primary);
  padding: 12px 16px;
  margin: 16px 0;
  background: rgba(245, 148, 61, 0.05);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
  font-style: italic;
}

.post-body code {
  font-family: 'JetBrains Mono', monospace;
  background: rgba(0, 0, 0, 0.03);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85em;
  color: var(--accent);
}

.post-body pre {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  overflow-x: auto;
  margin: 16px 0;
}

.post-body pre code {
  background: none;
  padding: 0;
  font-size: 0.85rem;
}

.post-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.post-actions {
  display: flex;
  gap: 6px;
}

.post-action-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  transition: all var(--transition-fast);
}

.post-action-btn:hover {
  background: rgba(0, 0, 0, 0.03);
  color: var(--text-secondary);
}

.post-action-btn.liked {
  color: var(--warm);
}

.post-action-btn .count {
  font-weight: 600;
}

.post-signature {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Reply Editor */
.reply-editor {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-top: 20px;
}

.reply-editor-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.editor-toolbar {
  display: flex;
  gap: 4px;
  padding: 10px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  flex-wrap: wrap;
}

.editor-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.editor-btn:hover {
  background: rgba(0, 0, 0, 0.03);
  color: var(--text-primary);
}

.editor-divider {
  width: 1px;
  background: var(--border);
  margin: 4px 6px;
}

.editor-textarea {
  width: 100%;
  min-height: 160px;
  padding: 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9rem;
  line-height: 1.7;
  resize: vertical;
}

.editor-textarea::placeholder {
  color: var(--text-muted);
}

.editor-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
}

.editor-options {
  display: flex;
  gap: 16px;
}

.editor-option {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
}

.editor-option input[type="checkbox"] {
  accent-color: var(--primary);
}

/* ============================================
   USER PROFILE PAGE 
   ============================================ */
.profile-cover {
  height: 220px;
  background: linear-gradient(135deg, var(--bg-tertiary), var(--primary-dark), var(--bg-secondary));
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  margin-bottom: 0;
}

.profile-cover::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="p" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1.5" fill="rgba(255,255,255,0.03)"/></pattern></defs><rect fill="url(%23p)" width="100" height="100"/></svg>');
}

.profile-info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-top: -60px;
  position: relative;
  z-index: 1;
  margin-left: 30px;
  margin-right: 30px;
}

.profile-info-top {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 16px;
}

.profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: var(--radius-full);
  border: 4px solid var(--bg-card);
  object-fit: cover;
  margin-top: -60px;
  box-shadow: var(--shadow-lg);
}

.profile-name-area {
  flex: 1;
}

.profile-name {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.verified-badge {
  color: var(--accent);
  font-size: 1rem;
}

.profile-username {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.profile-actions {
  display: flex;
  gap: 8px;
}

.profile-bio {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
}

.profile-details {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 0.83rem;
  color: var(--text-muted);
}

.profile-detail {
  display: flex;
  align-items: center;
  gap: 6px;
}

.profile-detail i {
  width: 16px;
  text-align: center;
}

.profile-stats-bar {
  display: flex;
  gap: 30px;
  padding: 16px 24px;
  margin-top: 16px;
  border-top: 1px solid var(--border);
}

.profile-stat {
  text-align: center;
}

.profile-stat-value {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
}

.profile-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Profile Tabs */
.profile-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  margin-top: 24px;
}

.profile-tab {
  padding: 12px 20px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
  cursor: pointer;
  background: none;
}

.profile-tab:hover {
  color: var(--text-secondary);
}

.profile-tab.active {
  color: var(--primary-light);
  border-bottom-color: var(--primary);
}

/* ============================================
   AUTH PAGES 
   ============================================ */
.auth-page {
  min-height: calc(100vh - var(--header-height));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-lg);
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-header h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.auth-header p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.83rem;
  color: var(--text-secondary);
}

.form-check input[type="checkbox"] {
  accent-color: var(--primary);
}

.form-link {
  font-size: 0.83rem;
  color: var(--primary-light);
  font-weight: 500;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-divider span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.social-btns {
  display: flex;
  gap: 10px;
}

.social-btn {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.social-btn:hover {
  background: rgba(0, 0, 0, 0.03);
  border-color: var(--border-light);
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ============================================
   BREADCRUMB 
   ============================================ */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 0;
  font-size: 0.83rem;
}

.breadcrumb a {
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.breadcrumb a:hover {
  color: var(--primary-light);
}

.breadcrumb .separator {
  color: var(--text-muted);
  font-size: 0.7rem;
}

.breadcrumb .current {
  color: var(--text-secondary);
  font-weight: 500;
}

/* ============================================
   PAGINATION 
   ============================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 24px 0;
}

.page-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.page-btn:hover {
  border-color: var(--primary);
  color: var(--primary-light);
}

.page-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.page-btn.disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ============================================
   FOOTER 
   ============================================ */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 50px 0 0;
  margin-top: 60px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
}

.footer-brand {
  max-width: 280px;
}

.footer-brand .logo {
  margin-bottom: 14px;
}

.footer-brand p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 16px;
}

.footer-social {
  display: flex;
  gap: 8px;
}

.footer-social a {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.footer-social a:hover {
  background: var(--primary-glow);
  border-color: var(--primary);
  color: var(--primary-light);
}

.footer-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--primary-light);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 20px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ============================================
   NEW TOPIC FORM 
   ============================================ */
.new-topic-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.new-topic-form .form-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--text-primary);
}

.form-select {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.9rem;
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b6b8d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}

/* ============================================
   UTILITIES 
   ============================================ */
.text-center {
  text-align: center;
}

.text-muted {
  color: var(--text-muted);
}

.mt-1 {
  margin-top: 8px;
}

.mt-2 {
  margin-top: 16px;
}

.mt-3 {
  margin-top: 24px;
}

.mb-1 {
  margin-bottom: 8px;
}

.mb-2 {
  margin-bottom: 16px;
}

.mb-3 {
  margin-bottom: 24px;
}

.gap-1 {
  gap: 8px;
}

.gap-2 {
  gap: 16px;
}

.flex {
  display: flex;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

/* ============================================
   RESPONSIVE 
   ============================================ */
@media (max-width: 1024px) {
  .main-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    order: -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .forum-table-header {
    display: none;
  }

  .topic-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .topic-count,
  .topic-last-activity {
    display: none;
  }

  .post-card {
    grid-template-columns: 1fr;
  }

  .post-author {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 12px 16px;
    flex-direction: row;
    gap: 12px;
    text-align: left;
  }

  .post-author-avatar {
    width: 50px;
    height: 50px;
    margin: 0;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .nav-main {
    display: none;
  }

  .mobile-toggle {
    display: flex;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .hero-stats {
    gap: 24px;
  }

  .hero-stat-value {
    font-size: 1.2rem;
  }

  .category-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    grid-template-columns: 1fr;
  }

  .profile-info-card {
    margin-left: 10px;
    margin-right: 10px;
    padding: 16px;
  }

  .profile-info-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .profile-stats-bar {
    flex-wrap: wrap;
    gap: 16px;
  }

  .auth-card {
    padding: 28px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 14px;
  }

  .hero h1 {
    font-size: 1.5rem;
  }

  .hero p {
    font-size: 0.95rem;
  }

  .hero-stats {
    flex-direction: column;
    gap: 12px;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .header-actions .btn span {
    display: none;
  }
}

/* ============================================
   SCROLLBAR 
   ============================================ */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-elevated);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ============================================
   ANIMATIONS 
   ============================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-in {
  animation: fadeInUp 0.5s ease forwards;
}

.animate-in:nth-child(1) {
  animation-delay: 0.05s;
}

.animate-in:nth-child(2) {
  animation-delay: 0.1s;
}

.animate-in:nth-child(3) {
  animation-delay: 0.15s;
}

.animate-in:nth-child(4) {
  animation-delay: 0.2s;
}

.animate-in:nth-child(5) {
  animation-delay: 0.25s;
}

.animate-in:nth-child(6) {
  animation-delay: 0.3s;
}