/* ═══════════════════════════════════════════════════
   سينما فاطمة — Premium Dark Feminine Theme (Netflix Style)
   ═══════════════════════════════════════════════════ */

@import url("https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800;900&family=Noto+Naskh+Arabic:wght@400;500;600;700&display=swap");

:root {
  --bg:          #140b10;
  --bg-warm:     #1b0e15;
  --bg-card:     #22121a;
  --bg-glass:    rgba(34, 18, 26, 0.75);
  --bg-hero:     linear-gradient(180deg, transparent 0%, #140b10 100%);

  --rose:        #f06292;
  --rose-deep:   #d81b60;
  --rose-soft:   #f8bbd0;
  --rose-pale:   #311c24;
  --rose-glow:   rgba(240, 98, 146, 0.35);

  --gold:        #ffb74d;
  --gold-soft:   #ffe082;
  
  --text:        #fff0f5;
  --text-soft:   #f48fb1;
  --text-muted:  #f8bbd0;
  --text-faint:  #885d6b;

  --border:      rgba(240, 98, 146, 0.25);
  --border-hover:rgba(240, 98, 146, 0.55);

  --shadow-sm:   0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md:   0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-lg:   0 20px 60px rgba(0, 0, 0, 0.7);
  --shadow-card: 0 4px 20px rgba(240, 98, 146, 0.1);
  --shadow-glow: 0 8px 40px rgba(240, 98, 146, 0.4);

  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   20px;
  --radius-xl:   30px;
  --radius-full: 999px;

  --font:        "Tajawal", "Segoe UI", system-ui, sans-serif;
  --font-display:"Tajawal", sans-serif;

  --ease:        cubic-bezier(0.4, 0, 0.2, 1);
  --transition:  0.3s var(--ease);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; background-color: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font);
  font-weight: 400;
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
img { display: block; max-width: 100%; object-fit: cover; }

/* ── Floating Bottom Nav (Mobile) / Side Nav (Desktop) ── */
.glass-nav {
  position: fixed;
  z-index: 100;
  background: linear-gradient(135deg, rgba(26, 19, 26, 0.75), rgba(15, 10, 15, 0.85));
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 20px;
}

@media (max-width: 768px) {
  .glass-nav {
    bottom: 12px;
    left: 20px;
    right: 20px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 10px 20px;
    justify-content: space-around;
  }
  .nav-item span { display: none; }
  .nav-item svg { width: 26px; height: 26px; }
}
@media (min-width: 769px) {
  body { padding-top: 80px; }
  .glass-nav {
    top: 0;
    left: 0;
    right: 0;
    padding: 12px 40px;
    border-radius: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    border-top: none;
    border-left: none;
    border-right: none;
    justify-content: space-between;
  }
}

.nav-item {
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.3s ease;
}
.nav-item i { font-size: 1.4rem; }
.nav-item:hover, .nav-item.active {
  color: var(--text);
  transform: translateY(-2px);
}
.nav-item.active { color: var(--rose); }

.nav-links {
  display: flex;
  gap: 30px;
  align-items: center;
}

/* ── Hero Banner ── */
.hero-banner {
  position: relative;
  width: 100%;
  height: 75vh;
  min-height: 500px;
  background-size: cover;
  background-position: center top;
  display: flex;
  align-items: flex-end;
  padding: 40px;
}
@media (max-width: 768px) {
  .hero-banner { height: 60vh; padding: 20px; }
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, var(--bg) 0%, rgba(15,12,16,0.5) 50%, transparent 100%);
}
.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
}
.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  margin: 0 0 10px;
  text-shadow: 0 4px 20px rgba(0,0,0,0.8);
  line-height: 1.1;
}
.hero-meta {
  display: flex;
  gap: 15px;
  align-items: center;
  margin-bottom: 20px;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-soft);
}
.hero-meta .badge {
  background: var(--rose);
  color: #fff;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
}
.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--rose);
  color: #fff;
  padding: 12px 32px;
  border-radius: var(--radius-full);
  font-size: 1.1rem;
  font-weight: 700;
  transition: var(--transition);
  box-shadow: var(--shadow-glow);
}
.hero-btn:hover {
  transform: scale(1.05);
  background: var(--rose-soft);
  color: var(--bg);
}

/* ── Horizontal Scroll Rows ── */
.row-container {
  margin: 40px 0;
  padding-right: 40px; /* RTL */
}
@media (max-width: 768px) {
  .row-container { padding-right: 20px; margin: 20px 0; }
}
.row-header {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 15px;
  color: var(--text);
}
.row-scroll {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 30px;
  padding-top: 20px;
  padding-left: 40px; /* Space at end */
}
@media (max-width: 768px) {
  .row-scroll { padding-left: 20px; gap: 15px; }
}
.row-scroll::-webkit-scrollbar { height: 6px; }
.row-scroll::-webkit-scrollbar-track { background: transparent; }
.row-scroll::-webkit-scrollbar-thumb { background: var(--rose-pale); border-radius: 10px; }

.movie-card {
  flex: 0 0 auto;
  width: 200px;
  scroll-snap-align: start;
  position: relative;
  transition: var(--transition);
}
@media (max-width: 768px) {
  .movie-card { width: 140px; }
}
.movie-poster {
  width: 100%;
  aspect-ratio: 2/3;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}
.movie-card:hover .movie-poster {
  transform: scale(1.05) translateY(-5px);
  box-shadow: var(--shadow-glow);
  border: 2px solid var(--rose);
}
.movie-info {
  margin-top: 10px;
}
.movie-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.movie-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}
.listing-page {
  padding: 40px;
}
.listing-head {
  margin-bottom: 30px;
}
.listing-head h1 {
  color: var(--text);
  font-size: 2rem;
  margin: 0 0 5px;
}
.listing-head p {
  color: var(--text-muted);
  margin: 0;
}
.listing-card {
  width: 100%;
  text-decoration: none;
}
.listing-card .movie-title {
  color: var(--text);
}
.listing-empty {
  color: var(--text-muted);
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

/* ── Grid Layout ── */
.movie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 25px;
  padding: 40px;
}
@media (max-width: 768px) {
  .movie-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); padding: 20px; gap: 15px; }
}

/* ── Utility ── */
.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--bg-card);
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--rose);
}
.badge-gold {
  background: var(--gold);
  color: #000;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: bold;
  font-size: 0.8rem;
}

/* ── Custom Pages ── */
.title-page {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}
.title-banner {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 430px;
  background-size: cover;
  background-position: center top;
  z-index: -1;
  opacity: .9;
}
.title-banner-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 82% 18%, rgba(200, 107, 133, .22), transparent 34%),
    linear-gradient(0deg, var(--bg) 0%, rgba(15,12,16,0.78) 58%, rgba(15,12,16,0.34) 100%);
}
.title-content {
  padding: 78px 40px 28px;
  display: flex;
  gap: 34px;
  align-items: center;
  max-width: 1420px;
  margin-inline: auto;
}
@media (max-width: 768px) {
  .title-content { flex-direction: column; align-items: center; padding: 34px 20px 20px; gap: 20px; text-align: center; }
}
.title-poster {
  width: min(230px, 20vw);
  min-width: 176px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, .14);
}
@media (max-width: 768px) {
  .title-poster { width: 170px; min-width: 0; }
}
.title-details {
  max-width: 820px;
  padding: 22px 0;
}
.title-details h1 {
  font-size: clamp(2rem, 4vw, 3.25rem);
  margin: 0 0 12px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.8);
  line-height: 1.05;
}
.title-meta {
  display: flex;
  gap: 15px;
  color: var(--text-soft);
  font-size: 1rem;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
@media (max-width: 768px) {
  .title-meta { justify-content: center; }
}
.title-story {
  font-size: 1.04rem;
  line-height: 1.8;
  color: var(--text-soft);
  max-width: 800px;
  margin: 0 0 20px;
}

.watch-header {
  padding: 40px 40px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
@media (max-width: 768px) {
  .watch-header { padding: 20px 20px 10px; flex-direction: column; align-items: flex-start; gap: 10px; }
}
.player-container {
  width: min(1180px, calc(100% - 120px));
  margin: 0 auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  background: #000;
}
.player-wrap {
  position: relative;
  max-height: 75vh;
}
.player-wrap .plyr,
.player-wrap .plyr--video {
  width: 100%;
  height: 100%;
}
.player-wrap .plyr__video-wrapper {
  height: 100%;
}
/* In fullscreen, allow full dimensions */
.plyr--fullscreen-fallback {
  max-height: none !important;
}
.plyr:fullscreen {
  max-height: none !important;
}
@media (max-width: 768px) {
  .player-container { width: calc(100% - 40px); margin: 0 20px; border-radius: var(--radius-md); }
  .player-wrap { max-height: 50vh; }
}

/* ══════════════════════════════════════════
   Plyr Video Player Customization
   ══════════════════════════════════════════ */
:root {
  --plyr-color-main: var(--rose);
  --plyr-video-control-color-hover: #fff;
  --plyr-video-control-background-hover: var(--rose);
  --plyr-font-family: var(--font);
  --plyr-captions-background: transparent;
  --plyr-captions-text-color: var(--subtitle-color, #fff);
}
.plyr--video {
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: #000;
}
.plyr__control--overlaid {
  background: var(--rose) !important;
  box-shadow: 0 0 20px rgba(200, 107, 133, 0.5) !important;
}
.plyr__control--overlaid:hover {
  background: var(--rose-deep) !important;
}
.plyr__menu__container .plyr__control[role=menuitemradio][aria-checked=true]::before {
  background: var(--rose) !important;
}

/* ── Search Bar ── */
.nav-search {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 5px 15px;
  transition: var(--transition);
}
.nav-search input {
  background: transparent;
  border: none;
  color: var(--text);
  outline: none;
  width: 150px;
  transition: var(--transition);
}
.nav-search input:focus {
  width: 200px;
}
@media (max-width: 768px) {
  .nav-search { display: none; }
}

/* ── Mobile Header for Search & Logo ── */
.mobile-top-bar {
  display: none;
}
@media (max-width: 768px) {
  .mobile-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: linear-gradient(135deg, rgba(26, 19, 26, 0.8), rgba(15, 10, 15, 0.9));
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
  }
  body {
    padding-top: 60px;
    padding-bottom: 80px;
  }
  .mobile-top-bar .nav-search {
    display: flex;
  }
  .mobile-top-bar .nav-search input { width: 100px; }
  .mobile-top-bar .nav-search input:focus { width: 140px; }
  .glass-nav .logo-container { display: none; }
}

.nav-item svg { width: 22px; height: 22px; fill: currentColor; transition: transform 0.3s ease; }
.nav-item.active svg { fill: var(--rose); }

.season-browser {
  margin: 24px 0 56px;
  padding-inline: 40px;
}
.watch-season-browser {
  margin-top: 18px;
}
.season-tabs {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 18px;
  min-height: 44px;
  padding-inline: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, .22);
  overflow-x: auto;
  scrollbar-width: none;
}
.season-tabs::-webkit-scrollbar { display: none; }
.season-tabs-label {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: .82rem;
  font-weight: 800;
}
.season-tab {
  flex: 0 0 auto;
  position: relative;
  padding: 0 2px 11px;
  border: 0;
  border-radius: 0;
  color: var(--text-faint);
  background: transparent;
  cursor: pointer;
  font-size: .78rem;
  font-weight: 900;
  line-height: 1;
  transition: color var(--transition), transform var(--transition);
}
.season-tab:hover {
  color: var(--text-soft);
  transform: translateY(-1px);
}
.season-tab.active {
  color: #fff;
}
.season-tab.active::after {
  content: "";
  position: absolute;
  inset-inline: -10px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 0 24px rgba(200, 107, 133, .55);
}
.single-season-label {
  justify-content: flex-start;
  flex-direction: row;
  color: var(--text);
  font-size: .9rem;
  font-weight: 900;
}
.season-panel[hidden] { display: none; }
.episode-strip {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 26px 0 14px;
}
.episode-strip::-webkit-scrollbar { height: 6px; }
.episode-strip::-webkit-scrollbar-track { background: transparent; }
.episode-strip::-webkit-scrollbar-thumb { background: var(--rose-pale); border-radius: 999px; }
.episode-tile {
  flex: 0 0 min(22vw, 238px);
  min-width: 190px;
  scroll-snap-align: start;
  display: grid;
  gap: 10px;
  color: var(--text-muted);
}
.episode-thumb-wrap {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 16px;
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(255, 255, 255, .06);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.episode-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.95) brightness(.86);
}
.episode-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .28));
  opacity: 0;
  font-weight: 900;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .8);
  transition: opacity var(--transition);
}
.episode-tile:hover .episode-thumb-wrap,
.episode-tile.active .episode-thumb-wrap {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, .88);
  box-shadow: var(--shadow-glow);
}
.episode-tile:hover .episode-play,
.episode-tile.active .episode-play {
  opacity: 1;
}
.episode-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: .95rem;
  font-weight: 900;
}
.episode-line strong {
  color: var(--text-soft);
}
.episode-tile.active .episode-line strong {
  color: #fff;
}
.episode-line small {
  color: var(--text-muted);
  direction: ltr;
}
.season-empty {
  margin: 0;
  padding: 22px;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
@media (max-width: 768px) {
  .season-browser { padding-inline: 20px; margin: 18px 0 40px; }
  .season-tabs { gap: 14px; min-height: 42px; }
  .season-tab { font-size: .78rem; padding-bottom: 10px; }
  .episode-strip { gap: 14px; padding-top: 20px; }
  .episode-tile { flex-basis: 56vw; min-width: 164px; max-width: 210px; }
}
@media (max-width: 420px) {
  .episode-tile { flex-basis: 52vw; min-width: 150px; }
}

.history-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}
.history-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-weight: 800;
}
.history-clear {
  border: 0;
  padding: 9px 18px;
  font-size: .92rem;
  cursor: pointer;
  box-shadow: none;
}
.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
  gap: 14px;
}
.history-card {
  position: relative;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.history-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-glow);
}
.history-card-link {
  display: grid;
  color: inherit;
  text-decoration: none;
}
.history-poster-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--rose-pale);
}
.history-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.95) brightness(.9);
}
.history-continue {
  position: absolute;
  inset-inline-start: 8px;
  bottom: 8px;
  padding: 4px 8px;
  border-radius: var(--radius-full);
  color: #fff;
  background: rgba(0, 0, 0, .58);
  backdrop-filter: blur(8px);
  font-size: .72rem;
  font-weight: 900;
}
.history-card .progress-bar {
  margin: 0;
  height: 4px;
  border-radius: 0;
  background: rgba(255, 255, 255, .08);
}
.history-info {
  display: grid;
  gap: 2px;
  padding: 9px 10px 10px;
}
.history-info strong {
  color: var(--text);
  font-size: .9rem;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-info small {
  color: var(--text-muted);
  font-size: .76rem;
  line-height: 1.35;
  min-height: 1.25em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-info em {
  color: var(--rose-soft);
  font-size: .7rem;
  font-style: normal;
  font-weight: 800;
}
.history-remove {
  position: absolute;
  top: 7px;
  inset-inline-end: 7px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, .65);
  cursor: pointer;
  font-size: .95rem;
  z-index: 2;
}
@media (max-width: 768px) {
  .history-head {
    align-items: start;
    flex-direction: column;
  }
  .history-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}
@media (max-width: 420px) {
  .history-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .history-info {
    padding: 8px;
  }
  .history-info strong {
    font-size: .82rem;
  }
  .history-info small,
  .history-info em {
    font-size: .68rem;
  }
}

/* ══════════════════════════════════════════
   Player UI — Subtitle Modal, Audio Popover,
   Buffering Spinner, Freeze Overlay, Cues
   ══════════════════════════════════════════ */

/* ── Fatima Spinner (buffering indicator) ── */
.fatima-spinner {
  display: none;
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 64px; height: 64px;
  z-index: 50;
  pointer-events: none;
}

.fatima-spinner::before, .fatima-spinner::after {
  content: '';
  position: absolute;
  border-radius: 50%;
}
.fatima-spinner::before {
  inset: 0;
  border: 5px solid rgba(240, 98, 146, 0.15);
  border-top-color: var(--rose, #f06292);
  border-bottom-color: var(--rose, #f06292);
  animation: fatima-spin 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
  box-shadow: 0 0 15px rgba(240, 98, 146, 0.4);
}
.fatima-spinner::after {
  inset: 12px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-left-color: #ffffff;
  border-right-color: #ffffff;
  animation: fatima-spin-reverse 1.5s linear infinite;
}
 100% { transform: rotate(360deg); } }
 100% { transform: rotate(-360deg); } }

/* ── Player Controls Visibility Visibility ── */
@media (max-width: 768px) and (orientation: portrait) {
  /* On mobile portrait: show only play, progress, settings, and fullscreen */
  .plyr__controls > *:not([data-plyr="play"]):not(.plyr__progress):not(.plyr__menu):not([data-plyr="fullscreen"]) {
    display: none !important;
  }
}


/* ── Freeze Overlay (quality switch) ── */
.freeze-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 9999;
  object-fit: contain;
  pointer-events: none;
  background: #08040a;
}

/* ── Subtitle Cue Styling ── */
::cue {
  font-size: var(--subtitle-size, 220%);
  color: var(--subtitle-color, #fff);
  font-family: var(--subtitle-font, "Cairo", "Noto Naskh Arabic", Tahoma, Arial, sans-serif);
  text-shadow: var(--subtitle-shadow, 0 0 4px #000, 0 0 8px #000, 0 0 14px #000, 0 0 22px #000, 0 0 34px #000, 0 0 50px #000, 0 2px 2px #000, 0 4px 6px #000, 2px 2px 4px #000, -2px -2px 4px #000);
  background: transparent !important;
  background-color: transparent !important;
  font-weight: 700;
  line-height: 1.5;
  direction: rtl;
  outline: none;
  -webkit-text-stroke: 0;
}
video::cue {
  font-size: var(--subtitle-size, 220%);
  color: var(--subtitle-color, #fff);
  font-family: var(--subtitle-font, "Cairo", "Noto Naskh Arabic", Tahoma, Arial, sans-serif);
  text-shadow: var(--subtitle-shadow, 0 0 4px #000, 0 0 8px #000, 0 0 14px #000, 0 0 22px #000, 0 0 34px #000, 0 0 50px #000, 0 2px 2px #000, 0 4px 6px #000, 2px 2px 4px #000, -2px -2px 4px #000);
  background: transparent !important;
  background-color: transparent !important;
  font-weight: 700;
}

/* ── Subtitle Settings Modal ── */
.subtitle-modal-overlay {
  position: absolute;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.subtitle-modal-overlay[hidden] {
  display: none !important;
}
.subtitle-modal-overlay.subtitle-modal-visible {
  opacity: 1;
  pointer-events: auto;
}

.subtitle-modal-card {
  background: linear-gradient(145deg, rgba(30, 18, 37, 0.95), rgba(22, 13, 24, 0.95));
  border: 1px solid rgba(240, 98, 146, 0.25);
  border-radius: 16px;
  width: auto;
  min-width: 320px;
  max-width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  color: #fff;
  direction: rtl;
  font-family: "Tajawal", sans-serif;
  transform: scale(0.95);
  transition: transform 0.25s ease;
}

@media (max-width: 768px) {
  .subtitle-modal-card {
    min-width: 0;
    width: 85%;
    max-height: 50vh;
    border-radius: 12px;
  }
  .subtitle-modal-header {
    padding: 8px 15px;
  }
  .subtitle-modal-header strong {
    font-size: 0.9rem;
  }
  .subtitle-modal-body {
    padding: 10px 15px 15px;
    gap: 10px 15px;
  }
  .smod-label {
    font-size: 0.75rem;
  }
  .smod-btn {
    padding: 5px 10px;
    font-size: 0.75rem;
  }
  .smod-value {
    font-size: 0.75rem;
  }
  .smod-swatch {
  min-width: 40px !important;
  min-height: 24px !important;
  width: 40px !important;
  height: 24px !important;
  border-radius: 4px;
  border: 2px solid transparent;
  cursor: pointer;
  flex-shrink: 0 !important;
  padding: 0;
  display: inline-block !important;
  margin: 0 4px;
}
}

.subtitle-modal-overlay.subtitle-modal-visible .subtitle-modal-card {
  transform: scale(1);
}

.subtitle-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.subtitle-modal-header strong {
  font-size: 1.05rem;
  color: #f8bbd0;
}
.subtitle-modal-close {
  background: none;
  border: none;
  color: #f8bbd0;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: all 0.2s ease;
}
.subtitle-modal-close:hover {
  background: rgba(240, 98, 146, 0.2);
  color: #fff;
}

.subtitle-modal-body {
  padding: 15px 20px 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px 20px;
}
@media (max-width: 480px) {
  .subtitle-modal-body {
    grid-template-columns: 1fr;
  }
}

.smod-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 100px;
}
.smod-label {
  font-size: 0.85rem;
  color: #f8bbd0;
  font-weight: 700;
}
.smod-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.smod-btn {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e0c0cc;
  padding: 7px 14px;
  border-radius: 10px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}
.smod-btn:hover {
  background: rgba(240, 98, 146, 0.15);
  border-color: rgba(240, 98, 146, 0.4);
  color: #fff;
}
.smod-btn.smod-active {
  background: rgba(240, 98, 146, 0.25);
  border-color: var(--rose, #f06292);
  color: #fff;
  box-shadow: 0 0 12px rgba(240, 98, 146, 0.2);
}
.smod-step {
  min-width: 42px;
  text-align: center;
  font-weight: 700;
}
.smod-value {
  color: #fff;
  font-size: 0.85rem;
  min-width: 40px;
  text-align: center;
  font-weight: 600;
}
.smod-reset {
  font-size: 1rem;
  min-width: 38px;
}

/* Color swatches */
.smod-colors {
  display: flex;
  gap: 8px;
  align-items: center;

  gap: 10px;
}
.smod-swatch {
  min-width: 40px !important;
  min-height: 24px !important;
  width: 40px !important;
  height: 24px !important;
  border-radius: 4px;
  border: 2px solid transparent;
  cursor: pointer;
  flex-shrink: 0 !important;
  padding: 0;
  display: inline-block !important;
  margin: 0 4px;
}
.smod-swatch:hover {
  transform: scale(1.15);
  border-color: rgba(255, 255, 255, 0.5);
}
.smod-swatch.smod-active {
  border-color: #fff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

/* ── Audio Track Popover ── */
.audio-track-control {
  position: relative;
  direction: rtl;
}
.audio-track-button {
  font-size: 0.82rem !important;
  padding: 4px 10px !important;
}
.audio-track-button span {
  font-size: 0.82rem;
  font-weight: 700;
}
.audio-track-popover {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  min-width: 150px;
  padding: 7px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 14px 32px rgba(45, 20, 31, .22);
  color: #111;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.audio-track-popover[hidden] {
  display: none !important;
}
.audio-track-popover button {
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  color: #333;
  background: transparent;
  cursor: pointer;
  text-align: right;
  font-size: 0.88rem;
  transition: all 0.2s ease;
  font-family: inherit;
  font-weight: 600;
}
.audio-track-popover button:hover,
.audio-track-popover button.active {
  color: #fff;
  background: var(--rose);
}

/* ── Subtitle Style Button ── */
.subtitle-style-control {
  position: relative;
}
.subtitle-style-button {
  font-size: 0.82rem !important;
  padding: 4px 10px !important;
}
.subtitle-style-button span {
  font-size: 0.82rem;
}

/* ── External Audio Active State ── */
.plyr.external-audio-active [data-plyr="volume"] {
  --plyr-range-fill-background: var(--rose, #f06292);
}


/* Modal and Episode Overlays */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(0, 0, 0, 0.75);
  display: none;
  overflow-y: auto;
  backdrop-filter: blur(5px);
  text-align: center;
}
.modal-overlay::before {
  content: "";
  display: inline-block;
  height: 100%;
  vertical-align: middle;
  margin-right: -4px;
}
.modal-content {
  display: inline-block;
  vertical-align: middle;
  text-align: right;
  margin: 40px auto;
  background: var(--bg-card);
  padding: 30px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: 400px;
  max-width: 90%;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  animation: modalPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes modalPop {
  0% { transform: scale(0.9); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}


.plyr-container-buffering::before,
.plyr-container-buffering::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    z-index: 60;
    pointer-events: none;
}
.plyr-container-buffering::before {
    top: 50%;
    left: 50%;
    width: 64px;
    height: 64px;
    margin-top: -32px;
    margin-left: -32px;
    border: 5px solid rgba(240, 98, 146, 0.15);
    border-top-color: var(--rose, #f06292);
    border-bottom-color: var(--rose, #f06292);
    animation: fatima-spin 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
    box-shadow: 0 0 15px rgba(240, 98, 146, 0.4);
}
.plyr-container-buffering::after {
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin-top: -20px;
    margin-left: -20px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left-color: #ffffff;
    border-right-color: #ffffff;
    animation: fatima-spin-reverse 1.5s linear infinite;
}
@keyframes fatima-spin {
    to { transform: rotate(360deg); }
}
@keyframes fatima-spin-reverse {
    to { transform: rotate(-360deg); }
}


@media (max-width: 760px) and (orientation: portrait) {
  .plyr__controls [data-plyr="rewind"],
  .plyr__controls .plyr__volume,
  .plyr__controls .plyr__time+.plyr__time {
    display: none;
  }
  .plyr__controls {
    --plyr-control-spacing: 8px;
  }
  .audio-track-button span {
    min-width: 28px;
    font-size: .7rem;
  }
}
