/* Google Font Link */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600;700&display=swap');
*{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins" , sans-serif;
}

/* this root belongs to filter dropdown */
:root {
  --darkgray: #444;
}

.sidebar{
  position: fixed;
  left: 0;
  top: 0;
  height: 100%;
  width: 78px;
  background: #e23e57;
  padding: 6px 14px;
  z-index: 99;
  transition: all 0.5s ease;
}
.sidebar.open{
  width: 250px;
}
.sidebar .logo-details{
  height: 60px;
  display: flex;
  align-items: center;
  position: relative;
}
.sidebar .logo-details .icon{
  opacity: 0;
  transition: all 0.5s ease;
}
.sidebar .logo-details .logo_name{
  color: #fff;
  font-size: 20px;
  font-weight: 600;
  opacity: 0;
  transition: all 0.5s ease;
}
.sidebar.open .logo-details .icon,
.sidebar.open .logo-details .logo_name{
  opacity: 1;
}
.sidebar .logo-details #btn{
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  font-size: 22px;
  transition: all 0.4s ease;
  font-size: 23px;
  text-align: center;
  cursor: pointer;
  transition: all 0.5s ease;
}
.sidebar.open .logo-details #btn{
  text-align: right;
}
.sidebar i{
  color: #fff;
  height: 60px;
  min-width: 50px;
  font-size: 28px;
  text-align: center;
  line-height: 60px;
}
.sidebar .nav-list{
  margin-top: 20px;
  height: 100%;
}
.sidebar li{
  position: relative;
  margin: 8px 0;
  list-style: none;
}
.sidebar li .tooltip{
  position: absolute;
  top: -20px;
  left: calc(100% + 15px);
  z-index: 3;
  background: #fff;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3);
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 400;
  opacity: 0;
  white-space: nowrap;
  pointer-events: none;
  transition: 0s;
}
.sidebar li:hover .tooltip{
  opacity: 1;
  pointer-events: auto;
  transition: all 0.4s ease;
  top: 50%;
  transform: translateY(-50%);
}
.sidebar.open li .tooltip{
  display: none;
}
.sidebar input{
  font-size: 15px;
  color: #FFF;
  font-weight: 400;
  outline: none;
  height: 50px;
  width: 100%;
  width: 50px;
  border: none;
  border-radius: 12px;
  transition: all 0.5s ease;
  background: #1d1b31;
}
.sidebar.open input{
  padding: 0 20px 0 50px;
  width: 100%;
}
.sidebar .bx-search{
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  font-size: 22px;
  background: #1d1b31;
  color: #FFF;
}
.sidebar.open .bx-search:hover{
  background: #1d1b31;
  color: #FFF;
}
.sidebar .bx-search:hover{
  background: #FFF;
  color: rgba(240, 135, 117, 0.795);
}
.sidebar li a{
  display: flex;
  height: 100%;
  width: 100%;
  border-radius: 12px;
  align-items: center;
  text-decoration: none;
  transition: all 0.4s ease;
  background: #e23e57;
}
.sidebar li a:hover{
  background: #FFF;
}
.sidebar li a .links_name{
  color: #fff;
  font-size: 15px;
  font-weight: 400;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: 0.4s;
}
.sidebar.open li a .links_name{
  opacity: 1;
  pointer-events: auto;
}
.sidebar li a:hover .links_name,
.sidebar li a:hover i{
  transition: all 0.5s ease;
  color: #e23e57;
}
.sidebar li i{
  height: 50px;
  line-height: 50px;
  font-size: 18px;
  border-radius: 12px;
}
.sidebar li.profile{
  position: fixed;
  height: 60px;
  width: 78px;
  left: 0;
  bottom: -8px;
  padding: 10px 14px;
  background: #1d1b31;
  transition: all 0.5s ease;
  overflow: hidden;
}
.sidebar.open li.profile{
  width: 250px;
}
.sidebar li .profile-details{
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
}
.sidebar li img{
  height: 45px;
  width: 45px;
  object-fit: cover;
  border-radius: 6px;
  margin-right: 10px;
}
.sidebar li.profile .name,
.sidebar li.profile .job{
  font-size: 15px;
  font-weight: 400;
  color: #fff;
  white-space: nowrap;
}
.sidebar li.profile .job{
  font-size: 12px;
}
.sidebar .profile #log_out{
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  background: #1d1b31;
  width: 100%;
  height: 60px;
  line-height: 60px;
  border-radius: 0px;
  transition: all 0.5s ease;
}
.sidebar.open .profile #log_out{
  width: 50px;
  background: none;
}
.home-section{
  position: relative;
  background-color: #002147;
background-image: linear-gradient(315deg, #002147 0%, #3b3c36 74%);
  min-height: 100vh;
  top: 0;
  left: 78px;
  width: calc(100% - 78px);
  transition: all 0.5s ease;
  z-index: 2;
}
.sidebar.open ~ .home-section{
  left: 250px;
  width: calc(100% - 250px);
}
.home-section .text{
  display: inline-block;
  color: #e23e57;
  font-size: 25px;
  font-weight: 500;
  margin: 18px
}

/* Start movie element css */

.logoDiv {
  text-align: center;
}

.logo {
  width: 300px;
  margin-top: 10px;
}

#trendingMovies {
  display: flex;
  flex-wrap: wrap;
  gap: 0px;
  padding: 0px;
  justify-content: center;
  height: 650px; /* 2 rows of ~260px each with gap */
  margin: 10px 10px;
}

.movies-grid {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0px;
  margin: 10px;
  min-height: 650px;
}

/* Movie card styling */
.movie-card {
  width: calc(10% - 10px); /* 10 per row */
  height: 250px;
  margin: 0px 5px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}


/* Poster image styling */
.movie-card img {
  width: 90%;
  height: auto;
  aspect-ratio: 2/3;
  object-fit: cover;
  border: solid 2px #e23e57;
  border-radius: 5px;
  transition: transform 0.3s ease;
  cursor: pointer;
}

.movie-card:hover img {
  transform: scale(1.05);
}

/* Text elements below the image */
.movie-card h3,
.movie-card p {
  color: white;
  font-size: 14px;
  margin: 4px 0;
  white-space: normal;
  overflow: hidden;
  text-overflow: unset; /* optional */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  width: 100%;
}


/* Drop down menu */

select {
  appearance: none;
  border: 0;
  box-shadow: none;
  flex: 1;
  padding: 0 1em;
  color: #ffffff;
  background-color: var(--darkgray);
  background-image: none;
  cursor: pointer;
}
/* Remove IE arrow */
select::-ms-expand {
  display: none;
}
/* Custom Select wrapper */

.dropDown-wrap {
  display: flex;
  gap: 1em;
}

.dropDown {
  position: relative;
  display: flex;
  width: 15em;
  height: 2.5em;
  border-radius: .25em;
  overflow: hidden;
}
/* Arrow */
.dropDown::after {
  content: '\25BC';
  position: absolute;
  top: 0;
  right: 0;
  padding: 0.5em;
  background-color: #ffffff;
  transition: .25s all ease;
  pointer-events: none;
  height: 1.5em;
}
/* Transition */
.dropDown:hover::after {
  color: #e23e57;
}

.hidden {
  display: none !important;
}

/* Filter Container */
.filter-container {
  position: relative;
  margin-top: 36px;
  margin-left: 20px;
  display: flex;
}

.filter-button {
  padding: 0.5em 1em;
  font-size: 1rem;
  border: none;
  background-color: #e23e57;
  color: white;
  border-radius: 0.25em;
  cursor: pointer;
}

/* Hidden by default */
.filter-options {
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateX(-20px) translateY(-50%);
  opacity: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  transition: opacity 0.3s ease, transform 0.3s ease;
  margin-left: 10px;
  z-index: 1;
}

.filter-options.show {
  opacity: 1;
  transform: translateX(0) translateY(-50%);
  pointer-events: auto;
}
/* Drop down ends here */


/* Make search container relatively positioned so dropdown can appear properly */
.search-container {
  justify-content: center;
  margin-top: 10px;
  width: 100%;
}

.wrap {
  align-items: center;
}

.search {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

#searchResults {
  display: flex;
  flex-wrap: wrap;
  gap: 0px;
  padding: 0px;
  justify-content: center;
  height: 650px;
  margin: 10px 10px;
}

.search-result {
  width: calc(10% - 10px); /* Match movie-card width */
  height: 250px; /* Match movie-card height */
  margin: 0px 5px; /* Match movie-card margin */
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

#searchResults.movie-grid {
  height: 650px; /* Force same height */
}

.search-result img {
  width: 90%; /* Match movie-card image width */
  height: auto; /* Match movie-card image height */
  aspect-ratio: 2/3; /* Match movie-card aspect ratio */
  object-fit: cover; /* Match movie-card object-fit */
  border: solid 2px #e23e57; /* Match movie-card border */
  border-radius: 5px; /* Match movie-card border radius */
  transition: transform 0.3s ease; /* Match movie-card transition */
  cursor: pointer; /* Match movie-card cursor */
}

.search-result:hover img {
  transform: scale(1.05); /* Match movie-card hover effect */
}

.search-result h3,
.search-result p {
  color: white; /* Match movie-card text color */
  font-size: 14px; /* Match movie-card font size */
  margin: 4px 0; /* Match movie-card margins */
  white-space: normal; /* Match movie-card whitespace */
  overflow: hidden; /* Match movie-card overflow */
  text-overflow: unset; /* Match movie-card text overflow */
  display: -webkit-box; /* Match movie-card display */
  -webkit-line-clamp: 2; /* Match movie-card line clamp */
  -webkit-box-orient: vertical; /* Match movie-card box orient */
  width: 100%; /* Match movie-card width */
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 30px;
  padding: 0 20px;
  flex-wrap: wrap;
}

.pagination button {
  padding: 8px 12px;
  border: 1px solid #032541;
  background: white;
  color: #032541;
  cursor: pointer;
  border-radius: 4px;
  font-weight: 600;
  transition: all 0.2s ease;
  min-width: 40px;
  text-align: center;
}

.pagination button:hover:not(:disabled) {
  background: #032541;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.pagination button:disabled {
  background: #032541;
  color: white;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.pagination button.active {
  background: #032541;
  color: white;
  border-color: #032541;
  font-weight: bold;
}

/* First/Last buttons styling */
.pagination button:first-child,
.pagination button:last-child {
  padding: 8px 16px;
  background: #f0f0f0;
  font-weight: bold;
}

.pagination button:first-child:hover:not(:disabled),
.pagination button:last-child:hover:not(:disabled) {
  background: #032541;
  color: white;
}

/* Add to your existing CSS */
.hidden {
  display: none;
}

.detail-overlay {
  display: none; /* Add this line */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  justify-content: center;
  align-items: center;
  z-index: 999;
}

.detail-frame {
  width: 90%;
  height: 90%;
  border: none;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.close-overlay {
  position: absolute;
  top: 20px;
  right: 40px;
  font-size: 3rem;
  background: transparent;
  color: white;
  border: none;
  cursor: pointer;
  z-index: 1000;
}

@media (max-width: 1024px) {

.filter-button {
  margin-bottom: 20px;
  padding: 0.03em 1em;
  top: 100px;
}

.filter-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
  }

  .filter-options {
    position: absolute;
    top: 150%;
    left: -200px;
    transform: translateX(-50%);
    opacity: 0;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    z-index: 1;
    width: 100%;
    max-width: 600px;
  }

  .filter-options.show {
    opacity: 1;
    pointer-events: auto;
  }

  .dropDown-wrap {
    flex-direction: row;
    margin-bottom: 25px;
    margin-right: 180px;
    width: 350px;
    gap: 10px;
  }

  .dropDown {
    width: 100%;
  }
  }



/* Responsive adjustments */
@media (max-width: 768px) {

  
  .logo {
    width: 300px;
    margin-top: 30px;
  }
  
  #trendingMovies {
height: fit-content;
  }

.movies-grid {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    overflow-x: auto !important;
    overflow-y: hidden;
    gap: 16px;
    padding: 10px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    height: 100%;
  }

  .movie-card {
    margin: 60px 10px;
    flex: 0 0 auto;
    width: 150px;
    height: 200px;
    background-color: #111;
    border-radius: 8px;
    scroll-snap-align: start;
    border: 2px solid #e23e57;
  }

  .movie-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
  }

  .movie-card h3 {
    font-size: 16px;
    color: white;
    text-align: center;
    margin: 10px 0 5px;
  }

  .movie-card p {
    font-size: 13px;
    color: white;
    text-align: center;
    margin-bottom: 10px;
    padding: 0 8px;
  }

.movie-info {
  margin: 5px 0px;
}

#searchResults.movie-grid {
    height: fit-content;
}

  .search-result {
    flex: 0 0 auto;
    width: 150px;
    height: 200px;
    background-color: #111;
    border-radius: 8px;
    scroll-snap-align: start;
    border: 2px solid #e23e57;
    margin: 60px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
  }

  .search-result img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
  }

  .search-result h3 {
    font-size: 16px;
    color: white;
    text-align: center;
    margin: 10px 0 5px;
  }

  .search-result p {
    font-size: 13px;
    color: white;
    text-align: center;
    margin-bottom: 10px;
    padding: 0 8px;
  }

.filter-button {
  padding: 1.3em 1em;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.filter-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
  }

  .filter-options {
    position: absolute;
    top: 150%;
    left: -200px;
    transform: translateX(-50%);
    opacity: 0;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    z-index: 1;
    width: 100%;
    max-width: 600px;
  }

  .filter-options.show {
    opacity: 1;
    pointer-events: auto;
  }

  .dropDown-wrap {
    flex-direction: row;
    width: 350px;
    gap: 10px;
    margin-left: 180px;
  }

  .dropDown {
    width: 100%;
  }

  /* .pagination {
    gap: 6px;
  }
  .pagination button {
    padding: 6px 10px;
    min-width: 36px;
    font-size: 14px;
  }
  .pagination button:first-child,
  .pagination button:last-child {
    padding: 6px 12px;
  } */
}

@media (max-width: 420px) {
  .sidebar li .tooltip {
    display: none;
  }

  .logo {
    width: 200px;
    margin-top: 20px;
  }

  .movies-grid {
    gap: 12px;
    padding: 8px;
  }

  .movie-card {
    margin: 60px 10px;
    width: 120px;
    height: 170px;
  }

  .movie-card h3 {
    font-size: 14px;
    margin: 8px 0 4px;
  }

  .movie-card p {
    font-size: 11px;
    margin-bottom: 8px;
    padding: 0 6px;
  }

  .dropDown-wrap {
    flex-direction: row;
    width: 350px;
    gap: 10px;
    margin-left: 280px;
  }

  select {
    font-size: 14px;
  }

  .pagination {
    gap: 4px;
    margin-top: 10px;
  }

  .pagination button {
    padding: 4px 8px;
    min-width: 32px;
    font-size: 12px;
  }

  .pagination button:first-child,
  .pagination button:last-child {
    padding: 4px 10px;
  }
}