/* Courses browse page + course card component */

/* ── Page layout ── */
.courses-page {
  max-width: 72rem; margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}
.courses-hero {
  text-align: center; margin-bottom: 2rem;
}
.courses-hero h1 {
  font-family: 'Sora', sans-serif;
  font-size: 1.75rem; font-weight: 700;
  margin: 0 0 0.375rem; letter-spacing: -0.02em;
}
.courses-hero p {
  color: var(--text-secondary); margin: 0 0 1.5rem;
  font-size: 0.9375rem;
}
.courses-search {
  max-width: 32rem; margin: 0 auto;
  display: flex; gap: 0.5rem;
}
.courses-search .input {
  flex: 1; border-radius: 999px; padding-left: 1.25rem;
}
.courses-search .btn {
  border-radius: 999px; padding: 0.5rem 1.5rem;
}
.courses-empty {
  text-align: center; padding: 4rem 1rem;
  color: var(--text-secondary);
}
.courses-empty p { margin: 0 0 0.375rem; }
.courses-empty a { color: var(--accent); }

/* ── Card grid ── */
.cc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

/* ── Card ── */
.cc-card {
  display: flex; flex-direction: column;
  border-radius: 14px; overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  text-decoration: none; color: inherit;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.25s ease,
              border-color 0.25s ease;
}
.cc-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px var(--shadow-md), 0 0 0 1px rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.15);
}

/* ── Thumbnail ── */
.cc-thumb {
  position: relative; width: 100%;
  aspect-ratio: 16 / 9; overflow: hidden;
  background: var(--bg-secondary);
}
.cc-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.cc-card:hover .cc-thumb img {
  transform: scale(1.04);
}
.cc-thumb-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg,
    rgba(59, 130, 246, 0.12) 0%,
    rgba(59, 130, 246, 0.04) 100%);
  font-size: 2.5rem; font-weight: 700;
  color: var(--accent); opacity: 0.6;
  font-family: 'Sora', sans-serif;
}

/* Enrolled count badge — top-left of thumbnail */
.cc-enrolled-badge {
  position: absolute; top: 0.625rem; left: 0.625rem;
  display: flex; align-items: center; gap: 0.3rem;
  padding: 0.2rem 0.625rem; border-radius: 999px;
  font-size: 0.6875rem; font-weight: 600;
  background: rgba(10, 10, 18, 0.7);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.cc-enrolled-badge svg { opacity: 0.7; }

/* ── Card body ── */
.cc-body {
  display: flex; flex-direction: column; flex: 1;
  padding: 1rem 1.125rem 1.125rem;
}
.cc-title {
  font-size: 1rem; font-weight: 600;
  line-height: 1.35; margin: 0 0 0.375rem;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
  letter-spacing: -0.01em;
}
.cc-desc {
  font-size: 0.8125rem; line-height: 1.5;
  color: var(--text-secondary); margin: 0 0 0.75rem;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}

/* Topics */
.cc-topics {
  display: flex; flex-wrap: wrap; gap: 0.375rem;
  margin-bottom: 0.875rem;
}
.cc-topic {
  padding: 0.125rem 0.5rem; border-radius: 999px;
  font-size: 0.6875rem; font-weight: 500;
  color: var(--text-muted);
  background: var(--accent-soft);
  border: 1px solid transparent;
  transition: color 0.2s;
}
.cc-card:hover .cc-topic {
  color: var(--accent);
}
.cc-topic--more {
  color: var(--accent); font-weight: 600;
}

/* Footer: creator + price */
.cc-footer {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-top: auto; padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.cc-creator {
  display: flex; align-items: center; gap: 0.5rem;
  min-width: 0;
}
.cc-creator-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
}
.cc-creator-avatar--initials {
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
  font-size: 0.6875rem; font-weight: 700;
}
.cc-creator-name {
  font-size: 0.8125rem; color: var(--text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 120px;
}
.cc-level {
  font-size: 0.6875rem; font-weight: 600;
  text-transform: capitalize; color: var(--text-muted);
  padding: 0.125rem 0.5rem; border-radius: 999px;
  background: var(--bg-secondary);
  flex-shrink: 0;
}

/* Price — big and bold in the footer */
.cc-price {
  font-size: 1.125rem; font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  flex-shrink: 0;
  padding: 0.25rem 0.875rem;
  border-radius: 8px;
  background: var(--accent-soft);
  border: 1px solid rgba(59, 130, 246, 0.15);
}
.cc-price--free {
  color: #34d399;
  background: rgba(52, 211, 153, 0.1);
  border-color: rgba(52, 211, 153, 0.15);
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .cc-grid {
    grid-template-columns: 1fr;
  }
  .courses-hero h1 { font-size: 1.375rem; }
}
