/* 전체 초기 설정 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  background-color: black;
  color: white;
}
body {
  max-width: 1600px;
  width: calc(100% - 4rem);
  margin: auto;
  padding: 2rem 1rem;
  font-family: "Pretendard", sans-serif;
}
li {
  list-style: none;
}

/* 헤더 설정 */
.header {
  /* border: 1px solid white; */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
}
h1 {
  padding: 2rem 0 3rem 0;
  color: #ffba4c;
  font-size: 5rem;
  font-family: "Anton", sans-serif;
  letter-spacing: 5px;
}
h1 > span {
  color: white;
}
.header-ul {
  display: flex;
  gap: 2rem;
}
.header-ul .header-menu {
  /* border: 1px solid yellowgreen; */
  color: #585858;
  border-radius: 17px;
  padding: 8px;
  cursor: pointer;
}
.header-ul .header-menu:hover,
.header-ul .header-menu.on {
  color: #ffba4c;
  border: 1px solid #ffba4c;
}

/* section1 설정 */
/* .section1-con {
  border: 1px solid red;
} */
.search-con {
  /* border: 1px solid orange; */
  padding: 1rem 0;
  display: flex;
  justify-content: center;
  gap: 1rem;
  width: 100%;
  height: 100%;
}
.search-con > * {
  border: 1px solid #a8a8a8;
  border-radius: 6px;
}
.search-con > label {
  padding: 5px;
  color: #a8a8a8;
}
.search-con #search {
  width: 35%;
  position: relative;
  outline: none;
  cursor: pointer;
}
.search-con #search:focus {
  border: 1px solid #ffba4c;
}
.search-con .search-btn {
  border: none;
}
#search-btn {
  position: absolute;
  transform: translate(-45px, -50%);
  color: #a8a8a8;
  cursor: pointer;
}
#search-btn:hover {
  color: #ffba4c;
}

/* 공통 속성 */
.section-con {
  width: 80%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
h2 {
  font-size: 2rem;
  padding: 2rem 1rem 1rem 1rem;
}

.section1-con {
  border-bottom: 1px solid white;
  padding-bottom: 20%;
}
.section1-wrapper .img-con1 {
  /* border: 1px solid green; */
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 20px;
  transform: translateY(5rem);
  padding: 1rem;
  position: relative;
}
.poster-con {
  /* border: 1px solid white; */
  display: flex;
  flex-direction: column;
  place-items: center;
  position: relative;
  cursor: pointer;
}
.poster-con .movieImg {
  /* border: 5px solid lightgray; */
  overflow: hidden;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}
.poster-con:hover {
  transform: scale(1.1, 1.1);
  transition: 0.3s;
}
.poster-con img {
  border-radius: 6px;
  object-fit: cover;
  width: 100%;
  height: 100%;
}
.detail-sec1 {
  display: flex;
  width: 100%;
  justify-content: flex-start;
  align-items: center;
  padding: 0.5rem 0;
  position: absolute;
  bottom: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.9));
}
.detail-sec1 > * {
  background-color: transparent;
}
.detail-sec1 .vote_average {
  color: #cbc4c4;
  border: 1px solid #585858;
  border-radius: 16px;
  font-size: 10px;
  padding: 8px 10px;
}
.detail-sec1 .title {
  color: white;
  width: 60%;
  padding: 0 1rem;
}
.detail-sec1 .release_date {
  color: #cbc4c4;
  border: 1px solid #585858;
  border-radius: 16px;
  font-size: 10px;
  padding: 8px 10px;
}
.pagination-con {
  /* border: 1px solid red; */
  transform: translateY(7rem);
  text-align: center;
}
.pagination-con > * {
  color: #5f5f5f;
  cursor: pointer;
  margin: 0 10px;
  cursor: pointer;
}
.pagination-con > span:hover {
  color: #ffba4c;
}
.pagination-con > button:hover {
  color: #ffba4c;
  border: 1px solid #ffba4c;
}
.pagination-con button {
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
}
.pagination-con > *.on {
  border: 1px solid #ffba4c;
  color: #ffba4c;
}

/* section2 */
#section2 {
  border-bottom: 1px solid white;
}
.section2-con {
  padding-bottom: 10%;
  max-width: 900px;
  width: 100%;
  height: 50vw;
  position: relative;
  margin: auto;
}
.nav-button {
  position: absolute;
  top: 50%;
  cursor: pointer;
  border: none;
  font-size: 30px;
}
.nav-button#prev {
  left: -20%;
}
.nav-button#next {
  right: -20%;
}
.nav-button#prev:hover,
.nav-button#next:hover {
  color: #ffba4c;
}
.section2-wrapper {
  display: flex;
  position: relative;
  height: 100%;
  perspective: 1000px;
  transition: transform 0.3s ease-in-out;
}
.card {
  position: relative;
  width: 100%;
  height: 100%;
  transform: translateX(20%) rotateY(-45deg);
  transition: transform 0.3s;
  transform-style: preserve-3d;
  cursor: pointer;
  opacity: 0.4;
}
.card.active {
  transform: rotateY(0deg) translateX(0);
  opacity: 1;
}
.card.left {
  transform: translateX(-20%) rotateY(45deg);
}
.inner-card {
  position: relative;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.3s;
}
.card:hover .inner-card {
  transform: rotateY(180deg);
}
.inner-card .front,
.inner-card .back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
}
.card .front img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.inner-card .back {
  transform: rotateY(180deg);
  background-color: black;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: center;
}
.back .title-score {
  display: flex;
  align-items: center;
}
.back .score {
  display: flex;
  padding: 0 0 3px 1rem;
}
.back .title {
  font-size: 1.5rem;
  font-weight: bold;
}
.back .detail {
  width: 100%;
  text-align: end;
}

/* section3 */
.section3-con {
  border-bottom: 1px solid white;
  padding-bottom: 18%;
  margin-bottom: 5%;
}
.category-con {
  /* border: 3px solid red; */
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  width: 100%;
  padding: 2rem 0 4rem 0;
}
.category-con button {
  /* border: 1px solid blue; */
  color: #585858;
  border-radius: 20px;
  font-size: 15px;
  font-weight: bold;
  border: none;
}
.category-con button:hover,
.category-con button.on {
  color: #ffba4c;
}
.genreImg-con {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 10px;
}
.genreImg-con li {
  overflow: hidden;
  position: relative;
}
.genreImg-con li:hover {
  transform: scale(1.1, 1.1);
  transition: 0.3s;
}
.genreImg-con .title {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.9));
  color: white;
  text-align: center;
}
.genreImg-con li:hover .title {
  color: #ffba4c;
  background-color: rgba(0, 0, 0, 0.8);
}
.genreImg-con li img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}
/* footer */
footer {
  padding: 3rem 0 0 1rem;
  text-align: center;
}
footer p {
  color: #585858;
}

/* modal */
.modal-con {
  opacity: 0;
  transition: 0.3s;
  margin: auto;
}
.modal-con.on {
  opacity: 1;
  position: fixed;
  border: 2px solid #ffba4c;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 999;
}
.modal-wrapper {
  display: flex;
  width: 90vw;
  min-width: 300px;
  max-width: 1200px;
  height: 30vw;
  min-height: 700px;
  margin: 0 auto;
  border-radius: 6px;
  justify-content: space-between;
  padding-top: 1rem;
}
.content-sec > * {
  /* transform: translate(1rem, 2.5rem); */
  padding-top: 1rem;
}
.content-sec {
  width: 50%;
}
.comment-sec {
  width: 50%;
}
.movie-poster {
  overflow: hidden;
  padding: 1rem;
}
.movie-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}
.movie-contents-con {
  padding: 10px 2rem 8px 2rem;
}
.title-content {
  display: flex;
  justify-content: space-between;
}
.movie-contents-con .modal-title {
  font-size: 2rem;
  font-weight: bold;
}
.movie-contents-con .show-date {
  color: #585858;
  padding-bottom: 1rem;
}
.score {
  gap: 5px;
  display: flex;
  padding: 10px 0;
}
.score .fa-star {
  color: #ffba4c;
  width: 20px;
  height: 20px;
}
.people-content > * {
  color: #a8a8a8;
  padding: 1px 0;
  font-size: 13px;
}
.movie-contents-con .actors {
  color: #a8a8a8;
  padding-bottom: 1rem;
}
.movie-contents-con .plot {
  color: #a8a8a8;
  width: 95%;
  font-size: 15px;
  overflow-y: auto;
}
.fa-close {
  font-size: 1.5rem;
  align-self: flex-end;
  padding-right: 1rem;
  position: absolute;
  top: 5px;
  right: 0;
  z-index: 9999;
}
.fa-close:hover,
.fa-close.on {
  color: #ffba4c;
}
.comment-sec {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2.5rem 0;
}
.my-comment-con {
  padding: 0 2rem;
  width: 90%;
}
.comment-title {
  color: #ffba4c;
  padding: 1rem 0;
}
.my-comment {
  margin-bottom: 10px;
}
.comment-con {
  display: flex;
  width: 100%;
  padding: 1rem 2rem;
}
#comment {
  background-color: #252020;
  border: none;
  outline: none;
  width: 90%;
  height: 35px;
  border-radius: 6px;
}
#comment:focus {
  border: 1px solid #ffba4c;
}
.comment-btn {
  background-color: #a8a8a8;
  color: black;
  border-radius: 5px;
  border: none;
  width: 60px;
  height: 30px;
  font-weight: bold;
}
.comment-btn:hover,
.comment-btn.on {
  background-color: #ffba4c;
}
@media (min-width: 374px) and (max-width: 767px) {
  h2 {
    font-size: 1.5rem;
  }
  .header-ul {
    gap: 1rem;
  }
  .header-ul .header-menu {
    padding: 0;
    font-size: 15px;
  }
  .search-con {
    width: 100vh;
    transform: translateX(-33%);
  }
  .section1-wrapper {
    display: flex;
    justify-content: center;
  }
  .section1-wrapper .img-con1 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: auto;
    position: relative;
    gap: 15px;
    justify-items: center;
    align-items: center;
    width: 100vh;
  }
  .poster-con .movieImg {
    width: 150px;
    height: auto;
  }
  .poster-con img {
    width: 150px;
    height: 100%;
    object-fit: cover;
  }
  .detail-sec1 {
    display: none;
  }
  .pagination-con > * {
    font-size: 8px;
    margin: 5px;
  }
  .pagination-con button {
    border-radius: 50%;
    width: 20px;
    height: 20px;
  }
  .section2-con {
    padding-top: 2rem;
  }
  .section2-wrapper {
    top: 20px;
  }
  .nav-button {
    font-size: 1rem;
    top: 180px;
  }
  .section3-con {
    padding-top: 2rem;
  }
  .category-con {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(2, 1fr);
    padding: 5px 0;
    gap: 5px;
  }
  .category-con button {
    font-size: 12px;
  }
  .genreImg-con {
    padding-top: 1rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto;
    gap: 8px;
  }
  .genreImg-con .title {
    font-size: 10px;
  }
  .genreImg-con .genre-item:hover {
    transform: scale(1.2, 1.2);
    transition: 0.3s;
  }
  .modal-con {
    transform: translateX(-40px);
  }
  .modal-wrapper {
    width: 300px;
    height: auto;
    display: flex;
    flex-direction: column;
  }
  .content-sec {
    width: 100%;
  }
  .comment-sec {
    width: 100%;
    padding: 0.5rem 0;
    font-size: 12px;
  }
  #comment {
    width: 100%;
    height: 30px;
  }
  .comment-btn {
    background-color: #a8a8a8;
    color: black;
    border-radius: 5px;
    border: none;
    width: 60px;
    height: 30px;
    font-weight: bold;
    font-size: 10px;
  }
}
