/* Zoom Base */
html {
  font-size: 20px; /* Zoomed */
}

/* Base Layout */
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #111;
  color: #fff;
  font-size: 1rem;
}

/* Header */
header {
  position:relative;
  top: 0;
  z-index: 999;
  background: #000;
  padding: 1.5rem 1rem 1rem;
  text-align: center;
  border-bottom: 1px solid #222;
}


header h1 {
  font-size: 2.5rem;
  color: #ff5733;
  margin: 0;
}

.search-bar {
  position: sticky;
  display: inline-block;
  width: 90%;
  max-width: 700px;
  margin-top: 1rem;
}

.search-bar input {
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
}

.search-bar button {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 1.25rem;
  color: #999;
  cursor: pointer;
}

/* Dropdown Filter */
#search-type, #year-filter {
  margin: 1rem 0.5rem;
  padding: 0.5rem;
  border-radius: 0.4rem;
  border: none;
  font-size: 1rem;
}

/* Navbar */
.navbar {
  background: #222;
  padding: 1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.navbar a {
  color: #fff;
  text-decoration: none;
  padding: 0.5rem 1rem;
  background: #333;
  border-radius: 0.5rem;
  transition: background 0.3s;
}

.navbar a:hover {
  background: #ff5733;
}

/* Sections */
section {
  padding: 2rem 1rem;
  max-width: 1400px;
  margin: 0 auto;
}

section h2 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

.movie-grid {
  display: flex;
  flex-direction: row;
  overflow-x: auto;
  overflow-y: hidden;
  gap: 12px;
  padding: 8px 0;
  scroll-behavior: smooth;
  scrollbar-width: none; /* Firefox */
}

.movie-grid::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Edge */
}
#movies-container {
  display: flex;
  flex-wrap: nowrap;       /* keep cards in a single horizontal line */
  overflow-x: auto;        /* horizontal scrollbar if needed */
  gap: 10px;               /* space between cards */
  padding: 10px;
}

#home-movie-cards {
  display: flex !important;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  gap: 15px;
  padding: 10px;
}


/* Movie Cards */
.movie-card {
  flex: 0 0 auto;          /* prevent shrinking */
  width: 180px;  /* or whatever width suits your layout */
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #111;
  color: white;
  border-radius: 8px;
  overflow: hidden;
  padding: 0;
  margin: 4px;
  position: relative;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.movie-card:hover {
  transform: scale(1.05);
}

.movie-card img {
  width: 100%;
  height: 170px; /* fixed height for uniformity */
  object-fit: cover; /* ensures the image fits without distortion */
  display: block;
  border-bottom: 1px solid #333;
}





/* Movie Details Popup */
#movie-details {
  position: fixed;
  top: 5%;
  left: 5%;
  width: 90%;
  max-height: 90%;
  background: #000;
  border: 2px solid #ff5733;
  border-radius: 1rem;
  padding: 1rem;
  overflow-y: auto;
  z-index: 1000;
}

#close-details {
  float: right;
  font-size: 1.5rem;
  color: #fff;
}

/* Continue Watching */
#continue-watching button {
  background: #ff5733;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.4rem;
  color: #fff;
  cursor: pointer;
  margin-bottom: 1rem;
}

/* Footer */
footer {
  background: #000;
  color: #aaa;
  text-align: center;
  padding: 1rem;
  font-size: 0.9rem;
}



@media (max-width: 600px) {
  .movie-grid .movie-card {
    width: 110px;
  }
  .movie-grid .movie-card img {
    height: 150px;
  }
  .carousel-arrow {
    background: rgba(0, 0, 0, 0.6);
  border: none;
  color: white;
  font-size: 2rem;
  width: 40px;
  height: 100%;
  cursor: pointer;
  z-index: 1;
  }
}


/* Responsive Enhancements */
@media (min-width: 768px) {
  html { font-size: 21px; }

  header h1 {
    font-size: 3rem;
  }

  .movie-card {
    max-width: 300px;
  }

  .movie-card img {
    max-height: 240px;
  }
}

@media (min-width: 1024px) {
  html { font-size: 22px; }

  .navbar {
    justify-content: space-around;
  }

  .movie-card {
    max-width: 320px;
  }

  .movie-card img {
    max-height: 260px;
  }
}

@media (min-width: 1400px) {
  html { font-size: 23px; }

  .movie-card {
    max-width: 340px;
  }

  .movie-card img {
    max-height: 280px;
  }
}


/*
for tv control
*/
.movie-card:focus {
  outline: 3px solid #ff5733;
  transform: scale(1.1);
  z-index: 2;
}

.movie-card:focus img {
  border-bottom: 2px solid #ff5733;
}

.movie-card:focus-visible {
  outline: 3px solid #ff5733;
}

.movie-card:focus:not(:hover) {
  background: #222;
}

/* Prevent mouse focus highlight */
.movie-card:focus:not(:focus-visible) {
  outline: none;
}

/* Make movie cards tabbable for remote control */
.movie-card {
  outline: none;
}

.movie-card {
  transition: transform 0.3s ease, outline 0.2s;
}

button:focus,
input:focus,
select:focus {
  outline: 2px solid #ff5733;
  box-shadow: 0 0 0.5rem #ff5733;
}










.scroll-row {
  display: flex;
  overflow-x: auto;
  gap: 1rem;
  padding: 1rem 0;
  scroll-snap-type: x mandatory;
}

.scroll-row::-webkit-scrollbar {
  height: 8px;
}

.scroll-row::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 4px;
}

.movie-card {
  flex: 0 0 auto;
  scroll-snap-align: start;
}











/* Carousel wrapper to align arrows and scroll area */
.carousel-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 90%;
  max-width: 1200px;
  margin: 1rem auto;
  position: relative;
  overflow: hidden;
}



/* Scrollbar styles for WebKit */
.movie-grid::-webkit-scrollbar {
  height: 8px;
}
.movie-grid::-webkit-scrollbar-track {
  background: transparent;
}
.movie-grid::-webkit-scrollbar-thumb {
  background-color: #ff5733;
  border-radius: 4px;
}

/* Movie card inside horizontal scroll */
.movie-grid .movie-card {
  flex: 0 0 auto; /* fix width, no shrinking */
  width: 140px;
  cursor: pointer;
  border-radius: 8px;
  background: #111;
  color: white;
  overflow: hidden;
  transition: transform 0.3s ease;
  position: relative;
}

.movie-grid .movie-card:hover,
.movie-grid .movie-card:focus-visible {
  transform: scale(1.1);
  z-index: 10;
  outline: 3px solid #ff5733;
}

.movie-grid .movie-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-bottom: 1px solid #333;
}

/* Arrow buttons */
.carousel-arrow {
  background: #222;
  border: none;
  color: #ff5733;
  font-size: 2rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.3s ease;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-arrow:hover {
  background: #ff5733;
  color: #111;
}

.carousel-arrow:focus {
  outline: 3px solid #ff5733;
}

.slideshow {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
}

.slide-info {
  position: absolute;
  bottom: 20px;
  left: 30px;
  color: white;
  background: rgba(0,0,0,0.5);
  padding: 10px;
}



#slideshow-container {
  position: relative;
  width: 100%;
  max-height: 60vh; /* or try 400px */
  overflow: hidden;
  border-radius: 12px;
  margin: 20px auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  object-fit: cover;
  transition: opacity 0.8s ease-in-out;
}

.slide.active {
  display: block;
  z-index: 1;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slide h3 {
  position: absolute;
  bottom: 20px;
  left: 20px;
  margin: 0;
  font-size: 2rem;
  color: white;
  text-shadow: 2px 2px 8px rgba(0,0,0,0.8);
}


#slideshow-container .slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}