/* ============================================
   NETFLIX CLONE - PREMIUM STYLES
   Netflix-accurate design + Arabic RTL
   ============================================ */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --netflix-red: #E50914;
  --netflix-red-hover: #F40612;
  --netflix-dark-red: #B81D24;
  --netflix-black: #000000;
  --bg-primary: #141414;
  --bg-secondary: #181818;
  --bg-tertiary: #232323;
  --bg-card: #2F2F2F;
  --bg-modal: #181818;
  --text-primary: #FFFFFF;
  --text-secondary: #E5E5E5;
  --text-tertiary: #B3B3B3;
  --text-dim: #808080;
  --border: rgba(255, 255, 255, 0.1);
  --border-hover: rgba(255, 255, 255, 0.3);
  --green-match: #46D369;
  --gold-rating: #FFD700;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 15px 40px rgba(0, 0, 0, 0.7);
  --shadow-xl: 0 25px 70px rgba(0, 0, 0, 0.85);
  --shadow-card-hover: 0 15px 50px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255,255,255,0.1);
  --transition-fast: 0.15s ease;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
  background: var(--bg-primary);
}

body {
  font-family: 'Cairo', 'Helvetica Neue', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
button { background: none; border: none; cursor: pointer; font-family: inherit; color: inherit; }
img { max-width: 100%; display: block; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: #333; border-radius: 5px; border: 2px solid var(--bg-primary); }
::-webkit-scrollbar-thumb:hover { background: var(--netflix-red); }

::selection { background: var(--netflix-red); color: white; }

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 18px 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background-color 0.4s ease;
  background: linear-gradient(180deg, rgba(0,0,0,0.7) 10%, rgba(0,0,0,0));
}

.navbar.scrolled {
  background-color: var(--bg-primary);
}

.nav-left { display: flex; align-items: center; gap: 30px; }

.logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 32px;
  font-weight: 900;
  color: var(--netflix-red);
  letter-spacing: 1px;
  cursor: pointer;
  transition: var(--transition-fast);
  /* Force LTR so Latin letters render N-E-T-F-L-I-X-Y with Y at the right end,
     regardless of the page's RTL direction */
  direction: ltr;
  unicode-bidi: embed;
  display: inline-block;
  white-space: nowrap;
}

.logo:hover { color: var(--netflix-red-hover); }

/* NETFLIXY logo - the "Y" letter (unified, white accent, no box / no rotation) */
.logo-y {
  color: #fff;
  display: inline-block;
  font-size: 1em;
  line-height: 1;
  text-shadow:
    0 0 10px rgba(255, 255, 255, 0.5),
    0 0 20px rgba(229, 9, 20, 0.8),
    0 2px 0 rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease, text-shadow 0.2s ease;
}
.logo:hover .logo-y {
  transform: scale(1.08);
  text-shadow:
    0 0 14px rgba(255, 255, 255, 0.8),
    0 0 28px rgba(229, 9, 20, 1),
    0 2px 0 rgba(0, 0, 0, 0.3);
}

/* Hide the default "U" placeholder in nav-profile when empty (profile-guard injects its own avatar) */
.nav-profile:empty {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #e50914, #b20710);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
}
.nav-profile:empty::before {
  content: '';
  width: 20px;
  height: 20px;
  background: rgba(255,255,255,0.9);
  border-radius: 50%;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z'/></svg>") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z'/></svg>") center / contain no-repeat;
}

.nav-links { display: flex; gap: 22px; list-style: none; }

.nav-links a {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 400;
  transition: color var(--transition-fast);
  position: relative;
}

.nav-links a:hover { color: var(--text-tertiary); }

.nav-links a.active {
  color: var(--text-primary);
  font-weight: 700;
}

/* ========== GENRE DROPDOWN ========== */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}

.nav-dropdown-toggle .fa-caret-down {
  font-size: 10px;
  transition: transform 0.2s ease;
}

.nav-dropdown.open .nav-dropdown-toggle .fa-caret-down,
.nav-dropdown:hover .nav-dropdown-toggle .fa-caret-down {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  min-width: 420px;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 10px 0;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
  z-index: 1000;
  max-height: 70vh;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  list-style: none;
  margin: 0;
}

.nav-dropdown.open .nav-dropdown-menu,
.nav-dropdown:hover .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown-menu li {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-dropdown-menu a {
  display: flex;
  align-items: center;
  padding: 10px 18px;
  color: #e5e5e5 !important;
  font-size: 14px;
  font-weight: 400;
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.nav-dropdown-menu a:hover,
.nav-dropdown-menu a:focus-visible,
.nav-dropdown-menu a.active {
  background: rgba(229, 9, 20, 0.25);
  color: #fff !important;
  outline: none;
}

.nav-dropdown-menu a i {
  margin-left: 10px;
  color: var(--netflix-red);
  width: 18px;
  text-align: center;
  font-size: 13px;
}

/* Row highlight (when scrolled-to via genre param) */
.row {
  position: relative;
}

.row.highlighted .row-title {
  color: var(--netflix-red);
  transition: all 0.3s ease;
}

.row.highlighted::before {
  content: '';
  position: absolute;
  right: 0;
  top: 20px;
  bottom: 10px;
  width: 4px;
  background: var(--netflix-red);
  border-radius: 2px;
  animation: genrePulse 2s ease-out;
  box-shadow: 0 0 20px var(--netflix-red);
}

@keyframes genrePulse {
  0% { opacity: 1; }
  100% { opacity: 0.4; }
}

/* Mobile dropdown - inline within mobile nav drawer */
@media (max-width: 768px) {
  .nav-dropdown {
    width: 100%;
  }
  .nav-dropdown-toggle {
    width: 100%;
    justify-content: space-between !important;
    padding: 12px 0 !important;
  }
  .nav-dropdown-menu {
    position: static !important;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    right: auto;
    left: auto;
    top: auto;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    background: rgba(255, 255, 255, 0.03);
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0;
    padding: 6px 0;
    margin-top: 8px;
    max-height: 0;
    overflow: hidden;
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: max-height 0.3s ease;
    box-shadow: none;
    backdrop-filter: none;
  }
  .nav-dropdown.open .nav-dropdown-menu {
    max-height: 500px;
    padding: 8px 0 12px;
  }
  /* Disable hover-open on mobile (touch devices) */
  .nav-dropdown:hover .nav-dropdown-menu {
    max-height: 0;
  }
  .nav-dropdown.open:hover .nav-dropdown-menu,
  .nav-dropdown.open .nav-dropdown-menu {
    max-height: 500px;
  }
  .nav-dropdown-menu a {
    padding: 10px 12px !important;
    font-size: 13px !important;
    border-bottom: none !important;
  }
  .nav-dropdown-menu a i {
    margin-left: 8px;
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  .nav-dropdown-menu {
    grid-template-columns: 1fr !important;
  }
  .nav-dropdown-menu a {
    padding: 12px 10px !important;
  }
}

.nav-right { display: flex; align-items: center; gap: 22px; }

.nav-search {
  color: white;
  font-size: 18px;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: var(--transition-fast);
}
.nav-search:hover { background: rgba(255,255,255,0.1); }

.nav-profile {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--netflix-red), var(--netflix-dark-red));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: white;
  cursor: pointer;
  transition: var(--transition-fast);
}

.nav-profile:hover { transform: scale(1.08); }

.menu-toggle { display: none; font-size: 22px; color: white; cursor: pointer; }

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  position: relative;
  width: 100%;
  height: 85vh;
  min-height: 650px;
  max-height: 900px;
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  padding: 0 60px;
  margin-bottom: -100px;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(77deg, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0) 85%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 14.7vw;
  background-image: linear-gradient(180deg, transparent, rgba(20, 20, 20, 0.15) 15%, rgba(20, 20, 20, 0.35) 29%, rgba(20, 20, 20, 0.58) 44%, #141414 68%, #141414);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 36%;
  min-width: 450px;
  animation: fadeInUp 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 3px;
  color: var(--text-primary);
  text-transform: uppercase;
}

.n-logo {
  font-family: 'Bebas Neue', sans-serif;
  background: var(--netflix-red);
  color: white;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0;
}

.hero-title {
  font-size: clamp(2.5rem, 5.5vw, 4.5rem);
  font-weight: 900;
  line-height: 1.05;
  margin-bottom: 20px;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.9);
  font-family: 'Bebas Neue', 'Cairo', sans-serif;
  letter-spacing: 1.5px;
}

.hero-meta {
  display: flex;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
  font-size: 15px;
  flex-wrap: wrap;
  color: var(--text-secondary);
}

.match-score { color: var(--green-match); font-weight: 700; }

.hd-badge {
  border: 1px solid rgba(255,255,255,0.4);
  padding: 2px 8px;
  font-size: 11px;
  border-radius: 3px;
  color: var(--text-secondary);
  font-weight: 600;
}

.hero-meta .rating {
  color: var(--gold-rating);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
}

.hero-overview {
  font-size: max(14px, 1.2vw);
  line-height: 1.4;
  margin-bottom: 25px;
  color: var(--text-primary);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
  max-width: 90%;
  font-weight: 400;
}

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.hero-indicators {
  position: absolute;
  right: clamp(14px, 4vw, 60px);
  bottom: max(24px, calc(env(safe-area-inset-bottom, 0px) + 20px));
  display: flex;
  align-items: center;
  gap: clamp(6px, 0.8vw, 10px);
  z-index: 4;
  max-width: min(92vw, 520px);
  padding: 6px 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(0,0,0,0.28), rgba(0,0,0,0.12));
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.indicator {
  width: clamp(18px, 2.2vw, 30px);
  height: clamp(3px, 0.45vw, 4px);
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: width 0.22s ease, background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  border-radius: 999px;
  flex: 0 0 auto;
  min-width: 16px;
}

.indicator:hover {
  background: rgba(255, 255, 255, 0.7);
  transform: translateY(-1px);
}

.indicator.active {
  background: linear-gradient(90deg, #ff2a36, var(--netflix-red));
  width: clamp(28px, 4vw, 50px);
  box-shadow: 0 0 10px rgba(229, 9, 20, 0.55);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 26px;
  border-radius: 4px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
  border: none;
  font-family: inherit;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
}

.btn i { font-size: 22px; }

.btn-primary {
  background: #FFFFFF;
  color: #000000;
}
.btn-primary:hover { background: rgba(255, 255, 255, 0.75); }

.btn-secondary {
  background: rgba(109, 109, 110, 0.7);
  color: white;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.btn-secondary:hover { background: rgba(109, 109, 110, 0.4); }

.btn-netflix { background: var(--netflix-red); color: white; }
.btn-netflix:hover { background: var(--netflix-red-hover); }

.btn-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(42, 42, 42, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.5);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: var(--transition-fast);
}
.btn-circle:hover {
  border-color: white;
  background: rgba(42, 42, 42, 0.9);
}

/* ============================================
   ROWS / CAROUSELS
   ============================================ */
.rows-section {
  position: relative;
  z-index: 3;
  padding: 20px 0 60px;
  background: var(--bg-primary);
}

.row {
  margin-bottom: 3vw;
  padding: 0 60px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.row.visible { opacity: 1; transform: translateY(0); }

.row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.row-title {
  font-size: max(18px, 1.4vw);
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.row-title::before {
  content: '';
  width: 4px;
  height: 20px;
  background: var(--netflix-red);
  border-radius: 2px;
}

.explore-all {
  font-size: 13px;
  color: var(--text-tertiary);
  opacity: 0;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

.explore-all::after {
  content: '›';
  color: var(--netflix-red);
  font-size: 18px;
  transition: transform 0.2s;
}

.row:hover .explore-all { opacity: 1; }
.row:hover .explore-all::after { transform: translateX(-3px); }

.row-wrapper { position: relative; }

.row-content {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 30px 0;
  margin: -30px 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.row-content::-webkit-scrollbar { display: none; }

.scroll-btn {
  position: absolute;
  top: 30px;
  bottom: 30px;
  width: 60px;
  background: rgba(20, 20, 20, 0.5);
  color: white;
  font-size: 30px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s, background 0.2s;
  cursor: pointer;
  backdrop-filter: blur(2px);
}

.row-wrapper:hover .scroll-btn { opacity: 1; }
.scroll-btn:hover { background: rgba(20, 20, 20, 0.9); }
.scroll-left { left: 0; }
.scroll-right { right: 0; }

/* ============================================
   CARDS
   ============================================ */
.card {
  flex: 0 0 auto;
  width: 180px;
  aspect-ratio: 2/3;
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s;
  animation: fadeIn 0.5s ease both;
  background: var(--bg-card);
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.card:hover {
  transform: scale(1.18);
  z-index: 20;
  box-shadow: var(--shadow-card-hover);
  border-radius: 6px;
}

.card-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0,0,0,0.6) 60%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s ease 0.1s;
}

.card:hover .card-info { opacity: 1; }

.card-info h3 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta {
  display: flex;
  gap: 8px;
  font-size: 11px;
  margin-bottom: 8px;
  align-items: center;
  color: var(--text-secondary);
}

.card-meta .rating {
  color: var(--gold-rating);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 600;
}

.card-meta .year { color: var(--text-tertiary); }

.card-buttons { display: flex; gap: 6px; align-items: center; }

.btn-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(42, 42, 42, 0.6);
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-icon:hover {
  background: white;
  color: black;
  border-color: white;
  transform: scale(1.08);
}

.btn-icon.btn-play {
  background: white;
  color: black;
  border-color: white;
}

.btn-icon.btn-play:hover {
  background: rgba(255, 255, 255, 0.8);
}

/* Poster cards */
.card-poster {
  width: 180px;
  aspect-ratio: 2/3;
}

.card-poster .card-info { display: none; }

/* ============================================
   MODAL - DETAILS
   ============================================ */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 2000;
  overflow-y: auto;
  padding: 40px 20px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal.active { display: block; animation: fadeIn 0.3s ease; }

.modal-content {
  max-width: 850px;
  margin: 40px auto;
  background: var(--bg-modal);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-xl);
  animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #181818;
  color: white;
  font-size: 16px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  border: 1px solid rgba(255,255,255,0.15);
  cursor: pointer;
}

.modal-close:hover {
  background: rgba(229, 9, 20, 0.9);
  transform: rotate(90deg);
}

.modal-body { min-height: 400px; }

.loader {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  font-size: 40px;
  color: var(--netflix-red);
}

.modal-hero {
  width: 100%;
  height: 480px;
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 40px;
}

.modal-hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  margin-bottom: 20px;
  font-family: 'Bebas Neue', 'Cairo', sans-serif;
  letter-spacing: 1.5px;
  text-shadow: 2px 2px 8px rgba(0,0,0,0.9);
  line-height: 1.1;
}

.modal-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.modal-details {
  padding: 24px 40px 40px;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 30px;
}

.modal-meta {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 15px;
  color: var(--text-secondary);
}

.modal-overview {
  font-size: 17px;
  line-height: 1.5;
  color: var(--text-primary);
}

.modal-details-side {
  font-size: 14px;
  color: var(--text-secondary);
}

.modal-details-side p {
  margin-bottom: 10px;
  line-height: 1.5;
}

.dim { color: var(--text-tertiary); }

/* ============================================
   TRAILER MODAL
   ============================================ */
.trailer-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 3000;
  justify-content: center;
  align-items: center;
  padding: 40px;
}

.trailer-modal.active { display: flex; }

.trailer-content {
  width: 100%;
  max-width: 1100px;
  aspect-ratio: 16/9;
  position: relative;
  background: black;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 80px rgba(229,9,20,0.3);
}

.trailer-content iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* ============================================
   TOAST
   ============================================ */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-tertiary);
  color: white;
  padding: 14px 24px;
  border-radius: 6px;
  border-right: 4px solid var(--netflix-red);
  box-shadow: var(--shadow-lg);
  z-index: 5000;
  opacity: 0;
  transition: all 0.3s ease;
  font-size: 15px;
  font-weight: 500;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================
   MAIN LOADER
   ============================================ */
.main-loader {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 20px;
}

.main-loader .loader-logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 72px;
  font-weight: 900;
  color: var(--netflix-red);
  animation: pulse 1.5s ease infinite;
  text-shadow: 0 0 30px rgba(229, 9, 20, 0.8);
}

.main-loader .loader-bar {
  width: 200px;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.main-loader .loader-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: -50%;
  height: 100%;
  width: 50%;
  background: var(--netflix-red);
  animation: loading 1.2s ease infinite;
}

/* ============================================
   SEARCH PAGE
   ============================================ */
.search-container {
  padding: 120px 4% 60px;
  min-height: 100vh;
}

.search-bar-wrap {
  max-width: 700px;
  margin: 0 auto 40px;
  position: relative;
}

.search-bar {
  width: 100%;
  padding: 18px 60px 18px 24px;
  font-size: 18px;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  color: white;
  border-radius: 50px;
  font-family: inherit;
  transition: var(--transition);
}

.search-bar:focus {
  outline: none;
  border-color: var(--netflix-red);
  box-shadow: 0 0 20px rgba(229, 9, 20, 0.3);
}

.search-bar::placeholder { color: var(--text-dim); }

.search-icon-big {
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 22px;
  color: var(--text-dim);
  pointer-events: none;
}

.search-status {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 30px;
  font-size: 15px;
}

.search-status i {
  color: var(--netflix-red);
  margin-left: 8px;
}

.search-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  max-width: 1600px;
  margin: 0 auto;
}

.search-results .card {
  width: 100%;
  aspect-ratio: 2/3;
}

/* ============================================
   PAGE HEADER / SUB HERO
   ============================================ */
.page-hero {
  position: relative;
  width: 100%;
  height: 60vh;
  min-height: 400px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  padding: 0 60px;
  margin-bottom: -60px;
}

.page-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 150px;
  background: linear-gradient(to top, var(--bg-primary), transparent);
}

.page-title-section {
  padding: 120px 60px 20px;
}

.page-title {
  font-size: 36px;
  font-weight: 900;
  margin-bottom: 10px;
  font-family: 'Bebas Neue', 'Cairo', sans-serif;
  letter-spacing: 1px;
}

.page-subtitle {
  color: var(--text-dim);
  font-size: 16px;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-secondary);
}

.empty-state i {
  font-size: 80px;
  color: var(--netflix-red);
  margin-bottom: 20px;
  opacity: 0.6;
}

.empty-state h3 {
  font-size: 24px;
  margin-bottom: 12px;
  color: white;
}

.empty-state p {
  color: var(--text-dim);
  font-size: 16px;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background: var(--bg-primary);
  padding: 60px 60px 30px;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  margin-top: 60px;
}

.footer-top {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
  font-size: 20px;
}

.footer-top a {
  color: var(--text-dim);
  transition: var(--transition-fast);
}

.footer-top a:hover {
  color: var(--netflix-red);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 1000px;
  margin-bottom: 30px;
}

.footer-grid a {
  color: var(--text-dim);
  font-size: 13px;
  transition: var(--transition-fast);
}

.footer-grid a:hover {
  text-decoration: underline;
  color: var(--text-secondary);
}

.footer-copyright {
  font-size: 13px;
  color: var(--text-dim);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes zoomIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(30px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.8; }
}

@keyframes loading {
  0% { left: -50%; }
  100% { left: 100%; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ========== NEW UI: CARD IMAGE WRAPPER + HOVER PLAY ========== */
.card-img-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  aspect-ratio: 2 / 3;
  background: #0a0a0a;
}

.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.card:hover .card-img-wrap img {
  transform: scale(1.05);
}

.card-play-hover {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,0.75) 100%);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.card-play-hover i {
  font-size: 52px;
  color: #fff;
  background: rgba(229, 9, 20, 0.92);
  width: 68px;
  height: 68px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6);
  transform: scale(0.8);
  transition: transform 0.25s ease;
}

.card:hover .card-play-hover {
  opacity: 1;
}

.card:hover .card-play-hover i {
  transform: scale(1);
}

/* HD badge on cards */
.hd-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(229, 9, 20, 0.9);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 0.5px;
  z-index: 2;
}

/* ========== CONTINUE WATCHING ROW ========== */
.row-continue-parent .row-content {
  padding-bottom: 10px;
}

.card-continue {
  flex: 0 0 160px !important;
  width: 160px !important;
  scroll-snap-align: start;
}

.card-continue .card-img-wrap.continue-img-wrap {
  aspect-ratio: 16 / 9;
  width: 100%;
  height: 100%;
  min-height: 90px;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.card-continue .card-img-wrap.continue-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.continue-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.7) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.card-continue:hover .continue-overlay {
  opacity: 1;
}

.continue-play {
  width: 64px;
  height: 64px;
  background: rgba(255,255,255,0.95);
  color: #000;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.continue-play:hover {
  transform: scale(1.1);
  background: #fff;
}

.continue-remove {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 30px;
  height: 30px;
  background: rgba(0,0,0,0.75);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: all 0.2s ease;
}

.continue-remove:hover {
  background: #e50914;
  transform: scale(1.1);
}

.continue-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: rgba(255,255,255,0.25);
  z-index: 3;
}

.continue-progress-bar {
  height: 100%;
  background: #e50914;
  transition: width 0.3s ease;
}

.continue-info {
  padding: 10px 2px;
}

.continue-info h3 {
  font-size: 14px;
  color: #fff;
  margin: 0 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.continue-info .card-meta {
  color: #999;
  font-size: 12px;
}

/* ========== HERO ARABIC SECONDARY TITLE ========== */
.hero-ar-title {
  font-size: 20px;
  color: #e5e5e5;
  margin: 4px 0 12px;
  font-weight: 500;
  opacity: 0.85;
}

/* ========== MODAL ARABIC TITLE + SIMILAR GRID ========== */
.modal-ar-title {
  font-size: 16px;
  color: #b3b3b3;
  margin: 4px 0 16px;
  font-weight: 500;
}

.modal-similar {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.modal-similar h3 {
  font-size: 20px;
  color: #fff;
  margin: 0 0 16px;
  font-weight: 600;
}

.modal-similar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.sim-card {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  text-decoration: none;
  color: #fff;
  background: #0a0a0a;
  transition: transform 0.2s ease;
}

.sim-card:hover {
  transform: scale(1.03);
}

.sim-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sim-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 30%, rgba(0,0,0,0.9) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 10px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.sim-card:hover .sim-overlay {
  opacity: 1;
}

.sim-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 42px;
  height: 42px;
  background: rgba(229,9,20,0.92);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.sim-info h4 {
  margin: 0 0 4px;
  font-size: 13px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sim-info span {
  font-size: 11px;
  color: #999;
}

/* ========== ROW TITLE ICONS ========== */
.row-title i {
  color: #e50914;
  margin-inline-end: 10px;
  font-size: 0.8em;
}

/* ========== TV REMOTE FOCUS OUTLINES ========== */
.card:focus-visible,
.sim-card:focus-visible,
.nav-links a:focus-visible,
.btn:focus-visible,
.btn-icon:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
  z-index: 10;
}

.card:focus-visible {
  transform: scale(1.05);
}

/* Responsive continue cards */
@media (max-width: 768px) {
  .card-continue {
    flex: 0 0 135px !important;
    width: 135px !important;
  }
  
  .modal-similar-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
  
  .hero-ar-title {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .card-continue {
    flex: 0 0 120px !important;
    width: 120px !important;
  }
}


/* ================================================================
   ANDROID TV REMOTE NAVIGATION - FOCUS STYLES
   ================================================================ */

/* Base focus indicator - strong visible outline for TV remote */
body.tv-nav-ready *:focus-visible {
  outline: 3px solid #e50914 !important;
  outline-offset: 2px;
  box-shadow: 0 0 0 5px rgba(229, 9, 20, 0.3), 0 0 20px rgba(229, 9, 20, 0.5);
  z-index: 10;
  position: relative;
}

/* Remove default focus on body */
body.tv-nav-ready:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

/* Card focus - scale up like Netflix */
body.tv-nav-ready .card:focus-visible,
body.tv-nav-ready .sim-card:focus-visible {
  outline: 3px solid #ffffff !important;
  outline-offset: 0;
  box-shadow: 0 0 0 4px #e50914, 0 8px 30px rgba(229, 9, 20, 0.6);
  transform: scale(1.08);
  z-index: 20;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  will-change: transform, box-shadow;
}

/* Nav links focus */
body.tv-nav-ready .nav-link:focus-visible,
body.tv-nav-ready .logo:focus-visible {
  outline: 2px solid #e50914 !important;
  outline-offset: 4px;
  background: rgba(229, 9, 20, 0.15);
  border-radius: 4px;
  color: #fff !important;
}

/* Hero buttons focus */
body.tv-nav-ready .hero-btn:focus-visible {
  outline: 3px solid #ffffff !important;
  outline-offset: 3px;
  box-shadow: 0 0 0 6px rgba(229, 9, 20, 0.4);
  transform: scale(1.05);
}

/* Icon buttons focus (player, navbar, search, profile) */
body.tv-nav-ready .nf-icon-btn:focus-visible,
body.tv-nav-ready .nf-tv-btn:focus-visible,
body.tv-nav-ready .btn-icon:focus-visible,
body.tv-nav-ready .search-btn:focus-visible,
body.tv-nav-ready .profile:focus-visible {
  outline: 3px solid #e50914 !important;
  outline-offset: 2px;
  background: rgba(229, 9, 20, 0.25) !important;
  transform: scale(1.1);
}

/* Episode cards (watch page) focus */
body.tv-nav-ready .nf-ep-card:focus-visible {
  outline: 3px solid #e50914 !important;
  outline-offset: 0;
  background: rgba(229, 9, 20, 0.15);
  transform: scale(1.02);
}

/* Season tab focus */
body.tv-nav-ready .nf-season-tab:focus-visible {
  outline: 2px solid #fff !important;
  outline-offset: 2px;
  background: #e50914 !important;
  color: #fff !important;
}

/* Genre chip focus */
body.tv-nav-ready .genre-chip:focus-visible {
  outline: 2px solid #e50914 !important;
  outline-offset: 2px;
  background: rgba(229, 9, 20, 0.3) !important;
  color: #fff !important;
  transform: scale(1.08);
}

/* Continue watching buttons */
body.tv-nav-ready .continue-play:focus-visible,
body.tv-nav-ready .continue-remove:focus-visible {
  outline: 3px solid #fff !important;
  outline-offset: 2px;
  box-shadow: 0 0 0 5px #e50914;
}

/* Input focus */
body.tv-nav-ready input:focus-visible,
body.tv-nav-ready textarea:focus-visible,
body.tv-nav-ready select:focus-visible {
  outline: 2px solid #e50914 !important;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(229, 9, 20, 0.25);
  background: rgba(255, 255, 255, 0.08) !important;
}

/* Make sure focused elements are never hidden by overflow */
body.tv-nav-ready .row-content,
body.tv-nav-ready .nf-episodes-list {
  overflow: visible;
}

/* Keep horizontal scroll working while preventing vertical clipping */
body.tv-nav-ready .row-content {
  overflow-x: auto;
  overflow-y: visible;
  scroll-snap-type: x proximity;
}

/* Smooth transitions for focus */
body.tv-nav-ready .card,
body.tv-nav-ready .sim-card,
body.tv-nav-ready .hero-btn,
body.tv-nav-ready .nf-icon-btn,
body.tv-nav-ready .nf-ep-card,
body.tv-nav-ready .genre-chip {
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, outline 0.1s ease;
}

/* Larger scroll padding for TV so focused items aren't at the edge */
html {
  scroll-padding-top: 100px;
  scroll-padding-bottom: 100px;
  scroll-padding-left: 50px;
  scroll-padding-right: 50px;
}

/* Hide mouse cursor on TV (optional, triggered by no-mouse movement) */
body.tv-mode {
  cursor: none !important;
}

body.tv-mode * {
  cursor: none !important;
}

/* ============================================================
   GENRE PAGE STYLES
   ============================================================ */
.genre-header-section {
  padding: 40px 4% 10px;
  max-width: 1600px;
  margin: 0 auto;
}

.genre-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.genre-title-wrap {
  display: flex;
  align-items: center;
  gap: 18px;
}

.genre-title-wrap > i {
  font-size: 42px;
  color: var(--netflix-red);
  background: rgba(229,9,20,0.1);
  padding: 18px;
  border-radius: 12px;
  min-width: 78px;
  text-align: center;
}

.genre-title-wrap h1 {
  font-size: 36px;
  font-weight: 900;
  margin: 0;
  color: #fff;
  line-height: 1.1;
}

.genre-sub {
  font-size: 15px;
  color: var(--text-secondary, #b3b3b3);
  margin: 6px 0 0;
}

.genre-stats {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.genre-stat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 30px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.genre-stat i { color: var(--netflix-red); }

/* Genre pills (quick switch between genres) */
.genre-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 14px;
}

.genre-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 30px;
  color: #e5e5e5;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.genre-pill:hover {
  background: rgba(229,9,20,0.15);
  border-color: rgba(229,9,20,0.5);
  color: #fff;
  transform: translateY(-1px);
}

.genre-pill.active {
  background: var(--netflix-red, #E50914);
  border-color: var(--netflix-red, #E50914);
  color: #fff;
  box-shadow: 0 4px 14px rgba(229,9,20,0.4);
}

.genre-pill i { font-size: 13px; }

/* Genre grid (full list view under the carousels) */
.genre-grid-section {
  padding: 40px 4%;
  max-width: 1600px;
  margin: 0 auto;
}

.grid-title {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.grid-title i { color: var(--netflix-red); }

.genre-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.genre-grid .card {
  margin: 0;
  min-width: 0;
  width: 100%;
}

.genre-grid .card .card-img {
  aspect-ratio: 2 / 3;
  width: 100%;
  height: auto;
}

/* Responsive: mobile tweaks */
@media (max-width: 768px) {
  .genre-header-section {
    padding: 24px 4% 6px;
  }
  .genre-title-wrap h1 { font-size: 26px; }
  .genre-title-wrap > i {
    font-size: 28px;
    padding: 14px;
    min-width: 58px;
  }
  .genre-stats { width: 100%; }
  .genre-stat { font-size: 12px; padding: 8px 14px; }
  .genre-pills {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 10px;
    -webkit-overflow-scrolling: touch;
  }
  .genre-pill { font-size: 13px; padding: 7px 14px; }
  .genre-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
  }
  .grid-title { font-size: 18px; }
}

@media (max-width: 480px) {
  .genre-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
}

/* ============================================ */
/* MY LIST PAGE - Remove button overlay        */
/* ============================================ */
.mylist-item-wrap {
  position: relative;
  display: block;
}
.mylist-item-wrap .mylist-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.85);
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.6);
  transition: all 0.2s ease;
  z-index: 10;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
[dir="rtl"] .mylist-item-wrap .mylist-remove {
  right: auto;
  left: 8px;
}
.mylist-item-wrap:hover .mylist-remove,
.mylist-item-wrap:focus-within .mylist-remove {
  opacity: 1;
  transform: scale(1);
}
.mylist-item-wrap .mylist-remove:hover {
  background: #e50914;
  border-color: #e50914;
  transform: scale(1.15);
  box-shadow: 0 4px 14px rgba(229, 9, 20, 0.5);
}
@media (max-width: 768px) {
  .mylist-item-wrap .mylist-remove {
    opacity: 1;
    transform: scale(1);
    width: 28px;
    height: 28px;
    font-size: 12px;
  }
}

/* My List status bar */
.mylist-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  margin: 0 0 20px 0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #e5e5e5;
  font-size: 15px;
}
.mylist-status strong {
  color: #e50914;
  font-size: 18px;
  margin: 0 4px;
}

.btn-text-danger {
  background: transparent;
  border: 1px solid rgba(229, 9, 20, 0.5);
  color: #ff6b74;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}
.btn-text-danger:hover {
  background: #e50914;
  color: #fff;
  border-color: #e50914;
}

/* ==========================================================================
   Server Picker Modal (choose server before playing)
   ========================================================================== */
.srv-picker-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.25s ease;
}
.srv-picker-modal.closing { animation: fadeOut 0.2s ease forwards; }

.srv-picker-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.srv-picker-box {
  position: relative;
  width: min(92vw, 520px);
  background: linear-gradient(145deg, #1c1c1c 0%, #141414 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 28px 24px 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(229, 9, 20, 0.15);
  animation: slideUpFade 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  direction: rtl;
  color: #fff;
}

.srv-picker-close {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.srv-picker-close:hover {
  background: #e50914;
  transform: rotate(90deg);
}

.srv-picker-header {
  text-align: center;
  margin-bottom: 22px;
}
.srv-picker-header .srv-picker-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e50914, #b81d24);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: #fff;
  box-shadow: 0 8px 24px rgba(229, 9, 20, 0.4);
}
.srv-picker-header h3 {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 6px;
  color: #fff;
}
.srv-picker-header p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
}

.srv-picker-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

.srv-picker-option {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  color: #fff;
  text-align: right;
  font-family: inherit;
  transition: all 0.25s ease;
  width: 100%;
  position: relative;
  overflow: hidden;
}
.srv-picker-option::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(229, 9, 20, 0.15), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.srv-picker-option:hover {
  border-color: #e50914;
  background: rgba(229, 9, 20, 0.08);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(229, 9, 20, 0.25);
}
.srv-picker-option:hover::before { opacity: 1; }

.srv-picker-option.recommended {
  border-color: rgba(229, 9, 20, 0.4);
  background: rgba(229, 9, 20, 0.06);
}

.srv-picker-opt-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #e50914, #7a0a0f);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  position: relative;
  z-index: 1;
}
.srv-picker-option[data-server="vidsrc"] .srv-picker-opt-icon {
  background: linear-gradient(135deg, #3a506b, #1c2e4a);
}

.srv-picker-opt-body {
  flex: 1;
  position: relative;
  z-index: 1;
  min-width: 0;
  text-align: right;
}
.srv-picker-opt-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.srv-picker-opt-desc {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.4;
}

.srv-picker-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  background: #e50914;
  color: #fff;
  letter-spacing: 0.5px;
}
.srv-picker-badge.alt {
  background: rgba(255, 255, 255, 0.12);
  color: #e5e5e5;
}

.srv-picker-chev {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.4);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  transition: transform 0.25s ease, color 0.25s ease;
}
.srv-picker-option:hover .srv-picker-chev {
  color: #e50914;
  transform: translateX(-4px);
}

.srv-picker-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 14px;
}
.srv-picker-footer i { color: #e50914; }

@keyframes slideUpFade {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }

@media (max-width: 480px) {
  .srv-picker-box { padding: 22px 16px 18px; }
  .srv-picker-header h3 { font-size: 18px; }
  .srv-picker-option { padding: 12px; gap: 10px; }
  .srv-picker-opt-icon { width: 42px; height: 42px; font-size: 17px; }
  .srv-picker-opt-title { font-size: 14px; }
  .srv-picker-opt-desc { font-size: 11px; }
}
