/* ═══════════════════════════════════════════════
   Rawad Al-Ilm — Home Page  (atv-* system)
   Apple TV Layout · Black × Gold × Purple
   Cinematic hero · Portrait & Landscape cards
   Top-10 numbered · Featured pairs
═══════════════════════════════════════════════ */

/* ── Keyframes ── */
@keyframes atv-fade-up   { from{opacity:0;transform:translateY(24px)} to{opacity:1;transform:translateY(0)} }
@keyframes atv-fade-in   { from{opacity:0} to{opacity:1} }
@keyframes atv-hero-zoom { from{transform:scale(1.06)} to{transform:scale(1)} }
@keyframes atv-shimmer   { 0%{left:-80%} 100%{left:130%} }
@keyframes atv-glow      { 0%,100%{box-shadow:0 0 24px rgba(186,162,109,0.35)} 50%{box-shadow:0 0 48px rgba(186,162,109,0.7)} }
@keyframes atv-dot-grow  { from{width:8px;border-radius:50%} to{width:28px;border-radius:4px;background:var(--c-gold)} }
@keyframes atv-count     { from{opacity:0;transform:translateY(12px)} to{opacity:1;transform:translateY(0)} }
@keyframes atv-orb       { 0%,100%{transform:translate(0,0)}50%{transform:translate(30px,-40px)} }

/* ══════════════════════════════════════
   GLOBAL RESET for this page
══════════════════════════════════════ */
/* ── Page background — deep purple-black from the brand ── */
.atv-hero, .atv-cats, .atv-row, .atv-stats,
.atv-cta, .atv-pair { background: #0A0414; }

/* Alternating rows for depth */
.atv-row:nth-child(even) { background: #0D0620; }

/* ══════════════════════════════════════
   HERO — Cinematic Full-Screen
══════════════════════════════════════ */
.atv-hero {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 640px;
  max-height: 980px;
  overflow: hidden;
}

.atv-hero__track { position: absolute; inset: 0; }

.atv-hero__slide {
  position: absolute;
  inset: 0;
  background-image: var(--bg, none);
  background-color: #2D0A4E;
  background-size: cover;
  background-position: center top;
  opacity: 0;
  transform: scale(1.05);
  transition: opacity 1.1s ease, transform 1.4s ease;
}
.atv-hero__slide--active {
  opacity: 1;
  transform: scale(1);
  z-index: 1;
}
.atv-hero__slide--empty {
  background: linear-gradient(160deg, #2a1a45 0%, #0a0614 100%);
}

/* Gradient overlays */
.atv-hero__grad {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.atv-hero__grad--bottom {
  background: linear-gradient(
    to top,
    #000 0%,
    rgba(0,0,0,0.85) 15%,
    rgba(0,0,0,0.45) 40%,
    transparent 70%
  );
}
.atv-hero__grad--side {
  background: linear-gradient(
    to right,
    rgba(0,0,0,0.75) 0%,
    rgba(0,0,0,0.2)  45%,
    transparent       70%
  );
}
[dir="ltr"] .atv-hero__grad--side {
  background: linear-gradient(
    to left,
    rgba(0,0,0,0.75) 0%,
    rgba(0,0,0,0.2)  45%,
    transparent       70%
  );
}
.atv-hero__grad--top {
  background: linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, transparent 20%);
}

/* Content */
.atv-hero__body {
  position: absolute;
  bottom: 0;
  inset-inline: 0;
  z-index: 2;
  padding-bottom: clamp(72px, 10vh, 110px);
  max-width: 720px;
}

.atv-hero__badge {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  backdrop-filter: blur(8px);
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 14px;
  animation: atv-fade-up 0.6s ease both;
}

.atv-hero__title {
  font-size: clamp(2rem, 5.5vw, 4.2rem);
  font-weight: 900;
  color: #fff;
  line-height: 1.1;
  letter-spacing: -0.025em;
  text-shadow: 0 2px 32px rgba(0,0,0,0.7);
  margin-bottom: 14px;
  animation: atv-fade-up 0.6s 0.1s ease both;
}

.atv-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  animation: atv-fade-up 0.6s 0.2s ease both;
}
.atv-hero__meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 99px;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.85);
  backdrop-filter: blur(6px);
}
.atv-hero__meta-chip--brand {
  background: rgba(201,168,76,0.2);
  border-color: rgba(201,168,76,0.45);
  color: #C9A84C;
  font-weight: 700;
}

.atv-hero__desc {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.7);
  line-height: 1.7;
  margin-bottom: 22px;
  max-width: 500px;
  animation: atv-fade-up 0.6s 0.28s ease both;
}

.atv-hero__actions {
  display: flex;
  gap: 12px;
  align-items: center;
  animation: atv-fade-up 0.6s 0.36s ease both;
}

/* Hero pagination */
.atv-hero__dots {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 3;
}
.atv-hero__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: all 0.35s cubic-bezier(0.34,1.4,0.64,1);
}
.atv-hero__dot--active {
  width: 28px;
  border-radius: 4px;
  background: var(--c-gold, #C9A84C);
}

/* Arrows */
.atv-hero__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(30,20,50,0.55);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3;
  opacity: 0;
  transition: all 0.25s;
}
.atv-hero:hover .atv-hero__arrow { opacity: 1; }
.atv-hero__arrow:hover {
  background: var(--c-gold, #C9A84C);
  color: #1a0e30;
  border-color: transparent;
  transform: translateY(-50%) scale(1.1);
}
.atv-hero__arrow--prev { inset-inline-start: 20px; }
.atv-hero__arrow--next { inset-inline-end: 20px; }

/* ══════════════════════════════════════
   BUTTONS
══════════════════════════════════════ */
.atv-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: none;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s, opacity 0.2s, box-shadow 0.2s;
  white-space: nowrap;
  font-family: inherit;
}
.atv-btn:active { transform: scale(0.96); }

.atv-btn--primary {
  background: linear-gradient(135deg, #C9A84C 0%, #e6c96d 50%, #C9A84C 100%);
  background-size: 200% 100%;
  color: #1a0e30;
  box-shadow: 0 4px 20px rgba(186,162,109,0.4);
}
.atv-btn--primary:hover {
  background-position: right center;
  box-shadow: 0 6px 30px rgba(186,162,109,0.6);
  transform: translateY(-2px);
  color: #1a0e30;
}

.atv-btn--circle {
  width: 46px; height: 46px;
  padding: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: 1.5px solid rgba(255,255,255,0.3);
  color: #fff;
  justify-content: center;
}
.atv-btn--circle:hover { background: rgba(255,255,255,0.22); }

.atv-btn--ghost {
  background: rgba(255,255,255,0.1);
  border: 1.5px solid rgba(255,255,255,0.2);
  color: #fff;
  backdrop-filter: blur(8px);
}
.atv-btn--ghost:hover { background: rgba(255,255,255,0.18); color: #fff; }

.atv-btn--lg { padding: 14px 32px; font-size: 1rem; border-radius: 12px; }

/* ══════════════════════════════════════
   SPECIALTY PILLS
══════════════════════════════════════ */
.atv-cats {
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding-block: 16px;
}
.atv-cats__inner {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.atv-cats__inner::-webkit-scrollbar { display: none; }

.atv-cat {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 18px;
  border-radius: 99px;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.1);
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s;
}
.atv-cat:hover, .atv-cat--all {
  color: #fff;
  border-color: rgba(186,162,109,0.5);
  background: rgba(186,162,109,0.1);
}
.atv-cat--all { color: var(--c-gold, #C9A84C); font-weight: 700; }

/* ══════════════════════════════════════
   ROW STRUCTURE
══════════════════════════════════════ */
.atv-row {
  padding-block: 32px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.atv-row__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-inline: 0;
}
.atv-row__title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  transition: color 0.2s;
}
.atv-row__title:hover { color: var(--c-gold, #C9A84C); }

/* Scrollable track */
.atv-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(186,162,109,0.25) transparent;
  scroll-snap-type: x mandatory;
  padding-inline: 2px;
}
.atv-track::-webkit-scrollbar { height: 3px; }
.atv-track::-webkit-scrollbar-thumb { background: rgba(186,162,109,0.3); border-radius: 99px; }

/* ══════════════════════════════════════
   PORTRAIT CARD — Apple TV exact style
   Image fills card · Text BELOW card
   Title: white · Sub: gray
══════════════════════════════════════ */
.atv-card {
  flex-shrink: 0;
  width: 150px;
  scroll-snap-align: start;
  cursor: pointer;
  position: relative;
}

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

/* Poster — pure image, no text overlay (Apple TV standard style) */
.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;
}
.atv-card:hover .atv-card__poster {
  transform: scale(1.04);
  box-shadow: 0 12px 36px rgba(0,0,0,0.8);
}

/* Gradient overlay — so title text is readable inside the card */
.atv-card__poster::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(10,4,20,0.92) 0%,
    rgba(10,4,20,0.55) 35%,
    transparent        65%
  );
  z-index: 1;
  pointer-events: none;
}

/* Badge — top-left */
.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;
  pointer-events: none;
}

/* Play button — center on hover */
.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;
}
.atv-card__play-btn svg {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.9);
  color: #2D0A4E;
  border-radius: 50%;
  padding: 11px;
}
.atv-card:hover .atv-card__play-btn { opacity: 1; }

/* Text INSIDE the poster — overlaid at bottom */
.atv-card__info {
  position: absolute;
  bottom: 0;
  inset-inline: 0;
  padding: 10px 10px 9px;
  z-index: 2;
}
.atv-card__title {
  font-size: 0.76rem;
  font-weight: 700;
  color: #ffffff;
  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);
}
.atv-card__sub {
  font-size: 0.63rem;
  color: rgba(255,255,255,0.52);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ══════════════════════════════════════
   TOP 10 — Numbered Cards
   Number overlaps from side · title below
══════════════════════════════════════ */
.atv-track--top10 { gap: 0; }
.atv-card--top10   { width: 185px; }

.atv-card--top10 .atv-card__info { padding: 10px 10px 9px; }

.atv-card__rank {
  position: absolute;
  bottom: 8px;
  inset-inline-start: -12px;
  font-size: 5.8rem;
  font-weight: 900;
  font-style: italic;
  line-height: 1;
  letter-spacing: -0.06em;
  color: #0A0414;
  -webkit-text-stroke: 2px rgba(255,255,255,0.45);
  text-stroke: 2px rgba(255,255,255,0.45);
  paint-order: stroke fill;
  z-index: 1;
  pointer-events: none;
  user-select: none;
}
.atv-card--top10 .atv-card__poster {
  margin-inline-start: 34px;
  width: calc(100% - 34px);
}

/* ══════════════════════════════════════
   FEATURED PAIR — Landscape with text INSIDE
   Like Apple TV's "مغامرات شديدة الخطورة"
══════════════════════════════════════ */
.atv-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.atv-pair__card {
  position: relative;
  aspect-ratio: 16/9;
  border-radius: 14px;
  overflow: hidden;
  background-color: #2D0A4E;
  background-image: var(--bg, none);
  background-size: cover;
  background-position: center;
  text-decoration: none;
  display: block;
  transition: transform 0.3s cubic-bezier(0.34,1.2,0.64,1), box-shadow 0.3s;
}
.atv-pair__card:hover {
  transform: scale(1.02);
  box-shadow: 0 16px 48px rgba(0,0,0,0.85);
}
/* Gradient overlay for text readability */
.atv-pair__grad {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.88) 0%, rgba(0,0,0,0.3) 45%, transparent 75%);
  z-index: 1;
}
.atv-pair__body {
  position: absolute;
  bottom: 0;
  inset-inline: 0;
  padding: 18px 18px 16px;
  z-index: 2;
}
.atv-pair__badge {
  display: inline-block;
  padding: 3px 9px;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 5px;
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.atv-pair__title {
  font-size: clamp(0.95rem, 2.2vw, 1.4rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 5px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}
.atv-pair__meta {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.52);
}

/* ══════════════════════════════════════
   BROWSE BY SPECIALTY — Colorful Gradient Cards
   Like Apple TV's "تصفح حسب المجموعة"
══════════════════════════════════════ */
.atv-track--browse { gap: 10px; }

.atv-sp-card {
  flex-shrink: 0;
  width: 155px;
  aspect-ratio: 2/3;
  border-radius: 12px;
  overflow: hidden;
  background: var(--sp-grad, linear-gradient(160deg,#2D0A4E,#5B1FA8));
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 14px 12px;
  text-decoration: none;
  scroll-snap-align: start;
  cursor: pointer;
  position: relative;
  transition: transform 0.28s cubic-bezier(0.34,1.2,0.64,1), box-shadow 0.28s;
}
.atv-sp-card:hover {
  transform: scale(1.05);
  box-shadow: 0 14px 40px rgba(0,0,0,0.75);
}
/* Subtle dark scrim at bottom */
.atv-sp-card::before {
  content: '';
  position: absolute;
  bottom: 0;
  inset-inline: 0;
  height: 60%;
  background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, transparent 100%);
  z-index: 1;
}
.atv-sp-card__icon {
  font-size: 2.2rem;
  line-height: 1;
  margin-bottom: 10px;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.4));
}
.atv-sp-card__name {
  font-size: 0.88rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.25;
  position: relative;
  z-index: 2;
  text-shadow: 0 1px 6px rgba(0,0,0,0.5);
}
.atv-sp-card__count {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.6);
  margin-top: 3px;
  position: relative;
  z-index: 2;
}

/* ══════════════════════════════════════
   STATS BAR
══════════════════════════════════════ */
.atv-stats {
  display: flex;
  justify-content: center;
  gap: 0;
  padding-block: 48px;
  border-top: 1px solid rgba(255,255,255,0.06);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.atv-stat {
  flex: 1;
  text-align: center;
  padding: 24px 16px;
  position: relative;
}
.atv-stat:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 20%;
  inset-inline-end: 0;
  width: 1px;
  height: 60%;
  background: linear-gradient(180deg, transparent, rgba(186,162,109,0.2), transparent);
}
.atv-stat__num {
  display: block;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #C9A84C, #e6c96d);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}
.atv-stat__label {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.4);
  font-weight: 500;
}

/* ══════════════════════════════════════
   CTA BANNER
══════════════════════════════════════ */
.atv-cta {
  padding-block: 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.atv-cta__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 25% 50%, rgba(91,31,168,0.4) 0%, transparent 55%),
    radial-gradient(ellipse at 75% 50%, rgba(201,168,76,0.12) 0%, transparent 55%);
  pointer-events: none;
}
.atv-cta__inner {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin-inline: auto;
}
.atv-cta h2 {
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.atv-cta p {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.55);
  margin-bottom: 32px;
  line-height: 1.7;
}
.atv-cta__btns {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 1024px) {
  .atv-pair { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .atv-hero { height: 85vh; min-height: 520px; }
  .atv-hero__arrow { display: none; }
  .atv-pair { grid-template-columns: 1fr 1fr; gap: 8px; }
  .atv-stats { flex-wrap: wrap; }
  .atv-stat { min-width: 40%; }
  .atv-stat::after { display: none !important; }
  .atv-card { width: 125px; }
  .atv-card--top10 { width: 158px; }
  .atv-card__rank { font-size: 4.5rem; bottom: 36px; }
  .atv-card--top10 .atv-card__poster { margin-inline-start: 28px; width: calc(100% - 28px); }
  .atv-sp-card { width: 130px; }
  .atv-pair { grid-template-columns: 1fr 1fr; gap: 8px; }
}

@media (max-width: 480px) {
  .atv-hero__title { font-size: clamp(1.7rem, 8vw, 2.4rem); }
  .atv-hero__desc { display: none; }
  .atv-hero__actions { flex-direction: column; align-items: flex-start; }
  .atv-pair { grid-template-columns: 1fr; }
  .atv-pair__card { aspect-ratio: 16/9; }
  .atv-cta__btns { flex-direction: column; align-items: center; }
  .atv-card { width: 120px; }
  .atv-card__title { font-size: 0.72rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.15ms !important; }
}
