/* ═══════════════════════════════════════════════════════════════
   CimaClub4U — Complete Design System
   Dark Arabic streaming portal · RTL/LTR · Premium dark theme
═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;900&family=Inter:wght@300;400;500;600;700&display=swap');

/* ─── CSS Variables ─────────────────────────────────────────── */
:root {
  --bg-primary:    #0d0716;
  --bg-secondary:  #140a22;
  --bg-card:       #1b0e2d;
  --bg-header:     #140a22ee;
  --bg-input:      rgba(255,255,255,0.07);
  --accent:        #9d4edd;
  --accent-dark:   #7b2cbf;
  --accent-glow:   rgba(157,78,221,0.3);
  --red:           #e63946;
  --gold:          #f4b942;
  --green:         #2dce89;
  --text-primary:  #f0f0f5;
  --text-secondary:#9b8caa;
  --text-muted:    #6c5b7b;
  --border:        rgba(255,255,255,0.07);
  --border-accent: rgba(157,78,221,0.3);
  --card-hover:    #1e2138;
  --overlay:       rgba(11,13,26,0.85);
  --radius-sm:     6px;
  --radius-md:     10px;
  --radius-lg:     16px;
  --radius-xl:     24px;
  --shadow-card:   0 8px 32px rgba(0,0,0,0.5);
  --shadow-glow:   0 0 30px rgba(157,78,221,0.15);
  --transition:    0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-ar:       'Cairo', sans-serif;
  --font-en:       'Inter', sans-serif;
  --header-h:      80px;
  --nav-h:         70px;
}

/* ─── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-ar);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}
body.ltr { font-family: var(--font-en); }
a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; color: inherit; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ─── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-dark); }

/* ─── Container ─────────────────────────────────────────────── */
.container { width: 100%; max-width: 1300px; margin: 0 auto; padding: 0 20px; }

/* ═══════════════════════════════════════════════════════════
   HEADER
═══════════════════════════════════════════════════════════ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--header-h);
  background: var(--bg-header);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: none;
  transition: var(--transition);
}
.site-header.scrolled {
  background: rgba(11,13,26,0.98);
  box-shadow: 0 4px 30px rgba(0,0,0,0.6);
}
/* Header inner ─ 3-column grid: logo | search | actions */
.header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  height: 100%;
  direction: ltr; /* logo always left regardless of page dir */
}

/* Logo ─ always top-left */
.logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}
.logo-img {
  height: 80px;
  width: auto;
  margin-top: 8px;
  object-fit: contain;
  transition: transform 0.25s ease, filter 0.25s ease;
  filter: drop-shadow(0 2px 12px rgba(157,78,221,0.3));
}
.logo:hover .logo-img {
  transform: scale(1.04);
  filter: drop-shadow(0 4px 20px rgba(157,78,221,0.5));
}

/* Search ─ centered column */
.header-search {
  max-width: 500px;
  width: 100%;
  margin: 0 auto;
  position: relative;
  direction: ltr;
}
.header-search input {
  width: 100%;
  height: 42px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 0 50px 0 18px;
  color: var(--text-primary);
  font-size: 14px;
  transition: var(--transition);
}
body.rtl .header-search input { padding: 0 18px 0 50px; }
.header-search input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255,255,255,0.1);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.header-search input::placeholder { color: var(--text-muted); }
.search-btn {
  position: absolute;
  right: 4px; top: 50%;
  transform: translateY(-50%);
  width: 34px; height: 34px;
  background: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px;
  transition: var(--transition);
}
body.rtl .search-btn { right: auto; left: 4px; }
.search-btn:hover { background: var(--accent-dark); transform: translateY(-50%) scale(1.05); }

/* Search dropdown */
.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: #1a1d30;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  display: none;
  z-index: 200;
  max-height: 420px;
  overflow-y: auto;
}
.search-dropdown.active { display: block; }
.search-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 15px;
  transition: var(--transition);
  border-bottom: 1px solid var(--border);
}
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: var(--bg-card); }
.search-item img { width: 40px; height: 58px; border-radius: 4px; object-fit: cover; flex-shrink: 0; }
.search-item-info { flex: 1; min-width: 0; }
.search-item-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-item-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.search-loading, .search-no-results { padding: 20px; text-align: center; color: var(--text-muted); font-size: 13px; }

/* Header actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-inline-start: auto;
  flex-shrink: 0;
}
.lang-btn {
  height: 34px;
  padding: 0 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  transition: var(--transition);
}
.lang-btn:hover { border-color: var(--accent); color: var(--accent); }
.menu-toggle {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 16px;
  transition: var(--transition);
  display: none;
}
.menu-toggle:hover { color: var(--accent); border-color: var(--accent); }

/* ─── Bottom Nav (Categories) ────────────────────────── */
.bottom-nav {
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0;
  z-index: 999;
  height: 70px;
  background: rgba(10, 12, 28, 0.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(157,78,221,0.12);
  box-shadow: 0 4px 30px rgba(0,0,0,0.4);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.bottom-nav::-webkit-scrollbar { display: none; }
.bottom-nav .container { height: 100%; }
.nav-list {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 16px;
  gap: 6px;
  width: max-content;
  min-width: 100%;
}

/* ── NAV BUTTONS ── */
.nav-item { list-style: none; }
.nav-item a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 33px;
  padding: 0 14px;
  border-radius: 100px;
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.09);
  transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
  white-space: nowrap;
  text-decoration: none;
  letter-spacing: 0.02em;
}
.nav-item a i {
  font-size: 11px;
  transition: transform 0.2s ease;
}
/* Default hover — blue */
.nav-item a:hover {
  background: rgba(157, 78, 221, 0.1);
  border: 1px solid rgba(157, 78, 221, 0.3);
  color: #9d4edd;
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(157, 78, 221, 0.4);
}
.nav-item a:hover i { transform: scale(1.2); }

/* Active — gradient pill */
.nav-item a.active {
  background: linear-gradient(135deg, #9d4edd 0%, #0080c9 100%);
  border-color: transparent;
  color: #fff !important;
  box-shadow: 0 4px 22px rgba(157,78,221,0.4), inset 0 1px 0 rgba(255,255,255,0.2);
  transform: translateY(-1px);
  font-weight: 700;
}

/* Color-coded per category (Hover & Active) */
/* Movies */
.nav-item a[href*="type=movie"]:hover { background: rgba(6,182,212,0.14); border-color: rgba(6,182,212,0.4); color: #06b6d4; box-shadow: 0 4px 16px rgba(6,182,212,0.2); }
.nav-item a[href*="type=movie"].active { background: linear-gradient(135deg, #06b6d4 0%, #0284c7 100%); box-shadow: 0 4px 22px rgba(6,182,212,0.4); }

/* Series */
.nav-item a[href*="type=tv"]:hover { background: rgba(16,185,129,0.14); border-color: rgba(16,185,129,0.4); color: #10b981; box-shadow: 0 4px 16px rgba(16,185,129,0.2); }
.nav-item a[href*="type=tv"].active { background: linear-gradient(135deg, #10b981 0%, #059669 100%); box-shadow: 0 4px 22px rgba(16,185,129,0.4); }

/* Arabic */
.nav-item a[href*="lang=ar"]:hover { background: rgba(245,158,11,0.14); border-color: rgba(245,158,11,0.4); color: #f59e0b; box-shadow: 0 4px 16px rgba(245,158,11,0.2); }
.nav-item a[href*="lang=ar"].active { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); box-shadow: 0 4px 22px rgba(245,158,11,0.4); }

/* Turkish */
.nav-item a[href*="lang=tr"]:hover { background: rgba(225,29,72,0.14); border-color: rgba(225,29,72,0.4); color: #e11d48; box-shadow: 0 4px 16px rgba(225,29,72,0.2); }
.nav-item a[href*="lang=tr"].active { background: linear-gradient(135deg, #e11d48 0%, #be123c 100%); box-shadow: 0 4px 22px rgba(225,29,72,0.4); }

/* K-Drama */
.nav-item a[href*="lang=ko"]:hover { background: rgba(236,72,153,0.14); border-color: rgba(236,72,153,0.4); color: #ec4899; box-shadow: 0 4px 16px rgba(236,72,153,0.2); }
.nav-item a[href*="lang=ko"].active { background: linear-gradient(135deg, #ec4899 0%, #db2777 100%); box-shadow: 0 4px 22px rgba(236,72,153,0.4); }

/* Russian */
.nav-item a[href*="lang=ru"]:hover { background: rgba(99,102,241,0.14); border-color: rgba(99,102,241,0.4); color: #6366f1; box-shadow: 0 4px 16px rgba(99,102,241,0.2); }
.nav-item a[href*="lang=ru"].active { background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%); box-shadow: 0 4px 22px rgba(99,102,241,0.4); }

/* Anime */
.nav-item a[href*="anime"]:hover { background: rgba(139,92,246,0.14); border-color: rgba(139,92,246,0.4); color: #8b5cf6; box-shadow: 0 4px 16px rgba(139,92,246,0.2); }
.nav-item a[href*="anime"].active { background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%); box-shadow: 0 4px 22px rgba(139,92,246,0.4); }

/* Top Rated & Search (Default gradients already cover these, but keeping explicit overrides if needed) */
.nav-item a[href*="top_rated"]:hover { background: rgba(251,191,36,0.14); border-color: rgba(251,191,36,0.4); color: #fbbf24; box-shadow: 0 4px 16px rgba(251,191,36,0.2); }
.nav-item a[href*="top_rated"].active { background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%); box-shadow: 0 4px 22px rgba(251,191,36,0.4); }

/* ─── Mobile Nav Menu ────────────────────────────────────── */
.mobile-menu {
  position: fixed;
  top: var(--header-h); right: 0;
  width: 280px; height: calc(100vh - var(--header-h));
  background: #111327;
  border-left: 1px solid var(--border);
  z-index: 1001;
  transform: translateX(100%);
  transition: var(--transition);
  overflow-y: auto;
  padding: 20px;
}
body.rtl .mobile-menu { right: auto; left: 0; border-left: none; border-right: 1px solid var(--border); transform: translateX(-100%); }
.mobile-menu.open { transform: translateX(0); }
.mobile-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  display: none;
}
.mobile-overlay.active { display: block; }
.mobile-nav-list { display: flex; flex-direction: column; gap: 4px; }
.mobile-nav-list a {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 15px; font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition);
}
.mobile-nav-list a:hover, .mobile-nav-list a.active {
  background: var(--bg-card); color: var(--accent);
}
.mobile-nav-list a i { width: 20px; text-align: center; }

/* ═══════════════════════════════════════════════════════════
   PAGE LAYOUT
═══════════════════════════════════════════════════════════ */
.main-content {
  padding-top: calc(var(--header-h) + var(--nav-h) + 20px);
  min-height: 100vh;
}

/* ═══════════════════════════════════════════════════════════
   HERO SLIDER
═══════════════════════════════════════════════════════════ */
.hero-section {
  position: relative;
  width: 100%;
  height: 580px;
  overflow: hidden;
  margin-bottom: 40px;
  margin-top: -20px;
}
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
}
.hero-slide.active { opacity: 1; z-index: 2; }
.hero-bg {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center top;
  filter: brightness(0.5);
  transform: scale(1.05);
  transition: transform 6s ease;
}
.hero-slide.active .hero-bg { transform: scale(1); }
.hero-gradient {
  position: absolute; inset: 0;
  background: linear-gradient(
    to right,
    rgba(11,13,26,0.98) 0%,
    rgba(11,13,26,0.7) 50%,
    rgba(11,13,26,0.2) 100%
  );
}
body.ltr .hero-gradient {
  background: linear-gradient(
    to left,
    rgba(11,13,26,0.98) 0%,
    rgba(11,13,26,0.7) 50%,
    rgba(11,13,26,0.2) 100%
  );
}
.hero-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 0 60px;
}
.hero-content .container {
  display: flex;
  align-items: flex-end;
  gap: 30px;
}
.hero-poster {
  flex-shrink: 0;
  width: 160px;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
  border: 2px solid rgba(255,255,255,0.1);
}
.hero-poster img { width: 100%; height: 240px; object-fit: cover; }
.hero-info { flex: 1; }
.hero-badges { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.hero-title {
  font-size: clamp(22px, 3.5vw, 36px);
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 10px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}
.hero-meta {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.hero-meta span { font-size: 13px; color: var(--text-secondary); display: flex; align-items: center; gap: 5px; }
.hero-meta .rating { color: var(--gold); font-weight: 700; }
.hero-overview {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 580px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 20px;
}
.hero-btns { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-watch {
  display: inline-flex; align-items: center; gap: 8px;
  height: 46px; padding: 0 28px;
  background: var(--accent);
  color: #fff; border-radius: 100px;
  font-size: 15px; font-weight: 700;
  transition: var(--transition);
  box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-watch:hover { background: var(--accent-dark); transform: translateY(-2px); box-shadow: 0 8px 30px var(--accent-glow); }
.btn-info {
  display: inline-flex; align-items: center; gap: 8px;
  height: 46px; padding: 0 24px;
  background: rgba(255,255,255,0.1);
  color: #fff; border-radius: 100px;
  font-size: 15px; font-weight: 600;
  border: 1px solid rgba(255,255,255,0.2);
  transition: var(--transition);
  backdrop-filter: blur(10px);
}
.btn-info:hover { background: rgba(255,255,255,0.2); transform: translateY(-2px); }

/* Hero controls */
.hero-controls {
  position: absolute;
  bottom: 20px;
  left: 50%; transform: translateX(-50%);
  display: flex; gap: 8px;
  z-index: 10;
}
.hero-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  transition: var(--transition);
  cursor: pointer;
}
.hero-dot.active { background: var(--accent); width: 24px; border-radius: 4px; }
.hero-arrow {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  z-index: 10;
  width: 44px; height: 44px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 16px;
  cursor: pointer;
  transition: var(--transition);
  backdrop-filter: blur(10px);
}
.hero-arrow:hover { background: var(--accent); border-color: var(--accent); }
.hero-arrow.prev { right: 20px; }
.hero-arrow.next { left: 20px; }
body.ltr .hero-arrow.prev { right: auto; left: 20px; }
body.ltr .hero-arrow.next { left: auto; right: 20px; }

/* ═══════════════════════════════════════════════════════════
   CONTENT SECTIONS
═══════════════════════════════════════════════════════════ */
.content-section { margin-bottom: 45px; }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 800;
}
.section-title::before {
  content: '';
  display: block;
  width: 4px; height: 22px;
  background: var(--accent);
  border-radius: 4px;
}
.section-title i { color: var(--accent); font-size: 16px; }
.view-all {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  display: flex; align-items: center; gap: 5px;
  transition: var(--transition);
  padding: 6px 14px;
  border: 1px solid var(--border-accent);
  border-radius: 100px;
}
.view-all:hover { background: var(--accent); color: #fff; }

/* ─── Cards Grid ────────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}
.cards-grid.large { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; }

/* ─── Horizontal Scroll Row ─────────────────────────────── */
.cards-row {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 10px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.cards-row::-webkit-scrollbar { display: none; }
.cards-row .card { flex: 0 0 160px; scroll-snap-align: start; }

/* ─── Movie/Series Card ─────────────────────────────────── */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: var(--transition);
  position: relative;
  cursor: pointer;
  display: block;
}
.card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-card), var(--shadow-glow);
}
.card-poster {
  position: relative;
  padding-top: 150%;
  overflow: hidden;
  background: #1a1d30;
}
.card-poster img {
  position: absolute;
  inset: 0; width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.card:hover .card-poster img { transform: scale(1.08); }
.card-poster-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(11,13,26,0.95) 0%, transparent 60%);
  opacity: 0;
  transition: var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.card:hover .card-poster-overlay { opacity: 1; }
.play-icon {
  width: 54px; height: 54px;
  background: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 20px;
  transform: scale(0.8);
  transition: var(--transition);
  box-shadow: 0 4px 20px var(--accent-glow);
  padding-right: 2px; /* optical center for play icon */
}
body.rtl .play-icon { padding-right: 0; padding-left: 2px; }
.card:hover .play-icon { transform: scale(1); }

/* Card badges */
.card-badges {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex; flex-direction: column; gap: 4px;
  z-index: 5;
}
body.ltr .card-badges { right: auto; left: 8px; }
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-hd { background: var(--accent); color: #fff; }
.badge-new { background: var(--green); color: #fff; }
.badge-type { background: rgba(0,0,0,0.75); color: var(--text-secondary); border: 1px solid var(--border); }
.badge-sub { background: var(--gold); color: #000; }

/* Card rating on poster */
.card-rating {
  position: absolute;
  bottom: 8px; left: 8px;
  background: rgba(0,0,0,0.8);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
  display: flex; align-items: center; gap: 3px;
  z-index: 5;
}
body.rtl .card-rating { left: auto; right: 8px; }

/* Card info */
.card-info { padding: 10px 12px 12px; }
.card-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.card-meta span {
  font-size: 11px;
  color: var(--text-muted);
  display: flex; align-items: center; gap: 3px;
}
.card-meta .card-year { color: var(--text-secondary); }

/* Card skeleton loader */
.skeleton {
  background: linear-gradient(90deg, #1a1d30 25%, #252841 50%, #1a1d30 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton-card { height: 280px; }

/* ═══════════════════════════════════════════════════════════
   FILTER TABS
═══════════════════════════════════════════════════════════ */
.filter-bar {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 30px;
}
.filter-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
  overflow-x: auto;
  scrollbar-width: none;
}
.filter-tabs::-webkit-scrollbar { display: none; }
.filter-tab {
  height: 36px;
  padding: 0 18px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: var(--transition);
}
.filter-tab:hover { color: var(--accent); border-color: var(--border-accent); }
.filter-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.advanced-filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.filter-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: block;
}
.filter-group { position: relative; }
.filter-select {
  height: 36px;
  padding: 0 32px 0 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238892a4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  text-align: center;
  min-width: 130px;
  transition: var(--transition);
}
body.rtl .filter-select {
  padding: 0 14px 0 32px;
  background-position: left 12px center;
}
.filter-select:focus { outline: none; border-color: var(--accent); color: var(--text-primary); }
.filter-select option { background: #1a1d30; }

/* ═══════════════════════════════════════════════════════════
   DETAIL PAGE — MOVIE / SERIES
═══════════════════════════════════════════════════════════ */
.detail-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 100vh;
  background-size: cover;
  background-position: center;
  opacity: 0.08;
  z-index: -1;
  filter: blur(4px);
}
.detail-hero {
  display: flex;
  gap: 40px;
  padding: 30px 0 40px;
  align-items: flex-start;
}
.detail-poster {
  flex-shrink: 0;
  width: 220px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border: 2px solid var(--border);
}
.detail-poster img { width: 100%; aspect-ratio: 2/3; object-fit: cover; display: block; }
.detail-info { flex: 1; min-width: 0; }
.detail-title {
  font-size: clamp(22px, 3vw, 36px);
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 6px;
}
.detail-original-title { font-size: 14px; color: var(--text-muted); margin-bottom: 14px; }
.detail-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 13px;
  color: var(--text-secondary);
}
.meta-badge.highlight { border-color: var(--accent); color: var(--accent); }
.meta-badge i { font-size: 12px; }
.rating-stars { color: var(--gold); }
.detail-genres { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.genre-tag {
  padding: 5px 14px;
  background: rgba(157,78,221,0.1);
  border: 1px solid var(--border-accent);
  border-radius: 100px;
  font-size: 12px;
  color: var(--accent);
  transition: var(--transition);
}
.genre-tag:hover { background: var(--accent); color: #fff; }
.detail-overview {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 24px;
  max-width: 700px;
}
.detail-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 10px;
  height: 50px; padding: 0 30px;
  background: var(--accent);
  color: #fff; border-radius: 100px;
  font-size: 16px; font-weight: 700;
  transition: var(--transition);
  box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-2px); }
.btn-secondary {
  display: inline-flex; align-items: center; gap: 10px;
  height: 50px; padding: 0 24px;
  background: var(--bg-card);
  color: var(--text-primary); border-radius: 100px;
  font-size: 15px; font-weight: 600;
  border: 1px solid var(--border);
  transition: var(--transition);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

/* ─── Player Section ────────────────────────────────────── */
.player-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 30px;
}
.player-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 12px;
}
.player-title { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.player-title i { color: var(--accent); }
.server-list { display: flex; gap: 8px; flex-wrap: wrap; }
.server-btn {
  height: 32px;
  padding: 0 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition);
}
.server-btn:hover { border-color: var(--accent); color: var(--accent); }
.server-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.player-wrapper {
  position: relative;
  padding-top: 56.25%;
  background: #000;
}
.player-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  border: none;
}
.player-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: #000;
  color: var(--text-secondary);
  font-size: 15px;
}
.spinner {
  width: 46px; height: 46px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Episodes ──────────────────────────────────────────── */
.seasons-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.season-tab {
  height: 36px;
  padding: 0 18px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: var(--transition);
}
.season-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.episodes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.episode-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}
.episode-card:hover, .episode-card.active {
  border-color: var(--accent);
  background: var(--card-hover);
}
.episode-thumb {
  flex-shrink: 0;
  width: 80px; height: 50px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-secondary);
  position: relative;
}
.episode-thumb img { width: 100%; height: 100%; object-fit: cover; }
.episode-num {
  position: absolute;
  bottom: 3px; right: 3px;
  background: rgba(0,0,0,0.8);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--accent);
}
body.rtl .episode-num { right: auto; left: 3px; }
.episode-info { flex: 1; min-width: 0; }
.episode-title { font-size: 12px; font-weight: 700; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.episode-sub { font-size: 11px; color: var(--text-muted); }

/* ─── Cast ──────────────────────────────────────────────── */
.cast-grid {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
}
.cast-grid::-webkit-scrollbar { display: none; }
.cast-card { flex: 0 0 100px; text-align: center; }
.cast-photo {
  width: 80px; height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  margin: 0 auto 8px;
  transition: var(--transition);
}
.cast-card:hover .cast-photo { border-color: var(--accent); }
.cast-name { font-size: 11px; font-weight: 600; line-height: 1.3; }
.cast-role { font-size: 10px; color: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════
   SEARCH PAGE
═══════════════════════════════════════════════════════════ */
.search-hero {
  text-align: center;
  padding: 40px 20px 30px;
}
.search-hero h1 { font-size: 28px; font-weight: 900; margin-bottom: 8px; }
.search-hero p { color: var(--text-muted); margin-bottom: 24px; }
.search-main {
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}
.search-main input {
  width: 100%;
  height: 56px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 100px;
  padding: 0 60px 0 24px;
  color: var(--text-primary);
  font-size: 16px;
  transition: var(--transition);
}
body.rtl .search-main input { padding: 0 24px 0 60px; }
.search-main input:focus { outline: none; border-color: var(--accent); }
.search-main-btn {
  position: absolute;
  right: 8px; top: 50%; transform: translateY(-50%);
  width: 42px; height: 42px;
  background: var(--accent);
  border-radius: 50%;
  color: #fff; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
body.rtl .search-main-btn { right: auto; left: 8px; }
.search-main-btn:hover { background: var(--accent-dark); }
.search-filter-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 16px;
}
.type-filter-btn {
  height: 36px; padding: 0 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 13px; font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition);
}
.type-filter-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ═══════════════════════════════════════════════════════════
   PAGINATION
═══════════════════════════════════════════════════════════ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 30px 0;
}
.page-btn {
  width: 38px; height: 38px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px; font-weight: 600;
  transition: var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.page-btn.ellipsis { pointer-events: none; color: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════════════════ */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  margin-top: 60px;
}
.footer-main {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  padding: 50px 0 40px;
  direction: ltr; /* brand always left */
}
.footer-brand { direction: rtl; } /* text inside brand is still RTL-aware */
body.ltr .footer-brand { direction: ltr; }
.footer-brand .logo { margin-bottom: 16px; display: inline-flex; }
.footer-desc { font-size: 13px; color: var(--text-muted); line-height: 1.8; max-width: 280px; }
.footer-social { display: flex; gap: 10px; margin-top: 20px; }
.social-btn {
  width: 36px; height: 36px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 15px;
  transition: var(--transition);
}
.social-btn:hover { color: #fff; border-color: var(--accent); background: var(--accent); }
.footer-col h4 {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--text-primary);
  position: relative;
  padding-bottom: 10px;
}
.footer-col h4::after {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  width: 30px; height: 2px;
  background: var(--accent);
  border-radius: 2px;
}
body.ltr .footer-col h4::after { right: auto; left: 0; }
.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-links a {
  font-size: 13px;
  color: var(--text-muted);
  transition: var(--transition);
  display: flex; align-items: center; gap: 6px;
}
.footer-links a:hover { color: var(--accent); padding-right: 4px; }
body.ltr .footer-links a:hover { padding-right: 0; padding-left: 4px; }
.footer-links a i { font-size: 11px; color: var(--accent); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 18px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.footer-bottom p { font-size: 12px; color: var(--text-muted); }
.disclaimer-text {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════
   EMPTY / ERROR STATES
═══════════════════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state i { font-size: 60px; margin-bottom: 16px; color: var(--text-muted); opacity: 0.5; }
.empty-state h3 { font-size: 20px; font-weight: 700; margin-bottom: 8px; color: var(--text-secondary); }
.empty-state p { font-size: 14px; }

/* ─── Toast ─────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 30px;
  left: 30px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
body.rtl .toast-container { left: auto; right: 30px; }
.toast {
  padding: 12px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow-card);
  animation: slideInToast 0.3s ease;
  max-width: 320px;
}
.toast.success { border-color: var(--green); }
.toast.error { border-color: var(--red); }
.toast i { font-size: 16px; }
.toast.success i { color: var(--green); }
.toast.error i { color: var(--red); }
@keyframes slideInToast {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
body.rtl .toast { animation-name: slideInToastRtl; }
@keyframes slideInToastRtl {
  from { transform: translateX(-100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ─── Back to Top ───────────────────────────────────────── */
.back-top {
  position: fixed;
  bottom: 30px;
  left: 30px;
  width: 42px; height: 42px;
  background: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 16px;
  cursor: pointer;
  opacity: 0; pointer-events: none;
  transition: var(--transition);
  box-shadow: 0 4px 15px var(--accent-glow);
  z-index: 500;
}
body.rtl .back-top { left: auto; right: 30px; }
.back-top.visible { opacity: 1; pointer-events: auto; }
.back-top:hover { transform: translateY(-3px); }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
  .footer-main { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .hero-section { height: 460px; }
  .hero-poster { display: none; }
  .detail-hero { flex-direction: column; }
  .detail-poster { width: 160px; }
}
@media (max-width: 768px) {
  :root { --header-h: 60px; }
  .header-search { max-width: 200px; }
  .menu-toggle { display: flex; }
  .bottom-nav { display: none; }
  .hero-section { height: 380px; }
  .hero-title { font-size: 20px; }
  .hero-overview { display: none; }
  .hero-btns .btn-info { display: none; }
  .cards-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
  .footer-main { grid-template-columns: 1fr 1fr; gap: 24px; }
  .footer-brand { grid-column: 1/-1; }
  .footer-bottom { justify-content: center; text-align: center; }
  .hero-arrow { display: none; }
}
@media (max-width: 480px) {
  .container { padding: 0 14px; }
  .hero-section { height: 320px; }
  .cards-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .cards-row .card { flex: 0 0 130px; }
  .header-search { max-width: 160px; }
  .footer-main { grid-template-columns: 1fr; }
  .detail-hero { gap: 20px; }
}

/* ─── Utility Classes ───────────────────────────────────── */
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.text-gold { color: var(--gold); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.fw-bold { font-weight: 700; }
.fw-black { font-weight: 900; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.d-flex { display: flex; } .align-center { align-items: center; } .gap-2 { gap: 8px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* Schedule Styles */
.schedule-days::-webkit-scrollbar { display: none; }
.schedule-day {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 60px; cursor: pointer; color: #555; transition: 0.3s ease;
  position: relative; padding-bottom: 15px;
}
.schedule-day:hover { color: #aaa; }
.schedule-day.active { color: #fff; }
.schedule-day.active::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 3px; background: #fff; border-radius: 2px;
}
.schedule-day .sd-month { font-size: 11px; text-transform: uppercase; font-weight: bold; letter-spacing: 1px; margin-bottom: 4px; }
.schedule-day .sd-day { font-size: 28px; font-weight: 800; text-transform: uppercase; line-height: 1; }

.schedule-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,0.03);
  transition: 0.2s ease; border-radius: 6px;
  cursor: pointer;
}
.schedule-item:hover { background: rgba(255,255,255,0.03); }
.schedule-time { width: 90px; color: #888; font-size: 14px; font-weight: bold; flex-shrink: 0; }
.schedule-title { flex: 1; font-size: 15px; color: #ddd; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 20px; }
body.rtl .schedule-title { padding-right: 0; padding-left: 20px; }
.schedule-item:hover .schedule-title { color: #fff; }
.schedule-ep { 
  background: rgba(255,255,255,0.05); padding: 6px 14px; border-radius: 20px; 
  font-size: 12px; color: #aaa; display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.schedule-item:hover .schedule-ep { background: rgba(255,255,255,0.1); color: #fff; }

@media(max-width: 768px) {
  .schedule-item { flex-wrap: wrap; padding: 12px 10px; }
  .schedule-title { flex: 1 1 100%; order: -1; margin-bottom: 8px; font-size: 14px; }
  .schedule-time { width: auto; font-size: 13px; }
}
