/* ═══════════════════════════════════════════════════════
   Rawad Al-Ilm — Courses Page
   Tailark-style Split Hero · Sidebar · Card Grid
═══════════════════════════════════════════════════════ */

/* ── Keyframes ── */
@keyframes crs-fade-up   { from{opacity:0;transform:translateY(20px)} to{opacity:1;transform:translateY(0)} }
@keyframes crs-photo-in  { from{opacity:0;transform:scale(1.04)} to{opacity:1;transform:scale(1)} }
@keyframes crs-float     { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-10px)} }
@keyframes crsCardIn     { to{opacity:1;transform:translateY(0)} }
@keyframes crs-shine     { 0%{left:-80%} 100%{left:130%} }

/* ══════════════════════════════════════════════════════
   HERO
══════════════════════════════════════════════════════ */
.crs-hero {
  position: relative;
  overflow: hidden;
  background: #0a0414;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

/* Background image */
.crs-hero__bg-img {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.crs-hero__bg-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  display: block;
  filter: saturate(0.7) brightness(0.45);
  transform: scale(1.04);
  animation: crs-hero-zoom 12s ease-out forwards;
}
@keyframes crs-hero-zoom {
  from { transform: scale(1.06); }
  to   { transform: scale(1.0);  }
}

/* Multi-layer dark overlay */
.crs-hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(to bottom,  rgba(10,4,20,0.55) 0%, rgba(10,4,20,0.2) 40%, rgba(10,4,20,0.65) 100%),
    linear-gradient(to right,   rgba(10,4,20,0.85) 0%, rgba(10,4,20,0.3) 55%, transparent 80%);
}
[dir="rtl"] .crs-hero__overlay {
  background:
    linear-gradient(to bottom,  rgba(10,4,20,0.55) 0%, rgba(10,4,20,0.2) 40%, rgba(10,4,20,0.65) 100%),
    linear-gradient(to left,    rgba(10,4,20,0.85) 0%, rgba(10,4,20,0.3) 55%, transparent 80%);
}

/* ── Inner — single column, text centred over bg image ── */
.crs-hero__inner {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  min-height: 380px;
}
.crs-hero__right { display: none; }

/* ══════════════════════════════════════
   LEFT — text side
══════════════════════════════════════ */
.crs-hero__left {
  padding-block: 56px 52px;
  padding-inline-end: 48px;
  display: flex;
  flex-direction: column;
  gap: 0;
  animation: crs-fade-up 0.7s ease both;
  max-width: 640px;
}

/* Chip / badge */
.crs-hero__chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 6px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 9999px;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  width: fit-content;
  margin-bottom: 28px;
  transition: border-color 0.2s, color 0.2s;
  background: rgba(255,255,255,0.04);
}
.crs-hero__chip:hover { border-color: rgba(255,255,255,0.3); color: #fff; }
.crs-hero__chip-tag {
  background: rgba(255,255,255,0.1);
  border-radius: 9999px;
  padding: 2px 9px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
}
.crs-hero__chip-text { flex: 1; }
.crs-hero__chip-sep {
  display: block;
  width: 1px;
  height: 14px;
  background: rgba(255,255,255,0.2);
}
.crs-hero__chip-arrow { opacity: 0.6; flex-shrink: 0; }

/* Title */
.crs-hero__title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 20px;
}
.crs-hero__title-line {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: #fff;
}
.crs-hero__title-line--accent {
  color: #fff;
}

/* Description */
.crs-hero__desc {
  font-size: 0.97rem;
  color: rgba(255,255,255,0.55);
  line-height: 1.7;
  margin-bottom: 32px;
  max-width: 460px;
}

/* Search — like the email input in screenshot */
.crs-search {
  margin-bottom: 24px;
  max-width: 480px;
}
.crs-search__wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.22s, box-shadow 0.22s;
  box-shadow: 0 2px 16px rgba(0,0,0,0.3);
  position: relative;
}
.crs-search__wrap:focus-within {
  border-color: rgba(255,255,255,0.3);
  box-shadow: 0 2px 24px rgba(0,0,0,0.4);
}
.crs-search__icon {
  position: absolute;
  inset-inline-start: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,0.3);
  pointer-events: none;
  transition: color 0.2s;
}
.crs-search__wrap:focus-within .crs-search__icon { color: rgba(255,255,255,0.6); }
.crs-search__input {
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 0.92rem;
  font-family: inherit;
  padding: 16px 16px 16px 46px;
  width: 100%;
  -webkit-appearance: none;
}
.crs-search__input::placeholder { color: rgba(255,255,255,0.28); }
.crs-search__btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  margin: 4px;
  background: #fff;
  color: #0f0c18;
  border: none;
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.crs-search__btn::before {
  content: '';
  position: absolute;
  top: 0; left: -80%; width: 50%; height: 100%;
  background: rgba(0,0,0,0.08);
  transform: skewX(-20deg);
  transition: left 0.35s ease;
}
.crs-search__btn:hover::before { left: 130%; }
.crs-search__btn:hover { background: #f0f0f0; box-shadow: 0 4px 16px rgba(255,255,255,0.15); }
.crs-search__btn-icon { opacity: 0.7; }
.crs-search__clear {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.35);
  text-decoration: none;
  transition: color 0.2s;
}
.crs-search__clear:hover { color: rgba(255,255,255,0.7); }

/* Features bullet list */
.crs-hero__features {
  list-style: none;
  padding: 0;
  margin: 0 0 28px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.crs-hero__features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: rgba(255,255,255,0.6);
}
.crs-hero__features li svg {
  color: rgba(255,255,255,0.5);
  flex-shrink: 0;
}

/* Pills */
.crs-hero__pills-wrap { overflow: hidden; position: relative; }
.crs-hero__pills-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  inset-inline-end: 0;
  width: 50px;
  height: 100%;
  background: linear-gradient(to var(--ltr-end,right), transparent, #0f0c18);
  pointer-events: none;
  z-index: 1;
}
[dir="rtl"] .crs-hero__pills-wrap::after { background: linear-gradient(to left, transparent, #0f0c18); }
.crs-hero__pills {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.crs-hero__pills::-webkit-scrollbar { display: none; }
.crs-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 13px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 9999px;
  color: rgba(255,255,255,0.5);
  font-size: 0.78rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s;
  flex-shrink: 0;
}
.crs-pill:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.22);
  color: rgba(255,255,255,0.9);
}
.crs-pill--active {
  background: #fff !important;
  border-color: #fff !important;
  color: #0f0c18 !important;
  font-weight: 700;
}
.crs-pill__count {
  background: rgba(0,0,0,0.12);
  border-radius: 9999px;
  padding: 1px 6px;
  font-size: 0.64rem;
  font-weight: 700;
}

/* ══════════════════════════════════════
   RIGHT — photo collage side
══════════════════════════════════════ */
.crs-hero__right {
  position: relative;
  height: 100%;
  min-height: 560px;
  overflow: hidden;
}

/* Gradient that fades photos into the background on the left edge */
.crs-hero__right-grad {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(to right, #0f0c18 0%, rgba(15,12,24,0.3) 30%, transparent 55%);
}
[dir="rtl"] .crs-hero__right-grad {
  background: linear-gradient(to left, #0f0c18 0%, rgba(15,12,24,0.3) 30%, transparent 55%);
}

/* Photos grid */
.crs-photos {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  padding: 20px 16px 20px 0;
}
.crs-photos__col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.crs-photos__col--1 { padding-top: 40px; }
.crs-photos__col--3 { padding-top: 20px; }

.crs-photo {
  border-radius: 16px;
  overflow: hidden;
  flex-shrink: 0;
  animation: crs-photo-in 0.9s ease both;
}
.crs-photo--tall { flex: 1; min-height: 0; }
.crs-photo--mid  { flex: 1; min-height: 0; }
.crs-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s ease;
}
.crs-photo:hover img { transform: scale(1.04); }

.crs-photos__col--1 .crs-photo { animation-delay: 0.1s; }
.crs-photos__col--2 .crs-photo:first-child { animation-delay: 0.2s; }
.crs-photos__col--2 .crs-photo:last-child  { animation-delay: 0.3s; }
.crs-photos__col--3 .crs-photo { animation-delay: 0.15s; }

/* Floating stat cards over photos */
.crs-photo-stat {
  position: absolute;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 16px;
  background: rgba(15,12,24,0.88);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  animation: crs-float 5s ease-in-out infinite;
}
.crs-photo-stat--1 { bottom: 28%; left: 4%; animation-delay: 0s; }
.crs-photo-stat--2 { top: 15%;   right: 4%; animation-delay: 1.5s; }
.crs-photo-stat__val {
  font-size: 1.15rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1;
}
.crs-photo-stat__lbl {
  font-size: 0.6rem;
  color: rgba(255,255,255,0.45);
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ══════════════════════════════════════════════════════
   LAYOUT: SIDEBAR + GRID
══════════════════════════════════════════════════════ */
.crs-layout {
  display: grid;
  grid-template-columns: 225px 1fr;
  gap: 28px;
  padding-block: 28px 52px;
  align-items: start;
}

/* ── SIDEBAR ── */
.crs-sidebar {
  position: sticky;
  top: 24px;
  background: rgba(12,8,22,0.85);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 10px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.crs-sidebar__head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px 10px;
  font-size: 0.7rem;
  font-weight: 700;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 6px;
}
.crs-sidebar__reset { margin-inline-start: auto; color: rgba(255,255,255,0.25); text-decoration: none; font-size: 0.9rem; transition: color 0.2s; line-height: 1; }
.crs-sidebar__reset:hover { color: #f87171; }
.crs-sidebar__section-title { font-size: 0.63rem; font-weight: 700; color: rgba(255,255,255,0.22); text-transform: uppercase; letter-spacing: 0.1em; padding: 10px 8px 4px; }

.crs-filter-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 9px;
  border-radius: 10px;
  color: rgba(255,255,255,0.48);
  text-decoration: none;
  font-size: 0.81rem;
  font-weight: 500;
  transition: all 0.2s;
  margin-bottom: 1px;
}
.crs-filter-item:hover { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.85); }
.crs-filter-item--active { background: rgba(255,255,255,0.08) !important; color: #fff !important; border-inline-start: 2px solid #fff; }
.crs-filter-item__icon { width: 20px; height: 20px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 1rem; }
.crs-filter-item__name { flex: 1; }
.crs-filter-item__count { font-size: 0.64rem; background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.5); padding: 2px 7px; border-radius: 9999px; font-weight: 700; }
.crs-filter-item--active .crs-filter-item__count { color: #fff; background: rgba(255,255,255,0.15); }

/* ── MAIN ── */
.crs-main { min-width: 0; }
.crs-mobile-filter-btn {
  display: none;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 9px;
  color: rgba(255,255,255,0.65);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  margin-bottom: 14px;
  position: relative;
  transition: all 0.2s;
}
.crs-mobile-filter-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.crs-mobile-filter-btn__dot { position: absolute; top: 7px; inset-inline-end: 7px; width: 7px; height: 7px; border-radius: 50%; background: #fff; }

.crs-results-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 10px; flex-wrap: wrap; }
.crs-results-bar__count { font-size: 0.82rem; color: rgba(255,255,255,0.4); }
.crs-results-bar__count strong { color: #fff; font-weight: 800; }
.crs-results-bar__count em { color: rgba(255,255,255,0.75); font-style: normal; }
.crs-results-bar__page { font-size: 0.75rem; color: rgba(255,255,255,0.28); }

/* ── GRID ── */
.crs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}

/* ── CARD — identical to atv-card ── */
.crs-card {
  opacity: 0;
  transform: translateY(16px);
  cursor: pointer;
  position: relative;
}
.crs-card--visible {
  animation: crsCardIn 0.45s ease calc(var(--ci,0) * 0.045s) forwards;
}

.crs-card .atv-card__link { display: block; text-decoration: none; }
.crs-card .atv-card__link:focus-visible .atv-card__poster {
  outline: 2px solid #C9A84C;
  outline-offset: 2px;
}

/* Poster */
.crs-card .atv-card__poster {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: 10px;
  overflow: hidden;
  background-color: #2D0A4E;
  background-image: var(--bg, none);
  background-size: cover;
  background-position: center top;
  transition: transform 0.28s cubic-bezier(0.34,1.2,0.64,1), box-shadow 0.28s;
}
.crs-card:hover .atv-card__poster {
  transform: scale(1.04);
  box-shadow: 0 12px 36px rgba(0,0,0,0.8);
}

/* Gradient overlay */
.crs-card .atv-card__poster::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10,4,20,0.95) 0%, rgba(10,4,20,0.55) 38%, transparent 65%);
  z-index: 1;
  pointer-events: none;
}

/* Badge */
.crs-card .atv-card__badge {
  position: absolute;
  top: 7px;
  inset-inline-start: 7px;
  padding: 3px 9px;
  background: linear-gradient(135deg, #C9A84C, #e6c96d);
  color: #2D0A4E;
  font-size: 0.6rem;
  font-weight: 800;
  border-radius: 5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  z-index: 2;
}

/* Play button */
.crs-card .atv-card__play-btn {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.3);
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 2;
}
.crs-card .atv-card__play-btn svg {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.9);
  color: #2D0A4E;
  border-radius: 50%;
  padding: 11px;
}
.crs-card:hover .atv-card__play-btn { opacity: 1; }

/* Price pill */
.crs-card__price-pill {
  position: absolute;
  bottom: 38px;
  inset-inline-end: 8px;
  z-index: 3;
  font-size: 0.7rem;
  font-weight: 800;
  color: #C9A84C;
  background: rgba(10,4,20,0.75);
  padding: 2px 8px;
  border-radius: 6px;
  backdrop-filter: blur(6px);
  pointer-events: none;
}
.crs-card__price-free { color: #4ade80; font-size: 0.7rem; font-weight: 700; }

/* Text inside poster */
.crs-card .atv-card__info {
  position: absolute;
  bottom: 0;
  inset-inline: 0;
  padding: 10px 10px 9px;
  z-index: 2;
}
.crs-card .atv-card__title {
  font-size: 0.76rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.32;
  margin-bottom: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.crs-card .atv-card__sub {
  font-size: 0.63rem;
  color: rgba(255,255,255,0.52);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Enroll button below card */
.crs-card__below { margin-top: 8px; }
.crs-card__enroll-btn {
  display: block;
  width: 100%;
  text-align: center;
  padding: 7px 10px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.11);
  border-radius: 8px;
  color: rgba(255,255,255,0.65);
  font-size: 0.74rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  font-family: inherit;
}
.crs-card:hover .crs-card__enroll-btn,
.crs-card__enroll-btn:hover {
  background: #C9A84C;
  border-color: #C9A84C;
  color: #1a0e30;
}

/* ── PAGINATION ── */
.crs-pagination { display: flex; align-items: center; justify-content: center; gap: 7px; padding-top: 38px; flex-wrap: wrap; }
.crs-pagination__btn {
  display: flex; align-items: center; justify-content: center;
  min-width: 38px; height: 38px; padding: 0 8px;
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.5);
  font-size: 0.83rem; font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
}
.crs-pagination__btn:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2); color: #fff; }
.crs-pagination__btn--active { background: #C9A84C !important; border-color: #C9A84C !important; color: #1a0e30 !important; box-shadow: 0 4px 14px rgba(201,168,76,0.4); font-weight: 800; }
.crs-pagination__btn--nav { width: 38px; }
.crs-pagination { transition: opacity 0.2s; cursor: pointer; }
.crs-pagination__btn { cursor: pointer; }
.crs-pagination__btn--loading { pointer-events: none; opacity: 0.5; }
.crs-grid { min-height: 200px; }

/* ── EMPTY ── */
.crs-empty { text-align: center; padding: 80px 20px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.crs-empty__icon { color: rgba(255,255,255,0.2); }
.crs-empty__title { font-size: 1.2rem; font-weight: 700; color: #fff; }
.crs-empty__desc { font-size: 0.85rem; color: rgba(255,255,255,0.4); max-width: 340px; }
.crs-empty__btn { display: inline-flex; align-items: center; padding: 11px 24px; background: #fff; color: #0f0c18; border-radius: 10px; font-size: 0.85rem; font-weight: 700; text-decoration: none; margin-top: 8px; transition: all 0.2s; }
.crs-empty__btn:hover { background: #e8e8e8; box-shadow: 0 4px 16px rgba(255,255,255,0.15); }

/* ══════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
  .crs-hero__left { padding-inline-end: 32px; }
}
@media (max-width: 900px) {
  .crs-hero__inner { grid-template-columns: 1fr; min-height: unset; }
  .crs-hero__right { display: none; }
  .crs-hero__left { padding-block: 60px 52px; padding-inline-end: 0; }
}
@media (max-width: 1024px) {
  .crs-layout { grid-template-columns: 200px 1fr; gap: 20px; }
  .crs-grid { grid-template-columns: repeat(auto-fill, minmax(140px,1fr)); }
}
@media (max-width: 768px) {
  .crs-layout { grid-template-columns: 1fr; }
  .crs-sidebar {
    position: fixed;
    inset-block: 0;
    inset-inline-start: -270px;
    width: 255px;
    border-radius: 0 16px 16px 0;
    z-index: 200;
    transition: inset-inline-start 0.3s ease;
    overflow-y: auto;
    max-height: 100vh;
  }
  [dir="rtl"] .crs-sidebar { inset-inline-start: auto; inset-inline-end: -270px; border-radius: 16px 0 0 16px; }
  .crs-sidebar--open { inset-inline-start: 0 !important; }
  [dir="rtl"] .crs-sidebar--open { inset-inline-end: 0 !important; inset-inline-start: auto !important; }
  .crs-mobile-filter-btn { display: inline-flex; }
  .crs-grid { grid-template-columns: repeat(auto-fill, minmax(130px,1fr)); gap: 12px; }
}
@media (max-width: 480px) {
  .crs-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .crs-hero__title-line { font-size: clamp(1.7rem, 8vw, 2.2rem); }
}
@media (max-width: 360px) {
  .crs-grid { grid-template-columns: repeat(2, 1fr); }
}
