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

:root {
  --theme: #1a1a1a;
  --radius: 6px;
}

/*header*/
header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 15px 30px;
  background: #3333331a;
  z-index: 100;
  gap: 10px;
  width: 100%;
  /* padding-bottom: 0; */
}

.logo img {
  height: 45px;
  width: auto;
}

/*search*/
.search-container {
  flex: 1;
  max-width: 55rem;
  display: flex;
  flex-direction: column;
}
.search-inner {
  position: relative;
  width: 100%;
}

.dropdown-button {
  background: transparent;
}
.search-bar,
.dropdown-button {
  color: #fff;
  border: none;
  border-radius: var(--radius);
}

.search-bar {
  background: var(--theme);
  width: 100%;
  padding: 15px 40px 15px 15px;
  border-radius: 10px;
  transition: 0.3s ease;
}
.search-bar:focus {
  -webkit-box-shadow: 0px 0px 200px -3px #fff71888;
  box-shadow: 0px 0px 20px -3px #fff71888;
  border: none;
  outline: none;
}
.search-button {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
}

.search-button img {
  width: 20px;
  height: 20px;
  opacity: 0.6;
  transition: opacity 0.5s ease;
}

.search-button:hover img {
  opacity: 1;
}

.search-error {
  color: #ff4d4d;
  font-size: 0.9rem;
  min-height: 1rem;
  /* visibility: hidden; */
  display: none;
}

.search-error.show {
  display: block;
}

.autocomplete-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--theme);
  border: 1px solid #141414;
  border-radius: 4px;
  margin-top: 5px;
  max-height: 30rem;
  overflow-y: auto;
  z-index: 1000;
  display: none;
}
.autocomplete-suggestions > * {
  padding: 10px;
  border-bottom: 1px solid #454545;
  display: flex;
  gap: 20px;
  transition: 0.5s ease;
  cursor: pointer;
}
.autocomplete-suggestions > * :hover {
  opacity: 0.8;
}
.autocomplete-suggestions .img {
  flex-basis: 80px;
  height: auto;
  min-width: 80px;
}
.autocomplete-suggestions .img img {
  width: 100%;
  height: 100%;
}
.autocomplete-suggestions .txt {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 10px 0;
}

/*dropdown*/
.dropdown {
  margin-top: 0.5rem;
  position: relative;
  align-self: start;
}

.dropdown-button {
  padding: 8px 12px;
  cursor: pointer;
  transition: 0.5s ease;
}
.dropdown-button:hover {
  opacity: 0.8;
  background-color: var(--theme);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: -2.6rem;
  display: none;
  flex-direction: column;
  background: var(--theme);
  border: 1px solid #141414;
  border-radius: var(--radius);
  min-width: 150px;
  max-height: 23rem;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 1000;
}

.dropdown-menu a {
  padding: 10px;
  display: block;
  color: #fff;
  text-decoration: none;
  transition: background 0.5s;
}

.dropdown-menu a:hover {
  background: #333;
}

/*responsive*/
@media (max-width: 992px) {
  .logo img {
    height: 45px;
  }
  .search-container {
    max-width: 100%;
  }
}

@media (max-width: 600px) {
  header {
    flex-direction: column;
    align-items: stretch;
    padding: 15px;
  }

  .logo {
    display: flex;
    justify-content: center;
    width: 100%;
  }

  .logo img {
    height: 50px;
    margin: 5px;
  }

  .dropdown,
  .search-container {
    width: 100%;
  }

  .dropdown-button {
    width: 100%;
  }

  .dropdown-menu {
    position: static;
    border: none;
    border-radius: 0;
    width: 100%;
  }

  .dropdown-menu a {
    text-align: center;
    border-bottom: 1px solid #333;
  }
}

.movies {
  margin-top: 2rem;
  width: 100%;
  padding: 2rem 4rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px;
  align-items: center;
}

.movie-wrapper {
  max-width: 300px;
  height: 650px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background-color: var(--theme);
  padding: 25px;
  justify-content: space-between;
  overflow: hidden;
  border-radius: 15px;
}

.movie-wrapper .title {
  font-weight: 700;
  font-size: 1.3rem;
}

.movie-wrapper figure {
  margin: -25px;
  max-width: 300px;
  max-height: 600px;
  margin-bottom: 8px;
}

.movie-wrapper figure img {
  width: 100%;
  height: auto;
}

.movie-wrapper .info-wrapper {
  width: 100%;
  display: flex;
  justify-content: space-between;
}

.movie-wrapper .rating {
  display: inline-flex;
  justify-self: center;
  align-items: center;
  gap: 4px;
}

.movie-wrapper .rating img {
  width: 1rem;
}

.movie-wrapper .rating span {
  padding-top: 5px;
}

.movie-wrapper .info-wrapper a {
  color: #1c97ff;
  text-decoration: none;
  padding: 13px;
  background-color: #363636;
  border-radius: 15px;
  transition: 0.5s ease;
}

.movie-wrapper .info-wrapper a:hover {
  opacity: 0.7;
}

footer {
  padding: 45px 20px 30px;
  text-align: center;
  font-size: 0.8rem;
  font-weight: lighter;
}

.pagination {
  flex-wrap: wrap;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 20px;
  color: #fff;
  font-family: sans-serif;
  margin: 30px;
}

.pagination button,
.pagination span {
  background: none;
  border: none;
  cursor: pointer;
  color: #fff;
  font-size: 16px;
}

.pagination .prev,
.pagination .next {
  background-color: #111;
  border-radius: 50%;
  padding: 6px 10px;
  transition: 0.5s ease;
}
.page-numbers {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}
.pagination .page-btn {
  padding: 6px 10px;
  border-radius: 50%;
  color: #fff;
  text-decoration: none;
  transition: 0.5s ease;
}
.pagination .page-btn:hover,
.pagination .prev:hover,
.pagination .next:hover {
  background-color: #c9c9c9a3;
}
.pagination .page-btn.active {
  background-color: gold;
  color: #000;
  font-weight: bold;
}

.pagination .dots {
  padding: 6px 10px;
  cursor: default;
}

/* scrollbar */
*::-webkit-scrollbar {
  height: 7px;
  width: 7px;
  transition: 1s;
}
*::-webkit-scrollbar-track {
  border-radius: 5px;
  background-color: #454545;
}

*::-webkit-scrollbar-track:hover {
  background-color: #454545;
}

*::-webkit-scrollbar-track:active {
  background-color: #454545;
}

*::-webkit-scrollbar-thumb {
  border-radius: 5px;
  background-color: #ffffff;
}

*::-webkit-scrollbar-thumb:hover {
  background-color: #c8c8c8;
}

*::-webkit-scrollbar-thumb:active {
  background-color: #ffffff;
}

.loader {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: inline-block;
  position: relative;
  border: 3px solid;
  border-color: #fff #fff transparent transparent;
  box-sizing: border-box;
  animation: rotation 1s linear infinite;
}

.loader::after,
.loader::before {
  content: "";
  box-sizing: border-box;
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  margin: auto;
  border: 3px solid;
  border-color: transparent transparent #ffea00 #ffea00;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  box-sizing: border-box;
  animation: rotationBack 0.5s linear infinite;
  transform-origin: center center;
}

.loader::before {
  width: 32px;
  height: 32px;
  border-color: #fff #fff transparent transparent;
  animation: rotation 1.5s linear infinite;
}

@keyframes rotation {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
@keyframes rotationBack {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(-360deg);
  }
}
