@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap");

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

html {
  scroll-behavior: smooth;
}

body {
  background: #000;
  color: #eee;
  font-family: "Poppins", sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

body::-webkit-scrollbar {
  display: none;
}

::selection {
  background-color: #fff;
  color: #000;
}

.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 15px 30px;
  z-index: 1020;
  background: rgba(0, 0, 0, 0.514);
  backdrop-filter: blur(10px);
  animation: fadeInDown .5s ease both;
  transition: background .3s ease, box-shadow .3s ease;
  display: flex;
  gap: 10px;
}

.header-icon {
  width: 34px;
  height: 34px;
}

.header-title {
  font-size: 23px;
  font-weight: 600;
  letter-spacing: 1px;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, .5);
  white-space: nowrap;
}

.fixed-search {
  position: absolute;
  top: 180px;
  left: 0;
  width: 100%;
  padding: 20px 0;
  z-index: 1015;
  transition: top .3s ease, background .3s ease;
}

.fixed-search .search-container {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
}

.fixed-search .search-container input {
  width: 100%;
  padding: 14px 20px 14px 50px;
  border: 1px solid #ffffff1a;
  border-radius: 50px;
  background-color: #08080894;
  background-image: url('/assets/images/search.png');
  background-repeat: no-repeat;
  background-position: 10px center;
  background-size: 35px 35px;
  color: #eee;
  font-size: 18px;
  outline: none;
  transition: all .2s ease;
  backdrop-filter: blur(10px);
}

.fixed-search .search-container input:hover,
.fixed-search .search-container input:focus {
  border: 1px solid #ffffff69;
}

.fixed-search .search-container input::placeholder {
  color: #bbb;
  font-size: 16px;
}

.hero {
  margin-top: 50px;
  padding: 80px 20px 40px;
  text-align: center;
  animation: fadeIn .6s ease both;
}

.hero h1 {
  font-size: 30px;
  margin-bottom: 10px;
  color: #fff;
  text-shadow: 0 3px 8px rgba(0, 0, 0, .8);
}

.main-content {
  padding: 40px 20px;
  margin-top: 20px;
  animation: fadeInUp .6s ease both;
}

.section {
  margin-bottom: 60px;
}

.section-header {
  position: relative;
  font-size: 32px;
  font-weight: 500;
  margin-bottom: -25px;
  color: #fff;
  animation: fadeIn .6s ease both;
}

.section-header::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 80px;
  height: 4px;
  background: #fff;
  border-radius: 2px;
  transition: width .5s ease;
}

.section-header:hover::after {
  width: 220px;
}

.movies-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  transition: opacity .3s ease;
}

#search-results {
  margin-bottom: 60px;
  animation: fadeIn .6s ease both;
}

.search-info {
  text-align: center;
  margin-bottom: 15px;
  font-size: 16px;
  color: #ccc;
}

.load-more {
  display: block;
  margin: 20px auto;
  padding: 10px 20px;
  background: #222;
  border: none;
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  transition: background .3s ease;
}

.load-more:hover {
  background: #333;
}

.end-message {
  text-align: center;
  margin-top: 20px;
  opacity: 0;
  font-size: 16px;
  color: #aaa;
  animation: fadeIn .6s forwards;
}

.movie {
  position: relative;
  width: 180px;
  height: 300px;
  background: #222;
  border-radius: 12px;
  overflow: hidden;
  transform: scale(.97);
  transition: transform .2s ease;
  cursor: pointer;
  animation: fadeIn .4s ease both;
}

.movie img {
  width: 100%;
  height: 100%;
  display: block;
  transition: transform .2s ease;
}

.movie:hover img {
  transform: scale(1.17);
}

.movie-info {
  position: absolute;
  bottom: 0;
  width: 100%;
  padding: 12px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .9));
  opacity: 0;
  transform: translateY(100%);
  transition: opacity .2s ease, transform .2s ease;
}

.movie:hover .movie-info {
  opacity: 1;
  transform: translateY(0);
}

.movie-info h3 {
  font-size: 18px;
  color: #fff;
  margin-bottom: 4px;
}

.rating {
  font-size: 16px;
  color: #ccc;
}

#overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-color: rgba(0, 0, 0, .85);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
  z-index: 2000;
}

#overlay.show {
  opacity: 1;
  visibility: visible;
}

#content {
  background: #0e0e0e;
  padding: 30px;
  width: clamp(300px, 80vw, 800px);
  border-radius: 16px;
  position: relative;
  color: #eee;
  animation: in 0.3s forwards;
  margin: 0 auto;
  box-sizing: border-box;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#content::-webkit-scrollbar {
  display: none;
}

#content {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.close-btn {
  position: absolute;
  top: 5px;
  right: 15px;
  font-size: 32px;
  background: transparent;
  color: #eee;
  border: none;
  cursor: pointer;
  transition: transform .2s ease, color .2s ease;
}

.close-btn:hover {
  transform: rotate(90deg);
  color: #adadad;
}

#movie-title {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 5px;
  color: #fff;
}

#movie-details {
  font-size: 16px;
  color: #a5a5a5;
  line-height: 1.5;
  margin-bottom: 5px;
}

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 30px;
  font-size: 20px;
  color: #fff;
}

.spinner {
  width: 30px;
  height: 30px;
  border: 4px solid rgba(255, 255, 255, .3);
  border-top: 4px solid #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin-right: 10px;
}

.no-movies {
  font-size: 18px;
  text-align: center;
  margin-top: 30px;
  color: #fff;
}

.video-container {
  width: 100%;
  margin-top: 20px;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
}

.video-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.slider-container {
  position: relative;
  overflow: hidden;
  margin: 0 auto;
  padding-top: 50px;
}

.slider-track {
  display: flex;
  gap: 20px;
  transition: transform .3s ease;
  will-change: transform;
}

.slider-btn {
  position: absolute;
  top: 0;
  width: 50px;
  height: 40px;
  background: transparent;
  border: none;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
  transition: background-color .2s;
}

.slider-btn.prev {
  right: 55px;
}

.slider-btn.next {
  right: 5px;
}

.slider-btn:hover {
  background: rgba(32, 35, 39, 1);
}

.slider-track .movie {
  min-width: 180px;
}

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

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes in {
  from {
    opacity: 0;
    transform: scale(.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

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

@media (max-width: 768px) {
  .header-title {
    font-size: 22px;
  }
  .hero h1 {
    font-size: 25px;
    margin-bottom: 20px;
  }
  .fixed-search .search-container input {
    font-size: 16px;
    padding: 12px 18px 12px 44px;
  }
  .movie {
    width: 180px;
  }
  .movie-info h3 {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .header-title {
    font-size: 20px;
  }
  .hero h1 {
    font-size: 20px;
    margin-bottom: 40px;
  }
  .fixed-search .search-container input {
    font-size: 14px;
    padding: 10px 14px 10px 40px;
  }
  .movie {
    width: 150px;
  }
  .movie-info h3 {
    font-size: 14px;
  }
  .slider-track .movie {
    min-width: 150px;
  }
}