/* ===== RESET & BASE ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-red: #e50914;
  --dark-red: #b20710;
  --bg-black: #0a0a0a;
  --bg-dark: #141414;
  --bg-gray: #1f1f1f;
  --bg-light: #f5f5f5;
  --text-white: #ffffff;
  --text-gray: #d2d2d2;
  --text-muted: #808080;
  --text-dark: #333333;
}

body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: var(--bg-black);
  color: var(--text-white);
  overflow-x: hidden;
  line-height: 1.6;
}

/* ===== NAVIGATION ===== */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  padding: 20px 4%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.9) 0%,
    rgba(0, 0, 0, 0) 100%
  );
  transition: background 0.3s ease;
}

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

.navbar-left {
  display: flex;
  align-items: center;
  gap: 40px;
}

/* Hamburger Menu (Mobile Only) */
.hamburger-menu {
  display: none;
}

.logo {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary-red);
  letter-spacing: -1px;
  cursor: pointer;
}

.nav-menu {
  display: flex;
  gap: 25px;
}

.nav-menu a {
  color: var(--text-gray);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.3s ease;
  position: relative;
}

.nav-menu a:hover,
.nav-menu a.active {
  color: var(--text-white);
}

.nav-menu a.active::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--primary-red);
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.search-btn {
  background: none;
  border: none;
  color: var(--text-white);
  font-size: 20px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.search-btn:hover {
  transform: scale(1.1);
}

/* ===== PAGE VIEWS SYSTEM ===== */
.page-views {
  position: relative;
}

.page-view {
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.page-view.active {
  display: block;
  opacity: 1;
}

/* Page Hero Section */
.page-hero {
  height: 40vh;
  min-height: 300px;
  background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0 4%;
  margin-top: 70px;
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
    circle at center,
    rgba(229, 9, 20, 0.1) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.page-hero h1 {
  font-size: 64px;
  font-weight: 800;
  margin-bottom: 20px;
  background: linear-gradient(90deg, #e50914 0%, #ff4444 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  z-index: 1;
}

.page-hero p {
  font-size: 20px;
  color: var(--text-gray);
  position: relative;
  z-index: 1;
}

/* ===== HERO BANNER WITH TRAILER SLIDER ===== */
.hero-banner {
  position: relative;
  height: 85vh;
  display: flex;
  align-items: center;
  margin-top: 0;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  transition: background-image 0.8s ease-in-out;
}

/* Video Background */
.hero-video-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: hidden;
  background: var(--bg-black);
}

.hero-video-container iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100vw;
  height: 100vh;
  min-width: 100%;
  min-height: 100%;
  transform: translate(-50%, -50%) scale(1.5);
  pointer-events: none;
  border: none;
  opacity: 0.6;
}

.hero-video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to right,
    rgba(0, 0, 0, 0.85) 0%,
    rgba(0, 0, 0, 0.6) 40%,
    rgba(0, 0, 0, 0.4) 60%,
    rgba(0, 0, 0, 0.85) 100%
  );
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 3;
  padding: 0 4%;
  max-width: 650px;
  animation: fadeInUp 1s ease;
  transition: opacity 0.3s ease;
}

.hero-title {
  font-size: 56px;
  font-weight: 800;
  margin-bottom: 20px;
  line-height: 1.1;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
}

.hero-description {
  font-size: 18px;
  line-height: 1.6;
  margin-bottom: 30px;
  color: var(--text-gray);
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.8);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-buttons {
  display: flex;
  gap: 15px;
}

.btn {
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s ease;
}

.btn-primary {
  background: var(--text-white);
  color: var(--bg-black);
}

.btn-primary:hover {
  background: rgba(255, 255, 255, 0.85);
  transform: scale(1.05);
}

.btn-secondary {
  background: rgba(109, 109, 110, 0.7);
  color: var(--text-white);
}

.btn-secondary:hover {
  background: rgba(109, 109, 110, 0.5);
  transform: scale(1.05);
}

/* Slider Controls */
.slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  border: none;
  color: var(--text-white);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  z-index: 3;
  transition: all 0.3s ease;
  opacity: 0;
}

.hero-banner:hover .slider-arrow {
  opacity: 1;
}

.slider-prev {
  left: 20px;
}

.slider-next {
  right: 20px;
}

.slider-arrow:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: translateY(-50%) scale(1.1);
}

/* Slider Indicators */
.slider-indicators {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 3;
}

.slider-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.3s ease;
}

.slider-indicator.active {
  background: var(--primary-red);
  width: 30px;
  border-radius: 6px;
}

.hero-fade {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 250px;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(0, 0, 0, 0.8) 50%,
    var(--bg-black) 100%
  );
  z-index: 2;
}

/* ===== CONTENT SECTIONS ===== */
.content-wrapper {
  position: relative;
  z-index: 3;
  margin-top: -100px;
  padding: 0 4%;
  padding-top: 60px;
}

/* Reset margin for non-home pages to prevent overlap */
.page-view:not(#home-view) .content-wrapper {
  margin-top: 0;
  padding-top: 40px;
}

.content-row {
  margin-bottom: 40px;
}

.row-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 15px;
  color: var(--text-white);
}

.row-posters {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 10px 0;
  scroll-behavior: smooth;
}

.row-posters::-webkit-scrollbar {
  height: 8px;
}

.row-posters::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

.row-posters::-webkit-scrollbar-thumb {
  background: var(--bg-gray);
  border-radius: 4px;
}

.row-posters::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.poster-card {
  min-width: 200px;
  height: 300px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.poster-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.poster-card:hover {
  transform: scale(1.08);
  z-index: 10;
}

.poster-card:hover img {
  filter: brightness(0.7);
}

.poster-card::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.poster-card:hover::after {
  opacity: 1;
}

/* ===== SPLIT-SCREEN VIDEO PLAYER MODAL ===== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

.modal.active {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(8px);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-black);
}

::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-red);
}

.modal-container-split {
  position: relative;
  background: var(--bg-black);
  width: 95%;
  max-width: 1600px;
  height: 90vh;
  display: flex;
  border-radius: 12px;
  overflow: hidden;
  z-index: 1001;
  animation: slideUp 0.4s ease;
}

@media (max-width: 1024px) {
  .modal-container-split {
    flex-direction: column;
    height: 95vh;
  }
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.7);
  border: none;
  color: var(--text-white);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  z-index: 1002;
  transition: all 0.3s ease;
}

.modal-close:hover {
  background: var(--primary-red);
  transform: rotate(90deg);
}

/* Left Side - Video Player */
.modal-left {
  flex: 1;
  background: var(--bg-black);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  min-width: 0; /* Prevent flex overflow */
}

/* Header removed */

.modal-title-mini {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-white);
}

.modal-meta-mini {
  display: flex;
  gap: 15px;
  align-items: center;
  font-size: 14px;
  color: var(--text-gray);
  margin-bottom: 20px;
}

.modal-rating {
  color: #ffd700;
  font-weight: 600;
}

.video-player-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  background: var(--bg-black);
  flex-shrink: 0;
}

.video-player-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.video-controls-info {
  padding: 20px 30px;
  background: var(--bg-dark);
}

.server-selector-inline {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}

.server-selector-inline label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-gray);
  display: flex;
  align-items: center;
  gap: 8px;
}

.server-selector-inline select {
  background: var(--bg-gray);
  color: var(--text-white);
  border: 1px solid var(--bg-gray);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}

.modal-description-mini {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-gray);
}

/* Right Side - Episodes & Related */
.modal-right {
  width: 400px;
  background: #1a1a1a;
  overflow-y: auto;
  flex-shrink: 0;
  border-left: 1px solid #2a2a2a;
}

@media (max-width: 1024px) {
  .modal-right {
    width: 100%;
    height: 100%;
    border-left: none;
    border-top: 1px solid #2a2a2a;
  }
}

.modal-sidebar {
  height: 100%;
}

.sidebar-section {
  padding: 20px;
  border-bottom: 1px solid #2a2a2a;
}

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

.sidebar-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-white);
}

/* Episode Range Selector */
.episode-range-selector {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.range-btn {
  padding: 4px 10px;
  background: #2a2a2a;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  color: var(--text-gray);
  cursor: pointer;
  transition: all 0.3s ease;
}

.range-btn:hover {
  background: #3a3a3a;
}

.range-btn.active {
  background: var(--primary-red);
  color: var(--text-white);
}

/* Season Selector Compact */
.season-selector-compact {
  margin-bottom: 15px;
}

.season-selector-compact select {
  width: 100%;
  padding: 10px;
  background: #2a2a2a;
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  font-size: 14px;
  color: var(--text-white);
  cursor: pointer;
}

/* Episodes Grid Compact */
.episodes-grid-compact {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.episode-card-compact {
  aspect-ratio: 1;
  background: #2a2a2a;
  border: 2px solid #3a3a3a;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.episode-card-compact:hover {
  border-color: var(--primary-red);
  transform: scale(1.05);
}

.episode-card-compact.watched {
  background: #1a3a1a;
}

.episode-number-compact {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-white);
}

.episode-duration {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.episode-card-compact .download-icon {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 10px;
  color: #2196f3;
}

/* Related List */
.related-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.related-item {
  display: flex;
  gap: 12px;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: background 0.3s ease;
  background: #2a2a2a;
  margin-bottom: 8px;
}

.related-item:hover {
  background: #3a3a3a;
}

.related-thumbnail {
  width: 120px;
  height: 68px;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
}

.related-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.related-info {
  flex: 1;
}

.related-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-white);
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.related-meta {
  font-size: 12px;
  color: #888888;
}

/* ===== SEARCH MODAL - SPLIT PANEL ===== */
.search-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  animation: fadeIn 0.3s ease;
}

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

/* Close Button */
.search-close-top {
  position: absolute;
  top: 20px;
  right: 40px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--text-white);
  font-size: 28px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 2001;
}

.search-close-top:hover {
  background: var(--primary-red);
  transform: rotate(90deg);
}

/* Split Container */
.search-split-container {
  display: flex;
  width: 95%;
  max-width: 1600px;
  height: 85vh;
  background: #0a0a0a;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

/* LEFT PANEL */
.search-left-panel {
  width: 350px;
  background: linear-gradient(180deg, #1a1a1a 0%, #0f0f0f 100%);
  border-right: 1px solid #2a2a2a;
  display: flex;
  flex-direction: column;
}

.search-header-panel {
  padding: 25px 20px;
  border-bottom: 1px solid #2a2a2a;
}

.search-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.search-header-panel h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-white);
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.filter-mode-toggle {
  padding: 8px 16px;
  background: rgba(229, 9, 20, 0.1);
  border: 2px solid var(--primary-red);
  border-radius: 20px;
  color: var(--primary-red);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-mode-toggle:hover {
  background: var(--primary-red);
  color: var(--text-white);
}

.filter-mode-toggle.basic-mode {
  background: #2a2a2a;
  border-color: #2a2a2a;
  color: var(--text-gray);
}

.filter-mode-toggle.basic-mode:hover {
  border-color: var(--primary-red);
  color: var(--text-white);
}

.search-header-panel input {
  width: 100%;
  padding: 12px 15px;
  background: #0a0a0a;
  border: 2px solid #2a2a2a;
  border-radius: 8px;
  color: var(--text-white);
  font-size: 14px;
  transition: all 0.3s ease;
}

.search-header-panel input:focus {
  outline: none;
  border-color: var(--primary-red);
}

/* Filters Container */
.filters-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  transition: all 0.3s ease;
}

.filters-container.hidden {
  display: none;
}

.filters-container::-webkit-scrollbar {
  width: 6px;
}

.filters-container::-webkit-scrollbar-track {
  background: #0a0a0a;
}

.filters-container::-webkit-scrollbar-thumb {
  background: #2a2a2a;
  border-radius: 3px;
}

/* Filter Groups */
.filter-group {
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 1px solid #2a2a2a;
}

.filter-group:last-of-type {
  border-bottom: none;
}

.filter-group h3 {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Content Type Buttons */
.filter-buttons-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.type-filter-btn {
  padding: 10px;
  background: #2a2a2a;
  border: 2px solid #2a2a2a;
  border-radius: 6px;
  color: var(--text-gray);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.type-filter-btn:hover {
  border-color: var(--primary-red);
  background: rgba(229, 9, 20, 0.1);
}

.type-filter-btn.active {
  background: var(--primary-red);
  border-color: var(--primary-red);
  color: var(--text-white);
}

/* Genre Grid */
.genre-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
  padding-right: 5px;
}

.genre-grid::-webkit-scrollbar {
  width: 4px;
}

.genre-grid::-webkit-scrollbar-thumb {
  background: #2a2a2a;
  border-radius: 2px;
}

.genre-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: #2a2a2a;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 12px;
  color: var(--text-gray);
}

.genre-grid label:hover {
  background: #3a3a3a;
}

.genre-grid input[type="checkbox"] {
  cursor: pointer;
  accent-color: var(--primary-red);
}

.genre-grid input[type="checkbox"]:checked + label {
  color: var(--text-white);
}

/* Year Range */
.year-range-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.year-range-container input[type="range"] {
  width: 100%;
  height: 6px;
  background: #2a2a2a;
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.year-range-container input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: var(--primary-red);
  border-radius: 50%;
  cursor: pointer;
}

.year-display {
  text-align: center;
  font-size: 14px;
  color: var(--text-white);
  font-weight: 600;
}

/* Rating Filter */
.filter-group input[type="range"] {
  width: 100%;
  height: 6px;
  background: #2a2a2a;
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  margin-bottom: 10px;
}

.filter-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: #ffd700;
  border-radius: 50%;
  cursor: pointer;
}

.rating-display {
  text-align: center;
  font-size: 16px;
  color: #ffd700;
  font-weight: 700;
}

/* Sort Select */
.filter-group select {
  width: 100%;
  padding: 10px;
  background: #2a2a2a;
  border: 2px solid #2a2a2a;
  border-radius: 6px;
  color: var(--text-white);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-group select:focus {
  outline: none;
  border-color: var(--primary-red);
}

/* Clear Filters Button */
.clear-filters-btn {
  width: 100%;
  padding: 12px;
  background: rgba(229, 9, 20, 0.1);
  border: 2px solid var(--primary-red);
  border-radius: 8px;
  color: var(--primary-red);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

.clear-filters-btn:hover {
  background: var(--primary-red);
  color: var(--text-white);
}

/* RIGHT PANEL */
.search-right-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #0a0a0a;
}

.results-header {
  padding: 20px 25px;
  border-bottom: 1px solid #2a2a2a;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.results-count {
  font-size: 16px;
  color: var(--text-gray);
}

.results-count strong {
  color: var(--primary-red);
  font-size: 20px;
}

/* Results Grid */
.search-results-grid {
  flex: 1;
  overflow-y: auto;
  padding: 25px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-content: start;
  grid-auto-rows: min-content;
}

.search-results-grid::-webkit-scrollbar {
  width: 8px;
}

.search-results-grid::-webkit-scrollbar-track {
  background: #0a0a0a;
}

.search-results-grid::-webkit-scrollbar-thumb {
  background: #2a2a2a;
  border-radius: 4px;
}

/* Search Result Cards (keep existing styles) */
.search-result-card {
  background: linear-gradient(145deg, #1a1a1a 0%, #0d0d0d 100%);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid #2a2a2a;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 420px;
}

.search-result-card:hover {
  transform: translateY(-8px);
  border-color: var(--primary-red);
  box-shadow: 0 8px 25px rgba(229, 9, 20, 0.3);
}

.search-card-poster {
  width: 100%;
  height: 240px;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

.search-card-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.search-result-card:hover .search-card-poster img {
  transform: scale(1.1);
}

.search-card-type-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--primary-red);
  color: var(--text-white);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.search-card-info {
  padding: 15px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.search-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-white);
  margin-bottom: 8px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 40px;
}

.search-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.search-card-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #ffd700;
  font-size: 14px;
  font-weight: 600;
}

.search-card-rating i {
  font-size: 12px;
}

.search-card-year {
  color: var(--text-gray);
  font-size: 13px;
  font-weight: 500;
}

.search-card-separator {
  width: 3px;
  height: 3px;
  background: var(--text-muted);
  border-radius: 50%;
}

.search-card-overview {
  font-size: 13px;
  color: var(--text-gray);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 8px;
}

.search-card-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  background: rgba(229, 9, 20, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.search-result-card:hover .search-card-play-icon {
  opacity: 1;
}

.search-card-play-icon i {
  color: var(--text-white);
  font-size: 20px;
  margin-left: 3px;
}

/* ===== FOOTER ===== */
.footer {
  background: var(--bg-dark);
  padding: 60px 4%;
  margin-top: 80px;
  border-top: 1px solid var(--bg-gray);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.footer-copyright {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 10px;
}

.footer-disclaimer {
  color: var(--text-muted);
  font-size: 12px;
  max-width: 600px;
  margin: 0 auto;
}

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

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

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

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .hero-title {
    font-size: 42px;
  }

  .hero-description {
    font-size: 16px;
  }

  .poster-card {
    min-width: 160px;
    height: 240px;
  }

  .modal-right {
    width: 350px;
  }

  .episodes-grid-compact {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .navbar {
    padding: 15px 4%;
  }

  .navbar-left {
    gap: 20px;
  }

  .logo {
    display: none;
  }

  .nav-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh; /* Full screen */
    background: var(--bg-black);
    flex-direction: column;
    align-items: center;
    justify-content: center; /* Center items vertically */
    padding: 20px 0;
    gap: 30px;
    transform: translateY(-150%);
    transition: transform 0.3s ease;
    z-index: 999;
  }

  .nav-menu.active {
    display: flex;
    transform: translateY(0);
  }

  .nav-menu a {
    font-size: 24px; /* Larger text for mobile */
  }

  .hamburger-menu {
    display: block;
    background: none;
    border: none;
    color: var(--text-white);
    font-size: 28px;
    cursor: pointer;
    position: relative; /* Ensure z-index works */
    z-index: 1000; /* Stay above the menu */
  }

  .hero-banner {
    height: 60vh;
  }

  .hero-video-container iframe {
    top: 25%;
  }

  .hero-title {
    font-size: 32px;
  }

  .hero-description {
    font-size: 14px;
    -webkit-line-clamp: 2;
  }

  .hero-buttons {
    flex-direction: column;
    gap: 10px;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .slider-arrow {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .content-wrapper {
    margin-top: -80px;
  }

  .row-title {
    font-size: 20px;
  }

  .poster-card {
    min-width: 130px;
    height: 195px;
  }

  /* Stack modal vertically on mobile */
  .modal {
    align-items: flex-start; /* Fix "too high" margin/centering issue */
  }

  .modal-container-split {
    flex-direction: column;
    width: 100%;
    height: 100%; /* Fill screen fully without vh jumps */
    border-radius: 0;
    max-height: none; /* Ensure no constraint */
  }

  .modal-right {
    width: 100%;
    max-height: 40vh;
  }

  .episodes-grid-compact {
    grid-template-columns: repeat(4, 1fr);
  }

  .search-results {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
  }

  .search-result-card img {
    height: 180px;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 24px;
  }

  .hero-description {
    font-size: 13px;
  }

  .btn {
    padding: 12px 24px;
    font-size: 14px;
  }

  .poster-card {
    min-width: 110px;
    height: 165px;
  }

  .modal-title-mini {
    font-size: 18px;
  }

  .search-modal {
    padding-top: 80px;
  }

  .search-input-wrapper input {
    font-size: 16px;
    padding: 15px 20px 15px 50px;
  }
}
