/* ===== GLOBAL & FONTS ===== */
:root {
  --primary-color: #e50914;
  --dark-color: #141414;
  --light-dark-color: #181818;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: 'Poppins', sans-serif;
  background: var(--dark-color);
  color: #fff;
}
/* ===== SCROLL LOCK CLASS ===== */
body.body-no-scroll {
  overflow: hidden;
}
a {
  color: #fff;
  text-decoration: none;
}

/* ===== NAVBAR ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 20px 60px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.7) 10%, transparent);
  transition: background-color 0.4s ease;
}
.navbar.scrolled {
  background-color: var(--dark-color);
}
.navbar-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo-effect {
  height: 35px;
}
.nav-links {
  display: flex;
  gap: 25px;
  font-weight: 500;
  margin-left: 20px;
  flex-grow: 1;
}
.nav-links a:hover, .nav-links a.active {
  color: #b3b3b3;
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 1.2rem;
}
.nav-actions i {
  cursor: pointer;
}
.watch-history-btn, #install-btn {
  background: none;
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
}

/* BAGO: Hamburger Menu Icon (hidden sa desktop) */
.hamburger-menu {
    display: none;
    cursor: pointer;
    z-index: 1002; /* Para siguradong nasa ibabaw */
}
.hamburger-menu .bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: #fff;
    transition: all 0.3s ease-in-out;
}

/* ===== HERO SECTION ===== */
.hero-section {
  height: 100vh;
  background-size: cover;
  background-position: center top;
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 60px;
}
.hero-content {
  z-index: 2;
  max-width: 600px;
}
.hero-title {
  font-size: 3.5rem;
  font-weight: 700;
  text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.7);
}
.hero-description {
  font-size: 1.1rem;
  line-height: 1.6;
  margin-top: 20px;
  text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.hero-buttons {
  margin-top: 30px;
  display: flex;
  gap: 15px;
}
.btn {
  padding: 12px 28px;
  border: none;
  border-radius: 5px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: opacity 0.3s;
}
.btn:hover { opacity: 0.8; }
.btn-primary { background: #fff; color: #000; }
.btn-secondary { background: rgba(109, 109, 110, 0.7); color: #fff; }
.hero-fade {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 10rem;
  background-image: linear-gradient(180deg, transparent, rgba(20, 20, 20, 0.6), var(--dark-color));
}

/* ===== MAIN CONTENT & MOVIE LISTS ===== */
.main-container {
  padding: 0 60px;
  margin-top: -100px;
  position: relative;
  z-index: 5;
}
.row {
  margin-bottom: 40px;
  position: relative; /* Kailangan para sa positioning ng buttons */
}
.row h2 {
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 15px;
}

/* BAGO: Container para sa listahan at scroll buttons */
.list-container {
    position: relative;
    margin: 0 -10px; /* Space para sa buttons */
}

.list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 0 10px 20px 10px;
  scroll-behavior: smooth;
}
.list::-webkit-scrollbar { display: none; }

/* BAGO: Styles para sa scroll buttons ng homepage */
.list-container .scroll-btn {
    position: absolute;
    top: 0;
    bottom: 20px; /* Itaas ng konti para hindi sagad */
    width: 50px;
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    font-size: 2.5rem;
    cursor: pointer;
    z-index: 20;
    display: none; 
    opacity: 0;
    transition: opacity 0.3s ease;
}
.list-container .scroll-btn.left {
    left: 0;
    border-radius: 0 8px 8px 0;
}
.list-container .scroll-btn.right {
    right: 0;
    border-radius: 8px 0 0 8px;
}
@media (min-width: 769px) {
    .list-container:hover .scroll-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 1;
    }
}


/* IN-UPDATE: Modern Movie Card Hover Effect */
.movie-card {
  width: 180px;
  flex-shrink: 0;
  background-color: var(--light-dark-color);
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  border-radius: 5px;
  overflow: visible; /* Payagan lumabas ang details panel */
}
.movie-card img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  display: block;
  border-radius: 5px;
}
.movie-card .movie-title { /* Itago by default, ililipat sa details panel */
    display: none;
}

/* BAGO: Details Panel na lalabas sa Hover */
.movie-card-details {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--light-dark-color);
    padding: 12px;
    border-radius: 0 0 5px 5px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(100%);
    transition: all 0.3s ease;
}
.movie-card-details h3 { /* Para sa title sa loob ng panel */
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 8px;
}
.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #ccc;
    margin-bottom: 10px;
}
.card-buttons {
    display: flex;
    gap: 10px;
}
.card-buttons button {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #888;
    background: rgba(42, 42, 42, 0.6);
    color: #fff;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}
.card-buttons button:hover {
    border-color: #fff;
    background-color: #333;
}

/* Logic para sa pag-hover sa Desktop */
@media (min-width: 769px) {
    .movie-card:hover {
        transform: scale(1.15) translateY(-10%);
        z-index: 10;
        box-shadow: 0 10px 30px rgba(0,0,0,0.7);
    }
    .movie-card:hover .movie-card-details {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}

/* ===== BAGO: STATIC PAGE STYLES ===== */
.static-page-container {
    padding: 120px 40px 60px; /* Top padding for navbar, side, bottom */
    min-height: 80vh; /* Ensure footer is pushed down */
    display: flex;
    flex-direction: column;
    align-items: center;
}
.static-page-content {
    background-color: var(--light-dark-color);
    padding: 30px 40px;
    border-radius: 8px;
    max-width: 800px;
    width: 100%;
}
.static-page-content h1 {
    font-size: 2.5rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 30px;
}
.static-page-content p, .static-page-content ul {
    line-height: 1.8;
    color: #ccc;
    margin-bottom: 15px;
}
.static-page-content a {
    color: var(--primary-color);
    text-decoration: none; /* Removed underline for a cleaner look */
    transition: opacity 0.2s ease;
}
.static-page-content a:hover {
    opacity: 0.8;
}
.static-page-content strong {
    color: #fff;
}
.static-page-content ul {
    list-style-position: inside;
    padding-left: 10px;
}


/* ===== FOOTER ===== */
.footer {
  padding: 40px 60px;
  text-align: center;
  color: #808080;
  border-top: 1px solid #222;
  margin-top: 50px;
}
.footer-links {
  margin-top: 15px;
  display: flex;
  justify-content: center;
  gap: 20px;
}

/* ===== MODALS (GENERAL) ===== */
.modal {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.9); display: none; z-index: 2000;
  align-items: center; justify-content: center;
}
.modal-content {
  background: #181818;
  border-radius: 8px;
  max-width: 700px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}
.close {
  position: absolute; top: 15px; right: 20px;
  font-size: 2rem; cursor: pointer; color: #aaa;
  z-index: 10;
}

/* ===== WATCH HISTORY MODAL ===== */
#watch-history-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 20px;
  padding: 20px;
  max-height: 70vh;
  overflow-y: auto;
}
#clear-history-btn {
  position: absolute; top: 15px; right: 60px;
  background: #333; color: #fff; border: none;
  width: 40px; height: 40px; border-radius: 50%;
  font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background-color 0.3s ease, transform 0.2s ease;
  z-index: 10;
}
#clear-history-btn:hover {
  background-color: #e53935;
  transform: scale(1.1);
}

/* BAGO: Modern Watch History Item Styles */
.history-item {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border-radius: 6px;
    aspect-ratio: 2 / 3;
}
.history-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.history-item:hover img {
    transform: scale(1.1);
}
.history-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
}
.history-item-title {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 500;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.play-icon-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.play-icon-overlay i {
    font-size: 2.5rem;
    color: #fff;
}
.history-item:hover .play-icon-overlay {
    opacity: 1;
}


/* ===== DETAILS MODAL ===== */
#details-modal .details-modal-content {
    position: relative;
    background-color: #181818;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    display: block;
}
.modal-backdrop {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  background-size: cover; background-position: center top;
  filter: brightness(0.3); z-index: 1;
}
.modal-body {
  position: relative;
  z-index: 2;
  width: 100%;
  height: auto;
  display: flex; align-items: flex-end;
  padding: 30px;
  background-image: linear-gradient(to top, rgba(24, 24, 24, 1) 20%, transparent 70%);
}
.modal-body img#modal-poster {
  width: 200px; height: 300px;
  object-fit: cover; border-radius: 6px;
  margin-right: 25px; flex-shrink: 0;
  box-shadow: 0 5px 25px rgba(0,0,0,0.5);
}
.modal-text { color: #fff; width: 100%; }
#modal-title {
  font-size: 2.5rem; font-weight: 700;
  margin-bottom: 10px; text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}
.modal-meta {
  display: flex; gap: 20px; margin-bottom: 15px;
  font-weight: 600; color: #ccc;
}
#modal-description {
  font-size: 1rem; line-height: 1.6;
  max-height: 100px; overflow-y: auto;
  margin-bottom: 15px;
}
.modal-genres { display: flex; gap: 8px; flex-wrap: wrap; }
.genre-tag {
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 5px 12px; border-radius: 15px; font-size: 0.8rem;
}
.modal-buttons {
  margin-top: 20px;
}

/* ===== MODERN SEARCH MODAL ===== */
.search-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background: rgba(0, 0, 0, 0.95);
    padding: 20px;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.search-modal.active {
    opacity: 1;
    visibility: visible;
}
.search-content {
    width: 100%;
    max-width: 800px;
    margin-top: 60px;
    position: relative;
}
.search-modal .close {
    top: -10px;
    right: 0;
}
.search-input-container {
    position: relative;
    width: 100%;
}
.search-input-container .fa-search {
    position: absolute;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    color: #888;
    font-size: 1.2rem;
}
#search-input {
    width: 100%;
    padding: 18px 20px 18px 60px;
    font-size: 1.2rem;
    color: #fff;
    background-color: #1c1c1c;
    border: 1px solid #333;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}
#search-input:focus {
    border-color: var(--primary-color);
    background-color: #222;
}
#search-results {
    display: flex; flex-wrap: wrap; 
    justify-content: center; 
    gap: 10px; 
    margin-top: 25px;
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 10px;
}

/* ===== WELCOME MODAL ===== */
.welcome-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.welcome-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}
.welcome-modal-content {
    background-color: var(--light-dark-color);
    padding: 30px;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 5px 25px rgba(0,0,0,0.5);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}
.welcome-modal-overlay.active .welcome-modal-content {
    transform: scale(1);
}
.welcome-modal-content h2 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: #fff;
}
.welcome-modal-content p {
    color: #ccc;
    line-height: 1.7;
    margin-bottom: 25px;
}
#welcome-modal-close-btn {
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 5px;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s ease;
}
#welcome-modal-close-btn:hover {
    opacity: 0.8;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .navbar { padding: 15px 20px; }
  
  .hamburger-menu {
      display: block;
  }
  .hamburger-menu.active .bar:nth-child(2) {
      opacity: 0;
  }
  .hamburger-menu.active .bar:nth-child(1) {
      transform: translateY(8px) rotate(45deg);
  }
  .hamburger-menu.active .bar:nth-child(3) {
      transform: translateY(-8px) rotate(-45deg);
  }

  .nav-links {
      position: fixed;
      left: -100%;
      top: 0;
      height: 100vh;
      width: 70%;
      max-width: 280px;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 30px;
      background-color: var(--dark-color);
      box-shadow: 2px 0 10px rgba(0,0,0,0.5);
      transition: left 0.3s ease-in-out;
  }
  .nav-links.active {
      left: 0;
  }
  .nav-links a {
      font-size: 1.2rem;
  }

  .hero-section { padding: 0 20px; }
  .hero-title { font-size: 2.5rem; }
  .hero-description { font-size: 1rem; }
  .main-container { padding: 0 20px; }
  .movie-card { width: 140px; }
  #clear-history-btn { top: 10px; right: 50px; }
  
  .modal-body { flex-direction: column; align-items: center; text-align: center; padding-top: 60%; }
  .modal-body img#modal-poster { display: none; }
  #modal-title { font-size: 2rem; }
  .modal-meta { justify-content: center; }
  .modal-buttons {
    display: flex;
    justify-content: center;
  }
  .static-page-container { padding: 100px 20px 40px; }
  .static-page-content h1 { font-size: 2rem; }
}

/* ===== STYLES PARA SA CAST AT SIMILAR MOVIES ===== */
#cast-list h2, #similar-movies h2 {
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 15px;
  border-left: 4px solid var(--primary-color);
  padding-left: 10px;
}

.extra-list-container {
    position: relative;
}
.extra-list {
  display: flex; 
  gap: 10px;
  overflow-x: auto; 
  padding-bottom: 20px;
  scroll-behavior: smooth;
}
.extra-list::-webkit-scrollbar { 
    display: none;
}
.extra-list .movie-card { width: 150px; }

.extra-list-container .scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.extra-list-container .scroll-btn.left {
    left: -20px;
}
.extra-list-container .scroll-btn.right {
    right: -20px;
}
@media (min-width: 769px) {
    .extra-list-container:hover .scroll-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 1;
    }
}

.cast-item {
  width: 140px;
  flex-shrink: 0;
  text-align: center;
}
.cast-item img {
  width: 100%;
  height: 210px;
  object-fit: cover;
  border-radius: 8px;
  background-color: #222;
}
.cast-item p {
  margin-top: 8px;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}