:root {
  --header-height: 3.5rem;

  /*========== Colors ==========*/
  /*Color mode HSL(hue, saturation, lightness)*/
  --black-color: hsl(220, 24%, 12%);
  --black-color-light: hsl(220, 24%, 15%);
  --black-color-lighten: hsl(220, 20%, 18%);
  --white-color: #fff;
  /*--body-color: hsl(220, 20%, 18%);*/
  --body-color: #1b1b1b;
  --gray-color:#9CA3AF;
  --pink-color:#fe628e;

  /* ========== Font and typography ==========
  /*.5rem = 8px | 1rem = 16px ...*/
  --body-font: "Montserrat", sans-serif;
  --normal-font-size: .938rem;

  /*========== Font weight ==========*/
  --font-regular: 400;
  --font-semi-bold: 600; 

  /*========== z index ==========*/
  --z-tooltip: 10;
  --z-fixed: 100;
}

/*========== Responsive typography ==========*/
@media screen and (min-width: 1024px) {
  :root {
    --normal-font-size: 1rem;
  }
}


body {
  font-family: var(--body-font);
  font-size: var(--normal-font-size);
  background-color: var(--body-color);
}

ul {
  list-style: none;
}

a {
  text-decoration: none;
}

/*=============== REUSABLE CSS CLASSES ===============*/
.container {
  max-width: 1120px;
  margin-inline: 1.5rem;
}

/*=============== HEADER ===============*/
.header {
  /* position: fixed; */
  top: 0;
  left: 0;
  width: 100%;
  box-shadow: 0 8px 8px -4px hsla(222, 54%, 60%, 0.3);
  z-index: var(--z-fixed);
  padding: 0 10px;
}

/*=============== NAV ===============*/
.nav {
  height: var(--header-height);
  position: relative;
}

.nav__logo, 
.nav__burger, 
.nav__close {
  color: var(--white-color);
}

.nav__data {
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav__logo {
  display: inline-flex;
  align-items: center;
  column-gap: .25rem;
  font-weight: var(--font-semi-bold);
  /* Color highlighting when pressed on mobile devices */
  /*-webkit-tap-highlight-color: transparent;*/
}

.nav__logo i {
  font-weight: initial;
  font-size: 1.25rem;
}

.nav__toggle {
  position: relative;
  width: 32px;
  height: 32px;
}

.nav__burger, 
.nav__close {
  position: absolute;
  width: max-content;
  height: max-content;
  inset: 0;
  margin: auto;
  font-size: 1.25rem;
  cursor: pointer;
  transition: opacity .1s, transform .4s;
}

.nav__close {
  opacity: 0;
}
.movie-item {
  width: 100%; /* Giữ nguyên */
  max-width: 100%; /* Đảm bảo không tràn container */
  overflow: hidden; /* Ngăn nội dung tràn ra ngoài */
}
/* Navigation for mobile devices */
@media screen and (max-width: 1023px) {
  .nav__menu {
    position: absolute;/* Chuyển thành absolute để menu không bị nhảy */
    left: 0;
    top: 2.5rem;
    width: 100%;
    height: calc(100vh - 3.5rem);
    overflow: auto;
    pointer-events: none;
    opacity: 0;
    transition: top .4s, opacity .3s ease-in-out;
    z-index: 20000; 
  }
  .nav__menu::-webkit-scrollbar {
    width: 0;
  }
  
  .nav__list {
     background-color: var(--body-color); 
    padding-top: 1rem;
  }
  .movie-item img {
    height: 180px; /* Chiều cao trung bình */
  }
  
}
@media (max-width: 1024px){
  .movie-item img {
    max-width: 700px;
    height: 150px;
  }
}
button#nav-toggle{
    background-color: var(--black-color-light);
}

.nav__link {
  color: white;
  /* background-color: var(--black-color); */
  font-weight: var(--font-semi-bold);
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color .3s;
}

.nav__link:hover,
.movie-item__pink:hover,.genre-item:hover,.footer__pink:hover {
  color: var(--pink-color);
}

/* Show menu */
.show-menu {
    opacity: 1 !important;
    top: 3.5rem !important;
    pointer-events: auto !important;
    z-index: 20000 !important;
  }


/* Show icon */
.show-icon .nav__burger {
  opacity: 0;
  transform: rotate(90deg);
}
.show-icon .nav__close {
  opacity: 1;
  transform: rotate(90deg);
}
/*-------text-color------*/
.text-pink{
  color: var(--pink-color);
}
/*=============== BREAKPOINTS ===============*/
/* For large devices */
@media screen and (min-width: 1023px) {
  .container {
    margin-inline: auto;
  }

  .nav {
    height: calc(var(--header-height) + 2rem);
    display: flex;
    justify-content: space-between;
  }
  .nav__toggle {
    display: none;
  }
  .nav__list {
    height: 100%;
    display: flex;
    column-gap: 3rem;
  }
  .nav__link {
    height: 100%;
    padding: 0;
    justify-content: initial;
    column-gap: .25rem;
  }
  .nav__link:hover {
    background-color: transparent;
  }
}
.movie-item img {
    width: 100%; /* Chiếm toàn bộ chiều rộng container */
  height: auto; /* Loại bỏ height cố định, để tự động theo tỷ lệ */
  aspect-ratio: 4 / 3; /* Giữ tỷ lệ cố định, có thể đổi thành 16 / 9 tùy nội dung */
  object-fit: cover; /* Đảm bảo ảnh không bị méo, cắt phần thừa */
  border-radius: 3px;
  display: block; /* Loại bỏ khoảng trắng dưới ảnh */
  max-width: 100%; /* Ngăn tràn khung */
}
.category-item {
  display: flex;
  align-items: center;
  padding: 5px;
  background: var(--black-color-light);
  border-radius: 10px;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
}

.search-form {
    display: flex;
    justify-content: end;
    width: 100%;
    margin-top: 10px;
    padding-left: 10px;
    padding-right: 10px;
}

.search-form input {
    width: 100%;
    max-width: 500px;
    padding: 0 0.5rem;
    height: 35px;
    font-size: 1rem;
    border: 2px solid #a99f9f;
    border-radius: 10px 0px 0px 10px;
    background-color: #fff;
    color: black;
    outline: none;
}

.search-form button {
    background-color: rgb(190 24 93 );
    padding: 0 2px;
    border: 2px solid #a99f9f;
    border-radius:0px 5px 5px 0px;
    color: #fff;
    cursor: pointer;
    width: auto;
    white-space: nowrap;
}

.search-form button:hover {
    background-color: #555;
}
/*=========Detail=========*/

.movie-servers h3 {
  margin-bottom: 10px;
  color:  var(--pink-color);
  font-size: 1.2rem;
}

.movie-description {
  margin-top: 15px;
  text-align: justify;
  font-size: 1rem;
  color: white;
}
.movie-servers {
margin-top: 10px;
padding: 10px;
/* background: hsl(220, 20%, 18%); */
border-radius: 8px;
color: #fff;
}

.server-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.server-list li {
  margin-bottom: 8px;
}
.server-list li a:hover {
  text-decoration: underline;
  color: var(--pink-color);
}

.movie-genres {
  margin-top: 10px;
  font-size: 1rem;
}

.genre-item {
  display: inline-block;
  margin-right: 5px;
  background: hsl(220, 20%, 18%);
  border-radius: 4px;
  color: #fff;
  font-size: 0.9rem;
  padding: 2px 4px;
}

.view-count-detail {
  margin: 10px 0;
  display: flex;
  align-items: center;
  gap: 5px;
  color: #fff;
  font-size: 1rem;
  background: hsl(220, 20%, 18%);
  padding: 5px 10px;
  border-radius: 5px;
  display: inline-block;
}

.view-count-detail span {
  display: flex;
  align-items: center;
  justify-content: center;
}
.pagination {
  display: flex; /* Giữ flex để căn giữa */
  justify-content: center;
  padding: 1rem 0;
  
}

.pagination a {
  color: white;
  padding: 8px 16px;
  text-decoration: none;
  transition: background-color .3s;
  border: 1px solid #ddd;
  margin: 0 4px;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px; /* Đảm bảo kích thước tối thiểu cho nút */
  border-radius: 25px;
}

.pagination a.active {
  background-color: var(--pink-color);
  color: white;
  border: 1px solid var(--pink-color);
}

.pagination a:hover:not(.active) {
  background-color: var(--pink-color);
}
.grid-cols-3{
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Responsive adjustments */
@media screen and (max-width: 768px) { /* Tablet */
  .pagination a {
    padding: 6px 12px;
    font-size: 14px;
    margin: 0 2px;
    min-width: 32px;
  }
}

@media screen and (max-width: 480px) { /* Mobile */
  .pagination {
    flex-wrap: wrap; /* Cho phép xuống dòng khi không đủ chỗ */
    gap: 4px; /* Khoảng cách giữa các nút */
    padding: 0.5rem 0;
  }
  
  .pagination a {
    padding: 5px 10px;
    font-size: 12px;
    margin: 0;
    min-width: 28px;
  }
  
  /* Ẩn bớt các trang không cần thiết trên mobile */
  .pagination a:nth-child(n+6):not(:last-child) {
    display: none;
  }
}

@media screen and (min-width: 1024px) { /* Desktop lớn */
  .pagination a {
    padding: 10px 20px;
    font-size: 18px;
    min-width: 40px;
  }
}