/* ============================================
   Creative Studio - Design Resource Platform
   Dark mode first, clean editorial aesthetic
   ============================================ */

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

:root {
  /* Dark mode (default) */
  --bg-primary: #0f0f0f;
  --bg-secondary: #1a1a1a;
  --bg-tertiary: #222222;
  --bg-hover: #2a2a2a;
  --text-primary: #ffffff;
  --text-secondary: #999999;
  --text-muted: #666666;
  --border: #2a2a2a;
  --border-light: #333333;
  --accent: #ff6431;
  --accent-hover: #ff7a50;
  --accent-subtle: rgba(255, 100, 49, 0.12);
  --star: #FFD700;
  --success: #34d399;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --transition: 200ms ease;
  --max-width: 1440px;
  --header-height: 64px;
}

/* Light mode */
[data-theme="light"] {
  --bg-primary: #fafafa;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f5f5f5;
  --bg-hover: #eeeeee;
  --text-primary: #111111;
  --text-secondary: #666666;
  --text-muted: #999999;
  --border: #e5e5e5;
  --border-light: #eeeeee;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
}

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

body {
  font-family: 'Be Vietnam Pro', 'DM Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea { font-family: inherit; }

/* --- Typography --- */
h1, h2, h3, h4, h5 {
  font-family: 'Poppins', 'Be Vietnam Pro', system-ui, sans-serif;
  font-weight: 600;
  line-height: 1.3;
}

/* --- Header / Navigation --- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-height);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
  flex-shrink: 0;
}

.header-logo svg {
  width: 28px;
  height: 28px;
}

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

.nav-link {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
  position: relative;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.nav-link.active {
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-full);
  font-size: 0.6875rem;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  margin-left: 4px;
}

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

.header-search-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.header-search-btn:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.header-search-btn svg {
  width: 20px;
  height: 20px;
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.theme-toggle:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.theme-toggle svg { width: 18px; height: 18px; }

.avatar-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 2px solid var(--border);
  transition: border-color var(--transition);
}

.avatar-btn:hover { border-color: var(--accent); }

.avatar-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Auth buttons (shown when logged out) */
.auth-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-login {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
}

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

.btn-signup {
  padding: 8px 20px;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  transition: all var(--transition);
}

.btn-signup:hover { background: var(--accent-hover); }

/* --- Main Content --- */
.main {
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
}

/* --- Page Container --- */
.page {
  display: none;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px;
}

.page.active { display: block; }

/* --- Inline Search --- */
.inline-search {
  padding: 20px 0 8px;
}

.inline-search-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all var(--transition);
}

.inline-search-inner:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

.inline-search-icon {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.inline-search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 0.9375rem;
  color: var(--text-primary);
}

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

.inline-search-kbd {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.6875rem;
  font-weight: 500;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .inline-search-kbd { display: none; }
  .inline-search-inner { padding: 12px 16px; }
}

/* --- Category Tabs --- */
.category-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 16px 0 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  border-bottom: 1px solid var(--border);
}

.category-tabs::-webkit-scrollbar { display: none; }

.category-tab {
  padding: 10px 20px;
  border-radius: 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  white-space: nowrap;
  transition: all var(--transition);
  position: relative;
  flex-shrink: 0;
}

.category-tab:hover { color: var(--text-primary); }

.category-tab.active {
  color: var(--text-primary);
  font-weight: 600;
}

.category-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 1px 1px 0 0;
}

/* --- Filter Bar --- */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0 24px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.filter-bar::-webkit-scrollbar { display: none; }

.filter-pill {
  padding: 8px 20px;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  white-space: nowrap;
  transition: all var(--transition);
  flex-shrink: 0;
}

.filter-pill:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.filter-pill.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

/* --- Sort & View Controls --- */
.controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 16px;
}

.controls-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.sort-select {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  outline: none;
  cursor: pointer;
}

.sort-select option { background: var(--bg-secondary); }

.result-count {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.view-toggle {
  display: flex;
  gap: 4px;
}

.view-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition);
}

.view-btn:hover { color: var(--text-secondary); }
.view-btn.active { color: var(--text-primary); background: var(--bg-secondary); }
.view-btn svg { width: 18px; height: 18px; }

/* --- Masonry Grid --- */
.masonry-grid {
  columns: 5;
  column-gap: 16px;
}

.masonry-item {
  break-inside: avoid;
  margin-bottom: 16px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  transition: all var(--transition);
  position: relative;
  cursor: pointer;
}

.masonry-item:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.masonry-item img {
  width: 100%;
  display: block;
}

.masonry-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 50%, rgba(0,0,0,0.6));
  opacity: 0;
  transition: opacity var(--transition);
  display: flex;
  align-items: flex-end;
  padding: 12px;
}

.masonry-item:hover .masonry-overlay { opacity: 1; }

.masonry-meta {
  flex: 1;
}

.masonry-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #fff;
}

.masonry-category {
  font-size: 0.6875rem;
  color: rgba(255,255,255,0.7);
  margin-top: 2px;
}

.save-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: 0;
  transition: all var(--transition);
}

.masonry-item:hover .save-btn { opacity: 1; }

.save-btn:hover { background: var(--accent); transform: scale(1.1); }
.save-btn.saved { opacity: 1; background: var(--accent); }
.save-btn svg { width: 16px; height: 16px; }

/* --- Uniform Grid (for websites/UI) --- */
.uniform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* --- Card --- */
.card {
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  transition: all var(--transition);
  cursor: pointer;
}

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

.card-image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16/10;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 300ms ease;
}

.card:hover .card-image img { transform: scale(1.03); }

.card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-badge.new { background: var(--accent); color: #fff; }
.card-badge.masterclass { background: var(--star); color: #111; }

.card-duration {
  position: absolute;
  bottom: 10px;
  right: 10px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  background: rgba(0,0,0,0.7);
  color: #fff;
}

.card-body {
  padding: 14px;
}

.card-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-subtitle {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.card-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.6875rem;
  font-weight: 500;
  background: var(--accent-subtle);
  color: var(--accent);
  margin-top: 8px;
}

/* --- Learning Hub: Horizontal Rows --- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 32px 0 16px;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 600;
}

.section-link {
  font-size: 0.875rem;
  color: var(--accent);
  font-weight: 500;
  transition: opacity var(--transition);
}

.section-link:hover { opacity: 0.8; }

.horizontal-scroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding-bottom: 8px;
}

.horizontal-scroll::-webkit-scrollbar { display: none; }

.horizontal-scroll .card {
  flex: 0 0 280px;
  scroll-snap-align: start;
}

/* --- Hero Banner (Learning Hub) --- */
.hero-banner {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 21/8;
  background: var(--bg-secondary);
  margin-bottom: 8px;
}

.hero-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.3) 60%, transparent);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px;
}

.hero-banner-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--accent);
  color: #fff;
  margin-bottom: 16px;
  width: fit-content;
}

.hero-banner-title {
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  max-width: 500px;
  line-height: 1.2;
}

.hero-banner-desc {
  font-size: 0.9375rem;
  color: rgba(255,255,255,0.7);
  margin-top: 8px;
  max-width: 400px;
}

.hero-banner-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.btn-primary {
  padding: 10px 24px;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition);
}

.btn-primary:hover { background: var(--accent-hover); }
.btn-primary svg { width: 18px; height: 18px; }

.btn-secondary {
  padding: 10px 24px;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition);
}

.btn-secondary:hover { background: rgba(255,255,255,0.15); }

/* --- Search Modal --- */
.search-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 120px;
}

.search-modal.open { display: flex; }

.search-container {
  width: 100%;
  max-width: 640px;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.search-input-wrapper svg {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 1rem;
  color: var(--text-primary);
}

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

.search-results {
  max-height: 400px;
  overflow-y: auto;
  padding: 8px;
}

.search-hint {
  padding: 16px;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* --- Lightbox / Detail Overlay --- */
/* --- Lightbox --- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.lightbox.open { display: flex; }

.lightbox-content {
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  overflow-y: auto;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: rgba(0,0,0,0.4);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all var(--transition);
  cursor: pointer;
}

.lightbox-close:hover { background: var(--accent); }
.lightbox-close svg { width: 16px; height: 16px; }

/* Navigation arrows */
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  cursor: pointer;
  transition: all var(--transition);
}

.lightbox-nav:hover {
  background: var(--bg-tertiary);
  border-color: var(--text-muted);
}

.lightbox-nav svg { width: 20px; height: 20px; }
.lightbox-prev { left: -56px; }
.lightbox-next { right: -56px; }

/* White preview area for logo */
.lightbox-preview {
  background: #ffffff;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  min-height: 240px;
  max-height: 320px;
}

.lightbox-image {
  max-width: 100%;
  max-height: 240px;
  object-fit: contain;
}

/* Details body */
.lightbox-body {
  padding: 20px 24px 16px;
}

.lightbox-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.lightbox-title {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.lightbox-meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 4px 0 0;
}

.lightbox-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.lightbox-save-btn,
.lightbox-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.lightbox-save-btn {
  color: #fff;
  background: var(--accent);
  border: none;
}

.lightbox-save-btn:hover {
  background: #e5572a;
}

.lightbox-save-btn.saved {
  background: var(--accent-subtle);
  color: var(--accent);
}

.lightbox-save-btn svg,
.lightbox-share-btn svg {
  width: 14px;
  height: 14px;
}

.lightbox-share-btn {
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
}

.lightbox-share-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.lightbox-tags {
  display: flex;
  gap: 6px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.lightbox-tag {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.6875rem;
  font-weight: 500;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
}

.lightbox-tag:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}

/* Related section */
.lightbox-related {
  padding: 16px 24px 24px;
  border-top: 1px solid var(--border);
}

.lightbox-related h3 {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 12px;
}

.lightbox-related-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  max-height: 280px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.lightbox-related-card {
  background: #ffffff;
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid var(--border);
}

.lightbox-related-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.lightbox-related-card.skeleton {
  background: var(--bg-tertiary);
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.7; }
}

.lightbox-related-card img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

@media (max-width: 800px) {
  .lightbox { padding: 16px; }
  .lightbox-nav { display: none; }
  .lightbox-content { max-width: 100%; }
  .lightbox-related-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 480px) {
  .lightbox-preview { padding: 24px; min-height: 180px; }
  .lightbox-header-row { flex-direction: column; }
  .lightbox-related-grid { grid-template-columns: repeat(2, 1fr); }
}

/* --- Learn Page --- */

/* Course Grid */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.course-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all 0.3s ease;
  cursor: pointer;
}

.course-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}

.course-card.coming-soon {
  opacity: 0.7;
  cursor: default;
}

.course-card.coming-soon:hover {
  transform: none;
  border-color: var(--border);
  box-shadow: none;
}

.course-card-thumb {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
}

.course-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.course-card:hover .course-card-thumb img {
  transform: scale(1.05);
}

.course-card-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.3);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.course-card:hover .course-card-play {
  opacity: 1;
}

.course-card-play svg {
  width: 48px;
  height: 48px;
  color: #fff;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.4));
}

.course-card-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.coming-soon-badge {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.course-card-body {
  padding: 16px 20px 20px;
}

.course-card-category {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.course-card-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 6px 0 8px;
  line-height: 1.3;
}

.course-card-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.course-card-meta {
  display: flex;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Course Detail */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color var(--transition);
  background: none;
  border: none;
  margin-bottom: 24px;
}

.back-btn:hover { color: var(--accent); }

.course-detail-header {
  display: flex;
  gap: 32px;
  margin-bottom: 40px;
}

.course-detail-thumb {
  width: 400px;
  flex-shrink: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.course-detail-thumb img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}

.course-detail-info {
  flex: 1;
}

.course-detail-category {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.course-detail-title {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 8px 0 12px;
  line-height: 1.2;
}

.course-detail-desc {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 20px;
}

.course-detail-stats {
  display: flex;
  gap: 20px;
  margin-bottom: 24px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.course-detail-stats span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.course-detail-stats i { width: 16px; height: 16px; }

/* Curriculum */
.course-curriculum {
  margin-top: 16px;
}

.curriculum-module {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  overflow: hidden;
}

.curriculum-module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  cursor: pointer;
  transition: background var(--transition);
  user-select: none;
}

.curriculum-module-header:hover {
  background: var(--bg-secondary);
}

.curriculum-module-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.curriculum-module-num {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  flex-shrink: 0;
}

.curriculum-module-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.curriculum-module-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.curriculum-chevron {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.curriculum-module.expanded .curriculum-chevron {
  transform: rotate(180deg);
}

.curriculum-lessons {
  display: none;
  border-top: 1px solid var(--border);
}

.curriculum-module.expanded .curriculum-lessons {
  display: block;
}

.curriculum-lesson {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px 12px 64px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  transition: all var(--transition);
  cursor: pointer;
}

.curriculum-lesson:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.curriculum-lesson.locked {
  opacity: 0.5;
  cursor: default;
}

.curriculum-lesson.locked:hover {
  background: none;
  color: var(--text-secondary);
}

.curriculum-lesson-icon {
  color: var(--text-muted);
  display: flex;
  flex-shrink: 0;
}

.curriculum-lesson-title {
  flex: 1;
}

.curriculum-lock {
  color: var(--text-muted);
  flex-shrink: 0;
}

.curriculum-placeholder {
  padding: 40px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.curriculum-lesson.completed .curriculum-lesson-icon {
  color: #43a047;
}

.curriculum-lesson.completed .curriculum-lesson-title {
  color: var(--text-muted);
}

.curriculum-lesson.in-progress .curriculum-lesson-icon {
  color: var(--accent);
}

.curriculum-lesson-duration {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.progress-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--accent-subtle);
  color: var(--accent);
}

.hero-banner-meta {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.7);
  margin-left: 8px;
}

@media (max-width: 768px) {
  .course-grid { grid-template-columns: 1fr; }
  .course-detail-header { flex-direction: column; gap: 20px; }
  .course-detail-thumb { width: 100%; }
  .course-detail-title { font-size: 1.375rem; }
  .curriculum-lesson { padding-left: 44px; }
}

/* --- Community Page --- */
.community-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0 16px;
}

.community-title {
  font-size: 1.75rem;
  font-weight: 700;
}

.community-subtitle {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.community-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
  margin-bottom: 24px;
}

.community-tab {
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  position: relative;
  transition: all var(--transition);
}

.community-tab:hover { color: var(--text-primary); }

.community-tab.active {
  color: var(--text-primary);
  font-weight: 600;
}

.community-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 1px 1px 0 0;
}

.community-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}

@media (max-width: 992px) {
  .community-layout { grid-template-columns: 1fr; }
  .community-sidebar { display: none; }
}

/* Community Cards */
.community-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 16px;
  transition: border-color var(--transition);
}

.community-card:hover { border-color: var(--border-light); }

.community-card.pinned {
  border-color: var(--accent);
  border-width: 1px;
}

.community-card-pin {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.community-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.community-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.community-avatar img { width: 100%; height: 100%; object-fit: cover; }

.community-author-name {
  font-size: 0.9rem;
  font-weight: 600;
}

.community-author-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.community-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: var(--radius-full);
  font-size: 0.6875rem;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  vertical-align: middle;
  margin-left: 4px;
}

.community-card-title {
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.4;
}

.community-card-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.community-card-images {
  margin-top: 16px;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.community-card-images.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.community-card-img {
  width: 100%;
  display: block;
  cursor: pointer;
  transition: opacity var(--transition);
}

.community-card-img:hover { opacity: 0.9; }

.community-card-tags {
  display: flex;
  gap: 6px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.community-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.community-card-actions {
  display: flex;
  gap: 16px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.community-action {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  color: var(--text-muted);
  transition: color var(--transition);
}

.community-action:hover { color: var(--text-primary); }

/* Community Comments Preview */
.community-comments-preview {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.community-comment {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.community-comment-avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  overflow: hidden;
  flex-shrink: 0;
}

.community-comment-avatar img { width: 100%; height: 100%; object-fit: cover; }

.community-comment-body {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.community-comment-author {
  font-weight: 600;
  color: var(--text-primary);
  margin-right: 4px;
}

.community-view-all {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 4px;
  transition: color var(--transition);
}

.community-view-all:hover { color: var(--accent); }

/* Community Sidebar */
.community-sidebar {
  position: sticky;
  top: calc(var(--header-height) + 24px);
}

.sidebar-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 16px;
}

.sidebar-card-title {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.sidebar-challenge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-challenge-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-challenge-title {
  font-size: 0.875rem;
  font-weight: 600;
}

.sidebar-challenge-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.sidebar-member {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.sidebar-member:last-child { margin-bottom: 0; }

.sidebar-member-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  overflow: hidden;
  flex-shrink: 0;
}

.sidebar-member-avatar img { width: 100%; height: 100%; object-fit: cover; }

.sidebar-member-name {
  font-size: 0.8125rem;
  font-weight: 600;
}

.sidebar-member-stat {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.sidebar-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Sidebar Channels */
.sidebar-channels {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-channel {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.sidebar-channel:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.sidebar-channel.active {
  color: var(--text-primary);
  background: var(--accent-subtle);
}

.sidebar-channel span:first-of-type { flex: 1; }

.channel-unread {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-full);
  background: var(--accent);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none !important;
}

/* Threaded Comments */
.community-comments-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.thread-comment {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.thread-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  object-fit: cover;
}

.thread-avatar.sm {
  width: 28px;
  height: 28px;
}

.thread-body { flex: 1; min-width: 0; }

.thread-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}

.thread-author {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.thread-time {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.thread-text {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

.thread-actions {
  display: flex;
  gap: 12px;
  margin-top: 6px;
}

.thread-action-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.6875rem;
  color: var(--text-muted);
  transition: color var(--transition);
}

.thread-action-btn:hover { color: var(--text-primary); }

.thread-reply {
  margin-top: 12px;
  padding-left: 12px;
  border-left: 2px solid var(--border);
}

.thread-input {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.thread-input-field {
  flex: 1;
  padding: 8px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 0.8125rem;
  outline: none;
  transition: border-color var(--transition);
}

.thread-input-field:focus { border-color: var(--accent); }

/* --- Lesson Player Page --- */
.lesson-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
}

@media (max-width: 992px) {
  .lesson-layout { grid-template-columns: 1fr; }
}

.lesson-video-wrapper {
  margin-bottom: 24px;
}

.lesson-video-player {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #111;
}

.lesson-video-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  padding: 24px 16px 12px;
}

.lesson-video-progress {
  position: relative;
  height: 4px;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
  cursor: pointer;
  margin-bottom: 10px;
}

.lesson-video-progress:hover { height: 6px; }

.lesson-video-progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  position: relative;
}

.lesson-video-progress-bar::after {
  content: '';
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  transition: opacity var(--transition);
}

.lesson-video-progress:hover .lesson-video-progress-bar::after { opacity: 1; }

.lesson-video-chapters { position: absolute; inset: 0; }

.chapter-marker {
  position: absolute;
  top: -2px;
  width: 2px;
  height: 8px;
  background: rgba(255,255,255,0.4);
  border-radius: 1px;
}

.lesson-video-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lesson-video-left-controls,
.lesson-video-right-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lesson-ctrl-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.lesson-ctrl-btn:hover { background: rgba(255,255,255,0.1); }

.lesson-time {
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.7);
  font-variant-numeric: tabular-nums;
}

.lesson-info { margin-bottom: 24px; }

.lesson-title {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 16px;
}

.lesson-instructor {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lesson-instructor-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  object-fit: cover;
}

.lesson-instructor-name {
  font-size: 0.9rem;
  color: var(--text-primary);
}

.lesson-instructor-name strong { font-weight: 600; }

.lesson-instructor-role {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Lesson Tabs */
.lesson-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.lesson-tab {
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  position: relative;
  transition: all var(--transition);
}

.lesson-tab:hover { color: var(--text-primary); }

.lesson-tab.active {
  color: var(--text-primary);
  font-weight: 600;
}

.lesson-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 1px 1px 0 0;
}

.lesson-tab-content {
  display: none;
}

.lesson-tab-content.active { display: block; }

/* Lesson Overview */
.lesson-overview p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 24px;
}

.lesson-overview h3 {
  font-size: 1.0625rem;
  margin-bottom: 12px;
}

.lesson-checklist {
  list-style: none;
  padding: 0;
}

.lesson-checklist li {
  padding: 8px 0 8px 28px;
  position: relative;
  font-size: 0.9rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.lesson-checklist li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  border: 2px solid var(--accent);
  background: var(--accent-subtle);
}

/* Lesson Resources */
.resource-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.resource-name {
  font-size: 0.875rem;
  font-weight: 600;
}

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

.resource-info { flex: 1; }

/* Lesson Notes */
.lesson-notes-input {
  width: 100%;
  min-height: 200px;
  padding: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9rem;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color var(--transition);
}

.lesson-notes-input:focus { border-color: var(--accent); }

.lesson-notes-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 8px;
}

/* Lesson Discussion */
.discussion-input {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.discussion-input-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.discussion-input-field {
  flex: 1;
  padding: 10px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 0.875rem;
  outline: none;
  transition: border-color var(--transition);
}

.discussion-input-field:focus { border-color: var(--accent); }

.discussion-comment {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.discussion-comment.nested {
  margin-top: 16px;
  margin-left: 0;
  padding-left: 16px;
  border-left: 2px solid var(--border);
}

.discussion-comment-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  object-fit: cover;
}

.discussion-comment-body { flex: 1; }

.discussion-comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.discussion-comment-author {
  font-size: 0.875rem;
  font-weight: 600;
}

.discussion-comment-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.discussion-comment-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.discussion-comment-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.discussion-action-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: color var(--transition);
}

.discussion-action-btn:hover { color: var(--text-primary); }

/* Lesson Sidebar */
.lesson-sidebar {
  position: sticky;
  top: calc(var(--header-height) + 24px);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.lesson-sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.lesson-sidebar-header h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.lesson-progress {
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  overflow: hidden;
}

.lesson-progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 300ms ease;
}

.lesson-progress-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 6px;
  display: block;
}

.lesson-chapters {
  max-height: 60vh;
  overflow-y: auto;
}

.lesson-chapter {
  border-bottom: 1px solid var(--border);
}

.lesson-chapter:last-child { border-bottom: none; }

.lesson-chapter-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background var(--transition);
}

.lesson-chapter-header:hover { background: var(--bg-tertiary); }

.lesson-chapter-header span { flex: 1; line-height: 1.4; }

.chapter-chevron {
  flex-shrink: 0;
  transition: transform 250ms ease;
  opacity: 0.5;
}

.lesson-chapter-header:hover .chapter-chevron { opacity: 1; }

.lesson-chapter.expanded .chapter-chevron { transform: rotate(180deg); opacity: 1; }

.lesson-chapter.active .lesson-chapter-header {
  color: var(--text-primary);
  font-weight: 600;
  background: var(--accent-subtle);
}

.lesson-chapter-lessons {
  overflow: hidden;
  max-height: 0;
  padding: 0 16px 0 40px;
  transition: max-height 300ms ease, padding 300ms ease;
}

.lesson-chapter.expanded .lesson-chapter-lessons {
  max-height: 500px;
  padding: 4px 16px 10px 40px;
}

.lesson-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  margin: 1px 0;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.lesson-item:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.lesson-item.completed { color: var(--text-secondary); }

.lesson-item.current {
  color: var(--accent);
  font-weight: 600;
  background: var(--accent-subtle);
}

.lesson-item span { flex: 1; }

.lesson-item-duration {
  font-size: 0.6875rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  flex: none !important;
  opacity: 0.7;
}

/* --- Logo Grid (uniform cards) --- */
.logo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.logo-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.logo-card:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.logo-card-image {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #ffffff;
}

.logo-card-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.logo-card-info {
  padding: 10px 12px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
}

.logo-card-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logo-card-meta {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logo-card .save-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-full);
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: 0;
  transition: all var(--transition);
  z-index: 2;
}

.logo-card:hover .save-btn { opacity: 1; }
.logo-card .save-btn:hover { background: var(--accent); transform: scale(1.1); }
.logo-card .save-btn.saved { opacity: 1; background: var(--accent); }
.logo-card .save-btn svg { width: 14px; height: 14px; }

/* --- Filter Drawer Sidebar --- */
.filter-drawer-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  transition: all var(--transition);
  cursor: pointer;
}

.filter-drawer-trigger:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.filter-drawer-trigger.has-filters {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-subtle);
}

.filter-count-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-full);
  font-size: 0.6875rem;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
}

.filter-drawer-trigger.has-filters .filter-count-badge { display: flex; }

/* Overlay */
.filter-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.filter-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* Drawer */
.filter-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 380px;
  max-width: 90vw;
  background: var(--bg-primary);
  border-right: 1px solid var(--border);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-drawer.open {
  transform: translateX(0);
}

.filter-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}

.filter-drawer-title {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.filter-drawer-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: all var(--transition);
  cursor: pointer;
}

.filter-drawer-close:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
}

/* Drawer search */
.filter-drawer-search {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 24px 8px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.filter-drawer-search input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 0.875rem;
  outline: none;
}

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

/* Drawer body - scrollable */
.filter-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 24px 24px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* Filter section (each category) */
.filter-section {
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}

.filter-section:last-child {
  border-bottom: none;
}

.filter-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 4px 0;
  user-select: none;
}

.filter-section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.filter-section-label svg {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.filter-section-count {
  font-size: 0.6875rem;
  color: var(--text-muted);
  font-weight: 400;
}

.filter-section-chevron {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.filter-section.expanded .filter-section-chevron {
  transform: rotate(180deg);
}

.filter-section-items {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 12px;
}

.filter-section.expanded .filter-section-items {
  display: flex;
}

/* Filter pills inside sections */
.filter-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  transition: all var(--transition);
  cursor: pointer;
  white-space: nowrap;
}

.filter-tag-pill:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
  background: var(--bg-tertiary);
}

.filter-tag-pill.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.filter-tag-pill .tag-count {
  font-size: 0.6875rem;
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
}

.filter-tag-pill.active .tag-count {
  opacity: 0.85;
}

/* Color swatches */
.color-swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid transparent;
}

.filter-tag-pill.active .color-swatch {
  border-color: rgba(255,255,255,0.3);
}

/* Show more inside section */
.filter-section-more {
  font-size: 0.75rem;
  color: var(--accent);
  padding: 4px 0;
  cursor: pointer;
  background: none;
  border: none;
}

.filter-section-more:hover { text-decoration: underline; }

/* Footer */
.filter-drawer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  gap: 12px;
}

.filter-clear-btn {
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
}

.filter-clear-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.filter-apply-btn {
  flex: 1;
  padding: 10px 24px;
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
}

.filter-apply-btn:hover {
  background: #e5572a;
  box-shadow: 0 4px 16px rgba(255,100,49,0.25);
}

/* Active filter chips (below controls bar) */
.active-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0;
}

.active-filter-chips:empty { display: none; }

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--accent-subtle);
  color: var(--accent);
  border: 1px solid rgba(255,100,49,0.2);
  transition: all var(--transition);
}

.filter-chip:hover {
  border-color: var(--accent);
}

.filter-chip-x {
  cursor: pointer;
  font-size: 0.875rem;
  line-height: 1;
  opacity: 0.7;
  transition: opacity var(--transition);
}

.filter-chip-x:hover { opacity: 1; }

.clear-all-btn {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 6px 10px;
  cursor: pointer;
  background: none;
  border: none;
}

.clear-all-btn:hover { color: var(--accent); }

/* Color dots (for chips) */
.color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .logo-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .logo-card-image { padding: 16px; }
  .filter-drawer { width: 100%; max-width: 100%; }
}

@media (max-width: 480px) {
  .filter-drawer { width: 100%; }
}

/* --- Load More --- */
.load-more-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 0;
}

.load-more-btn {
  padding: 12px 40px;
  border-radius: var(--radius-full);
  font-size: 0.9375rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  transition: all var(--transition);
  cursor: pointer;
}

.load-more-btn:hover {
  background: #e5572a;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(255,100,49,0.3);
}

.load-more-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.load-more-progress {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- Skeleton Loading --- */
.skeleton {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  animation: shimmer 1.5s infinite;
  position: relative;
  overflow: hidden;
}

.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.04), transparent);
  animation: shimmer-slide 1.5s infinite;
}

@keyframes shimmer-slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* --- Back to Top --- */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition);
  z-index: 50;
}

.back-to-top.visible { opacity: 1; pointer-events: auto; }
.back-to-top:hover { transform: translateY(-2px); }
.back-to-top svg { width: 20px; height: 20px; }

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 80px 24px;
}

.empty-state svg { width: 64px; height: 64px; color: var(--text-muted); margin-bottom: 16px; }
.empty-state h3 { font-size: 1.125rem; margin-bottom: 8px; }
.empty-state p { font-size: 0.875rem; color: var(--text-secondary); }

/* --- Coming Soon State --- */
.coming-soon-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 100px 24px 120px;
  min-height: 50vh;
}

.coming-soon-icon {
  color: var(--accent);
  margin-bottom: 24px;
  opacity: 0.8;
}

.coming-soon-title {
  font-family: 'Poppins', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.coming-soon-desc {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 480px;
  line-height: 1.6;
  margin-bottom: 24px;
}

.coming-soon-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 20px;
  background: var(--accent-subtle);
  color: var(--accent);
  border: 1px solid rgba(255, 100, 49, 0.25);
  border-radius: 100px;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 16px;
}

.coming-soon-hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* --- Responsive --- */
@media (max-width: 1200px) {
  .masonry-grid { columns: 4; }
}

@media (max-width: 992px) {
  .masonry-grid { columns: 3; }
  .hero-banner { aspect-ratio: 16/7; }
  .hero-banner-overlay { padding: 32px; }
  .hero-banner-title { font-size: 1.5rem; }
}

@media (max-width: 768px) {
  :root { --header-height: 56px; }

  .masonry-grid { columns: 2; column-gap: 12px; }
  .masonry-item { margin-bottom: 12px; }
  .page { padding: 16px; }

  .header-nav { display: none; }

  .hero-banner { aspect-ratio: 16/9; }
  .hero-banner-overlay { padding: 24px; }
  .hero-banner-title { font-size: 1.25rem; }
  .hero-banner-desc { font-size: 0.8125rem; }

  .horizontal-scroll .card { flex: 0 0 240px; }

  .lightbox { padding: 16px; }
  .lightbox-related-grid { grid-template-columns: repeat(2, 1fr); }

  /* Mobile bottom tabs */
  .mobile-tabs {
    display: flex !important;
  }
}

@media (max-width: 480px) {
  .masonry-grid { columns: 2; column-gap: 8px; }
  .masonry-item { margin-bottom: 8px; border-radius: var(--radius-sm); }
  .filter-pill { padding: 6px 14px; font-size: 0.8125rem; }
}

/* --- Mobile Bottom Tabs --- */
.mobile-tabs {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  z-index: 100;
  align-items: center;
  justify-content: space-around;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.mobile-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--text-muted);
  font-size: 0.625rem;
  font-weight: 500;
  padding: 6px 12px;
  transition: color var(--transition);
}

.mobile-tab svg { width: 22px; height: 22px; }

.mobile-tab.active { color: var(--accent); }

/* Offset main content for mobile tabs */
@media (max-width: 768px) {
  .main { padding-bottom: 60px; }
}

/* --- Lucide Icons --- */
.header-search-btn i,
.theme-toggle i,
.mobile-tab i,
.back-to-top i {
  width: 20px;
  height: 20px;
}

.mobile-tab i {
  width: 22px;
  height: 22px;
}

/* --- Utility --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* ============================================
   Community Module - Modals, Forms, Toast
   ============================================ */

/* Modal Overlay */
.cs-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.cs-modal {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,0.4);
}

.cs-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}

.cs-modal-body {
  padding: 20px 24px;
}

.cs-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--border);
}

/* Form Elements */
.cs-form-group {
  margin-bottom: 16px;
}

.cs-form-group:last-child {
  margin-bottom: 0;
}

.cs-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.cs-input,
.cs-select,
.cs-textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: var(--font-body);
  outline: none;
  transition: border-color 0.15s ease;
}

.cs-input:focus,
.cs-select:focus,
.cs-textarea:focus {
  border-color: var(--accent);
}

.cs-textarea {
  resize: vertical;
  line-height: 1.5;
}

.cs-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* Toast */
.cs-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--card-bg, #1a1a1a);
  color: var(--text-primary);
  border: 1px solid var(--border);
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 2000;
  pointer-events: none;
}

.cs-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Post menu items */
.cs-post-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s ease;
  text-align: left;
}

.cs-post-menu-item:hover {
  background: var(--bg-tertiary);
}

/* Community action liked state */
.community-action.liked {
  color: #ff6431;
}

/* User switcher dropdown smooth */
.cs-user-dropdown {
  animation: fadeInDown 0.15s ease;
}

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

.cs-switch-user:hover {
  background: var(--bg-tertiary) !important;
}

/* Channel action buttons */
.sidebar-channel:hover .cs-channel-actions button {
  opacity: 1 !important;
}

/* ============================================
   LEARN PAGE - Course Grid & Detail
   ============================================ */

/* Course Grid */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  padding: 0 var(--page-padding);
  margin-bottom: 2rem;
}

.course-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid transparent;
}
.course-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  border-color: rgba(255,100,49,0.3);
}

.course-card-image {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
  background: #111;
}
.course-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.course-card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.course-card-badge.draft {
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
}
.course-card-lessons {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
}

.course-card-body {
  padding: 1rem;
}
.course-card-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
  line-height: 1.3;
}
.course-card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Back Button */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.875rem;
  cursor: pointer;
  padding: 0.5rem 0;
  margin: 0.5rem 0 1rem var(--page-padding);
  transition: color 0.15s;
}
.back-btn:hover {
  color: var(--accent);
}

/* Course Detail V4 - Two Column + Sticky Sidebar */
.cd-v4-layout {
  display: flex;
  gap: 2rem;
  padding: 0 var(--page-padding);
  align-items: flex-start;
}
.cd-v4-main {
  flex: 1;
  min-width: 0;
}
.cd-v4-category {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 5px 14px;
  border-radius: 4px;
  margin-bottom: 1rem;
}
.cd-v4-title {
  font-family: var(--font-heading);
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.15;
  margin-bottom: 1rem;
}
.cd-v4-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1.5rem;
  max-width: 640px;
}

/* Stats Bar */
.cd-v4-stats-bar {
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 1rem 1.5rem;
  margin-bottom: 1.75rem;
  border: 1px solid var(--bg-tertiary);
}
.cd-v4-stat {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-primary);
  font-weight: 500;
}
.cd-v4-stat i {
  width: 20px;
  height: 20px;
  color: var(--accent);
}
.cd-v4-stat-divider {
  width: 1px;
  height: 24px;
  background: var(--bg-tertiary);
  margin: 0 1.5rem;
}

/* Instructor */
.cd-v4-instructor {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--bg-tertiary);
}
.cd-v4-instructor-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
}
.cd-v4-instructor-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}
.cd-v4-instructor-role {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.cd-v4-section-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

/* Sidebar */
.cd-v4-sidebar {
  width: 340px;
  flex-shrink: 0;
  position: sticky;
  top: 80px;
}
.cd-v4-sidebar-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--bg-tertiary);
}
.cd-v4-sidebar-thumb {
  aspect-ratio: 16/10;
  overflow: hidden;
}
.cd-v4-sidebar-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cd-v4-sidebar-body {
  padding: 1.25rem;
}

/* Progress Ring */
.cd-v4-progress-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.cd-v4-progress-ring {
  position: relative;
  width: 60px;
  height: 60px;
  flex-shrink: 0;
}
.cd-v4-progress-ring svg {
  width: 100%;
  height: 100%;
}
.cd-v4-progress-pct {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}
.cd-v4-progress-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  display: block;
}
.cd-v4-progress-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* CTA */
.cd-v4-cta {
  width: 100%;
  justify-content: center;
  padding: 14px 20px;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

/* Quick Stats */
.cd-v4-quick-stats h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}
.cd-v4-qs-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  padding: 0.4rem 0;
}
.cd-v4-qs-item i {
  width: 16px;
  height: 16px;
  color: var(--accent);
  flex-shrink: 0;
}

/* Curriculum */
.course-curriculum {
  padding: 0 var(--page-padding);
  margin-bottom: 2rem;
}
.curriculum-module {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  margin-bottom: 0.5rem;
  overflow: hidden;
  border: 1px solid var(--bg-tertiary);
}
.curriculum-module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: background 0.15s;
}
.curriculum-module-header:hover {
  background: var(--bg-tertiary);
}
.curriculum-module-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}
.curriculum-module-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-shrink: 0;
}
.curriculum-module-header .chevron-icon {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  transition: transform 0.2s;
  flex-shrink: 0;
  margin-left: 0.75rem;
}
.curriculum-module.expanded .chevron-icon {
  transform: rotate(180deg);
}
.curriculum-lessons {
  display: none;
  border-top: 1px solid var(--bg-tertiary);
}
.curriculum-module.expanded .curriculum-lessons {
  display: block;
}
.curriculum-lesson {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1.25rem 0.65rem 1.75rem;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.curriculum-lesson:hover {
  background: var(--bg-tertiary);
}
.curriculum-lesson.locked {
  opacity: 0.45;
  cursor: default;
}
.curriculum-lesson .lesson-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.curriculum-lesson .lesson-type-tag {
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(255,255,255,0.08);
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: auto;
}

/* Lesson Player */
.lesson-back-btn {
  margin: 0.75rem 0 0.5rem 0;
}
.lesson-video-player iframe,
.lesson-video-player video {
  width: 100%;
  aspect-ratio: 16/9;
  border: none;
  border-radius: var(--radius-md);
  display: block;
  background: #000;
}
.lesson-video-locked {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #1a1a1a, #111);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  text-align: center;
  gap: 0.75rem;
}
.lesson-video-locked svg {
  width: 48px;
  height: 48px;
  opacity: 0.5;
}
.lesson-video-locked h3 {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin: 0;
}
.lesson-video-locked p {
  font-size: 0.85rem;
  max-width: 320px;
}

/* Lesson Nav Row */
.lesson-nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--bg-tertiary);
}
.lesson-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
}

/* Lesson sidebar - active lesson */
.lesson-item.active {
  background: rgba(255,100,49,0.1);
  color: var(--accent) !important;
}
.lesson-item.active span:first-of-type {
  color: var(--accent);
}

/* Hero banner meta */
.hero-banner-meta {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
  margin-left: 1rem;
}

/* Responsive */
@media (max-width: 960px) {
  .cd-v4-layout {
    flex-direction: column;
  }
  .cd-v4-sidebar {
    width: 100%;
    position: static;
    order: -1;
  }
  .cd-v4-sidebar-card {
    display: flex;
    gap: 0;
  }
  .cd-v4-sidebar-thumb {
    width: 200px;
    flex-shrink: 0;
    aspect-ratio: auto;
  }
  .cd-v4-title {
    font-size: 1.75rem;
  }
}
@media (max-width: 768px) {
  .course-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
  }
  .cd-v4-sidebar-card {
    flex-direction: column;
  }
  .cd-v4-sidebar-thumb {
    width: 100%;
    aspect-ratio: 16/10;
  }
  .cd-v4-title {
    font-size: 1.5rem;
  }
  .cd-v4-stats-bar {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  .cd-v4-stat-divider {
    display: none;
  }
}
