/* ==========================================================
   Trial Sessions — public page
   Uses the header tokens (--primary, --text-primary, ...)
   ========================================================== */

.ts-page {
  --ts-navy: #0a0f38;
  --ts-surface: #ffffff;
  --ts-surface-2: #f4f8fc;
  --ts-ring: rgba(58, 146, 189, 0.35);
  --ts-radius: 18px;
  --ts-shadow: 0 4px 18px rgba(12, 83, 116, 0.08);
  --ts-shadow-hover: 0 18px 40px rgba(12, 83, 116, 0.16);
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--text-primary, #1a1a2e);
  background: var(--bg-subtle, #f8fafc);
  overflow-x: hidden;
}

.dark-theme .ts-page {
  --ts-surface: #111a2e;
  --ts-surface-2: #0d1526;
  --ts-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
  --ts-shadow-hover: 0 18px 40px rgba(0, 0, 0, 0.5);
  background: var(--bg-light, #0f172a);
}

.ts-container {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  /* Side space shrinks/grows with the screen instead of a narrow fixed column */
  padding: 0 clamp(16px, 2.5vw, 40px);
}
/* Hero text stays at a comfortable reading width */
.ts-hero-inner { max-width: 1000px; }

/* ---------- Subject colour presets ---------- */
.ts-color-blue   { --c1: #3a92bd; --c2: #0c5374; --ct: #0c5374; --cs: rgba(58, 146, 189, 0.12); }
.ts-color-purple { --c1: #7c6cf2; --c2: #5b3fb8; --ct: #5b3fb8; --cs: rgba(124, 108, 242, 0.12); }
.ts-color-green  { --c1: #22b07d; --c2: #0d7a6e; --ct: #0d7a6e; --cs: rgba(34, 176, 125, 0.12); }
.ts-color-pink   { --c1: #ec6aa0; --c2: #c2306b; --ct: #c2306b; --cs: rgba(236, 106, 160, 0.12); }
.ts-color-cyan   { --c1: #1fb6e8; --c2: #0077aa; --ct: #0077aa; --cs: rgba(31, 182, 232, 0.12); }
.ts-color-orange { --c1: #f6a23a; --c2: #d26a0c; --ct: #b85a06; --cs: rgba(246, 162, 58, 0.14); }
.ts-color-red    { --c1: #f0645a; --c2: #c0392b; --ct: #c0392b; --cs: rgba(240, 100, 90, 0.12); }
.ts-color-teal   { --c1: #2bb3a8; --c2: #127a72; --ct: #127a72; --cs: rgba(43, 179, 168, 0.12); }
.ts-color-indigo { --c1: #4f62d8; --c2: #2a2f8f; --ct: #2a3a9f; --cs: rgba(79, 98, 216, 0.12); }
.ts-color-gray   { --c1: #6b7a90; --c2: #334155; --ct: #334155; --cs: rgba(107, 122, 144, 0.14); }

.dark-theme .ts-subject { --ct: var(--c1); }

/* ==========================================================
   HERO
   ========================================================== */
.ts-hero {
  position: relative;
  overflow: hidden;
  padding: 72px 0 96px;
  background: radial-gradient(1200px 500px at 80% -10%, rgba(58, 146, 189, 0.45), transparent 60%),
              linear-gradient(135deg, #0a0f38 0%, #0c3a5c 55%, #0c5374 100%);
  color: #fff;
  text-align: center;
}

.ts-hero-bg { position: absolute; inset: 0; pointer-events: none; }
.ts-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
}
.ts-orb-1 { width: 340px; height: 340px; background: #3a92bd; top: -120px; left: -80px; }
.ts-orb-2 { width: 280px; height: 280px; background: #5b3fb8; bottom: -140px; right: -60px; opacity: 0.35; }
.ts-grid-lines {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}

.ts-hero-inner { position: relative; z-index: 1; }

.ts-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.85rem; font-weight: 600; letter-spacing: 0.02em;
  backdrop-filter: blur(6px);
}
.ts-badge i { color: #7fd0f5; }

.ts-hero-title {
  margin: 20px 0 12px;
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: #fff;
}
.ts-hero-title span {
  background: linear-gradient(90deg, #7fd0f5, #3a92bd);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}

.ts-hero-ar {
  font-family: 'Cairo', sans-serif;
  font-size: clamp(1.05rem, 2.4vw, 1.3rem);
  font-weight: 700;
  color: #ffe58a;
  margin: 0 0 10px;
}
.ts-hero-sub {
  max-width: 620px; margin: 0 auto;
  color: rgba(255, 255, 255, 0.78);
  font-size: 1.02rem; line-height: 1.7;
}

.ts-stats {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 34px;
}
.ts-stat {
  min-width: 120px;
  padding: 14px 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: flex; flex-direction: column; gap: 2px;
}
.ts-stat-value { font-size: 1.7rem; font-weight: 800; }
.ts-stat-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255,255,255,0.7); }

/* ==========================================================
   TOOLBAR
   ========================================================== */
.ts-toolbar {
  position: sticky;
  top: var(--header-height, 72px);
  z-index: 50;
  margin-top: -36px;
}
.ts-toolbar-inner {
  display: flex; flex-direction: column; gap: 12px;
  padding: 12px;
  border-radius: 20px;
  background: var(--ts-surface);
  border: 1px solid var(--border-color, #e2e8f0);
  box-shadow: 0 12px 32px -12px rgba(12, 83, 116, 0.22), var(--ts-shadow);
}

/* ---------- Search + curriculum ---------- */
.ts-filters {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
}
.ts-search {
  flex: 1 1 260px;
  display: flex; align-items: center; gap: 10px;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 14px;
  background: var(--bg-subtle, #f4f7fb);
  border: 1px solid var(--border-color, #e2e8f0);
  color: var(--text-secondary, #64748b);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.ts-search:focus-within { background: var(--ts-surface); border-color: var(--primary, #3a92bd); box-shadow: 0 0 0 4px var(--ts-ring); }
.ts-search input {
  flex: 1; min-width: 0;
  border: 0; outline: 0; background: transparent;
  font: 500 0.95rem 'Inter', sans-serif;
  color: var(--text-primary, #1a1a2e);
}
.ts-segment {
  display: inline-flex; gap: 2px;
  padding: 4px;
  border-radius: 14px;
  background: var(--bg-subtle, #f4f7fb);
  border: 1px solid var(--border-color, #e2e8f0);
}
.ts-seg-btn {
  min-height: 36px;
  padding: 6px 14px;
  border: 0; border-radius: 10px;
  background: transparent;
  color: var(--text-secondary, #64748b);
  font: 600 0.85rem 'Inter', sans-serif;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
}
.ts-seg-btn:hover { color: var(--primary, #3a92bd); }
.ts-seg-btn.is-active { background: var(--ts-surface); color: var(--primary, #3a92bd); box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12); }

/* ---------- Subject tabs ---------- */
.ts-chips-wrap {
  position: relative;
  padding-top: 12px;
  border-top: 1px solid var(--border-color, #e2e8f0);
}
.ts-chips {
  display: flex; gap: 8px;
  overflow-x: auto;
  padding: 2px;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
  overscroll-behavior-x: contain;
}
.ts-chips::-webkit-scrollbar { display: none; }

/* Fade edges + arrows only when the row overflows */
.ts-chips-wrap::before,
.ts-chips-wrap::after {
  content: ''; position: absolute; top: 12px; bottom: 0; width: 72px; z-index: 1;
  pointer-events: none; opacity: 0; transition: opacity 0.2s;
}
.ts-chips-wrap::before { left: 0; background: linear-gradient(90deg, var(--ts-surface) 35%, transparent); }
.ts-chips-wrap::after { right: 0; background: linear-gradient(270deg, var(--ts-surface) 35%, transparent); }
.ts-chips-wrap.can-left::before,
.ts-chips-wrap.can-right::after { opacity: 1; }

.ts-scroll-btn {
  position: absolute; top: calc(50% + 6px); z-index: 2;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  transform: translateY(-50%) scale(0.9);
  border-radius: 50%;
  border: 1px solid var(--border-color, #e2e8f0);
  background: var(--ts-surface);
  color: var(--text-primary, #1a1a2e);
  font-size: 0.8rem;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.14);
  cursor: pointer;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s, transform 0.2s, color 0.2s;
}
.ts-scroll-btn:hover { color: var(--primary, #3a92bd); }
.ts-scroll-prev { left: 2px; }
.ts-scroll-next { right: 2px; }
.ts-chips-wrap.can-left .ts-scroll-prev,
.ts-chips-wrap.can-right .ts-scroll-next { opacity: 1; pointer-events: auto; transform: translateY(-50%) scale(1); }

.ts-chip {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 9px;
  min-height: 44px;
  padding: 6px 12px 6px 6px;
  border-radius: 999px;
  border: 1px solid var(--border-color, #e2e8f0);
  background: var(--ts-surface);
  color: var(--text-primary, #1a1a2e);
  font: 600 0.9rem/1 'Inter', sans-serif;
  white-space: nowrap;
  cursor: pointer;
  scroll-snap-align: start;
  transition: border-color 0.2s, background 0.2s, color 0.2s, box-shadow 0.2s;
}
.ts-chip:hover { border-color: var(--primary, #3a92bd); background: var(--bg-subtle, #f4f7fb); }
.ts-chip:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--ts-ring); }
.ts-chip.is-active {
  background: linear-gradient(135deg, var(--primary, #3a92bd), var(--primary-dark, #0c5374));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 16px -4px rgba(12, 83, 116, 0.45);
}
.ts-chip-icon {
  width: 30px; height: 30px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c1, #3a92bd), var(--c2, #0c5374));
  color: #fff; font-size: 0.8rem;
}
.ts-chip-icon .ts-ico-txt { font-size: 0.6rem; }
.ts-chip.is-active .ts-chip-icon { background: rgba(255, 255, 255, 0.2); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3); }
.ts-chip-count {
  min-width: 24px;
  padding: 4px 7px; border-radius: 999px;
  background: var(--bg-subtle, #f1f5f9);
  color: var(--text-secondary, #64748b);
  font-size: 0.72rem; font-weight: 700; text-align: center;
}
.ts-chip.is-active .ts-chip-count { background: rgba(255, 255, 255, 0.2); color: #fff; }

.dark-theme .ts-search,
.dark-theme .ts-segment { background: rgba(255, 255, 255, 0.04); }

/* ==========================================================
   SUBJECTS
   ========================================================== */
.ts-subjects { padding-top: 36px; padding-bottom: 24px; }

.ts-subject {
  margin-bottom: 32px;
  padding: clamp(16px, 1.8vw, 28px);
  border-radius: 24px;
  background: var(--ts-surface);
  border: 1px solid var(--border-color, #e2e8f0);
  box-shadow: var(--ts-shadow);
  scroll-margin-top: calc(var(--header-height, 72px) + 150px);
}
.ts-subject[hidden] { display: none; }

.ts-subject-head {
  display: flex; align-items: center; gap: 14px;
  padding-bottom: 18px; margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
}
.ts-subject-icon {
  position: relative;
  width: 56px; height: 56px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 16px;
  font-size: 1.45rem;
  color: #fff;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  box-shadow: 0 10px 22px -6px var(--c2), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.ts-subject-icon::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.28), transparent 60%);
  pointer-events: none;
}
/* Language-code tiles (EN, FR, DE…) instead of flag emoji */
.ts-ico-txt { font: 800 0.95rem/1 'Inter', system-ui, sans-serif; letter-spacing: 0.04em; }
.ts-subject-titles { min-width: 0; }
.ts-subject-name {
  margin: 0;
  font-size: 1.45rem; font-weight: 800; letter-spacing: -0.01em;
  color: var(--ct);
}
.ts-subject-meta { font-size: 0.88rem; color: var(--text-secondary, #64748b); }
.ts-subject-name { line-height: 1.2; }

.ts-soon-badge {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  background: #fff6d6; color: #8a6200;
  font-size: 0.8rem; font-weight: 700;
  border: 1px solid #f5d76e;
}
.dark-theme .ts-soon-badge { background: rgba(245, 196, 0, 0.12); color: #f5d76e; border-color: rgba(245, 196, 0, 0.3); }

.ts-subject-soon {
  display: flex; align-items: center; gap: 12px;
  padding: 18px; border-radius: 14px;
  background: var(--cs);
  color: var(--text-secondary, #64748b);
}
.ts-subject-soon i { color: var(--ct); font-size: 1.2rem; }

.ts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 22px;
}

/* ---------- Card ---------- */
.ts-card {
  display: flex; flex-direction: column;
  border-radius: var(--ts-radius);
  overflow: hidden;
  background: var(--ts-surface);
  border: 1px solid var(--border-color, #e2e8f0);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.ts-card:hover { transform: translateY(-4px); box-shadow: var(--ts-shadow-hover); border-color: var(--cs); }
.ts-card[hidden] { display: none; }

.ts-thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0; border: 0;
  background: #0a0f38;
  cursor: pointer;
  overflow: hidden;
}
.ts-thumb img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  transition: transform 0.5s ease;
}
.ts-card:hover .ts-thumb img { transform: scale(1.06); }
/* Light subject-colour tint over the video still, plus top/bottom shading for legibility */
.ts-thumb[data-video]::before {
  content: ''; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  mix-blend-mode: soft-light;
  opacity: 0.55;
  pointer-events: none;
}
.ts-thumb-shade {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(10, 15, 56, 0.35) 0%, rgba(10, 15, 56, 0) 30%, rgba(10, 15, 56, 0) 50%, rgba(10, 15, 56, 0.85) 100%);
}
.ts-thumb img { filter: saturate(1.05) contrast(1.05); }
.ts-thumb-level {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  padding: 5px 10px; border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  color: #fff; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em;
}
.ts-play {
  position: absolute; top: 50%; left: 50%; z-index: 2;
  width: 58px; height: 58px;
  transform: translate(-50%, -50%);
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: var(--c2, #0c5374);
  font-size: 1.2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease;
}
.ts-play i { margin-left: 3px; }
.ts-play::before {
  content: ''; position: absolute; inset: -8px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.45);
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.ts-thumb:hover .ts-play::before { transform: scale(1.15); opacity: 0; }
.ts-thumb:hover .ts-play,
.ts-thumb:focus-visible .ts-play {
  transform: translate(-50%, -50%) scale(1.1);
  background: linear-gradient(135deg, var(--c1), var(--c2));
  color: #fff;
}
.ts-thumb:focus-visible { outline: 3px solid var(--primary, #3a92bd); outline-offset: -3px; }
.ts-thumb-label {
  position: absolute; left: 12px; bottom: 10px; z-index: 2;
  display: inline-flex; align-items: center; gap: 6px;
  color: #fff; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.01em;
  opacity: 0.95;
}
.ts-thumb-label i { font-size: 0.9rem; }

.ts-thumb-soon {
  cursor: default;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: linear-gradient(135deg, var(--c2), var(--c1));
  color: rgba(255, 255, 255, 0.9);
}
.ts-thumb-soon::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,0.06) 0 12px, transparent 12px 24px);
}
.ts-soon-icon {
  position: relative; z-index: 1;
  width: 54px; height: 54px; display: grid; place-items: center;
  border-radius: 16px; background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 1.3rem; color: #fff;
}
.ts-soon-text { position: relative; z-index: 1; }
.ts-soon-text { font-weight: 700; font-size: 0.9rem; letter-spacing: 0.02em; }

.ts-card-body {
  display: flex; flex-direction: column; gap: 14px;
  flex: 1;
  padding: 16px 16px 16px 18px;
}
.ts-course-name {
  margin: 0;
  font-size: 1.05rem; font-weight: 800; line-height: 1.35; letter-spacing: -0.005em;
  color: var(--text-primary, #1a1a2e);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ts-card-teacher {
  display: flex; align-items: center; gap: 10px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px dashed var(--border-color, #e2e8f0);
}
.ts-teacher-link {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 12px;
  margin: -6px; padding: 6px;
  border-radius: 14px;
  color: inherit; text-decoration: none;
  transition: background 0.2s ease;
}
a.ts-teacher-link:hover { background: var(--cs); }
a.ts-teacher-link:hover .ts-teacher { color: var(--ct); }
a.ts-teacher-link:focus-visible { outline: 3px solid var(--ts-ring); outline-offset: 1px; }
.ts-avatar {
  width: 44px; height: 44px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--ts-surface), 0 0 0 4px var(--cs);
  overflow: hidden;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  color: #fff; font-weight: 700; font-size: 0.95rem;
}
.ts-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ts-card-info { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.ts-card-sub { display: block; font-size: 0.78rem; color: var(--text-secondary, #64748b); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.ts-teacher-link .ts-card-sub { color: var(--ct); font-weight: 600; }
.ts-card-sub i { font-size: 0.68rem; margin-left: 2px; }
.ts-card-cta, .ts-card-soon {
  width: 38px; height: 38px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 12px; border: 0;
  font-size: 0.9rem;
}
.ts-card-cta {
  background: var(--cs); color: var(--ct);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.ts-card:hover .ts-card-cta,
.ts-card-cta:focus-visible { background: linear-gradient(135deg, var(--c1), var(--c2)); color: #fff; transform: translateX(2px); }
.ts-card-cta:focus-visible { outline: 3px solid var(--ts-ring); outline-offset: 2px; }
.ts-card-soon { background: var(--bg-subtle, #f1f5f9); color: var(--text-secondary, #94a3b8); }
.ts-teacher {
  display: block;
  font-size: 0.95rem; font-weight: 700; line-height: 1.3;
  color: var(--text-primary, #1a1a2e);
  transition: color 0.2s;
}
.ts-level { color: var(--ct); font-weight: 700; }

/* ---------- No results / Empty ---------- */
.ts-no-results,
.ts-empty {
  text-align: center;
  padding: 56px 20px;
  color: var(--text-secondary, #64748b);
}
.ts-no-results > i { font-size: 2rem; color: var(--primary, #3a92bd); margin-bottom: 10px; }
.ts-no-results h3,
.ts-empty h2 { color: var(--text-primary, #1a1a2e); margin: 8px 0; }
.ts-empty { padding: 72px 20px 40px; max-width: 640px; }
.ts-empty-icon {
  width: 76px; height: 76px; margin: 0 auto 14px;
  display: grid; place-items: center;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--primary, #3a92bd), var(--primary-dark, #0c5374));
  color: #fff; font-size: 1.8rem;
}
.ts-empty p { margin-bottom: 22px; line-height: 1.7; }

/* ---------- Buttons ---------- */
.ts-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px;
  padding: 12px 26px;
  border-radius: 999px;
  border: 0;
  font: 700 1rem 'Inter', sans-serif;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.ts-btn:hover { transform: translateY(-2px); }
.ts-btn-primary { background: linear-gradient(135deg, var(--primary, #3a92bd), var(--primary-dark, #0c5374)); color: #fff; box-shadow: 0 8px 22px rgba(58, 146, 189, 0.35); }
.ts-btn-primary:hover { color: #fff; }
.ts-btn-ghost { background: var(--bg-subtle, #f1f5f9); color: var(--text-primary, #1a1a2e); }
.ts-btn-whatsapp { background: #25d366; color: #fff; box-shadow: 0 8px 22px rgba(37, 211, 102, 0.35); white-space: nowrap; }
.ts-btn-whatsapp:hover { color: #fff; box-shadow: 0 12px 28px rgba(37, 211, 102, 0.45); }
.ts-btn-whatsapp i { font-size: 1.3rem; }

/* ---------- CTA ---------- */
.ts-cta {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  margin: 12px 0 64px;
  padding: 32px 36px;
  border-radius: 24px;
  background: linear-gradient(135deg, #0a0f38, #0c5374);
  color: #fff;
  box-shadow: var(--ts-shadow-hover);
}
.ts-cta h2 { margin: 0 0 6px; font-size: 1.6rem; font-weight: 800; color: #fff; }
.ts-cta p { margin: 0; color: rgba(255, 255, 255, 0.78); line-height: 1.7; }
.ts-cta-ar { font-family: 'Cairo', sans-serif; font-weight: 700; color: #ffe58a !important; margin-bottom: 4px !important; }

/* ==========================================================
   VIDEO MODAL
   ========================================================== */
.ts-modal {
  position: fixed; inset: 0; z-index: 10000;
  display: grid; place-items: center;
  padding: 16px;
}
.ts-modal[hidden] { display: none; }
.ts-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(5, 8, 30, 0.82);
  backdrop-filter: blur(4px);
  animation: tsFade 0.2s ease;
}
.ts-modal-dialog {
  position: relative;
  width: min(960px, 100%);
  border-radius: 20px;
  overflow: hidden;
  background: #0a0f38;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  animation: tsPop 0.25s ease;
}
.ts-modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px 12px 20px;
  color: #fff;
}
.ts-modal-head h3 {
  margin: 0; font-size: 1rem; font-weight: 700; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ts-modal-close {
  width: 42px; height: 42px; flex-shrink: 0;
  border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff; font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.2s;
}
.ts-modal-close:hover { background: rgba(255, 255, 255, 0.25); }
.ts-modal-video { aspect-ratio: 16 / 9; background: #000; }
.ts-modal-video iframe { width: 100%; height: 100%; border: 0; display: block; }

body.ts-modal-open { overflow: hidden; }

@keyframes tsFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes tsPop { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }

/* ==========================================================
   RESPONSIVE
   ========================================================== */
@media (min-width: 900px) {
  .ts-filters { flex-wrap: nowrap; }
}

@media (max-width: 768px) {
  .ts-hero { padding: 48px 0 84px; }
  .ts-stats { display: grid; width: 100%; gap: 8px; }
  .ts-stat { min-width: 0; padding: 12px 8px; }
  .ts-stat-value { font-size: 1.35rem; }
  .ts-subject { padding: 16px; border-radius: 20px; }
  .ts-subject-name { font-size: 1.2rem; }
  .ts-subject-icon { width: 46px; height: 46px; font-size: 1.35rem; }
  .ts-cta { flex-direction: column; text-align: center; padding: 28px 22px; }
  .ts-cta .ts-btn { width: 100%; }
}

@media (max-width: 600px) {
  .ts-container { padding: 0 12px; }
  .ts-grid { grid-template-columns: 1fr; gap: 16px; }
  .ts-toolbar { position: static; }
  .ts-segment { width: 100%; overflow-x: auto; scrollbar-width: none; }
  .ts-seg-btn { flex: 1 0 auto; }
  .ts-toolbar-inner { padding: 10px; border-radius: 16px; }
  .ts-scroll-btn { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ts-card, .ts-thumb img, .ts-play, .ts-btn { transition: none; }
  .ts-modal-backdrop, .ts-modal-dialog { animation: none; }
}
