/* ============================================================
   LDTribe — Clean Minimal CSS
   Lifestyle Design Tribe by Jay Costa
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --brand:       #2D6A4F;
  --brand-light: #52B788;
  --brand-pale:  #D8F3DC;
  --accent:      #E76F51;
  --accent-pale: #FFF0EB;

  --bg:          #FAFAF8;
  --bg-card:     #FFFFFF;
  --bg-sidebar:  #F5F4F1;
  --border:      #E8E4DC;
  --border-light:#F0EDE8;

  --text:        #1A1A1A;
  --text-muted:  #6B6B6B;
  --text-faint:  #9E9E9E;
  --link:        #2D6A4F;

  --upvote:      #E76F51;
  --downvote:    #5C6BC0;

  --radius-sm:   6px;
  --radius:      10px;
  --radius-lg:   16px;
  --radius-full: 9999px;

  --shadow-xs:   0 1px 3px rgba(0,0,0,.06);
  --shadow-sm:   0 2px 8px rgba(0,0,0,.08);
  --shadow:      0 4px 20px rgba(0,0,0,.10);
  --shadow-lg:   0 8px 40px rgba(0,0,0,.14);

  --font:        'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:   'SFMono-Regular', Consolas, monospace;

  --nav-h:       60px;
  --transition:  0.18s ease;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--brand-light); }
button { cursor: pointer; font-family: var(--font); }
ul, ol { list-style: none; }
input, textarea, select { font-family: var(--font); }

/* ── Layout ─────────────────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}
.container-sm { max-width: 680px; margin: 0 auto; padding: 0 20px; }
.container-md { max-width: 900px; margin: 0 auto; padding: 0 20px; }

.layout-sidebar {
  display: grid;
  grid-template-columns: 1fr 312px;
  gap: 24px;
  align-items: start;
}
.layout-3col {
  display: grid;
  grid-template-columns: 240px 1fr 280px;
  gap: 24px;
  align-items: start;
}

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid var(--border);
  height: var(--nav-h);
  box-shadow: var(--shadow-xs);
}
.navbar-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--nav-h);
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  color: var(--text);
}
.navbar-brand:hover { color: var(--brand); }
.brand-icon {
  font-size: 22px;
  color: var(--brand);
  line-height: 1;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.brand-text strong { font-size: 16px; font-weight: 700; letter-spacing: -0.3px; }
.brand-text small   { font-size: 10px; color: var(--text-muted); font-weight: 400; }

.navbar-search {
  flex: 1;
  max-width: 480px;
  position: relative;
  display: flex;
  align-items: center;
}
.navbar-search i {
  position: absolute;
  left: 12px;
  color: var(--text-faint);
  width: 16px;
  height: 16px;
}
.navbar-search input {
  width: 100%;
  height: 38px;
  padding: 0 16px 0 40px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 14px;
  background: var(--bg);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.navbar-search input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-pale);
  background: #fff;
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
}
.nav-link i { width: 15px; height: 15px; }
.nav-link:hover { background: var(--bg-sidebar); color: var(--text); }
.nav-link.active { color: var(--brand); }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  border: none;
  text-align: center;
  transition: all var(--transition);
  line-height: 1;
  cursor: pointer;
}
.btn i { width: 15px; height: 15px; flex-shrink: 0; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--brand);
  color: #fff;
}
.btn-primary:hover { background: #245840; color: #fff; box-shadow: var(--shadow-sm); transform: translateY(-1px); }

.btn-accent {
  background: var(--accent);
  color: #fff;
}
.btn-accent:hover { background: #d45e40; color: #fff; }

.btn-outline {
  background: transparent;
  color: var(--brand);
  border: 1.5px solid var(--brand);
}
.btn-outline:hover { background: var(--brand-pale); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-sidebar); color: var(--text); }

.btn-sm  { padding: 7px 14px; font-size: 13px; }
.btn-lg  { padding: 14px 28px; font-size: 16px; border-radius: var(--radius-lg); }
.btn-xl  { padding: 16px 36px; font-size: 17px; border-radius: var(--radius-lg); }
.btn-block { width: 100%; justify-content: center; }

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.card-body { padding: 20px; }
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-header h3 { font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; color: var(--text-muted); }
.card-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-sidebar);
}

/* ── Avatar ──────────────────────────────────────────────────── */
.avatar {
  border-radius: var(--radius-full);
  object-fit: cover;
  flex-shrink: 0;
}
.avatar-xs  { width: 24px; height: 24px; font-size: 9px; }
.avatar-sm  { width: 32px; height: 32px; font-size: 12px; }
.avatar     { width: 40px; height: 40px; font-size: 14px; }
.avatar-md  { width: 48px; height: 48px; font-size: 16px; }
.avatar-lg  { width: 72px; height: 72px; font-size: 24px; }
.avatar-xl  { width: 96px; height: 96px; font-size: 32px; }
.avatar-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

/* ── User Menu Dropdown ──────────────────────────────────────── */
.user-menu { position: relative; }
.user-menu-trigger {
  background: none;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
}
.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 220px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: none;
  z-index: 200;
  overflow: hidden;
}
.user-menu.open .user-menu-dropdown { display: block; }
.user-menu-header {
  padding: 14px 16px;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-light);
}
.user-menu-header strong { display: block; font-size: 14px; font-weight: 600; }
.user-menu-header small  { font-size: 12px; color: var(--text-muted); }
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--text);
  transition: background var(--transition);
}
.dropdown-item i { width: 15px; height: 15px; }
.dropdown-item:hover { background: var(--bg-sidebar); color: var(--text); }
.dropdown-item-danger { color: #c0392b; }
.dropdown-item-danger:hover { background: #fff5f5; color: #c0392b; }
.dropdown-divider { border: none; border-top: 1px solid var(--border-light); margin: 4px 0; }

/* ── Forms ───────────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}
.form-control {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-pale);
}
.form-control::placeholder { color: var(--text-faint); }
textarea.form-control { resize: vertical; min-height: 120px; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.form-error { font-size: 12px; color: #c0392b; margin-top: 5px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Auth Pages */
.auth-page {
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow);
}
.auth-header { text-align: center; margin-bottom: 28px; }
.auth-header .brand-icon { font-size: 36px; color: var(--brand); }
.auth-header h1 { font-size: 22px; font-weight: 700; margin-top: 10px; }
.auth-header p { color: var(--text-muted); font-size: 14px; margin-top: 6px; }
.auth-footer { text-align: center; margin-top: 20px; font-size: 13px; color: var(--text-muted); }
.auth-footer a { font-weight: 600; color: var(--brand); }
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--text-faint);
  font-size: 12px;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--border);
}

/* ── Flash Messages ──────────────────────────────────────────── */
.flash-container { position: fixed; top: 72px; right: 20px; z-index: 300; display: flex; flex-direction: column; gap: 8px; }
.flash {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow);
  max-width: 400px;
  animation: slideIn .2s ease;
}
.flash i { width: 16px; height: 16px; flex-shrink: 0; }
.flash-success { background: #F0FDF4; border: 1px solid #86EFAC; color: #166534; }
.flash-error   { background: #FFF5F5; border: 1px solid #FCA5A5; color: #991B1B; }
.flash-info    { background: #EFF6FF; border: 1px solid #93C5FD; color: #1E40AF; }
.flash-close   { margin-left: auto; background: none; border: none; font-size: 18px; cursor: pointer; color: inherit; opacity: .6; }
.flash-close:hover { opacity: 1; }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* ── Homepage ────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #F0FDF4 0%, #FAFAF8 50%, #FFF7F3 100%);
  padding: 90px 0 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--brand-pale) 0%, transparent 70%);
  opacity: .5;
  pointer-events: none;
}
.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--brand-pale);
  color: var(--brand);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .3px;
  text-transform: uppercase;
  margin-bottom: 24px;
}
.hero h1 {
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1.5px;
  color: var(--text);
  max-width: 780px;
  margin: 0 auto 20px;
}
.hero h1 span { color: var(--brand); }
.hero p {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 540px;
  margin: 0 auto 36px;
  line-height: 1.7;
}
.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}
.hero-scroll {
  font-size: 13px;
  color: var(--text-faint);
  margin-top: 48px;
}

.stats-bar {
  background: var(--text);
  color: #fff;
  padding: 20px 0;
}
.stats-inner {
  display: flex;
  justify-content: center;
  gap: 60px;
  flex-wrap: wrap;
}
.stat-item { text-align: center; }
.stat-item .stat-n { font-size: 28px; font-weight: 800; color: var(--brand-light); }
.stat-item .stat-l { font-size: 12px; color: rgba(255,255,255,.6); margin-top: 2px; text-transform: uppercase; letter-spacing: .4px; }

.home-section { padding: 72px 0; }
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 36px;
}
.section-header h2 { font-size: 28px; font-weight: 700; letter-spacing: -.5px; }
.section-header p   { color: var(--text-muted); margin-top: 6px; font-size: 15px; }

/* ── Community Cards ─────────────────────────────────────────── */
.communities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.community-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: box-shadow var(--transition), transform var(--transition);
  text-decoration: none;
  color: var(--text);
}
.community-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); color: var(--text); }
.community-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.community-card-info h3 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.community-card-info p  { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.community-card-meta {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-faint);
}

/* ── Course Cards ────────────────────────────────────────────── */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.course-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--transition), transform var(--transition);
}
.course-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.course-thumbnail {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
}
.course-card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.course-category {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--brand);
  margin-bottom: 8px;
}
.course-card-body h3 {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 10px;
}
.course-card-body p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
}
.course-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-faint);
}
.course-meta span { display: flex; align-items: center; gap: 4px; }
.course-meta i { width: 12px; height: 12px; }
.course-rating {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
}
.stars { color: #F59E0B; font-size: 13px; letter-spacing: 1px; }
.rating-count { font-size: 12px; color: var(--text-faint); }
.course-card-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.course-price { font-size: 20px; font-weight: 800; color: var(--text); }
.course-price-original { font-size: 13px; color: var(--text-faint); text-decoration: line-through; margin-left: 6px; }
.price-free { font-size: 16px; font-weight: 700; color: var(--brand); }

/* Level badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.badge-beginner     { background: #D1FAE5; color: #065F46; }
.badge-intermediate { background: #FEF3C7; color: #92400E; }
.badge-advanced     { background: #FEE2E2; color: #991B1B; }
.badge-free         { background: var(--brand-pale); color: var(--brand); }
.badge-brand        { background: var(--brand); color: #fff; }
.badge-muted        { background: var(--bg-sidebar); color: var(--text-muted); }

/* ── Forum / Post Feed ───────────────────────────────────────── */
.forum-page {
  padding: 28px 0 60px;
}
.feed-sort {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
  width: fit-content;
}
.sort-btn {
  padding: 7px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
}
.sort-btn i { width: 14px; height: 14px; }
.sort-btn:hover, .sort-btn.active { background: var(--brand); color: #fff; }

/* Post Row */
.post-row {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  gap: 0;
  margin-bottom: 10px;
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.post-row:hover { border-color: var(--brand-light); box-shadow: var(--shadow-sm); }

.vote-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 10px;
  background: var(--bg-sidebar);
  min-width: 56px;
  border-right: 1px solid var(--border-light);
}
.vote-btn {
  background: none;
  border: none;
  padding: 4px;
  border-radius: var(--radius-sm);
  color: var(--text-faint);
  display: flex;
  align-items: center;
  transition: color var(--transition), background var(--transition);
  font-size: 18px;
  line-height: 1;
}
.vote-btn:hover { background: var(--border-light); }
.vote-btn.upvote:hover, .vote-btn.voted-up { color: var(--upvote); }
.vote-btn.downvote:hover, .vote-btn.voted-down { color: var(--downvote); }
.vote-score {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 28px;
  text-align: center;
}
.vote-score.positive { color: var(--upvote); }
.vote-score.negative { color: var(--downvote); }

.post-content { flex: 1; padding: 14px 16px 12px; min-width: 0; }
.post-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-faint);
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.post-meta a { color: var(--text-faint); font-weight: 600; }
.post-meta a:hover { color: var(--brand); text-decoration: underline; }
.community-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-sidebar);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 600;
  color: var(--text);
  font-size: 12px;
}
.community-pill:hover { background: var(--brand-pale); color: var(--brand); }
.post-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
  margin-bottom: 8px;
  display: block;
}
.post-title:hover { color: var(--brand); }
.post-link-preview {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-faint);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.post-actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.post-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.post-action-btn i { width: 13px; height: 13px; }
.post-action-btn:hover { background: var(--bg-sidebar); color: var(--text); }

/* Post Detail */
.post-detail-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
}
.post-detail-body { padding: 24px; }
.post-detail-title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 14px;
}
.post-detail-text {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}
.post-detail-footer {
  padding: 12px 24px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-sidebar);
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Comments */
.comments-section { margin-top: 16px; }
.comment-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
}
.comment-box h3 { font-size: 15px; font-weight: 600; margin-bottom: 14px; }
.comment-list { display: flex; flex-direction: column; gap: 0; }
.comment {
  padding: 16px 0;
  border-bottom: 1px solid var(--border-light);
}
.comment:last-child { border-bottom: none; }
.comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.comment-user { font-size: 13px; font-weight: 600; color: var(--text); }
.comment-time { font-size: 12px; color: var(--text-faint); }
.comment-body { font-size: 14px; line-height: 1.7; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.comment-actions {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}
.comment-children {
  margin-left: 32px;
  padding-left: 16px;
  border-left: 2px solid var(--border);
  margin-top: 12px;
}

/* Create post */
.create-post-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.tab-btn {
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color var(--transition);
}
.tab-btn i { width: 15px; height: 15px; }
.tab-btn.active { color: var(--brand); border-bottom-color: var(--brand); }

/* ── Sidebar Widgets ─────────────────────────────────────────── */
.sidebar { display: flex; flex-direction: column; gap: 16px; }
.widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.widget-header {
  padding: 14px 16px;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-light);
}
.widget-header h3 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); }
.widget-body { padding: 16px; }
.widget-about p { font-size: 14px; line-height: 1.7; color: var(--text-muted); }

.community-stat-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 14px;
}
.community-stat-row:last-child { border-bottom: none; }
.community-stat-row strong { font-weight: 700; }

/* ── Course Detail ───────────────────────────────────────────── */
.course-hero {
  background: linear-gradient(135deg, #1A2F24 0%, #2D6A4F 100%);
  color: #fff;
  padding: 56px 0 48px;
}
.course-hero-inner { max-width: 760px; }
.course-hero .course-category { color: var(--brand-light); }
.course-hero h1 { font-size: clamp(24px, 3vw, 38px); font-weight: 800; line-height: 1.2; letter-spacing: -.5px; margin-bottom: 16px; color: #fff; }
.course-hero p  { font-size: 16px; line-height: 1.7; color: rgba(255,255,255,.8); margin-bottom: 24px; }
.course-hero .course-meta { color: rgba(255,255,255,.7); }
.course-hero .stars { color: #FBBF24; }

.enroll-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  position: sticky;
  top: calc(var(--nav-h) + 20px);
}
.enroll-card-price { padding: 24px 24px 0; }
.enroll-card-price .price { font-size: 32px; font-weight: 800; }
.enroll-card-body { padding: 16px 24px 24px; }
.enroll-includes { margin-top: 16px; }
.enroll-includes h4 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--text-muted); margin-bottom: 10px; }
.enroll-includes li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 5px 0;
}
.enroll-includes i { width: 14px; height: 14px; color: var(--brand); }

.curriculum-section { margin-bottom: 8px; }
.curriculum-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}
.curriculum-section-body {
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
}
.lesson-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
}
.lesson-row:last-child { border-bottom: none; }
.lesson-row i { width: 14px; height: 14px; color: var(--text-faint); flex-shrink: 0; }
.lesson-row .lesson-title { flex: 1; color: var(--text); }
.lesson-duration { font-size: 12px; color: var(--text-faint); flex-shrink: 0; }
.lesson-preview { font-size: 11px; font-weight: 600; color: var(--brand); flex-shrink: 0; }

/* ── Community Page Header ───────────────────────────────────── */
.community-hero {
  padding: 32px 0 0;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}
.community-hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}
.community-banner {
  height: 120px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%);
  margin-bottom: -32px;
}
.community-info {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  padding: 0 0 20px;
}
.community-avatar {
  width: 72px;
  height: 72px;
  border-radius: var(--radius);
  border: 4px solid #fff;
  background: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.community-info h1 { font-size: 22px; font-weight: 800; letter-spacing: -.3px; }
.community-info .community-handle { font-size: 14px; color: var(--text-muted); }

/* ── Profile Page ────────────────────────────────────────────── */
.profile-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 40px 0 0;
}
.profile-avatar-wrap { position: relative; margin-bottom: -36px; }
.profile-stats {
  display: flex;
  gap: 32px;
  margin-top: 24px;
}
.profile-stat { text-align: center; }
.profile-stat strong { display: block; font-size: 22px; font-weight: 800; }
.profile-stat span { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; }

/* ── Admin ───────────────────────────────────────────────────── */
.admin-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0;
  min-height: calc(100vh - var(--nav-h));
}
.admin-sidebar {
  background: var(--text);
  padding: 24px 0;
}
.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,.65);
  text-decoration: none;
  transition: color var(--transition), background var(--transition);
}
.admin-nav-item i { width: 16px; height: 16px; }
.admin-nav-item:hover, .admin-nav-item.active { color: #fff; background: rgba(255,255,255,.1); }
.admin-content { padding: 32px; background: var(--bg); }
.admin-header { margin-bottom: 28px; }
.admin-header h1 { font-size: 26px; font-weight: 800; }

.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.stat-card .stat-label { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--text-muted); margin-bottom: 8px; }
.stat-card .stat-value { font-size: 32px; font-weight: 800; }
.stat-card .stat-change { font-size: 12px; color: var(--brand); margin-top: 6px; }

/* Table */
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th { padding: 10px 16px; text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--text-muted); border-bottom: 2px solid var(--border); background: var(--bg-sidebar); }
.data-table td { padding: 13px 16px; border-bottom: 1px solid var(--border-light); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-sidebar); }

/* ── Footer ──────────────────────────────────────────────────── */
.site-footer {
  background: var(--text);
  color: rgba(255,255,255,.75);
  padding: 56px 0 32px;
  margin-top: 80px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
}
.footer-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 14px;
}
.footer-brand p { font-size: 14px; line-height: 1.7; max-width: 260px; }
.footer-byline { margin-top: 12px; font-size: 13px; }
.footer-byline span { color: var(--brand-light); font-weight: 600; }
.footer-col h4 { color: #fff; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 14px; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul li a { font-size: 14px; color: rgba(255,255,255,.6); transition: color var(--transition); }
.footer-col ul li a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}
.footer-tagline { color: var(--brand-light); font-style: italic; }

/* ── Utility ─────────────────────────────────────────────────── */
.text-muted  { color: var(--text-muted); }
.text-faint  { color: var(--text-faint); }
.text-brand  { color: var(--brand); }
.text-center { text-align: center; }
.mt-auto     { margin-top: auto; }
.gap-2       { gap: 8px; }
.d-flex      { display: flex; }
.align-center { align-items: center; }
.divider     { border: none; border-top: 1px solid var(--border); margin: 24px 0; }
.page-header { padding: 36px 0 28px; }
.page-header h1 { font-size: 28px; font-weight: 800; letter-spacing: -.5px; }
.page-header p  { color: var(--text-muted); margin-top: 6px; font-size: 15px; }
.empty-state { text-align: center; padding: 64px 20px; }
.empty-state i   { color: var(--border); margin-bottom: 16px; }
.empty-state h3  { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.empty-state p   { color: var(--text-muted); }

/* Mobile menu */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  padding: 4px;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .layout-sidebar { grid-template-columns: 1fr; }
  .layout-3col { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .navbar-search { display: none; }
  .navbar-links .nav-link { display: none; }
  .mobile-menu-toggle { display: flex; }
  .hero { padding: 60px 0 50px; }
  .hero h1 { letter-spacing: -1px; }
  .stats-inner { gap: 32px; }
  .home-section { padding: 48px 0; }
  .section-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .courses-grid { grid-template-columns: 1fr; }
  .communities-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
  .auth-card { padding: 28px 20px; }
  .form-row { grid-template-columns: 1fr; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
}

/* ── Loader / Skeleton ───────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--border-light) 25%, var(--border) 37%, var(--border-light) 63%);
  background-size: 400px 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }

/* ── Pagination ──────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
  padding: 24px 0;
}
.page-btn {
  min-width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  text-decoration: none;
  transition: all var(--transition);
}
.page-btn:hover { border-color: var(--brand); color: var(--brand); }
.page-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ══════════════════════════════════════════════════════════════
   Community v2 — /c/<slug> pages
══════════════════════════════════════════════════════════════ */

/* ── 1. Banner strip (gradient bg, breadcrumb inside) ─────── */
.c-banner {
  height: 150px;
  display: flex;
  align-items: flex-end;
  padding-bottom: 14px;
}
.c-breadcrumb {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: rgba(255,255,255,.9);
  margin: 0;
  padding: 0;
}
.c-breadcrumb a       { color: rgba(255,255,255,.9); text-decoration: none; }
.c-breadcrumb a:hover { color: #fff; text-decoration: underline; }
.c-breadcrumb span    { color: rgba(255,255,255,.65); }

/* ── 2. Info bar (white bg, avatar uses negative margin to straddle) */
.c-infobar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}
.c-hero-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 20px;
  flex-wrap: wrap;
}
.c-avatar {
  width: 80px;
  height: 80px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  border: 3px solid;
  flex-shrink: 0;
  margin-top: -40px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
}
.c-info {
  flex: 1;
  min-width: 160px;
  padding-top: 10px;
}
.c-info h1 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.4px;
  margin: 0 0 4px;
  color: var(--text);
  line-height: 1.2;
}
.c-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 8px;
  line-height: 1.5;
}
.c-stats {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--text-faint);
}
.c-stats span { display: inline-flex; align-items: center; gap: 4px; }
.c-actions {
  display: flex;
  flex-direction: row;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
  padding-top: 10px;
}

/* ── Feed area ─────────────────────────────────────────────── */
.community-page-v2 { padding: 24px 0 64px; }
.community-page-v2 .layout-sidebar { grid-template-columns: 1fr 300px; }
.community-page-v2 .sidebar        { display: flex !important; }

/* Sort bar */
.feed-sort-bar {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 2px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 6px 10px;
  margin-bottom: 14px;
}
.feed-sort-bar .sort-btn { flex-shrink: 0; white-space: nowrap; }
.feed-sort-bar > .btn    { margin-left: auto; flex-shrink: 0; }

/* ── Post card ─────────────────────────────────────────────── */
.post-card {
  display: flex;
  flex-direction: row;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 10px;
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.post-card:hover { border-color: var(--brand); box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.post-card .vote-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 14px 10px;
  background: var(--bg-sidebar);
  min-width: 52px;
  border-right: 1px solid var(--border-light);
}
.post-card .vote-btn {
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1;
  transition: color var(--transition), background var(--transition);
}
.post-card .vote-btn:hover      { color: var(--brand); background: var(--brand-bg); }
.post-card .vote-btn.voted-up   { color: var(--brand); }
.post-card .vote-btn.voted-down { color: #e74c3c; }
.post-card .post-content { flex: 1; padding: 14px 16px; min-width: 0; }

.post-author-avatar {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: #fff;
  flex-shrink: 0; vertical-align: middle;
}
.post-meta {
  display: flex; flex-direction: row; align-items: center;
  flex-wrap: wrap; gap: 6px;
  font-size: 12px; color: var(--text-faint); margin-bottom: 4px;
}
.post-author { font-size: 12px; font-weight: 600; color: var(--text-muted); text-decoration: none; }
.post-author:hover { color: var(--brand); }
.post-time { font-size: 11px; color: var(--text-faint); }
.post-title-link {
  display: block; font-size: 15px; font-weight: 600;
  color: var(--text); text-decoration: none; line-height: 1.4; margin: 4px 0 8px;
}
.post-title-link:hover { color: var(--brand); }
.post-link-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--text-faint);
  background: var(--bg-sidebar); border: 1px solid var(--border-light);
  border-radius: var(--radius-sm); padding: 2px 8px; margin-bottom: 6px; text-decoration: none;
}
.post-link-chip:hover { color: var(--brand); border-color: var(--brand); }
.post-actions-row {
  display: flex; flex-direction: row; gap: 4px; flex-wrap: wrap; margin-top: 4px;
}
.post-action-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--text-faint);
  background: none; border: none; border-radius: var(--radius-sm);
  padding: 4px 8px; cursor: pointer; text-decoration: none;
  transition: color var(--transition), background var(--transition);
}
.post-action-chip:hover { color: var(--text); background: var(--bg-sidebar); }
.badge-pinned {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 10px; font-weight: 700; color: var(--brand);
  background: var(--brand-bg); border-radius: 4px; padding: 2px 6px;
}

/* ── Widgets ───────────────────────────────────────────────── */
.widget-header {
  display: flex; flex-direction: row; align-items: center; gap: 8px;
}
.widget-header .fa-solid,
.widget-header .fa-regular,
.widget-header i { color: var(--brand); font-size: 13px; }
.widget-header-colored { background: rgba(0,0,0,.04) !important; }
.community-stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 4px; }
.community-stat-box { background: var(--bg-sidebar); border-radius: var(--radius); padding: 10px 12px; text-align: center; }
.community-stat-num { font-size: 18px; font-weight: 800; color: var(--text); letter-spacing: -.5px; }
.community-stat-label {
  font-size: 11px; color: var(--text-faint); margin-top: 2px;
  display: flex; align-items: center; justify-content: center; gap: 3px;
}

/* ── Empty state ───────────────────────────────────────────── */
.empty-state-v2 {
  text-align: center; padding: 64px 24px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.empty-state-v2 h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.empty-state-v2 p  { color: var(--text-muted); }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 900px) {
  .community-page-v2 .layout-sidebar { grid-template-columns: 1fr; }
  .community-page-v2 .sidebar        { display: none !important; }
  .c-actions { padding-top: 0; }
}
@media (max-width: 600px) {
  .c-banner  { height: 110px; }
  .c-avatar  { width: 60px; height: 60px; font-size: 24px; margin-top: -30px; }
  .c-info h1 { font-size: 18px; }
  .feed-sort-bar { overflow-x: auto; flex-wrap: nowrap; }
}

/* ══════════════════════════════════════════════════════════════
   Create Community page
══════════════════════════════════════════════════════════════ */
.create-community-page {
  padding: 32px 0 64px;
}
.create-community-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 28px;
  align-items: start;
}
.create-community-form-wrap .page-header h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.5px;
  margin: 8px 0 4px;
}
.create-community-form-wrap .page-header p {
  color: var(--text-muted);
  font-size: 14px;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-faint);
  text-decoration: none;
  margin-bottom: 6px;
}
.back-link:hover { color: var(--brand); }
.required-star { color: var(--brand); }
.name-input-wrap {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  overflow: hidden;
  transition: border-color var(--transition);
}
.name-input-wrap:focus-within { border-color: var(--brand); }
.name-prefix {
  padding: 0 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--brand);
  border-right: 1.5px solid var(--border);
  background: var(--brand-bg);
  height: 44px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.name-input {
  border: none !important;
  border-radius: 0 !important;
  flex: 1;
}
.name-input:focus { box-shadow: none !important; }
.color-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.color-swatch-input {
  width: 44px;
  height: 44px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  padding: 2px;
  background: var(--bg-card);
}
.color-presets {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.color-preset-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition);
}
.color-preset-btn:hover {
  transform: scale(1.2);
  border-color: var(--text);
}
.color-label {
  font-size: 12px;
  font-family: monospace;
  color: var(--text-faint);
}
.char-counter { text-align: right; }
.community-preview-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin: 4px 0 20px;
}
.preview-avatar {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border: 2px solid;
  flex-shrink: 0;
  transition: all .2s;
}
.preview-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.preview-handle {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 2px;
}
.tips-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tips-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
}
.tip-check {
  color: var(--brand);
  font-size: 12px;
  margin-top: 2px;
  flex-shrink: 0;
}
@media (max-width: 768px) {
  .create-community-layout { grid-template-columns: 1fr; }
  .create-community-tips { display: none; }
}
