/* ============================================
   FORUM BELAJARBRO - Premium Design System
   ============================================ */

/* === CSS Variables === */
:root {
  --primary: #6C63FF;
  --primary-dark: #5A52D5;
  --primary-light: #8B85FF;
  --primary-bg: rgba(108, 99, 255, 0.08);
  --secondary: #1EBBA3;
  --secondary-dark: #18A08B;
  --accent: #FF6B6B;
  --accent-warm: #F59E0B;

  --bg-body: #F0F2F5;
  --bg-card: #FFFFFF;
  --bg-card-hover: #FAFBFF;
  --bg-sidebar: #F8F9FC;
  --bg-input: #F3F4F8;
  --bg-nav: rgba(255,255,255,0.92);

  --text-primary: #1A1D26;
  --text-secondary: #5A6178;
  --text-muted: #8E95A9;
  --text-inverse: #FFFFFF;

  --border: #E4E7F1;
  --border-light: #F0F1F6;
  --border-focus: var(--primary);

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.08), 0 4px 8px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 50px rgba(0,0,0,0.12);
  --shadow-glow: 0 0 20px rgba(108,99,255,0.3);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 999px;

  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --max-width: 1200px;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 15px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }

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

/* === Typography === */
h1, h2, h3, h4, h5 { font-weight: 700; line-height: 1.3; color: var(--text-primary); }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }

/* === Navbar === */
.forum-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-nav);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border-light);
  height: 64px;
  transition: box-shadow var(--transition);
}
.forum-nav.scrolled { box-shadow: var(--shadow-md); }

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  color: var(--text-primary);
}
.nav-brand:hover { color: var(--primary); }

.nav-logo { height: 32px; width: auto; }

.nav-title {
  font-weight: 800;
  font-size: 1.1rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Search */
.nav-search {
  flex: 1;
  max-width: 480px;
  position: relative;
}

.nav-search input {
  width: 100%;
  padding: 10px 16px 10px 42px;
  border: 2px solid transparent;
  border-radius: var(--radius-full);
  background: var(--bg-input);
  font-family: var(--font);
  font-size: 14px;
  color: var(--text-primary);
  transition: all var(--transition);
  outline: none;
}
.nav-search input:focus {
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 4px rgba(108,99,255,0.1);
}
.nav-search input::placeholder { color: var(--text-muted); }

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

.search-results {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  max-height: 400px;
  overflow-y: auto;
  z-index: 100;
}
.search-results.active { display: block; }

.search-result-item {
  display: block;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  transition: background var(--transition);
}
.search-result-item:hover { background: var(--primary-bg); color: var(--text-primary); }
.search-result-item:last-child { border-bottom: none; }
.search-result-title { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.search-result-category { font-size: 12px; color: var(--text-muted); }

/* Nav Actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-ask {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 14px;
  transition: all var(--transition);
  box-shadow: 0 2px 8px rgba(108,99,255,0.3);
}
.btn-ask:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
  color: white;
}

.btn-login, .btn-register {
  padding: 8px 20px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 14px;
  transition: all var(--transition);
}
.btn-login {
  color: var(--primary);
  border: 2px solid var(--primary);
  background: transparent;
}
.btn-login:hover { background: var(--primary-bg); color: var(--primary); }
.btn-register {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: 2px solid transparent;
}
.btn-register:hover { transform: translateY(-1px); box-shadow: var(--shadow-glow); color: white; }

/* Notification */
.notif-btn {
  position: relative;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 18px;
  transition: all var(--transition);
}
.notif-btn:hover { color: var(--primary); background: var(--primary-bg); }

.notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--accent);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: var(--radius-full);
  min-width: 16px;
  text-align: center;
  line-height: 14px;
  animation: notifPulse 2s ease infinite;
}

@keyframes notifPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* User menu */
.user-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-full);
  transition: all var(--transition);
  color: var(--text-muted);
}
.user-btn:hover { background: var(--bg-input); }
.user-btn .fa-chevron-down { font-size: 10px; transition: transform var(--transition); }

.user-avatar-sm {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}

.nav-user { position: relative; }

.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  min-width: 260px;
  z-index: 200;
  animation: dropIn 0.2s ease;
}
.dropdown-menu.active { display: block; }

@keyframes dropIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.dropdown-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
}
.dropdown-avatar { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--border); }
.dropdown-name { font-weight: 700; font-size: 14px; }
.dropdown-badge { font-size: 12px; color: var(--accent-warm); }
.dropdown-badge i { font-size: 11px; }

.dropdown-divider { height: 1px; background: var(--border-light); margin: 4px 0; }

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: var(--text-secondary);
  font-size: 14px;
  transition: all var(--transition);
}
.dropdown-item:hover { background: var(--primary-bg); color: var(--primary); }
.dropdown-item.text-danger { color: var(--accent); }
.dropdown-item.text-danger:hover { background: rgba(255,107,107,0.08); color: var(--accent); }
.dropdown-item i { width: 18px; text-align: center; font-size: 14px; }

/* Mobile toggle */
.nav-toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  font-size: 20px;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
}
.nav-toggle:hover { background: var(--bg-input); }

/* Mobile Menu */
.mobile-menu {
  display: none;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
  backdrop-filter: blur(4px);
}
.mobile-menu.active { display: block; animation: fadeIn 0.2s ease; }

.mobile-menu-inner {
  background: var(--bg-card);
  padding: 20px;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  box-shadow: var(--shadow-xl);
  max-height: 80vh;
  overflow-y: auto;
}

.mobile-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--primary-bg);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}
.mobile-avatar { width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--primary-light); }
.mobile-name { font-weight: 700; font-size: 15px; }
.mobile-badge { font-size: 13px; color: var(--accent-warm); }

.mobile-search {
  position: relative;
  margin-bottom: 16px;
}
.mobile-search i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
}
.mobile-search input {
  width: 100%;
  padding: 12px 16px 12px 40px;
  border: 2px solid var(--border);
  border-radius: var(--radius-full);
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  background: var(--bg-input);
  color: var(--text-primary);
}
.mobile-search input:focus { border-color: var(--primary); }

.mobile-nav-links a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  color: var(--text-primary);
  font-weight: 500;
  font-size: 15px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.mobile-nav-links a:hover { background: var(--primary-bg); color: var(--primary); }
.mobile-nav-links a i { width: 20px; text-align: center; color: var(--text-muted); }
.mobile-nav-links a.text-danger { color: var(--accent); }
.mobile-nav-links a.text-danger i { color: var(--accent); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* === Main Content === */
.forum-main {
  flex: 1;
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 24px 20px;
}

/* === Layout Grid === */
.forum-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  align-items: start;
}

.forum-content { min-width: 0; }

/* === Sidebar === */
.sidebar {
  position: sticky;
  top: 88px;
}

.sidebar-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  padding: 20px;
  margin-bottom: 16px;
  transition: box-shadow var(--transition);
}
.sidebar-card:hover { box-shadow: var(--shadow-sm); }

.sidebar-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.sidebar-cat-list { list-style: none; }
.sidebar-cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 2px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
}
.sidebar-cat-item:hover { background: var(--primary-bg); color: var(--primary); }
.sidebar-cat-item.active { background: var(--primary-bg); color: var(--primary); font-weight: 600; }
.sidebar-cat-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-input);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.sidebar-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.stat-box {
  text-align: center;
  padding: 14px;
  background: var(--bg-input);
  border-radius: var(--radius-md);
}
.stat-number { font-size: 1.4rem; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }

/* === Hero / Ask Bar === */
.hero-section {
  background: linear-gradient(135deg, var(--primary) 0%, #4158D0 50%, var(--secondary) 100%);
  border-radius: var(--radius-xl);
  padding: 40px 32px;
  color: white;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.hero-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255,255,255,0.12) 0%, transparent 70%);
  border-radius: 50%;
}
.hero-section::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
  border-radius: 50%;
}

.hero-content { position: relative; z-index: 1; }
.hero-title {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: white;
}
.hero-subtitle {
  font-size: 1rem;
  opacity: 0.9;
  margin-bottom: 20px;
  font-weight: 400;
}

.hero-input-wrap {
  position: relative;
  max-width: 600px;
}
.hero-input-wrap input {
  width: 100%;
  padding: 16px 20px 16px 48px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  font-family: var(--font);
  font-size: 16px;
  color: white;
  outline: none;
  transition: all var(--transition);
}
.hero-input-wrap input::placeholder { color: rgba(255,255,255,0.7); }
.hero-input-wrap input:focus {
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.6);
  box-shadow: 0 0 30px rgba(255,255,255,0.1);
}
.hero-input-wrap i {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,0.7);
  font-size: 16px;
}

/* === Category Pills === */
.category-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 20px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.category-pills::-webkit-scrollbar { display: none; }

.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: all var(--transition);
  cursor: pointer;
}
.cat-pill:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-bg); }
.cat-pill.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(108,99,255,0.3);
}

/* === Sort Tabs === */
.sort-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  background: var(--bg-card);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-light);
  width: fit-content;
}
.sort-tab {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  background: transparent;
  font-family: var(--font);
}
.sort-tab:hover { color: var(--text-primary); }
.sort-tab.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 6px rgba(108,99,255,0.25);
}

/* === Question Card === */
.question-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  padding: 20px 24px;
  margin-bottom: 12px;
  transition: all var(--transition);
  position: relative;
}
.question-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.question-card.solved { border-left: 4px solid var(--secondary); }
.question-card.pinned { border-left: 4px solid var(--accent-warm); }

.qc-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.qc-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-light);
  flex-shrink: 0;
}
.qc-meta { flex: 1; min-width: 0; }
.qc-author {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
}
.qc-author:hover { color: var(--primary); }
.qc-time { font-size: 12px; color: var(--text-muted); }

.qc-category {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: white;
  flex-shrink: 0;
}

.qc-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}
.qc-title a { color: inherit; }
.qc-title a:hover { color: var(--primary); }

.qc-preview {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 14px;
}

.qc-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.qc-stat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}
.qc-stat i { font-size: 14px; }
.qc-stat.has-best { color: var(--secondary); font-weight: 600; }
.qc-stat.has-best i { color: var(--secondary); }

.qc-solved-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: rgba(30,187,163,0.1);
  color: var(--secondary);
  font-size: 11px;
  font-weight: 700;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* === Question Detail Page === */
.question-detail {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  padding: 32px;
  margin-bottom: 24px;
}

.qd-title {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: 16px;
}

.qd-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-light);
}
.qd-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--border);
  object-fit: cover;
}
.qd-author-name { font-weight: 700; font-size: 15px; }
.qd-author-name a { color: var(--text-primary); }
.qd-author-name a:hover { color: var(--primary); }
.qd-author-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--accent-warm);
}
.qd-time { font-size: 13px; color: var(--text-muted); }

.qd-content {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-primary);
  margin-bottom: 24px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.qd-content p { margin-bottom: 12px; }
.qd-content img { border-radius: var(--radius-sm); margin: 8px 0; }
.qd-content pre { background: var(--bg-input); padding: 16px; border-radius: var(--radius-sm); overflow-x: auto; }
.qd-content blockquote {
  border-left: 4px solid var(--primary);
  padding: 12px 20px;
  background: var(--primary-bg);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 12px 0;
}

.qd-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
  flex-wrap: wrap;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all var(--transition);
}
.action-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-bg); }
.action-btn.active { background: var(--primary-bg); color: var(--primary); border-color: var(--primary); }
.action-btn.upvoted { background: rgba(108,99,255,0.12); color: var(--primary); border-color: var(--primary); }
.action-btn.downvoted { background: rgba(255,107,107,0.08); color: var(--accent); border-color: var(--accent); }

.vote-count {
  font-weight: 800;
  font-size: 15px;
  min-width: 24px;
  text-align: center;
  color: var(--text-primary);
}

.action-btn-share { margin-left: auto; }

/* === Answers Section === */
.answers-section { margin-bottom: 24px; }

.answers-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.answers-count {
  font-size: 1.2rem;
  font-weight: 700;
}
.answers-count span { color: var(--primary); }

/* Answer Card */
.answer-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  padding: 24px;
  margin-bottom: 12px;
  transition: all var(--transition);
}
.answer-card:hover { box-shadow: var(--shadow-sm); }
.answer-card.best-answer {
  border: 2px solid var(--secondary);
  background: linear-gradient(to bottom right, rgba(30,187,163,0.03), var(--bg-card));
}

.best-answer-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
  color: white;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 14px;
}

.answer-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.answer-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--border-light);
  object-fit: cover;
}
.answer-author { font-weight: 600; font-size: 14px; }
.answer-author a { color: var(--text-primary); }
.answer-author a:hover { color: var(--primary); }
.answer-time { font-size: 12px; color: var(--text-muted); }

.answer-content {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-primary);
  margin-bottom: 16px;
  word-wrap: break-word;
}
.answer-content p { margin-bottom: 10px; }

.answer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
}

.mark-best-btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: transparent;
  border: 1px solid var(--secondary);
  border-radius: var(--radius-full);
  color: var(--secondary);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all var(--transition);
}
.mark-best-btn:hover { background: var(--secondary); color: white; }

/* === Answer Form === */
.answer-form-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  padding: 24px;
  margin-bottom: 24px;
}
.answer-form-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.answer-form-title i { color: var(--primary); }

.submit-answer-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
  color: white;
  border: none;
  border-radius: var(--radius-full);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  margin-top: 16px;
  box-shadow: 0 2px 8px rgba(30,187,163,0.3);
}
.submit-answer-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(30,187,163,0.4);
}
.submit-answer-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Login Prompt */
.login-prompt {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 2px dashed var(--border);
  padding: 32px;
  text-align: center;
  margin-bottom: 24px;
}
.login-prompt p {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}
.login-prompt .btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 15px;
  transition: all var(--transition);
}
.login-prompt .btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-glow); color: white; }

/* === Ask Question Page === */
.ask-page {
  max-width: 780px;
  margin: 0 auto;
}

.ask-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  padding: 32px;
}

.ask-card h1 {
  font-size: 1.6rem;
  margin-bottom: 8px;
}

.ask-subtitle {
  color: var(--text-secondary);
  margin-bottom: 28px;
  font-size: 15px;
}

.form-group {
  margin-bottom: 20px;
}
.form-label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--text-primary);
}
.form-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-input);
  font-family: var(--font);
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: all var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%235A6178' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}
.form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(108,99,255,0.1); }

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-input);
  font-family: var(--font);
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: all var(--transition);
}
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(108,99,255,0.1); background: white; }

/* === Searchable Select Dropdown with Live Filter & Creation === */
.searchable-select {
  position: relative;
  width: 100%;
}

.searchable-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-input);
  font-family: var(--font);
  font-size: 14px;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
  transition: all var(--transition);
  min-height: 48px;
  outline: none;
}

.searchable-select-trigger:hover {
  border-color: var(--primary-light);
  background: white;
}

.searchable-select-trigger:focus,
.searchable-select.is-open .searchable-select-trigger {
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 4px rgba(108,99,255,0.12);
}

.searchable-select.is-open .searchable-select-trigger {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.select-trigger-content {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  overflow: hidden;
}

.select-placeholder {
  color: var(--text-muted);
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 8px;
}

.selected-cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cat-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}

.badge-new-cat {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
  font-weight: 600;
  margin-left: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.select-trigger-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-clear-selection {
  background: none;
  border: none;
  padding: 4px 6px;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1;
  transition: all 0.15s;
}

.btn-clear-selection:hover {
  color: var(--accent);
  background: rgba(255, 107, 107, 0.1);
}

.trigger-chevron {
  font-size: 12px;
  color: var(--text-secondary);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.searchable-select.is-open .trigger-chevron {
  transform: rotate(180deg);
  color: var(--primary);
}

/* Dropdown Menu Panel */
.select-dropdown-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 2px solid var(--primary);
  border-top: none;
  border-bottom-left-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
  z-index: 105;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: dropdownFadeDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dropdownFadeDown {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.searchable-select.is-open .select-dropdown-panel {
  display: flex;
}

/* Search input header inside dropdown */
.select-search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-light);
}

.select-search-box .search-icon {
  color: var(--text-muted);
  font-size: 13px;
  flex-shrink: 0;
}

.select-search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--font);
  font-size: 13.5px;
  color: var(--text-primary);
  outline: none;
}

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

.search-clear-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  padding: 2px;
}

.search-clear-btn:hover {
  color: var(--text-primary);
}

/* Options List */
.select-options-list {
  max-height: 220px;
  overflow-y: auto;
  padding: 6px 0;
  overscroll-behavior: contain;
}

.select-options-list::-webkit-scrollbar {
  width: 6px;
}
.select-options-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 6px;
}

.select-option-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 16px;
  cursor: pointer;
  transition: background 0.15s ease;
  font-size: 14px;
}

.select-option-item:hover,
.select-option-item.is-focused {
  background: var(--primary-bg);
  color: var(--primary);
}

.select-option-item.is-selected {
  background: rgba(108, 99, 255, 0.12);
  color: var(--primary);
  font-weight: 600;
}

.option-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.option-name {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.option-count {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-body);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

/* Create Category Option Item */
.create-category-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(108, 99, 255, 0.07), rgba(30, 187, 163, 0.08));
  border-top: 1px dashed var(--border);
  cursor: pointer;
  transition: background 0.15s ease;
}

.create-category-item:hover,
.create-category-item.is-focused {
  background: linear-gradient(135deg, rgba(108, 99, 255, 0.14), rgba(30, 187, 163, 0.16));
}

.create-cat-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(108,99,255,0.25);
}

.create-cat-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.create-cat-label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.create-cat-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.create-cat-pill {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: rgba(30, 187, 163, 0.15);
  color: var(--secondary-dark);
  font-weight: 700;
  flex-shrink: 0;
}

/* Empty State */
.select-empty-state {
  padding: 20px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.select-empty-state i {
  font-size: 1.5rem;
  opacity: 0.5;
}

.btn-submit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: none;
  border-radius: var(--radius-full);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 4px 12px rgba(108,99,255,0.3);
  width: 100%;
  justify-content: center;
}
.btn-submit:hover { transform: translateY(-1px); box-shadow: var(--shadow-glow); }
.btn-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* === Profile Page === */
.profile-header {
  background: linear-gradient(135deg, #1A1D26 0%, #2D3148 100%);
  border-radius: var(--radius-xl);
  padding: 40px 32px;
  color: white;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.profile-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(108,99,255,0.2) 0%, transparent 70%);
  border-radius: 50%;
}

.profile-info {
  display: flex;
  align-items: center;
  gap: 24px;
  position: relative;
  z-index: 1;
}
.profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 4px solid rgba(255,255,255,0.3);
  object-fit: cover;
}
.profile-name { font-size: 1.6rem; font-weight: 800; color: white; }
.profile-username { font-size: 14px; color: rgba(255,255,255,0.7); margin-bottom: 8px; }

.profile-stats-row {
  display: flex;
  gap: 20px;
  margin-top: 8px;
}
.profile-stat { text-align: center; }
.profile-stat-val { font-size: 1.2rem; font-weight: 800; color: white; }
.profile-stat-label { font-size: 11px; color: rgba(255,255,255,0.6); text-transform: uppercase; letter-spacing: 0.5px; }

.profile-badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(245,158,11,0.2);
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: var(--radius-full);
  color: var(--accent-warm);
  font-size: 13px;
  font-weight: 700;
  margin-top: 10px;
}

.profile-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-light);
  margin-bottom: 20px;
  width: fit-content;
}
.profile-tab {
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 14px;
  color: var(--text-muted);
  transition: all var(--transition);
}
.profile-tab:hover { color: var(--text-primary); }
.profile-tab.active { background: var(--primary); color: white; }

/* === Login / Register Page === */
.auth-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 200px);
  padding: 40px 20px;
}
.auth-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
}
.auth-title {
  font-size: 1.5rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 8px;
}
.auth-subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 28px;
  font-size: 14px;
}
.auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-muted);
}
.auth-footer a { font-weight: 600; }

.auth-error {
  background: rgba(255,107,107,0.08);
  border: 1px solid rgba(255,107,107,0.2);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--accent);
  font-size: 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.category-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  padding: 24px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.category-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}
.category-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.category-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: white;
  margin-bottom: 14px;
}
.category-name {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 4px;
  color: var(--text-primary);
}
.category-count {
  font-size: 13px;
  color: var(--text-muted);
}

/* === Pagination === */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 32px;
  padding: 20px 0;
}
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 14px;
  font-family: var(--font);
  cursor: pointer;
  transition: all var(--transition);
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-bg); }
.page-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.page-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* === Toast === */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  font-size: 14px;
  font-weight: 500;
  animation: toastIn 0.3s ease;
  min-width: 280px;
}
.toast.success { border-left: 4px solid var(--secondary); }
.toast.error { border-left: 4px solid var(--accent); }
.toast.info { border-left: 4px solid var(--primary); }

.toast-icon { font-size: 18px; }
.toast.success .toast-icon { color: var(--secondary); }
.toast.error .toast-icon { color: var(--accent); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

/* === Back to top === */
.back-to-top {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  border: none;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(108,99,255,0.3);
  transition: all var(--transition);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  z-index: 100;
}
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { transform: translateY(-3px); box-shadow: var(--shadow-glow); }

/* === Share Modal === */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.active { display: flex; }

.modal-box {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 32px;
  max-width: 460px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  animation: modalIn 0.3s ease;
}
.modal-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 16px; }
.modal-close {
  float: right;
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
}

.share-url-box {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.share-url-box input {
  flex: 1;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 13px;
  color: var(--text-primary);
  background: var(--bg-input);
  outline: none;
}
.share-url-box button {
  padding: 10px 18px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all var(--transition);
}
.share-url-box button:hover { background: var(--primary-dark); }

/* === Empty State === */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}
.empty-state i { font-size: 64px; color: var(--border); margin-bottom: 16px; }
.empty-state h3 { font-weight: 700; margin-bottom: 8px; color: var(--text-secondary); }
.empty-state p { color: var(--text-muted); font-size: 14px; }

/* === TinyMCE overrides === */
.tox.tox-tinymce { border: 2px solid var(--border) !important; border-radius: var(--radius-md) !important; }
.tox.tox-tinymce:focus-within { border-color: var(--primary) !important; box-shadow: 0 0 0 4px rgba(108,99,255,0.1) !important; }
.tox .tox-statusbar__branding { display: none !important; }

/* === Loading Skeleton === */
.skeleton {
  background: linear-gradient(90deg, var(--bg-input) 25%, var(--border-light) 50%, var(--bg-input) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* === Responsive === */
@media (max-width: 1024px) {
  .forum-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; display: none; }
}

@media (max-width: 768px) {
  .nav-search { display: none; }
  .nav-toggle { display: block; }
  .btn-ask span { display: none; }
  .btn-login { display: none; }

  .hero-section { padding: 28px 20px; }
  .hero-title { font-size: 1.4rem; }

  .question-detail { padding: 20px; }
  .qd-title { font-size: 1.3rem; }
  .ask-card { padding: 24px; }

  .profile-info { flex-direction: column; text-align: center; }
  .profile-stats-row { justify-content: center; }

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

@media (max-width: 480px) {
  .forum-main { padding: 16px 12px; }
  .question-card { padding: 16px; }
  .qc-header { gap: 8px; }
  .qc-avatar { width: 34px; height: 34px; }
  .category-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 28px 20px; }
}

/* === Scrollbar === */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================
   CATEGORY EXPAND TOGGLE
   ============================================ */
.category-pills-container {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 20px;
  position: relative;
}
.category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 40px;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  flex: 1;
}
.category-pills.expanded {
  max-height: 600px;
}
.cat-expand-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.cat-expand-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-bg);
}
.cat-expand-btn.active i {
  transform: rotate(180deg);
}
.cat-expand-btn i {
  transition: transform 0.3s ease;
  font-size: 13px;
}

/* ============================================
   2-LEVEL NESTED COMMENTS & REPLIES
   ============================================ */
.btn-scroll-answer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--primary-bg);
  color: var(--primary);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  transition: all var(--transition);
}
.btn-scroll-answer:hover {
  background: var(--primary);
  color: white;
}
.btn-reply-toggle, .btn-reply-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-secondary);
  cursor: pointer;
}
.btn-reply-toggle:hover, .btn-reply-tag:hover {
  color: var(--primary);
  border-color: var(--primary);
}
.replies-container {
  margin-top: 14px;
  padding-left: 20px;
  border-left: 2px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.reply-card {
  background: var(--bg-card-hover);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  transition: all var(--transition);
}
.reply-card:hover {
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}
.reply-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.reply-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--border-light);
}
.reply-author {
  font-size: 13px;
  font-weight: 700;
}
.reply-author a { color: var(--text-primary); }
.reply-author a:hover { color: var(--primary); }
.reply-time {
  font-size: 11px;
  color: var(--text-muted);
}
.reply-content {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  margin-bottom: 8px;
  word-break: break-word;
}
.reply-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
}
.action-btn-sm {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.action-btn-sm:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.action-btn-sm.upvoted {
  background: rgba(108,99,255,0.12);
  color: var(--primary);
  border-color: var(--primary);
}
.action-btn-sm.downvoted {
  background: rgba(255,107,107,0.08);
  color: var(--accent);
  border-color: var(--accent);
}
.vote-count-sm {
  font-weight: 700;
  font-size: 12px;
  min-width: 18px;
  text-align: center;
  color: var(--text-primary);
}

/* Mention Tag */
.mention-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  background: rgba(108,99,255,0.1);
  color: var(--primary);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95em;
  transition: all var(--transition);
}
.mention-tag:hover {
  background: var(--primary);
  color: white;
}

/* Reply Form */
.reply-form-wrap {
  display: none;
  margin-top: 14px;
  padding: 14px 18px;
  background: var(--bg-sidebar);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  animation: fadeIn 0.25s ease;
}
.reply-form-wrap.active {
  display: block;
}
.reply-target-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-bg);
  color: var(--primary);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
}
.btn-cancel-reply-target {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
}
.btn-cancel-reply-target:hover { color: var(--accent); }
.reply-input-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.reply-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  font-family: var(--font);
  font-size: 13.5px;
  color: var(--text-primary);
  outline: none;
  resize: vertical;
  transition: all var(--transition);
}
.reply-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108,99,255,0.1);
}
.reply-buttons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.btn-cancel-reply {
  padding: 6px 14px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-cancel-reply:hover {
  background: var(--bg-input);
  color: var(--text-primary);
}
.btn-submit-reply {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 18px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-full);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-submit-reply:hover {
  background: var(--primary-dark);
  box-shadow: 0 2px 8px rgba(108,99,255,0.3);
}
.reply-login-note {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  padding: 6px 0;
}
.reply-login-note a { font-weight: 600; }

/* ============================================
   RICH SHARE MODAL
   ============================================ */
.share-modal-box {
  max-width: 520px;
  padding: 32px 28px;
}
.share-modal-desc {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 20px;
}
.share-social-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.share-social-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 6px;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all var(--transition-spring);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
}
.share-social-btn:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.share-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: white;
  transition: all var(--transition);
}
.share-social-btn span {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
}
.share-wa .share-icon-wrap { background: linear-gradient(135deg, #25D366, #128C7E); }
.share-tg .share-icon-wrap { background: linear-gradient(135deg, #2AABEE, #229ED9); }
.share-tw .share-icon-wrap { background: linear-gradient(135deg, #1A1A1A, #000000); }
.share-fb .share-icon-wrap { background: linear-gradient(135deg, #1877F2, #0D65D9); }
.share-th .share-icon-wrap { background: linear-gradient(135deg, #2A2A2A, #0A0A0A); }

.share-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin-bottom: 16px;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.share-divider::before, .share-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-light);
}
.share-divider span {
  padding: 0 12px;
}

/* ============================================
   PREMIUM STARTUP FOOTER
   ============================================ */
.forum-footer {
  background: #111420;
  color: #94A3B8;
  border-top: 1px solid rgba(255,255,255,0.08);
  margin-top: auto;
  padding: 56px 0 24px;
  font-size: 14px;
}
.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
}
.footer-logo {
  height: 38px;
  width: auto;
  margin-bottom: 16px;
  filter: brightness(1.1);
}
.footer-tagline {
  line-height: 1.7;
  color: #94A3B8;
  margin-bottom: 20px;
  font-size: 14px;
  max-width: 380px;
}
.footer-social-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.footer-social-label {
  font-size: 13px;
  font-weight: 600;
  color: #CBD5E1;
}
.footer-social-icons {
  display: flex;
  gap: 8px;
}
.social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.06);
  color: #CBD5E1;
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 16px;
  transition: all var(--transition);
}
.social-btn:hover {
  transform: translateY(-2px);
  color: #FFFFFF;
}
.social-ig:hover { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%); border-color: transparent; }
.social-yt:hover { background: #FF0000; border-color: transparent; }
.social-tt:hover { background: #000000; border-color: #00f2fe; box-shadow: 0 0 10px rgba(0,242,254,0.4); }
.social-tg:hover { background: #229ED9; border-color: transparent; }

.footer-col-title {
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 18px;
  letter-spacing: 0.3px;
  position: relative;
}
.footer-col-title::after {
  content: '';
  display: block;
  width: 24px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
  margin-top: 6px;
}
.footer-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-menu a {
  color: #94A3B8;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  transition: all var(--transition);
}
.footer-menu a i {
  font-size: 10px;
  color: #64748B;
  transition: transform var(--transition);
}
.footer-menu a:hover {
  color: #FFFFFF;
  transform: translateX(3px);
}
.footer-menu a:hover i {
  color: var(--primary);
}
.footer-safe-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding: 8px 14px;
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.25);
  border-radius: var(--radius-full);
  color: #10B981;
  font-size: 12px;
  font-weight: 600;
}
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: #64748B;
}
.footer-bottom strong { color: #CBD5E1; }
.footer-heart { color: #EF4444; animation: heartBeat 1.5s infinite; }

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 600px) {
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .share-social-grid { grid-template-columns: repeat(3, 1fr); }
  .replies-container { padding-left: 10px; margin-left: 8px; }
}
