/* =====================
   Global Reset & Layout
   ===================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: Arial, sans-serif;
  background: linear-gradient(135deg, #0d0d0d, #1a1a1a, #0f2027);
  background-color: #0d0d0d; /* fallback */
  color: #fff;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

/* =====================
   Header
   ===================== */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 30px;
  background: rgba(0,0,0,0.9);
  position: sticky;
  top: 0;
  z-index: 1000;
}

header h1 {
  font-size: 2em;
  font-weight: bold;
  margin-left: 0; /* ✅ Flush with left edge */
}

header h1 .flix {
  color: #00bfff;
}

header h1 .hub {
  color: #fff;
}

.nav-buttons {
  display: flex;
  gap: 10px;
  align-items: center;
}

.nav-buttons input {
  padding: 8px;
  border-radius: 4px;
  border: none;
  outline: none;
}

.nav-buttons button {
  background: #111;
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s;
}

.nav-buttons button:hover {
  background: #00bfff;
}

/* =====================
   Sidebar
   ===================== */
.sidebar {
  position: fixed;
  top: 60px;
  left: -220px;
  width: 220px;
  height: calc(100% - 60px);
  background: #111;
  padding: 20px;
  transition: left 0.3s ease;
  z-index: 900;
  overflow-y: auto;
}

.sidebar h3 {
  margin-top: 0;
  color: #00bfff;
}

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

.sidebar li {
  padding: 10px 0;
  cursor: pointer;
  transition: color 0.3s;
}

.sidebar li:hover {
  color: #00bfff;
}

body.sidebar-open .sidebar {
  left: 0;
}

/* =====================
   Page & Main Content
   ===================== */
.page {
  display: flex;
  flex: 1;
}

.main-content {
  flex-grow: 1;
  padding: 30px;
  margin-left: 0;
  transition: margin-left 0.3s ease;
}

body.sidebar-open .main-content {
  margin-left: 220px;
}

.welcome {
  font-size: 1.4em;
  margin-bottom: 20px;
  color: #00bfff;
  font-weight: bold;
  text-shadow: none;
}

/* =====================
   Movies Banner
   ===================== */
.movies-banner {
  text-align: center;
  font-size: 2em;
  font-weight: bold;
  color: #00bfff;   /* cyan accent */
  margin: 40px 0 20px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* =====================
   Movie Grid
   ===================== */
.movie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
}

.movie-card-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: space-between; 
  align-items: center;
  height: 100%; 
}

.movie-card {
  background: #111;
  border-radius: 10px;
  overflow: hidden;
  text-align: center;
  padding: 10px;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
  flex-grow: 1; 
  position: relative; 
}

.movie-card:hover {
  transform: scale(1.05);
  box-shadow: 0px 10px 20px rgba(0, 0, 0, 0.8);
}

.movie-card img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  border-radius: 6px;
}

.movie-card h3 {
  margin: 10px 0 0;
  font-size: 1em;
  font-weight: normal;
  color: #fff;
  text-decoration: none;
  /* ✅ FIX: removed pointer-events: none; */
}

/* =====================
   Cast Grid
   ===================== */
#castGrid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 15px;
}

.actor-card {
  flex: 0 1 120px;
  text-align: center;
}

.actor-card img {
  width: 100px;
  height: 140px;
  border-radius: 6px;
  object-fit: cover;
  display: block;
  margin: 0 auto;
}

.actor-card p {
  margin-top: 5px;
  font-size: 0.9em;
}

/* =====================
   Watchlist & Continue Watching
   ===================== */
.watchlist,
.continue-watching {
  margin-top: 40px;
}

.watchlist h2,
.continue-watching h2 {
  margin-bottom: 20px;
  color: #00bfff;
}

/* ✅ Watchlist same as movie grid */
#watchlistGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
}

#watchlistGrid .watchlist-item {
  background: #111;
  border-radius: 10px;
  overflow: hidden;
  text-align: center;
  padding: 10px;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
  position: relative;
}

#watchlistGrid .watchlist-item:hover {
  transform: scale(1.05);
  box-shadow: 0px 10px 20px rgba(0,0,0,0.8);
}

#watchlistGrid .watchlist-item img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  border-radius: 6px;
}

#watchlistGrid .watchlist-item h3 {
  margin: 10px 0 0;
  font-size: 1em;
  font-weight: normal;
  color: #fff;
}

/* ✅ Continue Watching same as movie grid */
#continueWatchingList {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
}

#continueWatchingList .movie-card {
  background: #111;
  border-radius: 10px;
  overflow: hidden;
  text-align: center;
  padding: 10px;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
  position: relative;
}

#continueWatchingList .movie-card:hover {
  transform: scale(1.05);
  box-shadow: 0px 10px 20px rgba(0,0,0,0.8);
}

#continueWatchingList .movie-card img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  border-radius: 6px;
}

#continueWatchingList .movie-card h3 {
  margin: 10px 0 0;
  font-size: 1em;
  font-weight: normal;
  color: #fff;
}

/* ✅ Remove Button */
.remove-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.7);
  border: 1px solid #00bfff;
  color: #fff;
  font-size: 0.9em;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s, background 0.2s, transform 0.2s;
  z-index: 10;
}

.movie-card:hover .remove-btn,
.watchlist-item:hover .remove-btn {
  opacity: 1;
  visibility: visible;
}

.remove-btn:hover {
  background: #00bfff;
  color: #000;
  transform: scale(1.1);
}

/* =====================
   Action Buttons
   ===================== */
.action-btn {
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 10px;
  font-size: 0.9em;
  background: #111;
  color: #fff;
  transition: background 0.3s, transform 0.2s, box-shadow 0.2s;
}

.action-btn:hover {
  background: #00bfff;
  transform: scale(1.05);
  box-shadow: 0px 6px 15px rgba(0, 191, 255, 0.6);
}

#playBtn.action-btn {
  background: #00bfff;
  color: #fff;
  font-weight: bold;
}
#playBtn.action-btn:hover {
  background: #009acd;
  transform: scale(1.05);
  box-shadow: 0px 6px 15px rgba(0, 191, 255, 0.8);
}

/* =====================
   Recommended Movies
   ===================== */
#recommendGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

#recommendGrid .movie-card {
  background: #111;
  border-radius: 10px;
  overflow: hidden;
  text-align: center;
  padding: 10px;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
  flex-grow: 1;
  position: relative;
}

#recommendGrid .movie-card:hover {
  transform: scale(1.05);
  box-shadow: 0px 10px 20px rgba(0, 0, 0, 0.8);
}

#recommendGrid .movie-card img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  border-radius: 6px;
}

#recommendGrid .movie-card h3 {
  margin: 10px 0 0;
  font-size: 1em;
  font-weight: normal;
  color: #fff;
}

/* =====================
   Login Page
   ===================== */
.login-container {
  max-width: 400px;
  margin: 60px auto;
  padding: 30px;
  background: #111;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.7);
  text-align: center;
}

.login-container h2 {
  margin-bottom: 20px;
  color: #00bfff;
}

.login-container input {
  display: block;
  width: 100%;
  margin-bottom: 15px;
  padding: 10px;
  border-radius: 6px;
  border: none;
}

.login-container button {
  width: 100%;
  padding: 10px;
  background: #00bfff;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1em;
  cursor: pointer;
  transition: background 0.3s;
}

.login-container button:hover {
  background: #009acd;
}

/* =====================
   Footer
   ===================== */
footer, footer p {
  text-align: center;
  padding: 10px;
  background: #000;
  font-size: 0.9em;
  margin-top: auto;
  position: fixed;
  bottom: 0;
  width: 100%;
  color: white;
  z-index: 100;
}

/* =====================
   Video Player Fullscreen
   ===================== */
.video-player {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: black;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.video-player video {
  width: 100%;
  height: 100%;
  background: black;
}

.video-player .close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(0,191,255,0.9);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 1.5em;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2100;
}

/* =====================
   Profiles Page
   ===================== */
.profiles-grid {
  display: flex;
  justify-content: center;
  gap: 25px;
  flex-wrap: wrap;
  margin-top: 40px;
}

.profile-card {
  background: #111;
  border-radius: 10px;
  padding: 15px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
}

.profile-card:hover {
  transform: scale(1.08);
  box-shadow: 0px 10px 20px rgba(0,0,0,0.8);
}

.profile-card img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 10px;
  border: 2px solid #00bfff;
}

.profile-card h3 {
  margin: 0;
  font-size: 1em;
  color: #fff;
}

/* =====================
   Enforce Nav Button Order
   ===================== */
.nav-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-buttons #searchInput { order: 1; min-width: 200px; }
.nav-buttons #homeBtn { order: 2; }
.nav-buttons #switchProfileBtn { order: 3; }
.nav-buttons #logoutBtn { order: 4; }