@import "./colors.css";

/* modal.css */
body.modal-open {
  overflow: hidden;
}

.modal-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5); /* 반투명 배경을 위해 설정 */
  backdrop-filter: blur(10px); /* 블러 효과 적용 */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
  visibility: hidden; /* 모달이 기본적으로 보이지 않도록 설정 */
  opacity: 0;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.modal-background.active {
  visibility: visible;
  opacity: 1;
}

.modal {
  background-color: var(--color-bluegray-90);
  padding: 20px;
  border-radius: 16px;
  color: white;
  z-index: 2;
  position: relative;
  width: 1000px;
}

.close-modal {
  position: absolute;
  margin: 0;
  padding: 0;
  top: 24px;
  right: 24px;
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
}

.modal-container {
  display: flex;
}

.modal-image img {
  width: 380px;
  border-radius: 16px;
}

.modal-description {
  width: 100%;
  padding: 8px;
  margin-left: 16px;
  line-height: 1.6rem;
}

.modal-description .rate > img {
  position: relative;
  top: 5px;
}

.modal-description .rate-label {
  color: white;
  padding-right: 10px;
}

.modal-description .rate-value {
  font-size: 1.2rem;
  font-weight: normal;
}

.modal-description > *:not(:last-child) {
  margin-bottom: 8px;
}

.modal-description .stars {
  display: flex;
  gap: 2px;
}

.modal-description .stars > img {
  width: 32px;
  position: relative;
  bottom: 7px;
  display: block;
}

.movie-rating {
  display: flex;
  justify-content: space-between;
  max-width: 380px;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.18px;
  margin-top: 20px;
}

.rating-score {
  color: #95a1b2;
}

.modal-description h2 {
  font-size: 2rem;
  font-weight: bold;
  margin: 0 0 4px 0;
}

.modal-description h3 {
  font-size: 1.5rem;
  font-weight: bold;
  padding-top: 8px;
}

.detail {
  max-height: 300px;
  overflow-y: auto;
}

/* 테블릿 */
@media (max-width: 1023px) {
  .modal-background {
    align-items: flex-end;
  }

  .modal {
    max-height: 750px;
    border-radius: 16px 16px 0 0;
    overflow-y: scroll;
  }

  .modal-image img {
    width: 200px;
    margin: 18px;
  }

  .modal-container {
    flex-direction: column;
    align-items: center;
  }

  .modal-description {
    margin: 0 14px;
  }

  .modal-description h2 {
    text-align: center;
    padding-bottom: 16px;
  }

  .modal-description .category {
    text-align: center;
  }

  .modal-description .rate {
    justify-content: center;
  }

  .modal-description h3 {
    padding: 10px 0 5px 0;
  }

  .detail {
    max-height: none;
    overflow-y: visible;
  }
}

/* 모바일 */
@media (max-width: 767px) {
  .modal {
    max-height: 600px;
  }

  .modal-image {
    display: none;
  }

  .modal-description {
    text-align: center;
  }

  .movie-rating {
    flex-wrap: wrap;
    justify-content: center;
    max-width: none;
    gap: 8px;
  }

  .movie-rating .stars {
    justify-content: center;
    width: 100%;
  }

  .detail {
    text-align: left;
  }
}
