/*  Grid / Movie Cards  */
.movie-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* For 4 per row */
  gap: 20px;
  max-width: 900px;  /* controls total width */
  margin: 0 auto;
}

/* Tablet */
@media (max-width: 900px) {
  .movie-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile */
@media (max-width: 500px) {
  .movie-grid {
    grid-template-columns: 1fr;
  }
}

.movie-card {
  position: relative;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  background: #1c1c1c;
  text-align: center;
  color: #fff;
  font-family: Arial, sans-serif;
}

.movie-card img {
  width: 100%;
  height: 270px;
  object-fit: cover;
}

.movie-card h3 {
  font-size: 1rem;
  margin: 5px 0;
}

.movie-card p {
  font-size: 0.75rem;
  padding: 5px;
  color: #ddd;
  max-height: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.movie-card:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

.fav-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.55);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 1rem;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.15s;
  z-index: 10;
}

.fav-btn:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.15);
}

.fav-btn.active {
  color: #e74c3c;
  background: rgba(0, 0, 0, 0.7);
}

.fav-btn-detail {
  margin-top: 12px;
  padding: 8px 18px;
  background: #1c1c1c;
  border: 2px solid #555;
  color: #fff;
  border-radius: 20px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.fav-btn-detail:hover {
  border-color: #e74c3c;
  color: #e74c3c;
}

.fav-btn-detail.active {
  border-color: #e74c3c;
  color: #e74c3c;
  background: rgba(231, 76, 60, 0.1);
}

.remove-fav-btn {
  display: block;
  width: calc(100% - 16px);
  margin: 4px 8px 8px;
  padding: 5px;
  background: transparent;
  border: 1px solid #555;
  color: #aaa;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.75rem;
  transition: border-color 0.2s, color 0.2s;
}

.remove-fav-btn:hover {
  border-color: #e74c3c;
  color: #e74c3c;
}

.category-title {
  text-align: center;
  font-size: 1.8rem;
  margin-bottom: 20px;
  color: #0d253f;
}

/*  Detailed View (Once you click on movie)  */
#homeView.detailed-view {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  color: #2c2b2b;
  font-family: Arial, sans-serif;
}

.movie-detail-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: flex-start;
}

#homeView.detailed-view img {
  width: 300px;
  height: auto;
  border-radius: 8px;
  object-fit: contain;
}

#homeView.detailed-view .person-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: #000;
}

.movie-info {
  max-width: 600px;
}

.movie-info h2 {
  font-size: 2rem;
  margin: 0;
}

.movie-info p,
.movie-info ul,
.movie-info h3 {
  color: #7d7d7d;
  line-height: 1.4;
}

.movie-info .rating {
  font-size: 1.2rem;
  color: #f5c518; /* gold */
  margin: 5px 0;
}

.movie-info .genres {
  margin: 5px 0;
}

.movie-info .genres span {
  background: #555;
  color: #fff;
  padding: 3px 8px;
  margin-right: 5px;
  border-radius: 12px;
  font-size: 0.8rem;
}

/*  Cast & Crew  */
.cast-list {
  margin-top: 15px;
}

.cast-list li {
  list-style: none;
  margin-bottom: 5px;
}

.person-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-start;
}

.person-card {
  width: 120px; /* fixed width */
  background: #1c1c1c;
  border-radius: 8px;
  flex-direction: column;
  overflow: hidden;
  text-align: center;
  color: #fff;
  font-family: Arial, sans-serif;
  cursor: default;
  transition: transform 0.2s, box-shadow 0.2s;
}

.person-card:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.person-card img {
  width: 100%;
  height: 160px; /* fixed height for uniformity */
  min-height: 160px;
  object-fit: cover;
  background: #000;
  display: block;
}

.person-card p {
  margin: 5px 0;
  font-size: 0.75rem;
  color: #ddd;
  line-height: 1.2;
}

.hidden-person {
  display: none;
}

.view-more-btn {
  display: inline-block;
  margin: 10px 0 20px 0;
  padding: 6px 12px;
  background: #01b4e4;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.9rem;
}


/*  Back Button  */
#backBtn{
  display: inline-block;
  margin: 10px 0;
  padding: 6px 12px;
  background: #01b4e4;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.9rem;
}

.view-more-btn {
  margin: 10px 0 20px 0; /* unique spacing */
}



/*  Navbar  */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #1a1a2e;
  padding: 15px 20px;  /* slightly more padding makes it taller */
  color: white;
  position: fixed;      /* stick to top */
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;        /* stay above movies */
  box-shadow: 0 2px 5px rgba(0,0,0,0.2); /* shadow */
}

/* Left side */
.nav-left {
  display: flex;
  align-items: center;
  gap: 15px;
}

/* Right side */
.nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Buttons */
.navbar button {
  background: none;
  border: none;
  color: white;
  font-size: 1rem;
  cursor: pointer;
}

.navbar button:hover {
  color: #01b4e4;
}

/* Push page content below navbar */
#homeView, #searchView, #favView {
  padding-top: 70px;
}

.search-bar {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 4px 8px;
  gap: 4px;
  transition: background 0.2s;
}

.search-bar:focus-within {
  background: rgba(255, 255, 255, 0.18);
  outline: 1px solid #01b4e4;
}

.search-bar input {
  background: transparent;
  border: none;
  outline: none;
  color: white;
  font-size: 0.9rem;
  width: 180px;
}

.search-bar input::placeholder { color: #aaa; }

.search-bar button {
  background: none;
  border: none;
  color: #01b4e4;
  font-size: 1rem;
  cursor: pointer;
  padding: 0 4px;
}

.search-bar button:hover { color: white; }

@media (max-width: 600px) {
  .search-bar input { width: 110px; }
}

/* Dropdown */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  display: block;
  position: absolute;
  background: #1c1c1c;
  min-width: 150px;
  border-radius: 6px;
  overflow: hidden;
  top: 30px;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 1000;
}

.dropdown-content a {
  display: block;
  padding: 10px;
  color: white;
  text-decoration: none;
}

.dropdown-content a:hover {
  background: #333;
}

/* Shows dropdown on hover */
.dropdown:hover .dropdown-content {
  visibility: visible;
  opacity: 1;
}


/* Load more button */
#loadMoreBtn {
  display: block;
  margin: 20px auto;
  width: 90%;
  max-width: 300px;
  padding: 12px;
  background: #01b4e4; /* same TMDB blue */
  color: white;
  border: none;
  border-radius: 6px;

  font-size: 1rem;
  cursor: pointer;
}

#loadMoreBtn {
  transition: all 0.2s ease;
}

#loadMoreBtn:hover {
  transform: scale(1.05);
  background: #0396c7;
}

/* ===================== AUTH0 LOGIN SCREEN ===================== */
body {
  margin: 0;
  padding: 30px;
  font-family: Arial, sans-serif;
}

#loginView {
  display: none;
  text-align: center;
  margin-top: 120px;
}

#loginView h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  color: #1a1a2e;
}

#loginView p {
  color: #aaa;
  margin-bottom: 30px;
  font-size: 1.1rem;
}

#loginBtn {
  padding: 12px 36px;
  font-size: 1rem;
  background-color: #e50914;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

#loginBtn:hover {
  background-color: #c40812;
}

/* ===================== LOGOUT BUTTON IN NAVBAR ===================== */
#logoutBtn {
  padding: 6px 14px;
  font-size: 0.85rem;
  background: transparent;
  color: #aaa;
  border: 1px solid #aaa;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

#logoutBtn:hover {
  color: white;
  border-color: white;
}
