/* --- Optimized CSS Variables & Base Styles --- */
:root {
  --primary-red: #e50914; /* Netflix Red */
  --bg-darkest: #141414;
  --bg-darker: #181818;
  --bg-dark: #222;
  --text-light: #fff;
  --text-mute: #ccc;
}

body {
  background: var(--bg-darkest);
  color: var(--text-light);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "Poppins", Arial, sans-serif;
}

/* FIX 1: Lock body scroll when modal is open */
body.modal-open {
  overflow: hidden;
  height: 100vh;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  background: var(--bg-darker);
  padding: 0 4vw;
  height: 68px;
  border-bottom: 3px solid var(--primary-red);
  position: sticky;
  top: 0;
  width: 100vw;
  z-index: 10;
}
.logo {
  height: 44px;
  margin-right: 28px;
}
.navbar nav {
  display: flex;
  gap: 32px;
}
.nav-link {
  color: var(--text-mute);
  font-weight: 600;
  text-decoration: none;
  font-size: 1.11rem;
  transition: color 0.2s;
  padding: 0 4px;
}
.nav-link.active,
.nav-link:hover {
  color: var(--primary-red);
}
.search-bar {
  margin-left: auto;
  padding: 8px 18px;
  border-radius: 20px;
  border: 2px solid #444;
  background: var(--bg-dark);
  color: var(--text-light);
  outline: none;
}

/* --- Hero Section --- */
.hero-banner,
#banner {
  min-height: 46vh;
  width: 100vw;
  display: flex;
  align-items: flex-end;
  background: linear-gradient(
      to top,
      rgba(20, 20, 20, 1) 0%,
      rgba(20, 20, 20, 0.4) 80%
    ),
    var(--banner-img, #232323);
  background-size: cover !important;
  background-position: center center;
  background-repeat: no-repeat !important;
  position: relative;
}

.hero-text,
#banner .hero-text {
  padding: 57px 62px 39px 62px;
  background: rgba(15, 15, 18, 0.7);
  border-radius: 0 0 18px 0;
  max-width: 580px;
  margin-bottom: 16px;
}
#banner-title,
.hero-text h1 {
  font-size: 2.55rem;
  font-weight: 900;
  color: var(--text-light);
  letter-spacing: 0.3px;
  margin-bottom: 10px;
  text-shadow: 0 5px 20px #000a;
}
.hero-text p,
#banner-overview {
  color: #efefef;
  margin-top: 15px;
  font-size: 1.21rem;
  font-weight: 400;
}

/* --- Content Rows --- */
.row {
  margin: 32px 0 36px 0;
}
.row h2 {
  margin-left: 4vw;
  margin-bottom: 8px;
  color: #fafafa;
  font-size: 1.23rem;
  font-weight: 700;
}
.list {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding: 0 4vw 14px 4vw;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  position: relative;
}

.list img {
  width: 176px;
  height: 270px;
  object-fit: cover;
  background: var(--bg-dark);
  border-radius: 7px;
  box-shadow: 0 2px 20px 0 #0006;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}
.list img:hover {
  transform: scale(1.05);
  box-shadow: 0 0 10px var(--primary-red);
  z-index: 2;
}

.list::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 50px;
  height: 100%;
  background: linear-gradient(to right, var(--bg-darkest), transparent); 
  pointer-events: none;
  z-index: 5;
}

/* --- Modal and Search Styles --- */
.modal,
.search-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(20, 20, 20, 0.97);
  opacity: 0;
  display: none; 
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.25s ease;
}

.modal.show,
.search-modal.show {
  display: flex; 
  opacity: 1;
}

.modal-content {
  background: #23232c;
  border-radius: 14px;
  padding: 32px;
  width: 92vw;
  max-width: 600px;
  position: relative;
  color: var(--text-light);
  box-shadow: 0 12px 42px 0 #000b;
  
  /* FIX 2: Enable scrolling inside the modal to reach the bottom content */
  max-height: 90vh; 
  overflow-y: auto; 
}

.modal-body {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.modal-body img {
  width: 150px; /* Fixed width for desktop/tablet view */
  height: auto;
  object-fit: cover;
  border-radius: 5px;
}

.modal-text {
  flex-grow: 1;
}

#modal-description {
  font-size: 0.95rem;
  line-height: 1.4;
}

.close {
  position: absolute;
  top: 16px;
  right: 24px;
  font-size: 2.3rem;
  color: var(--primary-red);
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
  z-index: 20;
}

.close:hover {
  color: var(--text-light);
}

#search-input,
.search-modal input {
  max-width: 600px;
  width: 90vw;
  padding: 16px;
  border-radius: 8px;
  border: 2px solid var(--text-light);
  background: var(--bg-darker);
  color: var(--text-light);
  font-size: 1.13rem;
  margin: 44px auto 10px auto;
  display: block;
  outline: none;
}

#search-input:focus {
  border-color: var(--primary-red);
}

.search-modal .results {
  width: 94vw;
  max-width: 650px;
  margin: 12px auto 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

/* --- Footer --- */
.footer {
  background: var(--bg-darker);
  color: var(--text-mute);
  padding: 18px 2vw;
  text-align: center;
  margin-top: 56px;
  border-top: 2px solid #2c2c2c;
}

.footer-links a {
  color: var(--primary-red);
  margin: 0 11px;
  text-decoration: none;
  font-weight: 500;
}

.footer-links a:hover {
  color: var(--text-light);
}

/* --- Media Queries --- */
@media (max-width: 950px) {
  .hero-text {
    max-width: 90vw;
    padding: 30px 8vw;
  }
  .list img {
    width: 122px;
    height: 186px;
  }
}

@media (max-width: 550px) {
  .modal-content {
    padding: 20px;
  }
  
  .modal-body {
    flex-direction: column; /* Stack image and text vertically */
    gap: 15px;
  }

  .modal-body img {
    width: 100%; /* Image takes full width at the top */
    max-height: 300px; /* Prevent very large images */
    object-fit: contain;
  }
  
  #modal-title {
    font-size: 1.5rem;
  }
  
  #modal-video {
    height: 250px; /* Ensure video is smaller on mobile */
  }
}

@media (max-width: 480px) {
  .navbar,
  .footer {
    padding: 0 1vw;
  }
  .hero-text {
    padding: 24px 3vw;
  }
  #banner-title {
    font-size: 1.8rem;
  }
  #banner-overview {
    font-size: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3; 
    -webkit-box-orient: vertical;  
    overflow: hidden;
  }
  .row h2 {
    font-size: 1.07rem;
  }
  #search-input,
  .search-modal input {
    width: 92vw;
    font-size: 0.98rem;
  }
}
