/* Body background styling to match home page */
body {
  background: var(--gradient-bg);
}

/* Mobile Menu Close Button - Enhanced for Section Pages */
.mobile-menu-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(139, 92, 246, 0.15);
  border: 2px solid rgba(139, 92, 246, 0.3);
  border-radius: 12px;
  width: 44px;
  height: 44px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  z-index: 1004;
  opacity: 0;
  transform: scale(0.8) rotate(90deg);
  pointer-events: none;
}

.mobile-menu-close svg {
  color: var(--primary);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.5));
}

.mobile-menu-close:hover {
  background: rgba(139, 92, 246, 0.25);
  border-color: rgba(139, 92, 246, 0.5);
  transform: scale(1.05) rotate(0deg);
  box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
}

.mobile-menu-close:hover svg {
  color: white;
  transform: rotate(90deg);
  filter: drop-shadow(0 0 12px rgba(139, 92, 246, 0.8));
}

.mobile-menu-close:active {
  transform: scale(0.95) rotate(0deg);
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.6);
}

/* Show close button when mobile menu is active */
.nav-menu.active .mobile-menu-close {
  display: flex;
  opacity: 1;
  transform: scale(1) rotate(0deg);
  pointer-events: all;
  animation: closeButtonFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes closeButtonFadeIn {
  0% {
    opacity: 0;
    transform: scale(0.8) rotate(90deg);
  }
  50% {
    transform: scale(1.1) rotate(45deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

/* Dropdown styles for genre navigation */
.dropdown {
  position: relative;
}

.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(20, 20, 20, 0.95);
  min-width: 700px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
  border-radius: 8px;
  padding: 20px;
  z-index: 30;
  border: 1px solid rgba(141, 22, 201, 0.5);
  backdrop-filter: blur(15px);
  transition: opacity 0.3s, transform 0.3s;
  opacity: 0;
  transform: translateX(-50%) translateY(10px);
  pointer-events: none;
  flex-wrap: wrap;
}

/* Remove hover-based display since we're using JS instead */
/*
.dropdown:hover .dropdown-content {
  display: flex;
  flex-wrap: wrap;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
*/

.dropdown-column {
  flex: 1;
  min-width: 150px;
  padding: 0 15px;
}

.dropdown-column h3 {
  color: #8d16c9;
  margin-bottom: 12px;
  font-size: 18px;
  border-bottom: 1px solid rgba(141, 22, 201, 0.3);
  padding-bottom: 5px;
}

.dropdown-content a {
  color: #fff;
  text-decoration: none;
  padding: 8px 0;
  display: block;
  font-size: 16px;
  transition: all 0.2s;
}

.dropdown-content a:hover {
  color: #8d16c9;
  transform: translateX(5px);
}

.dropdown-footer {
  width: 100%;
  text-align: center;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid rgba(141, 22, 201, 0.3);
}

.view-all-genres {
  display: inline-block !important;
  background-color: rgba(141, 22, 201, 0.2);
  padding: 8px 20px !important;
  border-radius: 4px;
  font-weight: 500;
}

.view-all-genres:hover {
  background-color: rgba(141, 22, 201, 0.5);
  transform: translateY(-2px) !important;
}

/* Mobile dropdown adjustments */
@media screen and (max-width: 768px) {
  /* Hide watchlist button on mobile */
  .watchList-Btn {
    display: none !important;
  }

  .dropdown-content {
    min-width: 90vw;
    left: 0;
    right: 0;
    transform: none;
  }

  /* Remove hover-based display since we're using JS instead */
  /*
  .dropdown:hover .dropdown-content {
    transform: translateY(0);
  }
  */

  .dropdown-column {
    flex-basis: 100%;
    margin-bottom: 15px;
  }
}

/**
 * TV Shows section-specific fixes for FreeFlix
 * Ensures correct button placement and portrait banner navigation
 */

/* Add search results styling */
#searchResults {
  position: absolute;
  top: 60px;
  left: 48.5%; /* Move slightly to left from center */
  transform: translateX(-50%); /* Center perfectly */
  width: 500px; /* Match max-width of input container */
  background-color: #141414;
  color: white;
  border-radius: 5px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  max-height: 80vh;
  overflow-y: auto;
  /* Remove the purple border */
  border: none;
}

#searchResults p {
  padding: 15px;
  text-align: center;
  margin: 0;
}

.movie-list {
  padding: 10px;
  border-bottom: 1px solid #333;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.movie-list:hover {
  background-color: #222;
}

.search-item-thumbnail {
  width: 50px;
  height: 75px;
  overflow: hidden;
  margin-right: 10px;
}

.search-item-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.search-item-info {
  flex: 1;
}

.search-item-info h3 {
  font-size: 14px;
  margin: 0 0 5px 0;
}

.search-item-info p {
  font-size: 12px;
  color: #999;
  margin: 0;
}

.watchListBtn {
  background-color: #8d16c9;
  color: white;
  border: none;
  padding: 5px 10px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
  white-space: nowrap;
}

.watchListBtn:hover {
  background-color: #a428e6;
}

/* Override any conflicting styles and ensure navigation buttons work correctly */
.tv-section .navigation-button,
.movie-section .navigation-button {
  height: 170px !important;
  width: 40px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 15 !important;
  opacity: 0;
  transition: opacity 0.3s ease-in-out, background-color 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: #8d16c9;
  background-color: rgba(0,0,0,0.3);
  border-radius: 5px;
  cursor: pointer;
}

.tv-section .movie-container:hover .navigation-button,
.movie-section .movie-container:hover .navigation-button {
  opacity: 0.8 !important;
}

.tv-section .navigation-button:hover,
.movie-section .navigation-button:hover {
  opacity: 1 !important;
  background-color: rgba(0,0,0,0.5);
}

.tv-section .previous,
.movie-section .previous {
  left: 0;
}

.tv-section .next,
.movie-section .next {
  right: 0;
}

/* Netflix Originals/Portrait container navigation buttons */
.netflix-previous, .netflix-next {
  height: 340px !important;
  z-index: 15;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  transition: opacity 0.3s, background-color 0.3s;
  background-color: rgba(0,0,0,0.3);
  color: #8d16c9;
  border-radius: 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  width: 40px;
}

.netflix-previous {
  left: 0;
}

.netflix-next {
  right: 0;
}

/* Ensure buttons are always visible on hover */
.netflix-container:hover + .netflix-next,
.netflix-container:hover ~ .netflix-previous,
.netflix-previous:hover,
.netflix-next:hover,
.movie-container:hover .netflix-previous,
.movie-container:hover .netflix-next {
  opacity: 0.8 !important;
}

.netflix-previous:hover,
.netflix-next:hover {
  opacity: 1 !important;
  background-color: rgba(0,0,0,0.5);
}

/* Ensure containers have proper sizing */
.tv-section .movie-container,
.movie-section .movie-container,
.movie-container {
  position: relative;
  overflow: visible;
  margin-bottom: 20px;
}

/* Ensure navigation buttons are properly aligned */
.navigation-button {
  z-index: 15;
}

.previous {
  left: 0;
}

.next {
  right: 0;
}

/* Make sure Netflix Originals buttons are visible when container is hovered */
.movie-container:hover .netflix-previous,
.movie-container:hover .netflix-next {
  opacity: 0.8 !important;
}

.tv-section .movies-box,
.movie-section .movies-box {
  min-height: 190px;
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

.tv-section .movies-box::-webkit-scrollbar,
.movie-section .movies-box::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

/* Consistent item sizing */
.tv-section .movie-item,
.movie-section .movie-item {
  width: 290px;
  height: 170px;
}

/* Additional fix for mobile view */
@media (max-width: 768px) {
  .tv-section .navigation-button,
  .movie-section .navigation-button {
    width: 35px;
    height: 150px !important;
    opacity: 0.7;
    top: 50%;
    transform: translateY(-50%);
    z-index: 15 !important;
    font-size: 1.5rem;
  }

  /* Ensure Netflix Originals navigation buttons are visible and positioned correctly in mobile */
  .netflix-previous, .netflix-next {
    height: 260px !important;
    width: 32px;
    top: 50%;
    z-index: 15;
    opacity: 0.7;
    transform: translateY(-50%);
    font-size: 1.5rem;
  }

  .netflix-previous {
    left: 0;
  }

  .netflix-next {
    right: 0;
  }

  /* Extra space for movie containers so buttons aren't cut off */
  .tv-section .movie-container,
  .movie-section .movie-container,
  .movie-container {
    padding-left: 20px;
    padding-right: 20px;
    margin-left: 0;
    margin-right: 0;
  }
}

@media (max-width: 480px) {
  .tv-section .navigation-button,
  .movie-section .navigation-button {
    width: 30px;
    height: 130px !important;
    font-size: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 15 !important;
  }

  .netflix-previous, .netflix-next {
    height: 260px !important;
    width: 30px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
  }
}

/* Style fix for active navigation items */
.nav-item.active {
  background-color: rgb(141, 22, 201);
}
