* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Inter", sans-serif;
  line-height: 1.2;
}

body {
  background-color: #222222;
}

.container {
  max-width: 750px;
  height: 779px;
  margin: 2rem auto;
  background-color: #ffffff;
  display: flex;
  flex-direction: column;
  overflow-y: scroll;
}

header,
main {
  display: grid;
  grid-template-areas: ". content .";
  grid-template-columns: 1fr 10fr 1fr;
}

header {
  width: 100%;
  height: 208px;
  background: linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.8)),
    url("/images/header-img.png");
  background-size: cover;
  background-position: 25% 25%;
  color: #ffffff;
}

header > .wrapper {
  grid-area: content;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

h1 {
  margin: 0;
  padding: 0;
  font-size: 2.6rem;
  font-weight: 800;
}

ul {
  list-style-type: none;
}

ul > li > a {
  text-decoration: none;
  color: #ffffff;
  font-size: 0.8rem;
  cursor: pointer;
}

ul > li > a:hover {
  text-decoration: underline;
}

main {
  width: 100%;
  height: 571px;
}

main > .wrapper {
  grid-area: content;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
}

.search-container {
  align-self: stretch;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid #d1d5db;
  border-radius: 5px;
  height: 2.5rem;
  margin-top: -1.25rem;
  background: #ffffff;
  color: #374151;
  z-index: 20;
}

.search-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 10%;
  height: 100%;
  margin: 0;
  border: none;
  border-radius: 5px 0 0 5px;
}

.search-container > img {
  width: 20px;
  height: 20px;
}

.search-container > input {
  width: 80%;
  height: 100%;
  border: none;
  padding: 0.5rem 0.5rem 0.5rem 0.5rem;
  font-size: 1rem;
  border: none;
  outline: none;
  background: transparent;
  color: inherit;
}

#search-button {
  width: 20%;
  height: 100%;
  border: none;
  background: transparent;
  cursor: pointer;
  background: #f9fafb;
  border: 1px solid #d1d5db;
  border-top: none;
  border-bottom: none;
  border-right: none;
  border-radius: 0 5px 5px 0;
  outline: none;
  color: inherit;
  cursor: pointer;
}

#search-button:hover {
  background: #f3f4f6;
}

.movies-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin: 3rem 0;
}

.placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-size: 1.25rem;
  color: #dfdddd;
  text-align: center;
}

.placeholder > img {
  width: 70px;
  margin: 0 0 0.5rem 0;
}

.placeholder > p {
  margin: 0;
  padding: 0;
  font-weight: 700;
  width: 60%;
}

.placeholder > a {
  text-decoration: none;
  color: #374151;
  cursor: pointer;
  margin: 1rem 0 0 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hidden {
  display: none;
}

.movie {
  width: 100%;
  display: flex;
  align-items: center;
  pad: 1.25rem 0;
  gap: 1.5rem;
  border-bottom: 1.5px solid #e5e7eb;
  padding: 0 0 1rem 0;
}

.movie-img {
  width: 99px;
  height: 147px;
  border-radius: 2px;
  font-size: 0.75rem;
}

.movie-info {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.top-info {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.top-info > h2 {
  font-size: 1.125rem;
  font-weight: 500;
  margin: 0 0.5rem 0 0;
  width: fit-content;
}

.rating {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 0 0 0 0.5rem;
  width: 10%;
}

.rating > img {
  margin: 0 0 0.2rem 0;
  width: 12px;
  height: 12px;
}

.rating > p {
  margin: 0;
  font-size: 0.75rem;
}

.mid-info {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  margin: 0;
  font-size: 0.75rem;
  font-weight: 400;
  color: #111827;
}

.mid-info > button {
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  font-size: inherit;
  margin: 0 0 0.2rem 0;
}

.mid-info > button > span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
}

.mid-info > button > img {
  width: 12px;
  height: 12px;
}

.bottom-info {
  width: 100%;
  font-size: 0.875rem;
  font-weight: 400;
  color: #6b7280;
  margin: 0;
  line-height: 1.5rem;
}

.bottom-info > p {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
}

.pagination {
  width: 100%;
  display: none;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 0 1.5rem 0;
}

.pagination > button {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
  color: #6b7280;
}

.pagination > button:hover {
  color: #111827;
  font-weight: 500;
  color: #111827;
  font-weight: 500;
}

.page-number {
  color: #111827;
  font-weight: 500;
  font-size: 0.75rem;
  margin: 0.2rem 0 0 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.page-number > p {
  margin: 0;
  padding: 0;
  text-decoration: underline;
}

.page-number :nth-child(2) {
  color: #6b7280;
  font-style: italic;
  text-decoration: none;
}

.pagination > button:disabled,
.pagination > button:disabled:hover {
  cursor: not-allowed;
  color: #9da7ba;
  font-weight: 400;
}

.added-to-watchlist {
  color: #10b981;
  cursor: not-allowed;
}

#search-results {
  color: #6b7280;
  font-size: 0.75rem;
  font-weight: 400;
  margin: 2rem 0 0 0;
}

.loader {
  border: 6px solid rgba(0, 0, 0, 0.1);
  border-top: 6px solid #171717;
  border-radius: 50%;
  width: 3rem;
  height: 3rem;
  animation: spin 1s linear infinite;
}

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

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

@media screen and (max-width: 768px) {
  html,
  body {
    width: 100vw;
    height: 100vh;
    overflow-x: hidden;
  }
  .container {
    width: 100%;
    height: 100%;
    margin: 0;
  }

  main {
    height: 80%;
  }

  header {
    height: 20%;
  }
}

/* ----- Animations ----- */
.content {
  opacity: 0;
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
  transform: translateY(10px); /* optional subtle lift */
}

.content.fade-in {
  opacity: 1;
  transform: translateY(0);
}

