@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  background-color: #0d0d0d;
  color: #f5f5f5;
}

a {
  text-decoration: none;
  color: inherit;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 30px;
  background-color: #1a1a1a;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 10px rgba(0,0,0,0.6);
}

.navbar img {
  height: 45px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}


.nav-links a {
  color: #ccc;
  padding: 6px 12px;
  border-radius: 5px;
  transition: background 0.3s;
}

.nav-links a:hover {
  background-color: #333;
  color: #00bcd4;
}

/* Make nav-links wrap on small screens */
@media (max-width: 768px) {
  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* Style nav buttons */
.nav-links a {
  font-weight: 500;
  font-size: 1rem;
}


.search-bar {
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  background: #2c2c2c;
  color: #fff;
}

.banner {
  height: 55vh;
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex;
  align-items: center;
  padding: 20px;
}

.banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, #0d0d0d, transparent);
  z-index: 1;
}

.banner h1 {
  position: relative;
  z-index: 2;
  font-size: 3rem;
  font-weight: 600;
  color: #fff;
  max-width: 80%;
}

.row {
  margin: 40px 30px;
}

.row h2 {
  margin-bottom: 15px;
  font-weight: 500;
  color: #00bcd4;
}

.list {
  display: flex;
  overflow-x: auto;
  gap: 15px;
  padding-bottom: 10px;
}

.list img {
  width: 160px;
  border-radius: 12px;
  transition: transform 0.3s ease, filter 0.3s ease;
  cursor: pointer;
}

.list img:hover {
  transform: scale(1.08);
  filter: brightness(1.3);
  z-index: 2;
}

.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  justify-content: center;
  align-items: flex-start; /* Start from top instead of centering */
  overflow-y: auto; /* Allow scrolling */
  z-index: 1001;
  padding: 30px 10px;
}


.modal-content {
  background: #1e1e1e;
  padding: 25px;
  width: 100%;
  max-width: 800px;
  border-radius: 12px;
  text-align: center;
  position: relative;
}

.modal-content {
  margin-top: 60px; /* Push modal down a bit */
}


.modal-body {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
}

.modal-body img {
  width: 30%;
  border-radius: 8px;
}

.modal-text {
  flex: 1;
  text-align: left;
}

.stars {
  color: #fbc02d;
  margin: 10px 0;
}

.close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 28px;
  font-weight: bold;
  color: #ff5252;
  cursor: pointer;
  z-index: 10;
  background: transparent;
  border: none;
}

.close {
  padding: 8px;
  line-height: 1;
}


.server-selector {
  margin: 15px 0;
  text-align: left;
  color: #aaa;
}

.server-selector select {
  background: #2c2c2c;
  color: #fff;
  padding: 8px;
  border-radius: 6px;
  border: none;
}

.search-modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.9);
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 200;
  padding: 20px;
}

.search-modal input {
  width: 300px;
  padding: 12px;
  margin-bottom: 20px;
  border-radius: 6px;
  border: none;
  background: #333;
  color: #fff;
}

.search-modal .results {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
}

.search-modal img {
  width: 120px;
  border-radius: 8px;
  cursor: pointer;
}

.search-modal .close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 30px;
  color: #ff5252;
}

/* Footer */
.footer {
  background: #1a1a1a;
  color: #aaa;
  padding: 30px;
  text-align: center;
  margin-top: 40px;
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-links a {
  color: #00bcd4;
  transition: color 0.3s;
}

.footer-links a:hover {
  color: #fff;
}

/* Responsive */
@media (max-width: 768px) {
  .banner {
    flex-direction: column;
    justify-content: center;
    padding: 15px;
    height: 45vh;
  }

  .banner-content {
    max-width: 100%;
    align-items: flex-start;
  }

  .banner-content h1 {
    font-size: 1.8rem;
    margin-bottom: 12px;
  }

  .play-btn {
    font-size: 0.9rem;
    padding: 8px 16px;
  }

  .list img {
    width: 120px;
  }

  .movie-label {
    width: 120px;
    font-size: 13px;
    padding: 4px 8px;
  }
}


  .modal-body {
    flex-direction: column;
    align-items: center;
  }

  .modal-body img {
    width: 80%;
  }

  .search-modal input {
    width: 90%;
  }

  .list img {
    width: 130px;
  }


@media (max-width: 480px) {
  .navbar {
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 15px;
  }

  .nav-links {
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }

  .banner {
    height: 35vh;
  }

  .row {
    margin: 20px 15px;
  }

  .row h2 {
    font-size: 18px;
  }
}

/* Loader */
#loader {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: none;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.9);
  z-index: 9999;
}

#loader::after {
  content: "";
  width: 50px;
  height: 50px;
  border: 6px solid #00bcd4;
  border-top: 6px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.movie-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.7);
  padding: 6px 10px;
  border-radius: 8px;
  margin-top: 8px;
  font-size: 14px;
  color: #fff;
  width: 160px; /* Same as .list img width */
  box-sizing: border-box;
}

.movie-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.movie-rating {
  margin-left: 8px;
  color: #fbc02d;
  flex-shrink: 0;
}

.play-btn {
  position: relative;
  z-index: 2;
  margin-top: 15px;
  padding: 10px 24px;
  font-size: 1rem;
  font-weight: 500;
  background-color: #fff;
  color: #000;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s;
}

.play-btn:hover {
  background-color: #e0e0e0;
}

.banner-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 80%;
}

.banner-content h1 {
  margin-bottom: 15px;
}

.play-btn {
  padding: 10px 24px;
  font-size: 1rem;
  font-weight: 500;
  background-color: #fff;
  color: #000;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s;
}

.play-btn:hover {
  background-color: #e0e0e0;
}

/* Hide hamburger on desktop */
.hamburger {
  display: none;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Show hamburger and hide nav links on mobile */
@media (max-width: 768px) {
  .hamburger {
    display: block;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    background: #111; /* Optional: dark background */
    position: absolute;
    top: 60px; /* below navbar */
    left: 0;
    padding: 10px 0;
  }

  .nav-links.show {
    display: flex;
  }

  .nav-links a, .nav-links .search-bar {
    padding: 10px 20px;
  }
}

/* Navbar default layout */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  position: relative;
}

/* Search bar stays in middle */
.search-bar {
  flex: 1;
  max-width: 300px;
  margin: 0 15px;
  padding: 8px 12px;
  border-radius: 20px;
  border: none;
}

/* Nav links default */
.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Mobile responsive tweaks */
@media (max-width: 768px) {
  .navbar {
    flex-wrap: wrap;
  }

  .search-bar {
    order: 2;
    flex: 1;
    margin: 10px 0;
  }

  .logo {
    order: 1;
  }

  .hamburger {
    order: 3;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    background: #111;
    position: absolute;
    top: 60px;
    left: 0;
    padding: 10px 0;
  }

  .nav-links.show {
    display: flex;
  }

  .nav-links a {
    padding: 10px 20px;
  }
}
