/* Netflix-style Theme Variables */
:root {
  --netflix-black: #141414;
  --netflix-red: #E50914;
  --netflix-dark-grey: #181818;
  --text-primary: #ffffff;
  --text-secondary: #b3b3b3;
}

body {
  background: linear-gradient(rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.9)), url('https://www.transparenttextures.com/patterns/carbon-fibre.png') repeat, #000000;
  color: var(--text-primary) !important;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  margin: 0;
  padding: 0;
}

h1, h2, h3, h4, h5, h6, p {
  color: #ffffff;
}

/* Navbar */
.navbar {
  background-color: rgba(15, 15, 15, 0.95) !important;
  border-bottom: 1px solid #333;
}

.navbar-brand {
  color: var(--netflix-red) !important;
  font-weight: 700;
  font-size: 1.5rem;
}

.nav-link {
  color: var(--text-secondary) !important;
  transition: color 0.3s ease;
}

.nav-link:hover, .nav-link:focus, .nav-link:active {
  color: var(--netflix-red) !important;
  text-shadow: 0 0 5px rgba(229, 9, 20, 0.5);
}

.dropdown-menu {
  background-color: var(--netflix-dark-grey) !important;
  border: 1px solid #333 !important;
  max-height: 300px;
  overflow-y: auto;
  scrollbar-width: none;
}
.dropdown-menu::-webkit-scrollbar {
  display: none;
}

.dropdown-item {
  color: var(--text-secondary) !important;
}

.dropdown-item:hover {
  background-color: #333 !important;
  color: var(--text-primary) !important;
}

.btn-outline-success {
  color: var(--text-primary);
  border-color: var(--netflix-red);
  background-color: var(--netflix-red);
}

.btn-outline-success:hover {
  background-color: #f40612;
  border-color: #f40612;
  color: #fff;
}

/* Navbar Search Input */
.navbar .form-control {
  background-color: #e0e0e0 !important;
  border: none;
  color: #333 !important;
}
.navbar .form-control:focus {
  background-color: #fff !important;
  box-shadow: 0 0 5px rgba(229, 9, 20, 0.5);
}

/* Forms */
.card .form-control, .cinematic-bg .form-control, .select {
  background-color: #222 !important;
  color: #fff !important;
  border: 1px solid #444 !important;
  border-radius: 4px;
}

.card .form-control::placeholder, .cinematic-bg .form-control::placeholder {
  color: #8c8c8c;
}

.form-label {
  color: var(--text-secondary);
}

/* Media Cards */
.media-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 20px;
  padding: 20px 0;
}

.item {
  width: 100%;
  border-radius: 8px;
  background-color: var(--netflix-dark-grey);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

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

.poster-img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

.first-txt {
  font-size: 1rem;
  font-weight: 600;
  margin: 10px;
  color: var(--text-primary);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rating-text {
  color: var(--netflix-red);
  font-weight: bold;
  text-align: center;
  margin-bottom: 10px;
}

/* Hero Section */
.hero-img {
  width: 100%;
  max-height: 70vh;
  object-fit: cover;
  object-position: center top;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%);
}

.hero-title {
  text-align: center;
  margin-top: -80px;
  font-size: 3rem;
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
  position: relative;
  z-index: 2;
}

/* Stars Rating */
.stars {
  display: flex;
  justify-content: center;
  flex-direction: row-reverse;
  margin: 20px 0;
}

input.star {
  display: none;
}

.stars label {
  font-size: 30px;
  color: #666; /* Lightened from #333 to be visible on dark background */
  cursor: pointer;
  transition: color 0.2s, transform 0.2s ease-in-out;
}

.stars label:before {
  content: '★';
  font-family: inherit;
}

.stars input:checked ~ label {
  color: #fd4;
  text-shadow: 0 0 10px rgba(255, 221, 68, 0.5);
}

.stars label:hover,
.stars label:hover ~ label {
  color: #f39c12;
  transform: scale(1.2);
}

.btn-primary {
  background-color: var(--netflix-red) !important;
  border-color: var(--netflix-red) !important;
}

.btn-primary:hover {
  background-color: #f40612 !important;
}

/* Cards (Comments/Forms) */
.card {
  background-color: var(--netflix-dark-grey) !important;
  border: 1px solid #333 !important;
  color: var(--text-primary) !important;
  border-radius: 8px;
}

.text-dark {
  color: var(--text-primary) !important;
}

/* Cinematic Background for forms */
.cinematic-bg {
  background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('https://assets.nflxext.com/ffe/siteui/vlv3/d1532433-07b1-4e39-a920-0f08b81a489e/67033404-2df8-42e0-a5a0-4c8288b4da2c/US-en-20231120-popsignuptwoweeks-perspective_alpha_website_large.jpg') no-repeat center center fixed;
  background-size: cover;
  min-height: 100vh;
}

/* Cast Row & Media Carousels */
.carousel-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  margin: 0 40px; /* Add margin so buttons sit cleanly outside */
}
.carousel-btn {
  background-color: rgba(0,0,0,0.5);
  border: none;
  color: white;
  font-size: 2rem;
  padding: 10px;
  cursor: pointer;
  z-index: 100;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  transition: background-color 0.3s;
}
.carousel-btn:hover {
  background-color: var(--netflix-red);
}
.carousel-btn-left {
  left: -50px;
}
.carousel-btn-right {
  right: -50px;
}

.cast-container, .media-carousel {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  gap: 15px;
  padding: 10px 0;
  scroll-behavior: smooth;
  scrollbar-width: none; /* Hide scrollbar for cleaner look with buttons */
}
.cast-container::-webkit-scrollbar, .media-carousel::-webkit-scrollbar {
  display: none;
}

.cast-card {
  min-width: 120px;
  text-align: center;
}
.cast-img {
  width: 120px;
  height: 180px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 5px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.5);
}
.cast-name {
  font-size: 0.9rem;
  font-weight: bold;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cast-character {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Comments Bubble */
.comment-bubble {
  background-color: rgba(24, 24, 24, 0.8);
  border: 1px solid #333;
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 15px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}
.comment-header {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #333;
  padding-bottom: 5px;
  margin-bottom: 10px;
}
.comment-author {
  font-weight: bold;
  color: var(--netflix-red);
}
.comment-date {
  font-size: 0.8rem;
  color: #ccc;
}
.comment-body {
  color: #fff;
  font-size: 1rem;
}

.detail-layout {
  display: flex;
  flex-direction: column;
  gap: 30px;
  padding: 20px 4vw;
  margin: 0 auto;
}
.detail-main {
  width: 100%;
}
.detail-sidebar {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}