/**
 * CourseKub — Theme Stylesheet
 * Uses CSS custom properties set by Admin\Settings::render_css_variables()
 */

/* ── Base ──────────────────────────────────────────────────── */
.ckub-wrap {
  font-family: var(--lms-thai-font, 'Kanit'), Arial, Helvetica, sans-serif;
  color: var(--lms-text, #1F2937);
  line-height: 1.6;
}

.ckub-wrap h1,
.ckub-wrap h2,
.ckub-wrap h3,
.ckub-wrap h4 {
  font-family: var(--lms-thai-font, 'Kanit'), sans-serif;
  font-weight: 600;
  color: var(--lms-text, #1F2937);
}

/* ── Buttons ──────────────────────────────────────────────── */
.ckub-btn {
  display: inline-block;
  padding: 10px 24px;
  background: var(--lms-primary, #10B981);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease;
}

.ckub-btn:hover,
.ckub-btn:focus {
  background: var(--lms-primary-hover, #059669);
  color: #fff;
  text-decoration: none;
}

.ckub-btn--outline {
  background: transparent;
  color: var(--lms-primary, #10B981);
  border: 2px solid var(--lms-primary, #10B981);
}

.ckub-btn--outline:hover {
  background: var(--lms-primary, #10B981);
  color: #fff;
}

/* ── Cards ────────────────────────────────────────────────── */
.ckub-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  padding: 24px;
  margin-bottom: 20px;
}

/* ── Progress Bar ─────────────────────────────────────────── */
.ckub-progress {
  background: #E5E7EB;
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.ckub-progress__bar {
  height: 100%;
  background: var(--lms-primary, #10B981);
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* ── Course Grid ──────────────────────────────────────────── */
.ckub-courses {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.ckub-course-card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ckub-course-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.ckub-course-card__thumb {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.ckub-course-card__body {
  padding: 16px;
}

.ckub-course-card__title {
  font-size: 18px;
  margin: 0 0 8px;
}

/* ── LINE Login Button ────────────────────────────────────── */
.ckub-line-login-btn {
  display: inline-block;
  background: #06C755;
  color: #fff;
  padding: 10px 24px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  transition: background 0.2s ease;
}

.ckub-line-login-btn:hover {
  background: #05a647;
  color: #fff;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .ckub-courses {
    grid-template-columns: 1fr;
  }

  .ckub-card {
    padding: 16px;
  }
}

/* ══════════════════════════════════════════════════════════════
   Cohort Courses (Virtual / On-Demand)  — v1.4.1
   ══════════════════════════════════════════════════════════════ */

.ckub-cohort {
  --ckub-radius: 16px;
  --ckub-border: #E9EAEE;
  --ckub-muted: #6B7280;
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 20px 64px;
  overflow-wrap: break-word;
}
.ckub-cohort,
.ckub-cohort * { min-width: 0; }
.ckub-card { overflow-wrap: break-word; word-break: break-word; }
.ckub-hero__title,
.ckub-replay__title,
.ckub-agenda__title,
.ckub-section-title { overflow-wrap: break-word; word-break: break-word; }

/* ── Hero header ──────────────────────────────────────────── */
.ckub-hero {
  background: #fff;
  border: 1px solid var(--ckub-border);
  border-radius: var(--ckub-radius);
  padding: 28px 32px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.ckub-hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--lms-primary, #10B981), color-mix(in srgb, var(--lms-primary, #10B981) 40%, #6366F1));
}
.ckub-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  padding: 5px 12px;
  border-radius: 999px;
  text-transform: uppercase;
}
.ckub-badge--live { background: #FEF2F2; color: #DC2626; }
.ckub-badge--ondemand { background: #EFF6FF; color: #2563EB; }
.ckub-badge--live .ckub-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #DC2626;
  box-shadow: 0 0 0 0 rgba(220,38,38,.6);
  animation: ckub-pulse 1.8s infinite;
}
@keyframes ckub-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(220,38,38,.5); }
  70%  { box-shadow: 0 0 0 8px rgba(220,38,38,0); }
  100% { box-shadow: 0 0 0 0 rgba(220,38,38,0); }
}
.ckub-hero__title {
  font-size: clamp(26px, 4vw, 36px);
  line-height: 1.15;
  margin: 14px 0 10px;
}
.ckub-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--ckub-muted);
  font-size: 15px;
}
.ckub-hero__meta span { display: inline-flex; align-items: center; gap: 6px; }

/* ── Layout grid: main + sidebar ──────────────────────────── */
.ckub-cohort__grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
}
.ckub-cohort__aside { position: sticky; top: 24px; }

/* ── Section heading ──────────────────────────────────────── */
.ckub-section-title {
  font-size: 20px;
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Zoom join panel ──────────────────────────────────────── */
.ckub-zoom {
  background: linear-gradient(150deg, #EEF2FF 0%, #F5F3FF 100%);
  border: 1px solid #C7D2FE;
  border-radius: var(--ckub-radius);
  padding: 24px;
  text-align: center;
  margin-bottom: 16px;
}
.ckub-zoom__eyebrow {
  font-size: 12px; letter-spacing: 1px; font-weight: 700;
  color: #4F46E5; text-transform: uppercase;
}
.ckub-zoom__when { margin: 8px 0 16px; font-size: 15px; color: #374151; }
.ckub-zoom__btn {
  display: block; width: 100%; box-sizing: border-box;
  background: #2D8CFF; color: #fff;
  font-size: 18px; font-weight: 700;
  padding: 15px; border-radius: 12px; text-decoration: none;
  box-shadow: 0 6px 18px rgba(45,140,255,.35);
  transition: transform .15s ease, box-shadow .15s ease;
}
.ckub-zoom__btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(45,140,255,.45); color:#fff; }
.ckub-zoom__muted { color: var(--ckub-muted); margin: 12px 0 0; font-size: 14px; }

/* ── Help button ──────────────────────────────────────────── */
.ckub-help-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--lms-primary, #10B981); color: #fff;
  font-size: 17px; font-weight: 700;
  padding: 15px; border-radius: 12px; text-decoration: none;
  transition: background .2s ease;
}
.ckub-help-btn:hover { background: var(--lms-primary-hover, #059669); color:#fff; }

/* ── Replay grid ──────────────────────────────────────────── */
.ckub-replays {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.ckub-replay {
  background: #fff;
  border: 1px solid var(--ckub-border);
  border-radius: 14px;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.ckub-replay:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.09); }
.ckub-replay--active { border-color: var(--lms-primary, #10B981); box-shadow: 0 0 0 2px color-mix(in srgb, var(--lms-primary,#10B981) 30%, transparent); }
.ckub-replay__thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #1F2937, #374151);
  display: flex; align-items: center; justify-content: center;
}
.ckub-replay__thumb--empty { background: #F3F4F6; }
.ckub-replay__play {
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(255,255,255,.92);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: var(--lms-primary, #10B981);
  transition: transform .15s ease;
}
.ckub-replay:hover .ckub-replay__play { transform: scale(1.12); }
.ckub-replay__num {
  position: absolute; top: 10px; left: 10px;
  background: rgba(0,0,0,.55); color: #fff;
  font-size: 12px; font-weight: 600;
  padding: 2px 9px; border-radius: 999px;
}
.ckub-replay__body { padding: 12px 14px 14px; }
.ckub-replay__date { font-size: 12px; color: var(--ckub-muted); margin-bottom: 3px; }
.ckub-replay__title { font-size: 15px; font-weight: 600; line-height: 1.35; }
.ckub-replay__status {
  display: inline-block; font-size: 12px; padding: 3px 10px; border-radius: 999px;
  background: #F3F4F6; color: var(--ckub-muted); margin-top: 8px;
}

/* ── Schedule list (agenda) ───────────────────────────────── */
.ckub-agenda { list-style: none; margin: 0; padding: 0; }
.ckub-agenda__item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--ckub-border);
}
.ckub-agenda__item:last-child { border-bottom: 0; }
.ckub-agenda__num {
  flex: 0 0 32px; height: 32px; border-radius: 50%;
  background: color-mix(in srgb, var(--lms-primary,#10B981) 12%, #fff);
  color: var(--lms-primary, #10B981);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
}
.ckub-agenda__title { flex: 1; font-weight: 500; }
.ckub-agenda__date { color: var(--ckub-muted); font-size: 13px; white-space: nowrap; }

/* ── Player wrap ──────────────────────────────────────────── */
.ckub-player {
  position: relative; padding-bottom: 56.25%; height: 0;
  border-radius: var(--ckub-radius); overflow: hidden; background: #000;
  box-shadow: 0 10px 40px rgba(0,0,0,.18);
}
.ckub-player iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }

/* ── Enroll CTA card ──────────────────────────────────────── */
.ckub-enroll-cta {
  background: #fff;
  border: 1px solid var(--ckub-border);
  border-radius: var(--ckub-radius);
  padding: 24px;
  text-align: center;
}
.ckub-enroll-cta__price { font-size: 28px; font-weight: 700; color: var(--lms-text,#1F2937); margin-bottom: 4px; font-family: var(--lms-thai-font,'Kanit'),sans-serif; }
.ckub-enroll-cta .ckub-btn { width: 100%; box-sizing: border-box; font-size: 17px; padding: 14px; }

/* ── Prose ────────────────────────────────────────────────── */
.ckub-prose {
  font-size: 16px;
  line-height: 1.75;
  color: #374151;
  overflow-wrap: break-word;   /* wrap long unbroken strings (e.g. ddddd…) */
  word-break: break-word;
}
.ckub-prose > *:first-child { margin-top: 0; }
.ckub-prose > *:last-child { margin-bottom: 0; }
.ckub-prose img { max-width: 100%; height: auto; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 880px) {
  .ckub-cohort__grid { grid-template-columns: 1fr; }
  .ckub-cohort__aside { position: static; }
}

/* ── Global long-word guard for all CourseKub content ─────── */
.ckub-wrap { overflow-wrap: break-word; word-break: break-word; }
.ckub-wrap img { max-width: 100%; height: auto; }

/* ── Cohort: mini action buttons + calendar link (v1.6.0) ─── */
.ckub-mini-btn {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 600;
  padding: 5px 12px; border-radius: 8px;
  text-decoration: none;
  background: #F3F4F6; color: #374151;
  border: 1px solid var(--ckub-border, #E9EAEE);
  transition: background .15s ease, transform .15s ease;
  white-space: nowrap;
}
.ckub-mini-btn:hover { background: #E5E7EB; color:#111827; transform: translateY(-1px); }
.ckub-mini-btn--zoom { background: #2D8CFF; color:#fff; border-color:#2D8CFF; }
.ckub-mini-btn--zoom:hover { background:#1B7AF0; color:#fff; }

.ckub-agenda__item { flex-wrap: wrap; }
.ckub-agenda__actions { margin-left: auto; }

.ckub-zoom__cal {
  display:block; margin-top:10px;
  font-size:13px; font-weight:600; text-decoration:none;
  color:#4F46E5;
}
.ckub-zoom__cal:hover { text-decoration: underline; color:#4338CA; }

@media (max-width: 520px) {
  .ckub-agenda__actions { margin-left: 0; width: 100%; margin-top: 8px; }
}

/* ══════════════════════════════════════════════════════════════
   Session single page + study stats (v1.7.0)
   ══════════════════════════════════════════════════════════════ */
.ckub-back-link { display:inline-block; font-size:14px; color:var(--lms-primary,#10B981); text-decoration:none; margin-bottom:4px; }
.ckub-back-link:hover { text-decoration:underline; }

/* Document list */
.ckub-doc-list { list-style:none; margin:0; padding:0; }
.ckub-doc {
  display:flex; align-items:center; gap:12px;
  padding:12px 0; border-bottom:1px solid var(--ckub-border,#E9EAEE);
}
.ckub-doc:last-child { border-bottom:0; }
.ckub-doc__ext {
  flex:0 0 auto; font-size:11px; font-weight:700; letter-spacing:.5px;
  background:#EEF2FF; color:#4F46E5; padding:6px 8px; border-radius:6px; min-width:44px; text-align:center;
}
.ckub-doc__name { flex:1; font-weight:500; word-break:break-word; }
.ckub-doc__size { color:var(--ckub-muted,#6B7280); font-size:13px; }
.ckub-doc__dl {
  flex:0 0 auto; font-size:13px; font-weight:600; text-decoration:none;
  background:var(--lms-primary,#10B981); color:#fff; padding:7px 16px; border-radius:8px;
}
.ckub-doc__dl:hover { background:var(--lms-primary-hover,#059669); color:#fff; }

/* Prev / next nav */
.ckub-sess-nav { display:flex; justify-content:space-between; gap:12px; margin-top:20px; }
.ckub-sess-nav__btn {
  display:inline-block; max-width:48%;
  background:#fff; border:1px solid var(--ckub-border,#E9EAEE); border-radius:10px;
  padding:12px 16px; text-decoration:none; color:var(--lms-text,#1F2937); font-weight:500;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  transition:border-color .15s ease, transform .15s ease;
}
.ckub-sess-nav__btn:hover { border-color:var(--lms-primary,#10B981); transform:translateY(-1px); color:var(--lms-text,#1F2937); }
.ckub-sess-nav__btn--next { margin-left:auto; text-align:right; }

/* Session list (sidebar) */
.ckub-sess-list { list-style:none; margin:0; padding:0; }
.ckub-sess-list__item {
  display:flex; align-items:center; gap:10px;
  padding:9px 8px; border-radius:8px; text-decoration:none; color:var(--lms-text,#1F2937);
  transition:background .12s ease;
}
.ckub-sess-list__item:hover { background:#F3F4F6; color:var(--lms-text,#1F2937); }
.ckub-sess-list__item.is-active { background:color-mix(in srgb, var(--lms-primary,#10B981) 12%, #fff); font-weight:600; }
.ckub-sess-list__item.is-locked { color:#9CA3AF; cursor:default; }
.ckub-sess-list__num {
  flex:0 0 26px; height:26px; border-radius:50%;
  background:#EEF2FF; color:#4F46E5; font-size:13px; font-weight:700;
  display:flex; align-items:center; justify-content:center;
}
.ckub-sess-list__item.is-active .ckub-sess-list__num { background:var(--lms-primary,#10B981); color:#fff; }
.ckub-sess-list__title { flex:1; font-size:14px; line-height:1.3; }

/* Study stats bar (enrolled cohort main view) */
.ckub-stats {
  display:grid; grid-template-columns:repeat(3,1fr); gap:12px; margin-bottom:20px;
}
.ckub-stat {
  background:#fff; border:1px solid var(--ckub-border,#E9EAEE); border-radius:14px;
  padding:16px; text-align:center;
}
.ckub-stat__num { font-size:26px; font-weight:700; font-family:var(--lms-thai-font,'Kanit'),sans-serif; color:var(--lms-primary,#10B981); line-height:1.1; }
.ckub-stat__label { font-size:12px; color:var(--ckub-muted,#6B7280); margin-top:4px; }
@media (max-width:520px){ .ckub-stat__num{ font-size:20px; } }

/* ══════════════════════════════════════════════════════════════
   Replays as 1-per-row cards + speakers + richer agenda (v1.8.0)
   ══════════════════════════════════════════════════════════════ */

/* One card per row */
.ckub-replays--rows { grid-template-columns: 1fr; gap: 14px; }
.ckub-replay--row {
  display: grid;
  grid-template-columns: 260px 1fr;
  align-items: stretch;
  text-decoration: none;
  color: inherit;
}
.ckub-replay--row .ckub-replay__thumb { aspect-ratio: auto; height: 100%; min-height: 146px; }
.ckub-replay--row .ckub-replay__body {
  display: flex; flex-direction: column; justify-content: center;
  padding: 18px 20px;
}
.ckub-replay__speakers { font-size: 13px; color: var(--ckub-muted, #6B7280); margin-top: 4px; }
.ckub-replay__cta {
  display: inline-block; margin-top: 12px;
  font-size: 14px; font-weight: 600; color: var(--lms-primary, #10B981);
}
.ckub-replay--row:hover .ckub-replay__cta { text-decoration: underline; }

@media (max-width: 560px) {
  .ckub-replay--row { grid-template-columns: 1fr; }
  .ckub-replay--row .ckub-replay__thumb { min-height: 0; aspect-ratio: 16/9; }
}

/* Richer agenda (day / time-range / speakers) */
.ckub-agenda__body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ckub-agenda__when { font-size: 13px; color: var(--ckub-muted, #6B7280); }
.ckub-agenda__speakers { font-size: 13px; color: #4F46E5; font-weight: 500; }
.ckub-agenda__item { align-items: flex-start; }
.ckub-agenda__num { margin-top: 2px; }

/* All cohort text uses the configured Thai font (default Kanit) */
.ckub-cohort, .ckub-session-page,
.ckub-agenda__title, .ckub-replay__title,
.ckub-hero__title, .ckub-section-title,
.ckub-stat__label, .ckub-doc__name,
.ckub-agenda__when, .ckub-agenda__speakers,
.ckub-replay__speakers, .ckub-prose {
  font-family: var(--lms-thai-font, 'Kanit'), Arial, Helvetica, sans-serif;
}

/* ══════════════════════════════════════════════════════════════
   v1.9.0 — no underlines, modern Zoom steps, FAQ, survey CTA
   ══════════════════════════════════════════════════════════════ */

/* Kill theme's default link underlines inside our UI */
.ckub-cohort a,
.ckub-session-page a,
.ckub-wrap .ckub-replay,
.ckub-wrap .ckub-agenda a,
.ckub-wrap .ckub-sess-list__item,
.ckub-replay__title,
.ckub-replay a { text-decoration: none !important; }
.ckub-cohort a:hover, .ckub-session-page a:hover { text-decoration: none; }

/* Replay row titles shouldn't look like links */
.ckub-replay--row .ckub-replay__title { color: var(--lms-text, #1F2937); }

/* Zoom box — modern refresh */
.ckub-zoom {
  background: linear-gradient(160deg, #EEF2FF 0%, #EDE9FE 100%);
  border: 1px solid #C7D2FE;
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 8px 24px rgba(79,70,229,.10);
}
.ckub-zoom__eyebrow {
  display:inline-block; font-size:12px; letter-spacing:.5px; font-weight:700;
  color:#4F46E5; margin-bottom:14px;
}
.ckub-zoom__steps {
  list-style: none; counter-reset: zoomstep; margin: 16px 0 0; padding: 0;
}
.ckub-zoom__steps li {
  counter-increment: zoomstep;
  position: relative; padding: 0 0 0 34px; margin-bottom: 12px;
  font-size: 13.5px; line-height: 1.5; color: #374151;
}
.ckub-zoom__steps li:last-child { margin-bottom: 0; }
.ckub-zoom__steps li::before {
  content: counter(zoomstep);
  position: absolute; left: 0; top: 0;
  width: 24px; height: 24px; border-radius: 50%;
  background: #4F46E5; color: #fff;
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.ckub-zoom__steps b { color: #4338CA; }
.ckub-zoom__cal {
  display: block; margin-top: 16px; text-align: center;
  font-size: 13px; font-weight: 600; color: #4F46E5;
}

/* Help button spacing */
.ckub-help-btn { margin-top: 16px; }

/* FAQ box */
.ckub-faq-box {
  margin-top: 16px;
  background: #fff; border: 1px solid var(--ckub-border,#E9EAEE);
  border-radius: 14px; padding: 16px 18px;
}
.ckub-faq-box__title { font-size: 16px; margin: 0 0 10px; }
.ckub-faq-item { border-bottom: 1px solid var(--ckub-border,#E9EAEE); }
.ckub-faq-item:last-child { border-bottom: 0; }
.ckub-faq-item__q {
  cursor: pointer; padding: 12px 0; font-weight: 600; font-size: 14.5px;
  list-style: none; position: relative; padding-right: 24px;
  color: var(--lms-text,#1F2937);
}
.ckub-faq-item__q::-webkit-details-marker { display: none; }
.ckub-faq-item__q::after {
  content: "+"; position: absolute; right: 4px; top: 10px;
  font-size: 18px; color: var(--lms-primary,#10B981); transition: transform .2s;
}
.ckub-faq-item[open] .ckub-faq-item__q::after { content: "−"; }
.ckub-faq-item__a { padding: 0 0 12px; font-size: 14px; color: #4B5563; line-height: 1.6; }

/* Survey CTA */
.ckub-survey-btn {
  display: flex; align-items: center; gap: 12px;
  margin-top: 16px; padding: 16px 18px;
  background: linear-gradient(135deg, #FEF3C7, #FDE68A);
  border: 1px solid #FBBF24; border-radius: 14px;
  color: #92400E; font-weight: 700; font-size: 14.5px; line-height: 1.4;
  transition: transform .15s ease, box-shadow .15s ease;
}
.ckub-survey-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(251,191,36,.35); color:#92400E; }
.ckub-survey-btn__icon { font-size: 24px; flex: 0 0 auto; }

/* ══════════════════════════════════════════════════════════════
   v1.10.0 — sidebar action boxes (Zoom / contact / ask instructor)
   Matches the 3-box stacked design.
   ══════════════════════════════════════════════════════════════ */

/* ── Box 1: Zoom (blue) ───────────────────────────────────── */
.ckub-zoom {
  background: #DCE7FF;
  border: 2px solid #6C9BFF;
  border-radius: 20px;
  padding: 18px;
  box-shadow: none;
  margin-bottom: 16px;
}
.ckub-zoom__btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; box-sizing: border-box;
  background: #2D7BFF; color: #fff;
  font-size: 19px; font-weight: 700;
  padding: 16px; border-radius: 14px; text-decoration: none;
  box-shadow: 0 4px 12px rgba(45,123,255,.3);
  transition: transform .15s ease, box-shadow .15s ease;
}
.ckub-zoom__btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(45,123,255,.4); color:#fff; }
.ckub-zoom__or {
  display: flex; align-items: center; justify-content: center; text-align: center;
  color: #4B5563; font-size: 15px; margin: 14px 0 10px;
}
.ckub-zoom__or span { flex: 0 0 auto; padding: 0 12px; }
.ckub-zoom__or::before, .ckub-zoom__or::after {
  content: ""; flex: 1 1 0; height: 2px; background: #1F2937; max-width: 70px;
}
.ckub-zoom__creds {
  text-align: center; font-size: 16px; color: #1F2937; line-height: 1.6;
}
.ckub-zoom__creds span { margin: 0 6px; }
.ckub-zoom__creds strong { font-weight: 700; }
.ckub-zoom__note {
  text-align: center; color: #2D7BFF; font-weight: 700; font-size: 17px;
  margin: 10px 0 0;
}

/* ── Box 2: Contact team (green) ──────────────────────────── */
.ckub-contact-box {
  background: #EAF7EA;
  border: 2px solid #37A937;
  border-radius: 20px;
  padding: 18px;
  margin-bottom: 16px;
}
.ckub-contact-box__btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; box-sizing: border-box;
  background: #1F9D1F; color: #fff;
  font-size: 19px; font-weight: 700;
  padding: 16px; border-radius: 14px; text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
}
.ckub-contact-box__btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(31,157,31,.35); color:#fff; }
.ckub-contact-box__sub {
  text-align: center; color: #1F9D1F; font-weight: 700; font-size: 16px;
  margin: 10px 0 0;
}

/* ── Box 3: Ask instructor (purple) ───────────────────────── */
.ckub-ask-box {
  background: #F3E8FF;
  border: 2px solid #C77DFF;
  border-radius: 20px;
  padding: 18px;
  margin-bottom: 16px;
}
.ckub-ask-box__btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; box-sizing: border-box;
  background: #7C3AED; color: #fff;
  font-size: 19px; font-weight: 700;
  padding: 16px; border-radius: 14px; text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
}
.ckub-ask-box__btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(124,58,237,.35); color:#fff; }
.ckub-ask-box__sub {
  text-align: center; color: #7C3AED; font-weight: 700; font-size: 16px;
  margin: 10px 0 0;
}

/* Plain (non-gradient) step list under the boxes */
.ckub-zoom__steps--plain {
  list-style: disc; padding-left: 22px; margin: 4px 0 16px;
}
.ckub-zoom__steps--plain li {
  counter-increment: none; position: static; padding: 0; margin-bottom: 10px;
  font-size: 15px; line-height: 1.55; color: #374151;
}
.ckub-zoom__steps--plain li::before { content: none; }

/* ── Expiry countdown box (course ended) — v1.11.0 ────────── */
.ckub-expiry {
  background: #FDF6D8;
  border: 3px dashed #EAB308;
  border-radius: 20px;
  padding: 24px 20px;
  text-align: center;
  margin-bottom: 16px;
  color: #4B4636;
}
.ckub-expiry__icon { font-size: 34px; line-height: 1; margin-bottom: 10px; }
.ckub-expiry__title {
  font-weight: 700; font-size: 18px; color: #3F3A2C; line-height: 1.4;
  font-family: var(--lms-thai-font, 'Kanit'), sans-serif;
}
.ckub-expiry__sub { font-size: 15px; margin-top: 4px; color: #5C5540; }
.ckub-expiry__count {
  font-family: var(--lms-thai-font, 'Kanit'), sans-serif;
  font-weight: 800; font-size: 52px; line-height: 1.1; color: #1F2937;
  margin: 6px 0 2px;
}
.ckub-expiry__count span { font-size: 34px; font-weight: 700; }
.ckub-expiry__date { font-size: 15px; color: #5C5540; margin-top: 2px; }

/* ── Hero featured image — v1.12.0 ────────────────────────── */
.ckub-hero { padding: 0; overflow: hidden; }
.ckub-hero:not(.ckub-hero--has-image) { padding: 28px 32px; }
.ckub-hero--has-image .ckub-hero__content { padding: 24px 32px 28px; }
.ckub-hero__image {
  width: 100%;
  aspect-ratio: 16 / 6;
  overflow: hidden;
  background: #F3F4F6;
}
.ckub-hero__image img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.ckub-hero--has-image::before { display: none; } /* image replaces the top gradient bar */
@media (max-width: 600px) {
  .ckub-hero__image { aspect-ratio: 16 / 9; }
  .ckub-hero--has-image .ckub-hero__content { padding: 20px; }
  .ckub-hero:not(.ckub-hero--has-image) { padding: 20px; }
}

/* ── Agenda session status (v1.13.0) ──────────────────────── */
.ckub-agenda__badge {
  display: inline-block; align-self: flex-start;
  font-size: 12px; font-weight: 600;
  padding: 2px 10px; border-radius: 999px; margin-top: 4px;
}
.ckub-agenda__badge--past  { background: #E5E7EB; color: #6B7280; }
.ckub-agenda__badge--today { background: #DCFCE7; color: #166534; }
.ckub-agenda__badge--soon  { background: #EEF2FF; color: #4F46E5; }

/* Past sessions greyed out */
.ckub-agenda__item--past { opacity: .65; }
.ckub-agenda__item--past .ckub-agenda__title,
.ckub-agenda__item--past .ckub-agenda__when,
.ckub-agenda__item--past .ckub-agenda__speakers { color: #9CA3AF; }
.ckub-agenda__item--past .ckub-agenda__num { background: #E5E7EB; color: #9CA3AF; }

/* Today highlighted */
.ckub-agenda__item--today .ckub-agenda__num {
  background: #16A34A; color: #fff;
}

/* ── Subheadline (v1.14.0) ────────────────────────────────── */
.ckub-hero__subtitle {
  font-size: 16px; color: var(--ckub-muted, #6B7280);
  margin: 0 0 10px; line-height: 1.5;
  font-family: var(--lms-thai-font, 'Kanit'), sans-serif;
}

/* ── VIRTUAL rules box ────────────────────────────────────── */
.ckub-rules {
  background: #fff; border: 1px solid var(--ckub-border,#E9EAEE);
  border-radius: 14px; padding: 14px 16px; margin-top: 16px;
}
.ckub-rules__title {
  font-size: 15px; margin: 0 0 8px; font-weight: 700;
  font-family: var(--lms-thai-font, 'Kanit'), sans-serif;
}
.ckub-rules .ckub-zoom__steps--plain { margin-bottom: 0; }

/* ── Consent modal ────────────────────────────────────────── */
.ckub-consent-overlay {
  position: fixed; inset: 0; z-index: 99999;
  background: rgba(17,24,39,.65);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; backdrop-filter: blur(3px);
}
.ckub-consent-modal {
  background: #fff; border-radius: 18px;
  max-width: 560px; width: 100%; max-height: 85vh;
  display: flex; flex-direction: column;
  padding: 26px; box-shadow: 0 24px 60px rgba(0,0,0,.3);
  font-family: var(--lms-thai-font, 'Kanit'), sans-serif;
}
.ckub-consent-modal__title { font-size: 20px; margin: 0 0 14px; }
.ckub-consent-modal__body {
  overflow-y: auto; flex: 1;
  font-size: 14.5px; line-height: 1.7; color: #374151;
  border: 1px solid var(--ckub-border,#E9EAEE); border-radius: 10px;
  padding: 14px 16px; margin-bottom: 16px; background: #F9FAFB;
}
.ckub-consent-modal__check {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 14.5px; color: #1F2937; margin-bottom: 16px; cursor: pointer;
}
.ckub-consent-modal__check input { margin-top: 3px; flex: 0 0 auto; width: 18px; height: 18px; }
.ckub-consent-modal .ckub-btn { width: 100%; box-sizing: border-box; font-size: 16px; padding: 13px; font-family: var(--lms-thai-font, 'Kanit'), sans-serif; font-weight: 600; }
.ckub-consent-modal .ckub-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Speaker chips (v1.16.0) ──────────────────────────────── */
.ckub-speakers {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px;
}
.ckub-speaker-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12.5px; font-weight: 500; line-height: 1;
  padding: 5px 10px; border-radius: 999px;
  background: #EEF2FF; color: #4338CA;
  border: 1px solid #C7D2FE;
  white-space: nowrap;
  font-family: var(--lms-thai-font, 'Kanit'), sans-serif;
}
.ckub-agenda__item--past .ckub-speaker-chip {
  background: #F3F4F6; color: #9CA3AF; border-color: #E5E7EB;
}

/* ── Announcement box (v1.16.0) ───────────────────────────── */
.ckub-announce {
  background: #FFF7ED;
  border: 1px solid #FDBA74;
  border-left: 4px solid #F97316;
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 16px;
}
.ckub-announce__head {
  font-weight: 700; font-size: 15px; color: #C2410C; margin-bottom: 8px;
  font-family: var(--lms-thai-font, 'Kanit'), sans-serif;
}
.ckub-announce__body { font-size: 14px; color: #7C2D12; line-height: 1.6; }
.ckub-announce__body :first-child { margin-top: 0; }
.ckub-announce__body :last-child { margin-bottom: 0; }

/* ══════════════════════════════════════════════════════════════
   Course Management dashboard (v1.16.0)
   ══════════════════════════════════════════════════════════════ */
.ckub-dashboard .ckub-course-card__title {
  font-family: var(--lms-thai-font, 'Kanit'), sans-serif;
}

/* Filter tabs */
.ckub-dash-tabs {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px;
}
.ckub-dash-tab {
  border: 1px solid var(--ckub-border, #E9EAEE);
  background: #fff; color: #374151;
  font-family: var(--lms-thai-font, 'Kanit'), sans-serif;
  font-size: 14px; font-weight: 500;
  padding: 8px 16px; border-radius: 999px; cursor: pointer;
  transition: all .15s ease; display: inline-flex; align-items: center; gap: 6px;
}
.ckub-dash-tab span {
  font-size: 12px; background: #F3F4F6; color: #6B7280;
  padding: 1px 8px; border-radius: 999px;
}
.ckub-dash-tab:hover { border-color: var(--lms-primary, #10B981); }
.ckub-dash-tab.is-active {
  background: var(--lms-primary, #10B981); color: #fff; border-color: var(--lms-primary, #10B981);
}
.ckub-dash-tab.is-active span { background: rgba(255,255,255,.25); color: #fff; }

/* Card thumb + type badge */
.ckub-course-card__thumbwrap { position: relative; }
.ckub-course-card__thumb--empty {
  width: 100%; height: 160px; display: flex; align-items: center; justify-content: center;
  font-size: 44px; background: linear-gradient(135deg,#EEF2FF,#F5F3FF);
}
.ckub-ctype {
  position: absolute; top: 10px; left: 10px;
  font-size: 11px; font-weight: 700; letter-spacing: .3px;
  padding: 4px 10px; border-radius: 999px; color: #fff;
  font-family: var(--lms-thai-font, 'Kanit'), sans-serif;
  backdrop-filter: blur(2px);
}
.ckub-ctype--virtual  { background: rgba(220,38,38,.92); }
.ckub-ctype--ondemand { background: rgba(37,99,235,.92); }
.ckub-ctype--chapter  { background: rgba(16,163,74,.92); }

.ckub-course-card__meta { font-size: 13px; color: #6B7280; margin: 0 0 4px; }

/* Back link spacing on cohort pages */
.ckub-cohort > .ckub-back-link { margin-bottom: 14px; }

/* ══════════════════════════════════════════════════════════════
   Auth pages — login + change password (v1.17.0)
   ══════════════════════════════════════════════════════════════ */
.ckub-auth {
  min-height: 60vh; display: flex; align-items: center; justify-content: center;
  padding: 40px 16px;
}
.ckub-auth__card {
  width: 100%; max-width: 420px;
  background: #fff; border-radius: 20px;
  box-shadow: 0 20px 50px rgba(17,24,39,.10);
  border: 1px solid var(--ckub-border, #E9EAEE);
  padding: 36px 32px;
  font-family: var(--lms-thai-font, 'Kanit'), sans-serif;
}
.ckub-auth__logo { display: block; max-height: 56px; margin: 0 auto 20px; }
.ckub-auth__title {
  font-size: 26px; text-align: center; margin: 0 0 6px;
  font-family: var(--lms-thai-font, 'Kanit'), sans-serif;
}
.ckub-auth__sub { text-align: center; color: var(--ckub-muted, #6B7280); font-size: 14px; margin: 0 0 24px; }
.ckub-auth__form { display: flex; flex-direction: column; }
.ckub-auth__label { font-size: 13px; font-weight: 600; color: #374151; margin: 0 0 6px; }
.ckub-auth__input {
  width: 100%; box-sizing: border-box;
  border: 1.5px solid #D1D5DB; border-radius: 10px;
  padding: 12px 14px; font-size: 15px; margin-bottom: 16px;
  transition: border-color .15s ease, box-shadow .15s ease;
  font-family: inherit;
}
.ckub-auth__input:focus {
  outline: none; border-color: var(--lms-primary, #10B981);
  box-shadow: 0 0 0 3px rgba(16,185,129,.15);
}
.ckub-auth__pwwrap { position: relative; }
.ckub-auth__toggle {
  position: absolute; right: 8px; top: 10px;
  background: none; border: 0; cursor: pointer; font-size: 18px; padding: 4px;
}
.ckub-auth__remember {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; color: #4B5563; margin-bottom: 20px; cursor: pointer;
}
.ckub-auth__submit { width: 100%; font-size: 16px; padding: 13px; font-family: inherit; }
.ckub-auth__link {
  display: block; text-align: center; margin-top: 18px;
  font-size: 14px; color: var(--lms-primary, #10B981); text-decoration: none;
}
.ckub-auth__link:hover { text-decoration: underline; }
.ckub-auth__error {
  background: #FEF2F2; border: 1px solid #FCA5A5; color: #B91C1C;
  border-radius: 10px; padding: 10px 14px; font-size: 14px; margin-bottom: 18px; text-align: center;
}
.ckub-auth__success {
  background: #F0FDF4; border: 1px solid #86EFAC; color: #166534;
  border-radius: 10px; padding: 10px 14px; font-size: 14px; margin-bottom: 18px; text-align: center;
}

.ckub-dash-pwlink {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; color: #4B5563; text-decoration: none;
  border: 1px solid var(--ckub-border,#E9EAEE); background: #fff;
  padding: 8px 14px; border-radius: 999px;
  font-family: var(--lms-thai-font, 'Kanit'), sans-serif;
}
.ckub-dash-pwlink:hover { border-color: var(--lms-primary,#10B981); color: var(--lms-primary,#10B981); }

/* ══════════════════════════════════════════════════════════════
   My Courses — modern redesign (v1.18.0)
   Restrained, calm, readable. Generous whitespace, one accent,
   soft neutrals, no gradients-as-decoration.
   ══════════════════════════════════════════════════════════════ */
.ckub-dash2 {
  max-width: 920px; margin: 0 auto; padding: 40px 16px 64px;
  font-family: var(--lms-thai-font, 'Kanit'), sans-serif;
  color: #1F2937;
}

/* Header */
.ckub-dash2__header {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 20px; margin-bottom: 36px;
}
.ckub-dash2__welcome { display: flex; align-items: center; gap: 16px; }
.ckub-dash2__logo { max-height: 52px; width: auto; }
.ckub-dash2__hi { margin: 0; font-size: 14px; color: #9CA3AF; }
.ckub-dash2__name { margin: 2px 0 0; font-size: 26px; font-weight: 600; letter-spacing: -.01em; }

/* Account nav */
.ckub-dash2__nav { display: flex; gap: 4px; flex-wrap: wrap; }
.ckub-dash2__navlink {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 14px; color: #4B5563; text-decoration: none;
  padding: 9px 14px; border-radius: 10px; cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.ckub-dash2__navlink:hover { background: #F3F4F6; color: #111827; }
.ckub-dash2__navlink.is-active { background: #F0FDF9; color: var(--lms-primary, #10B981); font-weight: 600; }
.ckub-dash2__navlink--danger:hover { background: #FEF2F2; color: #DC2626; }
.ckub-dash2__navicon { font-size: 15px; opacity: .85; }

/* Tabs */
.ckub-dash2__tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.ckub-dash2__tab {
  border: 0; background: transparent; color: #6B7280;
  font-family: inherit; font-size: 14px; font-weight: 500;
  padding: 7px 14px; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
  transition: background .15s ease, color .15s ease;
}
.ckub-dash2__tab span {
  font-size: 12px; background: #F3F4F6; color: #9CA3AF;
  padding: 1px 8px; border-radius: 999px; transition: inherit;
}
.ckub-dash2__tab:hover { background: #F9FAFB; color: #374151; }
.ckub-dash2__tab.is-active { background: #111827; color: #fff; }
.ckub-dash2__tab.is-active span { background: rgba(255,255,255,.2); color: #fff; }

/* Horizontal cards */
.ckub-hcards { display: flex; flex-direction: column; gap: 16px; }
.ckub-hcard {
  display: grid; grid-template-columns: 240px 1fr;
  background: #fff; border: 1px solid #EEF0F3; border-radius: 16px;
  overflow: hidden; transition: border-color .15s ease, box-shadow .15s ease;
}
.ckub-hcard:hover { border-color: #E0E3E8; box-shadow: 0 6px 22px rgba(17,24,39,.06); }

.ckub-hcard__media { position: relative; background: #F3F4F6; }
.ckub-hcard__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ckub-hcard__media--empty {
  width: 100%; height: 100%; min-height: 150px;
  display: flex; align-items: center; justify-content: center; font-size: 40px;
}
.ckub-ctype {
  position: absolute; top: 12px; left: 12px;
  font-size: 11px; font-weight: 600; letter-spacing: .02em;
  padding: 4px 11px; border-radius: 999px; color: #fff;
}
.ckub-ctype--virtual  { background: #2D7BFF; }   /* blue, per request */
.ckub-ctype--ondemand { background: #7C3AED; }
.ckub-ctype--chapter  { background: #10B981; }

.ckub-hcard__body {
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 20px 22px; gap: 16px; min-width: 0;
}
.ckub-hcard__title {
  font-size: 18px; font-weight: 600; margin: 0 0 8px; line-height: 1.4;
  letter-spacing: -.01em;
}
.ckub-hcard__meta { display: flex; flex-wrap: wrap; gap: 14px; }
.ckub-hcard__metaitem { font-size: 13px; color: #6B7280; }

.ckub-hcard__bottom { display: flex; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.ckub-hcard__progress { flex: 1; min-width: 160px; }
.ckub-hcard__progresshead {
  display: flex; justify-content: space-between; font-size: 12.5px;
  color: #9CA3AF; margin-bottom: 6px;
}
.ckub-hcard__pct { font-weight: 600; color: #374151; }
.ckub-hcard .ckub-progress { height: 7px; background: #F1F3F5; border-radius: 999px; }
.ckub-hcard .ckub-progress__bar { background: var(--lms-primary, #10B981); border-radius: 999px; }

.ckub-hcard__actions { display: flex; align-items: center; gap: 14px; }
.ckub-hcard__cta { padding: 10px 22px; font-size: 14px; white-space: nowrap; }
.ckub-hcard__cert { font-size: 13px; color: var(--lms-primary, #10B981); text-decoration: none; font-weight: 500; white-space: nowrap; }
.ckub-hcard__cert:hover { text-decoration: underline; }

/* Empty state */
.ckub-dash2__empty {
  text-align: center; padding: 64px 24px; background: #fff;
  border: 1px solid #EEF0F3; border-radius: 16px;
}
.ckub-dash2__empty-icon { font-size: 44px; margin-bottom: 12px; }
.ckub-dash2__empty p { color: #6B7280; font-size: 16px; margin: 0 0 18px; }

/* Responsive: stack the card */
@media (max-width: 640px) {
  .ckub-hcard { grid-template-columns: 1fr; }
  .ckub-hcard__media { aspect-ratio: 16 / 8; }
  .ckub-hcard__media--empty { min-height: 0; aspect-ratio: 16 / 8; }
  .ckub-dash2__header { flex-direction: column; align-items: flex-start; }
  .ckub-dash2__bottom { flex-direction: column; align-items: stretch; }
}

/* Self-paced classroom sidebar progress (v1.21.0) */
.ckub-sidebar__progress {
  padding: 14px 16px; border-bottom: 1px solid var(--ckub-border, #E9EAEE);
  font-family: var(--lms-thai-font, 'Kanit'), sans-serif;
}
.ckub-sidebar__progress-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: #6B7280; margin-bottom: 6px;
}
.ckub-sidebar__progress-pct { font-weight: 700; color: var(--lms-primary, #10B981); font-size: 15px; }
.ckub-sidebar__progress .ckub-progress { height: 8px; background: #EEF0F3; border-radius: 999px; overflow: hidden; }
.ckub-sidebar__progress .ckub-progress__bar { height: 100%; background: var(--lms-primary, #10B981); border-radius: 999px; transition: width .4s ease; }
.ckub-sidebar__progress-meta { font-size: 12px; color: #9CA3AF; margin-top: 6px; }
