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


body {
  font-family: Rubik, Arial, sans-serif;
  background-color: #15151d;
  margin: 0;
  height: 100%;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.container {
  flex: 1;
  background-color: #15151D;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: start;

}
h1 {
  margin: 0;
}
form {
  margin-bottom: 20px;
}
input[type="text"] {
  width: 70%;
  padding: 10px;
  margin-block: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
}

button {
  padding: 10px 20px;
  border: none;
  background-color: #333;
  color: #fff;
  border-radius: 5px;
  cursor: pointer;
}

button:hover {
  background-color: #555;
}

#backBtn {
  margin-top: 20px;
}

#results {
  margin-top: 20px;
  margin-bottom: 1rem;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  padding: 0 40px;
}

#results p{
  color:red;
  text-align: center; 
  width: 100%;
}
.movie {
  padding: 10px;
  border-radius: 5px;
  width: 100%;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  justify-content: space-around;
  gap: 2rem;
  transition: all 0.5s;
}

.movie h2 {
  text-align: center;
  color: #fff;
  font-size: 1em;
  margin: 0;
  font-weight: 400;
}

.movie p {
  display: -webkit-box;
  font-size: 0.9em;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
  overflow: hidden;
  color: #666;
}

img {
  max-width: 100%;

  vertical-align: middle;
  font-style: italic;
  background-repeat: no-repeat;
  background-size:cover;
  shape-margin: 1rem;
  border-radius: 5px;
  margin-top: 10px;
}

/*  */
.cover {
  background: url("images/cover.png") no-repeat;
  background-size: cover;
  width: 100%;
  height: 100%;
  padding: 1.5rem 3rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 5rem;
  border-radius: 0 0 30px 30px;
  border-bottom: 1px solid #707070;
}
.logo {
  width: auto;
  height: 2rem;
  float: left;
}
.nav {
  width: 100%;
}
.content {
  color: #c5c5c5;
  display: flex;
  flex-direction: column;
  text-align: left;
  gap: 10px;
}
.intro {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: start;
  gap: 20px;
  width: 100%;
  font-size: 2rem;
}
#searchForm {
  display: flex;
  flex-direction: row;
  justify-content: start;
  align-items: center;
  width: 100%;
  height: 4rem;
  background-color: #000;
  border-radius: 50px;
  border: 0.5px solid #5B5B5B;
  overflow: hidden;
}
#searchForm input {
  height: 100%;
  width: 85%;
  background-color: #000;
  border: none;
  padding-left: 20px;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: #fff;
  outline: none;
}
#searchForm button {
  height: 100%;
  width: 15%;
  border-radius: 50px;
  background-color: #f4b41a;
  font-size: 1.2rem;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  transition: all 0.5s;
}
#searchForm button:hover {
  font-size: 1.6rem;
}

.load_more_btn{
  z-index: 9999;
  background: white;
  color: black;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  width: 50%;
  justify-self: center;
  grid-column: 1/ -1; /* span across all cols */
  margin-bottom: 5rem;
  margin-inline: 10px;
}

footer {
  background-color: #000;
  color: #fff;
  margin-top: auto; 
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  height: 75px;
  position: relative;
  bottom: 0;
  flex-shrink: 0;
  padding: 10px 0;
  gap: 10px;
}
.crd {
  font-size: 0.9rem;
  font-weight: 600;
}
.api_crd {
  font-size: 0.8rem;
  font-weight: 400;
}

.movie{
  cursor: pointer;
}

.movie:hover{
  scale: 1.1;
}
.movie-details{
  width: 60vw;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.movie_cast_div{
    /* grid layout for the cast */
    display: grid;
    justify-content: center;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    place-items: center;
}
.movie_details_wrapper{
  background-color: #1F1F29;
  padding: 20px;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 30px;
  border-radius: 15px;
}
.movie_details_wrapper img{
  margin: 0;
  width: auto;
  height: 400px;
}
.movie_details_wrapper p:nth-last-child(6){
  color: #777777;
  font-size: 1.2rem;
}
.movie_info{
  color: white;
  display: flex;
  flex-direction: column;
  gap: 25px;
}
.movie_info h2{
  font-size: 30px;
  margin: 0;
}
.trailer_button{
  width: 200px;
  background-color:  #F4B41A;
  border-radius: 50px;
}
.movie-cast {
   background-color: #1F1F29; 
   border-radius: 15px;
   padding: 20px;
   color: #fff;
   display: flex;
   flex-direction: column;
   gap: 20px;
   margin-bottom: 100px;
}
.movie-cast h3{
  font-size: 20px;
}
.cast_div_container{
  width: 150px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items:flex-start;
  text-align: center;
}
#recommended_movies{
  width: 35vw;
  display: flex;
  flex-direction: column;
  justify-content: start;
  align-items: center;
  position: sticky;
  top: 0;
  right: 0;
}
.recom_movie_container{
  max-height: 83vh;
  background-color: #1F1F29;
  overflow: hidden ;
  width: auto;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: starts;
  align-items: start;
  gap: 20px;
  padding: 20px;
  border-radius: 15px;
}
.recom_movie_div{
  display: flex;
  flex-direction: row;
  justify-content: start;
  align-items: center;
  gap: 40px;
}
.recom_movie_container img{
  width: auto;
  height:150px;
}



.recom_movie_wrapper{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    overflow-y: auto;
}
.movie_details_container{
  display: flex; 
  flex-direction: row;
  padding: 0 20px;
  justify-content: center;
  align-items: start;
  gap: 20px;
}

/* responsive */
@media (max-width: 1000px) {
  .movie_details_wrapper{
    align-items:center;
  }
  .movie_details_wrapper img{
    height: 300px;
  }
  .movie_info {
    gap:15px ;
  }
  .movie_info h2{
    font-size: 20px;
  }
  .movie_info p:nth-last-child(6){
    font-size: 0.9rem;
  }
  .movie_info p:nth-last-child(1){
    font-size: 0.8rem;
  }
  .movie_info p{
    font-size: 14px;
  }
  .movie_details_container{
    margin-block: -2rem;
  }
  .movie_cast_div{
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    align-items: start;
    gap: 10px;
}
.cast_div_container{
  font-size: 12px;
  gap: 10px;
}
.trailer_button{
  width: 150px;
}
}
@media (max-width:900px) {
  .movie_details_container{
    flex-direction: column;
    gap:10px ;
    justify-content: center;
    align-items: center;
  }
  /* .movie-details{
    width: 100%;
  } */
  .movie-cast{
    margin: 0;
  }
  .recom_movie_container{
    width: 100%;
    max-height: 300px;
    margin-bottom: 100px;
  }
  #recommended_movies{
    width: 100%;
  }
  .recom_movie_div{
    flex-direction: column;
    width: 100%;
  }
  .recom_movie_wrapper{
    width: 100%;
    max-width: 100%;
    grid-auto-flow: row;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
  footer{
    gap: 10px;
    padding: 10px 0;
  }
  .api_crd{
    font-size: 0.6rem;
  }
  .crd{
    font-size: 12px;
  }
  #results{
    margin-bottom: 40px;
  }
}
@media (max-width: 800px) {
  .cover{
    padding: 1rem 2rem;
    gap: 2rem;
  }
  .logo{
    height: 1.5rem;
  }
  .content{
    font-size:  1.2rem;
  }
  #searchForm{
    height: 3rem;
  }
  #searchForm input{
    font-size: 1rem;
  }
  #searchForm button{
    font-size: 0.9rem;
    width: 20%;
  }
  #searchForm button:hover{
    font-size: 1.1rem;
  }
  
}
@media (max-width:500px) {
  .cover a{
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .content span {
    text-align: center;
  }
  .intro{
    gap: 10px;
  }
  .cover{
    background-size: 100% 100%;
    gap: 20px;
  }
  .cover {
    gap: 10px;
  }
  .logo{
    height: 1rem;
    border-radius: 0;
  }
  .content{
    font-size: 14px;
    gap: 8px;
    width: 100%;
  }
  #searchForm{
    height: 2.3rem;
  }
  #searchForm input{
    font-size: 0.6rem;
    padding: 10px;
  }
  #searchForm button{
    font-size: 0.6rem;
    text-align: center;
    width: 20%;
    align-items: center;
  }
  #searchForm button:hover{
    font-size: 0.8rem;
  }
  .movie h2{
    font-size: 10px;
  }
  .movie_details_wrapper{
    flex-direction: column;
  }
  .movie_details_wrapper img{
    height: 250px;
  }

  .cast_div_container{
    align-items: center;
    justify-content: center;
  }

  .recom_movie_container h3, .movie-cast h3{
    text-align: center;
    width: 100%;
  }
  .movie_info {
   gap: 10px;
  }
  .movie_info h2{
    font-size: 16px;
  }
  .movie_info p:nth-last-child(5){
    font-size: 0.7rem;
  }
  .movie_info p:nth-last-child(1){
    font-size: 0.6rem;
  }
  .movie_info p{
    font-size: 12px;
  }
  .trailer_button{
    width: 100%;
    font-size: 10px;
    height: 30px;
  }


.recom_movie_wrapper{
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));

}
.movie-cast{
  padding: 8px 10px;
}
.movie_cast_div{
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.cast_div_container{
  width: 100%;
}
.cast_div_container img{
  width: 200px;
}
#results {
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
}

}
@media (max-width:400px) {
  .cover{
    padding: 8px 10px;
    height: 25vh;
  }
  .content{
    font-size: 12px;
  }
  #searchForm input {
    width: 75%;
  }
  #searchForm button {
    width: 25%;
  }
  #results {
    padding: 0 20px;
    margin-bottom: 35px;
  }
  .movie_details_container{
    align-items: center;
    justify-content: center;
  }

  .movie-cast{
    display: flex;
    align-items: center;
    justify-content: center;
  }
}