/* Classroom (ห้องเรียน) — course catalogue page */

.page.page-classroom {
  width: min(1380px, calc(100% - 48px));
  padding-bottom: 80px;
}

.classroom-layout {
  display: grid;
  gap: 48px;
  padding: 28px 0 0;
}

/* ── Hero ── */
.classroom-hero {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  padding: 44px 48px;
  background:
    radial-gradient(circle at 14% 18%, rgba(228, 42, 112, 0.22), rgba(228, 42, 112, 0) 38%),
    radial-gradient(circle at 82% 78%, rgba(125, 75, 255, 0.22), rgba(125, 75, 255, 0) 42%),
    linear-gradient(180deg, rgba(20, 28, 44, 0.92), rgba(12, 18, 30, 0.96));
  border: 1px solid rgba(138, 163, 196, 0.16);
}

@keyframes classroomHeroFadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.classroom-hero > * {
  opacity: 0;
  animation: classroomHeroFadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.classroom-hero > :nth-child(1) { animation-delay: 0.08s; }
.classroom-hero > :nth-child(2) { animation-delay: 0.16s; }
.classroom-hero > :nth-child(3) { animation-delay: 0.24s; }
.classroom-hero > :nth-child(4) { animation-delay: 0.32s; }
.classroom-hero > :nth-child(n+5) { animation-delay: 0.40s; }

@media (prefers-reduced-motion: reduce) {
  .classroom-hero > * {
    animation: none;
    opacity: 1;
  }
}

.classroom-hero-kicker {
  margin: 0 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #f16da0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.classroom-hero-kicker::before {
  content: "";
  width: 32px;
  height: 1px;
  background: linear-gradient(90deg, rgba(37, 244, 238, 0.2), rgba(37, 244, 238, 0.95));
}

.classroom-hero-title {
  margin: 0 0 14px;
  font-size: clamp(2rem, 4vw, 3.4rem);
  font-weight: 600;
  line-height: 1.1;
  color: #fbfcff;
  letter-spacing: -0.02em;
}

.classroom-hero-title-accent {
  background: linear-gradient(90deg, #f16da0, #a78bfa, #25f4ee);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.classroom-hero-desc {
  margin: 0;
  max-width: 60ch;
  font-size: 0.96rem;
  line-height: 1.6;
  color: rgba(212, 224, 244, 0.78);
}

.classroom-hero-stats {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.classroom-hero-stat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(138, 163, 196, 0.08);
  border: 1px solid rgba(138, 163, 196, 0.18);
  font-size: 0.78rem;
  color: #d4e0f4;
}

.classroom-hero-stat strong {
  color: #ffe7f0;
  font-weight: 600;
}

/* ── Section ── */
.classroom-section {
  display: grid;
  gap: 22px;
}

.classroom-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.classroom-section-title {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 600;
  color: #fbfcff;
  letter-spacing: -0.01em;
}

.classroom-section-subtitle {
  margin: 4px 0 0;
  font-size: 0.86rem;
  color: rgba(192, 207, 230, 0.7);
}

/* ── Filter tabs ── */
.classroom-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.classroom-filter-tab {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(138, 163, 196, 0.22);
  background: rgba(16, 24, 36, 0.7);
  color: rgba(212, 224, 244, 0.78);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
}

.classroom-filter-tab:hover {
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.4);
  color: #ddd6fe;
}

.classroom-filter-tab.is-active {
  background: linear-gradient(180deg, rgba(228, 42, 112, 0.32), rgba(125, 75, 255, 0.28));
  border-color: rgba(228, 42, 112, 0.55);
  color: #ffe7f0;
}

/* ── Course grid ── */
.classroom-course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
}

.classroom-course-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(22, 30, 46, 0.96), rgba(14, 20, 32, 0.98));
  border: 1px solid rgba(138, 163, 196, 0.14);
  cursor: pointer;
  transition: transform 0.22s, border-color 0.22s, box-shadow 0.22s;
  animation: classroomCourseCardIn 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes classroomCourseCardIn {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.classroom-course-card:nth-child(1)  { animation-delay: 0.05s; }
.classroom-course-card:nth-child(2)  { animation-delay: 0.12s; }
.classroom-course-card:nth-child(3)  { animation-delay: 0.19s; }
.classroom-course-card:nth-child(4)  { animation-delay: 0.26s; }
.classroom-course-card:nth-child(5)  { animation-delay: 0.33s; }
.classroom-course-card:nth-child(6)  { animation-delay: 0.40s; }
.classroom-course-card:nth-child(7)  { animation-delay: 0.47s; }
.classroom-course-card:nth-child(8)  { animation-delay: 0.54s; }
.classroom-course-card:nth-child(9)  { animation-delay: 0.61s; }
.classroom-course-card:nth-child(10) { animation-delay: 0.68s; }
.classroom-course-card:nth-child(11) { animation-delay: 0.75s; }
.classroom-course-card:nth-child(12) { animation-delay: 0.82s; }
.classroom-course-card:nth-child(n+13) { animation-delay: 0.90s; }

@media (prefers-reduced-motion: reduce) {
  .classroom-course-card {
    animation: none;
  }
}

/* Hover — combine entry animation's translateY with hover lift */
.classroom-course-card:hover {
  transform: translateY(-4px);
  border-color: rgba(139, 92, 246, 0.45);
  box-shadow: 0 18px 36px -18px rgba(125, 75, 255, 0.45);
}

.classroom-course-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0f1723;
  overflow: hidden;
}

.classroom-course-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s;
}

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

.classroom-course-thumb-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 30% 30%, rgba(228, 42, 112, 0.32), rgba(228, 42, 112, 0) 50%),
    radial-gradient(circle at 70% 70%, rgba(125, 75, 255, 0.34), rgba(125, 75, 255, 0) 52%),
    #0f1723;
  color: rgba(255, 255, 255, 0.6);
}

.classroom-course-level-badge {
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(8, 12, 22, 0.6);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #ffe7f0;
  border: 1px solid rgba(228, 42, 112, 0.45);
}

.classroom-course-level-badge.is-beginner {
  border-color: rgba(37, 244, 238, 0.5);
  color: #25f4ee;
}

.classroom-course-level-badge.is-intermediate {
  border-color: rgba(251, 191, 36, 0.5);
  color: #fbbf24;
}

.classroom-course-level-badge.is-advanced {
  border-color: rgba(239, 68, 68, 0.5);
  color: #f87171;
}

.classroom-course-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 18px 16px;
}

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

.classroom-course-tag {
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.28);
  font-size: 0.7rem;
  color: #c4b5fd;
}

.classroom-course-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.32;
  color: #fbfcff;
}

.classroom-course-desc {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.5;
  color: rgba(192, 207, 230, 0.72);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.classroom-course-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.76rem;
  color: rgba(192, 207, 230, 0.66);
  margin-top: 4px;
}

.classroom-course-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.classroom-course-meta-item svg {
  opacity: 0.7;
}

.classroom-course-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid rgba(138, 163, 196, 0.1);
  background: rgba(8, 12, 22, 0.42);
}

/* ── Course sale button (purple/yellow promo style) ── */
.classroom-course-sale-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 9px 14px;
  border-radius: 10px;
  box-sizing: border-box;
  border: 1px solid rgba(167, 139, 250, 0.5);
  background:
    radial-gradient(circle at 85% -30%, rgba(192, 132, 252, 0.5), transparent 55%),
    linear-gradient(160deg, #6d28d9 0%, #5b21b6 55%, #4c1d95 100%);
  color: #ffffff;
  font-family: inherit;
  cursor: pointer;
  overflow: hidden;
  box-shadow:
    0 8px 20px -12px rgba(124, 58, 237, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.classroom-course-sale-btn::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -15%;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(250, 204, 21, 0.3), transparent 70%);
  pointer-events: none;
}

.classroom-course-sale-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(192, 132, 252, 0.85);
  box-shadow:
    0 12px 26px -12px rgba(124, 58, 237, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

.classroom-course-sale-headline {
  position: relative;
  font-size: 1.0rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.15;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.classroom-course-sale-headline-accent {
  background: linear-gradient(180deg, #fde047 0%, #facc15 100%);
    background-clip: border-box;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-left: 2px;
  font-weight: 500;
  text-shadow: none;
}

.classroom-course-sale-prices {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-variant-numeric: tabular-nums;
}

.classroom-course-sale-old {
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  text-decoration-color: rgba(255, 255, 255, 0.6);
}

.classroom-course-sale-now {
  font-size: 0.96rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  background: linear-gradient(180deg, #fde047 0%, #facc15 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.classroom-course-sale-btn.is-free {
  border-color: rgba(110, 231, 183, 0.5);
  background:
    radial-gradient(circle at 80% -10%, rgba(167, 243, 208, 0.45), transparent 55%),
    linear-gradient(160deg, #047857 0%, #065f46 55%, #064e3b 100%);
  box-shadow:
    0 14px 32px -16px rgba(16, 185, 129, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -2px 0 rgba(0, 0, 0, 0.25);
}

.classroom-course-sale-btn.is-free::before {
  background: radial-gradient(circle, rgba(253, 224, 71, 0.32), transparent 70%);
}

.classroom-course-sale-btn.is-free:hover {
  border-color: rgba(110, 231, 183, 0.95);
  box-shadow:
    0 20px 42px -16px rgba(16, 185, 129, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -2px 0 rgba(0, 0, 0, 0.25);
}

/* ── Course price button (split design — legacy, kept for fallback) ── */
.classroom-course-price-btn {
  position: relative;
  display: inline-flex;
  align-items: stretch;
  width: 100%;
  padding: 0;
  border-radius: 12px;
  border: 1px solid rgba(228, 42, 112, 0.4);
  background: rgba(8, 12, 22, 0.55);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 10px 28px -18px rgba(228, 42, 112, 0.55);
}

.classroom-course-price-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(228, 42, 112, 0.85);
  box-shadow: 0 16px 36px -16px rgba(228, 42, 112, 0.78);
}

.classroom-course-price-btn-amount {
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
  padding: 12px 16px;
  font-size: 1.05rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  color: #fbfcff;
  background: linear-gradient(180deg, rgba(22, 30, 46, 0.85), rgba(14, 20, 32, 0.95));
  border-right: 1px solid rgba(228, 42, 112, 0.32);
  flex: 0 0 auto;
}

.classroom-course-price-btn-currency {
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(228, 167, 196, 0.95);
  margin-right: 2px;
}

.classroom-course-price-btn-cta {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(228, 42, 112, 0.85), rgba(125, 75, 255, 0.78));
  color: #ffffff;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: background 0.2s ease;
}

.classroom-course-price-btn:hover .classroom-course-price-btn-cta {
  background: linear-gradient(135deg, rgba(247, 70, 138, 0.95), rgba(150, 100, 255, 0.92));
}

.classroom-course-price-btn-arrow {
  transition: transform 0.2s ease;
}

.classroom-course-price-btn:hover .classroom-course-price-btn-arrow {
  transform: translateX(3px);
}

/* Free variant — emerald accent, FREE chip on the left */
.classroom-course-price-btn.is-free {
  border-color: rgba(37, 244, 238, 0.45);
  box-shadow: 0 10px 28px -18px rgba(37, 244, 238, 0.55);
}

.classroom-course-price-btn.is-free:hover {
  border-color: rgba(37, 244, 238, 0.9);
  box-shadow: 0 16px 36px -16px rgba(37, 244, 238, 0.65);
}

.classroom-course-price-btn-tag {
  display: inline-flex;
  align-items: center;
  padding: 12px 16px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #25f4ee;
  background: linear-gradient(180deg, rgba(22, 30, 46, 0.85), rgba(14, 20, 32, 0.95));
  border-right: 1px solid rgba(37, 244, 238, 0.3);
  flex: 0 0 auto;
}

.classroom-course-price-btn.is-free .classroom-course-price-btn-cta {
  background: linear-gradient(135deg, rgba(37, 244, 238, 0.55), rgba(45, 212, 191, 0.55));
  color: #06222a;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.2);
}

.classroom-course-price-btn.is-free:hover .classroom-course-price-btn-cta {
  background: linear-gradient(135deg, rgba(37, 244, 238, 0.75), rgba(45, 212, 191, 0.7));
}

.classroom-course-owned-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 44px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 700;
  color: #25f4ee;
  letter-spacing: 0.01em;
  box-sizing: border-box;
}

.classroom-course-owned-label svg {
  flex: 0 0 auto;
}

.classroom-course-price {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fbfcff;
}

.classroom-course-price-currency {
  font-size: 0.78rem;
  font-weight: 500;
  color: rgba(212, 224, 244, 0.7);
}

.classroom-course-price.is-free {
  color: #25f4ee;
}

.classroom-course-enroll-btn {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid rgba(228, 42, 112, 0.45);
  background: linear-gradient(180deg, rgba(228, 42, 112, 0.32), rgba(125, 75, 255, 0.28));
  color: #ffe7f0;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, transform 0.18s;
}

.classroom-course-enroll-btn:hover {
  border-color: rgba(228, 42, 112, 0.78);
  background: linear-gradient(180deg, rgba(228, 42, 112, 0.5), rgba(125, 75, 255, 0.42));
  transform: translateY(-1px);
}

/* ── Empty state ── */
.classroom-empty {
  padding: 60px 20px;
  text-align: center;
  border-radius: 16px;
  border: 1px dashed rgba(138, 163, 196, 0.26);
  background: rgba(16, 24, 36, 0.5);
  color: rgba(192, 207, 230, 0.72);
}

.classroom-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: rgba(139, 92, 246, 0.14);
  color: #c4b5fd;
  margin-bottom: 14px;
}

.classroom-empty-title {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 600;
  color: #ecf4ff;
}

.classroom-empty-msg {
  margin: 0;
  font-size: 0.86rem;
}

@media (max-width: 900px) {
  .page.page-classroom {
    width: calc(100% - 28px);
    padding-top: 60px;
  }
}

@media (max-width: 720px) {
  .classroom-hero {
    padding: 32px 22px;
  }
  .classroom-course-grid {
    grid-template-columns: 1fr;
  }
}
