/* Reset & basics */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
  background-color: #121212;
  color: #eee;
  overflow-x: hidden;
}

/* Dark theme */
.dark-theme {
  background-color: #121212;
  color: #eee;
}

/* Navbar */
#navbar {
  background-color: #1f1f1f;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
}

.nav-link.custom-hover-red {
  color: #eee;
  transition: color 0.3s ease;
}

.nav-link.custom-hover-red:hover,
.nav-link.custom-hover-red.active {
  color: #e70c0c !important;
}

/* Dropdown */
.dropdown-menu-dark {
  background-color: #2a2a2a;
}

.dropdown-item.custom-hover-red:hover {
  background-color: #3d0000;
  color: #e70c0c !important;
}

/* Hero Section */
.hero-bg {
  background-image: var(--hero-bg-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  min-height: 75vh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-content {
  max-width: 800px;
  z-index: 10;
}

#heroTitle {
  font-size: 3.5rem;
  font-weight: 900;
  margin-bottom: 0.5rem;
  color: #e70c0c;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
}

#heroRating,
#heroYear,
#heroRuntime {
  font-size: 1.25rem;
  color: #ccc;
}

#heroGenres {
  font-size: 1rem;
  font-weight: 600;
  color: #e70c0c;
}

#heroOverview {
  font-size: 1.125rem;
  color: #ddd;
  max-height: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Hero Buttons */
.hero-buttons button {
  margin: 0 0.5rem;
  font-weight: 600;
}

/* Movie Cards */
.movie-card {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s ease;
  background-color: #000;
}

.movie-card:hover {
  transform: scale(1.05);
}

.movie-card img {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 0 15px rgba(255, 0, 0, 0.6);
}

.movie-title {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  padding: 5px;
  font-size: 0.85rem;
  text-align: center;
  font-weight: bold;
  z-index: 2;
}

.movie-meta {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  padding: 5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  z-index: 2;
}

/* Theme Toggle Icon */
body.light-theme #toggleThemeBtn i {
  color: #000;
}
body.dark-theme #toggleThemeBtn i {
  color: #fff;
}

/* Light theme overrides */
body.light-theme {
  background-color: #f9f9f9;
  color: #111;
}

body.light-theme .navbar {
  background-color: #f8f9fa !important;
}

body.light-theme .nav-link.custom-hover-red {
  color: #111 !important;
}
body.light-theme .nav-link.custom-hover-red:hover,
body.light-theme .nav-link.custom-hover-red.active {
  color: #e70c0c !important;
}

body.light-theme .dropdown-menu-dark {
  background-color: #fff;
}
body.light-theme .dropdown-item.custom-hover-red:hover {
  background-color: #ffe6e6;
  color: #e70c0c !important;
}

/* Hero Section Light Mode */
body.light-theme .hero-bg {
  background-blend-mode: overlay;
}
body.light-theme #heroTitle {
  color: #b50000;
  text-shadow: none;
}
body.light-theme #heroRating,
body.light-theme #heroYear,
body.light-theme #heroRuntime {
  color: #333;
}
body.light-theme #heroOverview {
  color: #444;
}
body.light-theme #heroGenres {
  color: #b50000;
}

/* Movie Cards Light Theme */
body.light-theme .movie-card {
  background-color: #fff;
  box-shadow: 0 0 8px rgba(200, 0, 0, 0.2);
}
body.light-theme .movie-meta {
  background: rgba(255, 255, 255, 0.85);
  color: #000;
}
body.light-theme .movie-title {
  background: rgba(255, 255, 255, 0.85);
  color: #000;
}
body.light-theme .movie-meta .btn-outline-light {
  border-color: #e70c0c;
  color: #e70c0c;
}
body.light-theme .movie-meta .btn-outline-light:hover {
  background-color: #e70c0c;
  color: #fff;
}
body.light-theme .movie-card img {
  box-shadow: 0 0 8px rgba(200, 0, 0, 0.3);
}

/* Buttons */
.btn-danger {
  background-color: #e70c0c;
  border: none;
}
.btn-danger:hover {
  background-color: #b50a0a;
}

/* Search Bar */
form.d-flex.position-relative {
  max-width: 100%;
}
form input.form-control {
  background-color: #fff7f7;
  border: 1px solid #444;
  color: #eee;
  padding-right: 2.5rem;
  font-size: 1rem;
  height: 34px;
  border-radius: 4px;
}
form input.form-control::placeholder {
  color: #aaa;
}
form input.form-control:focus {
  border-color: #dc3545;
  background-color: #222;
  color: #fff;
  box-shadow: none;
}
body.light-theme input.form-control {
  background-color: #fff;
  color: #000;
  border-color: #ccc;
}
body.light-theme input.form-control:focus {
  background-color: #f0f0f0;
  color: #000;
  border-color: #e70c0c;
}

/* Carousel */
.slick-carousel .slick-slide {
  outline: none;
}
.slick-carousel .slick-arrow {
  color: #e70c0c;
}
body.light-theme .slick-arrow {
  color: #e70c0c;
}

/* Section Title */
.section-title {
  font-weight: 700;
  color: #e70c0c;
  margin-bottom: 1rem;
  font-size: 1.75rem;
}

/* Genres */
.genres-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.genres-list button {
  background-color: transparent;
  border: 1px solid #e70c0c;
  color: #e70c0c;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
}
.genres-list button:hover,
.genres-list button.active {
  background-color: #e70c0c;
  color: #121212;
}

/* Modal */
.modal-content.bg-dark {
  background-color: #1f1f1f;
  color: #eee;
}
.modal-header {
  border-bottom: none;
}

/* Footer (Dark + Light theme) */
footer {
  padding: 1.5rem 0;
  text-align: center;
  background-color: #000;
  color: #eee;
  border-top: 1px solid #444;
}

footer p,
footer a {
  color: #eee;
}

footer a:hover {
  color: #e70c0c;
}

body.light-theme footer {
  background-color: #f1f1f1;
  color: #111;
  border-top: 1px solid #ccc;
}

body.light-theme footer p,
body.light-theme footer a {
  color: #111;
}

body.light-theme footer a:hover {
  color: #e70c0c;
}

/* Hero Section Animation */
.animate-item {
  opacity: 0;
  transform: translateY(20px);
  animation-fill-mode: forwards;
  animation-timing-function: ease-out;
}
.animate-delay-1 {
  animation-delay: 0.3s;
  animation-name: fadeInUp;
  animation-duration: 0.6s;
}
.animate-delay-2 {
  animation-delay: 0.6s;
  animation-name: fadeInUp;
  animation-duration: 0.6s;
}
.animate-delay-3 {
  animation-delay: 0.9s;
  animation-name: fadeInUp;
  animation-duration: 0.6s;
}
.animate-delay-4 {
  animation-delay: 1.2s;
  animation-name: fadeInUp;
  animation-duration: 0.6s;
}
.animate-delay-5 {
  animation-delay: 1.5s;
  animation-name: fadeInUp;
  animation-duration: 0.6s;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
