/* ========= HERO SECTION ========= */
.hero {
  position: relative;
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: var(--header-height);
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background: var(--gradient-hero);
  z-index: 0;
}
.hero-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 800px 600px at 20% 50%, rgba(139, 92, 246, 0.15) 0%, transparent 70%),
    radial-gradient(ellipse 600px 400px at 80% 30%, rgba(59, 130, 246, 0.12) 0%, transparent 70%),
    radial-gradient(ellipse 500px 500px at 50% 80%, rgba(6, 182, 212, 0.1) 0%, transparent 70%);
}
.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(139, 92, 246, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 92, 246, 0.025) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse 70% 50% at 50% 40%, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 70% 50% at 50% 40%, black 20%, transparent 70%);
}

/* Particles */
.hero-particles {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
}
.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: rgba(139, 92, 246, 0.4);
  border-radius: 50%;
  animation: float 6s ease-in-out infinite;
}
.particle:nth-child(2) { left: 20%; top: 30%; animation-delay: -1s; background: rgba(59, 130, 246, 0.3); width: 6px; height: 6px; }
.particle:nth-child(3) { left: 70%; top: 20%; animation-delay: -2s; background: rgba(6, 182, 212, 0.3); width: 3px; height: 3px; }
.particle:nth-child(4) { left: 40%; top: 60%; animation-delay: -3s; width: 5px; height: 5px; }
.particle:nth-child(5) { left: 85%; top: 70%; animation-delay: -4s; background: rgba(236, 72, 153, 0.3); width: 4px; height: 4px; }
.particle:nth-child(6) { left: 10%; top: 80%; animation-delay: -2.5s; background: rgba(16, 185, 129, 0.3); width: 5px; height: 5px; }
.particle:nth-child(7) { left: 55%; top: 15%; animation-delay: -1.5s; width: 3px; height: 3px; }
.particle:nth-child(8) { left: 30%; top: 90%; animation-delay: -3.5s; background: rgba(245, 158, 11, 0.3); width: 4px; height: 4px; }

/* Hero content */
.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 820px;
  padding: 0 2rem;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 7px 22px;
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: var(--radius-full);
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--accent-primary-light);
  margin-bottom: 2rem;
  animation: fadeInUp 0.6s ease;
  backdrop-filter: blur(10px);
}
.hero-badge .dot {
  width: 7px;
  height: 7px;
  background: var(--accent-green);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}
.hero-title {
  font-size: clamp(2.8rem, 5.5vw, 4.2rem);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -2px;
  margin-bottom: 1.5rem;
  animation: fadeInUp 0.6s ease 0.1s both;
}
.hero-title .gradient-text {
  background: linear-gradient(135deg, #a78bfa, #60a5fa, #34d399);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% auto;
  animation: gradientShift 5s ease infinite;
}
.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 580px;
  margin: 0 auto 2.5rem;
  line-height: 1.8;
  animation: fadeInUp 0.6s ease 0.2s both;
  opacity: 0.85;
}
.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  animation: fadeInUp 0.6s ease 0.3s both;
}
.hero-actions .btn {
  padding: 15px 34px;
  font-size: 0.95rem;
  border-radius: var(--radius-xl);
  font-weight: 600;
}

/* ========= STATS ========= */
.stats-section {
  position: relative;
  z-index: 2;
  margin-top: -3.5rem;
  padding: 0 2rem;
}
.stats-bar {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(17, 24, 39, 0.6);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(148, 163, 184, 0.08);
  border-radius: var(--radius-xl);
  padding: 2.25rem 2rem;
  box-shadow:
    var(--shadow-xl),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.stat-item {
  text-align: center;
  position: relative;
}
.stat-item:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 10%;
  height: 80%;
  width: 1px;
  background: linear-gradient(transparent, rgba(148, 163, 184, 0.1), transparent);
}
.stat-number {
  font-size: 2.1rem;
  font-weight: 800;
  background: linear-gradient(135deg, #c4b5fd, #93c5fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}
.stat-label {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-top: 0.3rem;
  font-weight: 500;
  letter-spacing: 0.3px;
}

/* ========= COURSES SECTION ========= */
.courses-section {
  padding: 6rem 0 2rem;
}
.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}
.section-tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent-primary-light);
  margin-bottom: 0.75rem;
  background: rgba(139, 92, 246, 0.08);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(139, 92, 246, 0.12);
}
.section-title {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 1rem;
}
.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 550px;
  margin: 0 auto;
}

/* Search & Filter */
.search-filter-bar {
  display: flex;
  gap: 1rem;
  max-width: 700px;
  margin: 0 auto 3rem;
  flex-wrap: wrap;
  justify-content: center;
}
.search-box {
  flex: 1;
  min-width: 280px;
  position: relative;
}
.search-box input {
  width: 100%;
  padding: 12px 20px 12px 48px;
  background: rgba(17, 24, 39, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: var(--radius-xl);
  color: var(--text-primary);
  font-size: 0.92rem;
  transition: all var(--transition-base);
  backdrop-filter: blur(10px);
}
.search-box input:focus {
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1), 0 4px 20px rgba(0, 0, 0, 0.2);
  background: rgba(17, 24, 39, 0.8);
}
.search-box input::placeholder { color: var(--text-dim); }
.search-box .search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}
.filter-btns {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.filter-btn {
  padding: 8px 20px;
  border-radius: var(--radius-full);
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--text-muted);
  background: rgba(17, 24, 39, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.08);
  transition: all var(--transition-base);
  cursor: pointer;
}
.filter-btn:hover {
  color: var(--text-primary);
  border-color: rgba(139, 92, 246, 0.2);
  background: rgba(139, 92, 246, 0.06);
}
.filter-btn.active {
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: white;
  border-color: transparent;
  box-shadow: 0 2px 12px rgba(139, 92, 246, 0.3);
}

/* ========= COURSE GRID ========= */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}
.course-card {
  position: relative;
  background: rgba(17, 24, 39, 0.5);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(148, 163, 184, 0.06);
  border-radius: 18px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  animation: fadeInUp 0.5s ease both;
}
.course-card:hover {
  transform: translateY(-8px);
  border-color: rgba(139, 92, 246, 0.25);
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.3),
    0 0 40px rgba(139, 92, 246, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.course-card:nth-child(2) { animation-delay: 0.05s; }
.course-card:nth-child(3) { animation-delay: 0.1s; }
.course-card:nth-child(4) { animation-delay: 0.15s; }
.course-card:nth-child(5) { animation-delay: 0.2s; }
.course-card:nth-child(6) { animation-delay: 0.25s; }
.course-card:nth-child(7) { animation-delay: 0.3s; }
.course-card:nth-child(8) { animation-delay: 0.35s; }

.card-thumbnail {
  height: 180px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-thumbnail .thumb-icon {
  font-size: 3.5rem;
  z-index: 1;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
  transition: transform 0.4s ease;
}
.course-card:hover .card-thumbnail .thumb-icon {
  transform: scale(1.15) rotate(-3deg);
}
.card-thumbnail .thumb-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.12;
  background-image: radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
  background-size: 20px 20px;
}
.card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.course-card:hover .card-overlay { opacity: 1; }
.card-overlay .play-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(0.7);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.5);
}
.course-card:hover .card-overlay .play-icon { transform: scale(1); }

.card-body { padding: 1.25rem; }
.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.card-title {
  font-size: 1.08rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}
.card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 1rem;
}
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid rgba(148, 163, 184, 0.06);
}
.card-stat {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.card-stat svg { width: 16px; height: 16px; }

/* ========= FEATURES ========= */
.features-section { padding: 5rem 0; }
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.feature-card {
  padding: 2rem;
  background: rgba(17, 24, 39, 0.4);
  border: 1px solid rgba(148, 163, 184, 0.06);
  border-radius: 18px;
  transition: all 0.35s ease;
  position: relative;
  overflow: hidden;
}
.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.15), transparent);
  opacity: 0;
  transition: opacity 0.35s ease;
}
.feature-card:hover::before { opacity: 1; }
.feature-card:hover {
  border-color: rgba(139, 92, 246, 0.15);
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}
.feature-icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
}
.feature-card h3 {
  font-size: 1.08rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
}
.feature-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ========= CTA SECTION ========= */
.cta-section {
  padding: 4rem 0;
}
.cta-card {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(59, 130, 246, 0.06));
  border: 1px solid rgba(139, 92, 246, 0.15);
  border-radius: 24px;
  padding: 5rem 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.04) 0%, transparent 60%);
  animation: float 8s ease-in-out infinite;
}
.cta-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.3), transparent);
}
.cta-card h2 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 1rem;
  position: relative;
  letter-spacing: -0.5px;
}
.cta-card p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto 2.5rem;
  position: relative;
  line-height: 1.7;
}
.cta-card .btn {
  position: relative;
}

/* ========= RESPONSIVE ========= */

/* Tablet */
@media (max-width: 1024px) {
  .hero { min-height: 80vh; }
  .hero-content { max-width: 650px; }
  .hero-title { font-size: 3rem; }
  .stats-bar { max-width: 100%; padding: 2rem 1.5rem; }
  .course-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .cta-card { padding: 4rem 2.5rem; }
}

/* Mobile */
@media (max-width: 768px) {
  .hero { min-height: 70vh; padding-top: calc(var(--header-height) + 1rem); }
  .hero-content { padding: 0 1rem; }
  .hero-badge { font-size: 0.78rem; padding: 6px 16px; margin-bottom: 1.5rem; }
  .hero-title { font-size: 2.2rem; letter-spacing: -1px; margin-bottom: 1rem; }
  .hero-subtitle { font-size: 0.95rem; margin-bottom: 2rem; line-height: 1.7; }
  .hero-actions { gap: 0.75rem; }
  .hero-actions .btn { padding: 12px 24px; font-size: 0.88rem; width: 100%; justify-content: center; }
  .stats-section { margin-top: -2rem; padding: 0 1rem; }
  .stats-bar { grid-template-columns: repeat(2, 1fr); gap: 1.25rem; padding: 1.5rem; }
  .stat-item:nth-child(2)::after { display: none; }
  .stat-number { font-size: 1.6rem; }
  .stat-label { font-size: 0.75rem; }
  .courses-section { padding: 4rem 0 1rem; }
  .section-header { margin-bottom: 2rem; }
  .section-tag { font-size: 0.72rem; padding: 5px 12px; }
  .section-title { font-size: 1.6rem; }
  .section-subtitle { font-size: 0.92rem; }
  .search-filter-bar { flex-direction: column; gap: 0.75rem; margin-bottom: 2rem; }
  .search-box { min-width: auto; }
  .filter-btns { justify-content: center; }
  .filter-btn { padding: 7px 16px; font-size: 0.8rem; }
  .course-grid { grid-template-columns: 1fr; gap: 1rem; }
  .card-thumbnail { height: 160px; }
  .features-section { padding: 3rem 0; }
  .features-grid { grid-template-columns: 1fr; gap: 1rem; }
  .feature-card { padding: 1.5rem; }
  .cta-section { padding: 2rem 0; }
  .cta-card { padding: 2.5rem 1.5rem; border-radius: 18px; }
  .cta-card h2 { font-size: 1.5rem; }
  .cta-card p { font-size: 0.92rem; margin-bottom: 2rem; }
}

/* Small phones */
@media (max-width: 480px) {
  .hero { min-height: 65vh; }
  .hero-title { font-size: 1.9rem; letter-spacing: -0.5px; }
  .hero-subtitle { font-size: 0.88rem; }
  .hero-actions .btn { padding: 11px 20px; font-size: 0.85rem; }
  .stats-bar { grid-template-columns: repeat(2, 1fr); gap: 1rem; padding: 1.25rem; border-radius: 16px; }
  .stat-number { font-size: 1.4rem; }
  .stat-label { font-size: 0.7rem; }
  .section-title { font-size: 1.4rem; }
  .course-grid { gap: 0.75rem; }
  .card-body { padding: 1rem; }
  .card-title { font-size: 1rem; }
  .card-desc { font-size: 0.8rem; }
  .cta-card { padding: 2rem 1rem; }
  .cta-card h2 { font-size: 1.3rem; }
  .cta-card p { font-size: 0.85rem; }
}

/* Very small phones */
@media (max-width: 360px) {
  .hero-title { font-size: 1.7rem; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; }
  .stats-bar { gap: 0.75rem; padding: 1rem; }
  .stat-number { font-size: 1.2rem; }
}
