:root {
  --color-white: #ffffff;
  --color-lightblue-90: #0da9fd;
  --color-bluegray-100: #242a32;
  --color-bluegray-80: #39414d;
  --color-bluegray-10: #e0e6ed;
  --color-bluegray-30: #a6b1c3;
  --color-bluegray-90: #2f3844;
  --color-gray-300: #d1d3d4;
  --color-yellow: #ffc700;
  --color-ffffff: #ffffff;
  --color-242a32: #242a32;
}
* {
  box-sizing: border-box;
}
a {
  color: inherit;
  text-decoration: none;
}
body {
  font-size: 16px;
  color: var(--color-white);
  background-color: var(--color-bluegray-100);
}
#wrap,
section {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.movie-section {
  width: fit-content;
  margin: 0 auto;
}
main {
  margin: 64px 0;
}
main section {
  margin-top: 8rem;
}
.page-title {
  font-size: 3rem;
  margin-bottom: 4rem;
  margin-left: 2rem;
  font-weight: 600;
}
.star {
  width: 24px;
}
button {
  border: 0;
  padding: 8px 16px;
  cursor: pointer;
}
button.primary {
  color: var(--color-white);
  font-weight: bold;
  background-color: var(--color-lightblue-90);
  border-radius: 4px;
}
#wrap {
  min-width: 1440px;
  background-color: var(--color-bluegray-100);
}
#wrap h2 {
  font-size: 1.4rem;
  font-weight: bold;
  margin-bottom: 32px;
}
.container {
  max-width: 1280px;
  margin: 0 auto;
}
.background-container {
  position: relative;
  background-position: center center;
  background-size: cover;
  height: 500px;
  padding: 48px;
}
.background-container.is-search-mode {
  height: auto;
  padding: 24px 48px;
}
.logo-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  gap: 1.5rem;
}
.logo-container > img {
  width: 10rem;
  z-index: 3;
}
.search-container {
  width: 55%;

  border: 2px solid white;
  border-radius: 20px;
  display: flex;
  justify-content: space-between;

  z-index: 3;
}
.search-bar {
  background: none;
  border: none;

  margin-left: 15px;
  width: 100%;

  color: white;
  font-size: 1.2rem;
}
.search-bar:focus {
  outline: none;
}
.search-btn {
  background: none;
  border: none;

  font-size: 1.5rem;
}
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  background-color: rgba(0, 0, 0, 0.5);
  width: 100%;
  height: 100%;
  z-index: 1;

  display: flex;
  align-items: center;
  justify-content: center;
}
.overlay img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 50%;
}
.overlay[hidden] {
  display: none;
}
.top-rated-container {
  user-select: none;
  position: relative;
  z-index: 2;
  max-width: 1000px;
  margin: 0 auto;
}
.top-rated-movie {
  margin-top: 64px;
}
.top-rated-movie > *:not(:last-child) {
  margin-bottom: 8px;
}
.logo img {
  width: 12rem;
}
.rate {
  display: flex;
  align-items: baseline;
  color: var(--color-yellow);
}
.rate > img {
  position: relative;
  top: 2px;
}
span.rate-value {
  margin-left: 8px;
  font-weight: bold;
  font-size: 1.66rem;
}
.title {
  font-size: 3rem;
  font-weight: bold;
}
.btn-container {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
}
.display-more-btn {
  padding: 1rem;
  width: 100%;
  background-color: #4e5ba6;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
}
footer {
  min-height: 180px;
  background-color: var(--color-bluegray-80);
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  font-size: 1.1rem;
}
footer p:not(:last-child) {
  margin-bottom: 8px;
}
.skeleton-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.square,
.first-line,
.second-line {
  border: none;
  background-color: #757575;
  border-radius: 0.7rem;

  -webkit-animation: skeleton-gradient 1.8s infinite ease-in-out;
  animation: skeleton-gradient 1.8s infinite ease-in-out;
}
.square {
  width: 10rem;
  height: 14rem;
}
.first-line {
  width: 5rem;
  height: 1.5rem;
}
.second-line {
  width: 9rem;
  height: 1.5rem;
}
@-webkit-keyframes skeleton-gradient {
  0% {
    background-color: rgba(165, 165, 165, 0.1);
  }

  50% {
    background-color: rgba(165, 165, 165, 0.3);
  }

  100% {
    background-color: rgba(165, 165, 165, 0.1);
  }
}
@keyframes skeleton-gradient {
  0% {
    background-color: rgba(165, 165, 165, 0.1);
  }

  50% {
    background-color: rgba(165, 165, 165, 0.3);
  }

  100% {
    background-color: rgba(165, 165, 165, 0.1);
  }
}
div[class="title"] {
  font-size: 4rem;
}
strong[class="title"] {
  font-size: 1.2rem;
  font-weight: 500;
}
.error-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
}
.error-icon {
  width: 10rem;
  height: 10rem;
}
.error-text {
  font-size: 3rem;
  font-weight: 500;
}
.error-container {
  margin-bottom: 5rem;
}
.error-container[hidden] {
  display: none;
}
.stop-scrolling {
  height: 100%;
  overflow: hidden;
}
/* modal.css */
body.modal-open {
  overflow: hidden;
}
.modal-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 0 20px;
  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 > span {
  color: white;
}
.modal-description > *:not(:last-child) {
  margin-bottom: 8px;
}
.modal-description h2 {
  width: 80%;
  word-break: keep-all;

  font-size: 2rem;
  font-weight: 600;
  line-height: 1.1;
  margin: 0 0 8px;
}
.modal-description hr {
  opacity: 0.4;
}
.rate-title,
.detail-title {
  font-size: 1.3rem;
  font-weight: 600;
}
.detail {
  max-height: 430px;
  overflow-y: auto;
}
.user-rate {
  display: flex;

  gap: 1rem;
}
.rate-detail > span {
  font-size: 1.5rem;
  font-weight: 600;
}
/* http://meyerweb.com/eric/tools/css/reset/
   v2.0 | 20110126
   License: none (public domain)
*/
html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
b,
u,
i,
center,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
canvas,
details,
embed,
figure,
figcaption,
footer,
header,
hgroup,
menu,
nav,
output,
ruby,
section,
summary,
time,
mark,
audio,
video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section {
  display: block;
}
body {
  line-height: 1;
}
ol,
ul {
  list-style: none;
}
blockquote,
q {
  quotes: none;
}
blockquote:before,
blockquote:after,
q:before,
q:after {
  content: "";
  content: none;
}
table {
  border-collapse: collapse;
  border-spacing: 0;
}
.tab {
  display: flex;
  margin: 32px 0;
}
.tab-item {
  cursor: pointer;
  user-select: none;

  display: flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 40px;

  border-radius: 40px;
  background: linear-gradient(90deg, #14191f 0%, #0a0d12 100%);
}
.tab-item.selected {
  background: linear-gradient(90deg, #4b8bf4 0%, #1c2a3a 100%);
}
.tab-item:hover {
  background: linear-gradient(90deg, #2f3e54 0%, #4b8bf4 100%);
}
.tab li:not(:last-child) {
  margin-right: 8px;
}
.thumbnail-list {
  margin: 0 auto 56px;
  display: grid;
  grid-template-columns: repeat(auto-fit, 200px);
  gap: 70px;

  justify-content: center;
}
.thumbnail {
  width: 200px;
  height: 300px;
  border-radius: 8px;
}
.item {
  user-select: none;
  cursor: pointer;
}
.item-desc > *:not(:last-child) {
  position: relative;
  margin-bottom: 4px;
  line-height: 1.2rem;
}
p.rate {
  display: flex;
  align-items: baseline;
  color: var(--color-yellow);
}
p.rate > span {
  margin-left: 4px;
}
.item .star {
  width: 16px;
  top: 1px;
}
@media (max-width: 800px) {
  .top-rated-movie > .title {
    font-size: 2.5rem;
  }
  .search-container {
    width: 80%;
  }

  /* 1. 그리드 변경 */
  .thumbnail-list {
    margin: 0 auto 56px;
    /* grid-template-columns: repeat(3, 200px); */
    gap: 60px;
  }

  /* 2. 모달 변경 */
  .modal-background {
    align-items: flex-end;
    padding: 0 0;
  }

  .modal-container {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1.6rem;
  }

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

  .movie-detail {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    gap: 0.5rem;
  }
  .modal-description h2 {
    text-align: center;
  }
}
@media (max-width: 400px) {
  .top-rated-movie > .title {
    font-size: 2rem;
  }
  .search-container {
    width: 100%;
  }

  /* 1. 그리드 변경 */
  .thumbnail-list {
    /* grid-template-columns: repeat(1, 250px); */
    gap: 50px;
  }

  .thumbnail {
    width: 200px;
    border-radius: 8px;
  }

  .page-title {
    font-size: 2.4rem;
    margin: 0 auto 56px;
  }

  section {
    display: flex;
    justify-content: center;
    align-items: center;
  }

  /* 2. 모달 변경 */
  .modal-background {
    align-items: flex-end;
    padding: 0 0;
  }

  .modal-container {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1.6rem;
  }

  .modal-image img {
    display: none;
  }

  .movie-detail {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    gap: 0.5rem;
  }

  .user-rate,
  .modal-description {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

  .modal-description hr {
    width: 100%;
  }
  .modal-description h2 {
    text-align: center;
    width: 100%;
  }
}
