/* =================================== */
/* 1. GLOBAL STYLES & VARIABLES      */
/* =================================== */
:root {
  --primary-color: #2b313d; /* Dark blue-grey from your logo's background */
  --accent-color: #3b4252; /* Slightly lighter shade for hover/active states */
  --background-color: #1a1e26; /* Deeper background, slightly darker than primary */
  --container-bg-color: #2b313d; /* Matches primary color for containers */
  --text-color: #ffffff;
  --text-color-secondary: #cccccc; /* Lighter secondary text */
  --stars-color: #b0b0b0; /* Lighter shade for review stars */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--container-bg-color); border-radius: 10px; }
::-webkit-scrollbar-thumb { background: #4a515c; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #5a626f; }

/* =================================== */
/* 2. NAVBAR                         */
/* =================================== */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 3rem;
  background: rgba(26, 30, 38, 0.7);
  backdrop-filter: blur(10px);
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  transition: background-color 0.3s ease;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 15px;
  text-decoration: none;
  color: inherit;
}
.logo-container img { height: 40px; }
.logo-container h1 {
  font-size: 1.8rem;
  font-weight: 600;
  
  /* --- New Gradient Animation Styles --- */
  background: linear-gradient(90deg, #b0b0b0, #ffffff, #b0b0b0); /* Light grey, white, light grey gradient */
  background-size: 200% auto; /* Make the background wider than the text */
  -webkit-background-clip: text; /* Clip the background to the text shape */
  -webkit-text-fill-color: transparent; /* Make the text itself transparent */
  animation: gradient-flow 3s linear infinite; /* Apply the animation */
  /* --- End New Gradient Animation Styles --- */
}

/* Define the animation */
@keyframes gradient-flow {
  0% {
    background-position: 0% center; /* Start with gradient at the left */
  }
  100% {
    background-position: 200% center; /* Move gradient to the right (200% because background-size is 200%) */
  }
}

.nav-links { display: flex; align-items: center; gap: 20px; }
.nav-links a { color: var(--text-color); text-decoration: none; font-weight: 500; transition: color 0.3s ease; }
.nav-links a:hover { color: var(--text-color-secondary); }

.search-bar {
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid #444;
  border-radius: 20px;
  padding: 8px 15px;
  color: var(--text-color);
  font-family: 'Poppins', sans-serif;
  transition: all 0.3s ease;
}
.search-bar::placeholder { color: var(--text-color-secondary); }
.search-bar:focus { outline: none; border-color: var(--accent-color); background-color: rgba(0, 0, 0, 0.3); }

/* =================================== */
/* 3. BANNER SLIDER                  */
/* =================================== */
.banner-slider {
  height: 80vh;
  position: relative;
  overflow: hidden;
}

.banner-slides {
  display: flex;
  height: 100%;
  transition: transform 0.5s ease-in-out;
}

.banner-slide {
  flex-shrink: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center top;
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 5rem;
}

.banner-slide::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: linear-gradient(to right, rgba(26, 30, 38, 0.95) 15%, transparent 70%),
              linear-gradient(to top, rgba(26, 30, 38, 0.8) 10%, transparent 50%);
}

.banner-dots {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 10;
}
.banner-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: background-color 0.3s ease;
}
.banner-dot.active {
  background-color: var(--text-color);
}

/* =================================== */
/* 4. BANNER CONTENT                 */
/* =================================== */
.banner-content {
  z-index: 2;
  max-width: 65%;
  color: #fff;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.banner-content h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  margin-bottom: 0.5rem;
  white-space: nowrap;
}

.banner-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.banner-meta .rating {
  color: var(--stars-color);
}

.banner-description {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.banner-buttons {
  display: flex;
  gap: 1rem;
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 5px;
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-primary {
  background-color: var(--accent-color);
  color: var(--text-color);
}
.btn-primary:hover {
  background-color: var(--primary-color);
  transform: scale(1.05);
}

.btn-secondary {
  background-color: rgba(109, 109, 110, 0.3);
  color: var(--text-color);
}
.btn-secondary:hover {
  background-color: rgba(109, 109, 110, 0.5);
  transform: scale(1.05);
}

/* =================================== */
/* 5. CONTENT ROWS & CARDS           */
/* =================================== */
.row {
  padding: 1rem 3rem;
  margin-top: 20px;
}

.row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.row h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0;
}

.slider-nav {
  display: flex;
  gap: 0.5rem;
}

.slider-arrow {
  background-color: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--text-color-secondary);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.slider-arrow:hover {
  background-color: rgba(255, 255, 255, 0.2);
  color: var(--text-color);
}

.list {
  display: flex;
  gap: 15px;
  overflow-x: hidden;
  scroll-behavior: smooth;
  padding: 5px;
  padding-bottom: 1rem;
}

.movie-card {
  flex-shrink: 0;
  width: 200px;
  display: flex;
  flex-direction: column;
  background-color: var(--container-bg-color);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease;
}

.movie-card:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 20px rgba(0,0,0,0.4);
  z-index: 5;
}

.movie-card img {
  width: 100%;
  height: 300px;
  object-fit: cover;
}

.card-content {
  padding: 1rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.5rem;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-color-secondary);
  margin-bottom: 0.75rem;
}

.card-meta .rating {
  font-weight: 600;
  color: var(--stars-color);
}

.card-description {
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-color-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* =================================== */
/* 6. MODALS (DETAILS & SEARCH)      */
/* =================================== */
.modal, .search-modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0; top: 0;
  width: 100%; height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.85);
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: var(--primary-color); /* Updated background */
  margin: auto;
  padding: 2rem;
  border-radius: 10px;
  max-width: 900px;
  width: 90%;
  position: relative;
  box-shadow: 0 15px 30px rgba(0,0,0,0.5);
}

.close {
  color: var(--text-color-secondary);
  position: absolute;
  top: 1rem; right: 1.5rem;
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s ease;
}
.close:hover { color: var(--text-color); }

.modal-body { display: flex; gap: 2rem; }
#modal-image { max-width: 250px; height: auto; border-radius: 8px; }
.modal-text h2 { font-size: 2.5rem; margin-bottom: 1rem; }
.stars { color: var(--stars-color); font-size: 1.2rem; margin-bottom: 1rem; }
#modal-description { line-height: 1.6; color: var(--text-color-secondary); }

.watch-btn {
  display: inline-block;
  margin-top: 20px;
  padding: 12px 25px;
  background-color: var(--accent-color);
  color: var(--text-color);
  text-decoration: none;
  font-weight: 600;
  border-radius: 5px;
  transition: background-color 0.3s ease, transform 0.2s ease;
  font-size: 1rem;
}
.watch-btn:hover {
  background-color: #4a515c; /* Slightly lighter hover */
  transform: scale(1.05);
}
.watch-btn .fas { margin-right: 8px; }

/* Search Modal */
.search-modal { flex-direction: column; padding-top: 0; }
#search-input {
    width: 90%;
    max-width: 600px;
    padding: 15px 25px;
    font-size: 1.2rem;
    border-radius: 30px;
    border: 2px solid #444;
    background-color: var(--container-bg-color);
    color: var(--text-color);
    margin-bottom: 2rem;
    outline: none;
    transition: border-color 0.3s ease;
}
#search-input:focus { border-color: var(--accent-color); }
.results {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    max-height: 70vh;
    width: 90%;
    max-width: 1200px;
    overflow-y: auto;
}
.results .movie-card { width: 180px; }
.results .movie-card img { height: 270px; }


/* =================================== */
/* 7. FOOTER                         */
/* =================================== */
.footer {
  margin-top: 40px;
  padding: 2rem 3rem;
  background-color: #111; /* Slightly darker than main bg */
  text-align: center;
}
.footer-content { max-width: 1200px; margin: 0 auto; }
.footer-links { margin-top: 1rem; display: flex; justify-content: center; gap: 20px; }
.footer-links a { color: var(--text-color-secondary); text-decoration: none; transition: color 0.3s ease; }
.footer-links a:hover { color: var(--accent-color); }

/* =================================== */
/* 8. RESPONSIVE DESIGN              */
/* =================================== */
@media (max-width: 768px) {
  .navbar { padding: 1rem 1.5rem; }
  .logo-container h1 { font-size: 1.5rem; }
  .logo-container img { height: 30px; }
  
  .banner-slide { height: 70vh; padding: 0 2rem; }
  .banner-content { max-width: 90%; }
  .banner-content h1 { font-size: 2.2rem; }
  .banner-meta { font-size: 0.9rem; }
  .banner-description { font-size: 0.9rem; -webkit-line-clamp: 2; }
  .banner-buttons { flex-direction: column; align-items: flex-start; gap: 0.5rem; width: 100%; max-width: 250px; }
  .btn { width: 100%; }
  
  .row { padding: 1rem 1.5rem; }
  .row h2 { font-size: 1.2rem; }
  
  .movie-card { width: 160px; }
  .movie-card img { height: 240px; }
  .card-content { padding: 0.8rem; }
  .card-title { font-size: 0.9rem; }
  .card-meta { font-size: 0.7rem; }
  .card-description { -webkit-line-clamp: 1; }
  
  .modal-body { flex-direction: column; align-items: center; text-align: center; }
  #modal-image { max-width: 200px; }
  .modal-text h2 { font-size: 1.8rem; }

  .results .movie-card { width: 140px; }
  .results .movie-card img { height: 210px; }
}

@media (max-width: 480px) {
  .navbar { flex-direction: column; align-items: flex-start; gap: 10px; }
  .nav-links { width: 100%; justify-content: space-between; }
  
  .banner-slide { padding: 0 1rem; }
  .banner-content h1 { font-size: 1.8rem; }
  .banner-description { display: none; }

  .row { padding: 1rem; }
  
  .movie-card { width: 120px; }
  .movie-card img { height: 180px; }
  .card-content { padding: 0.5rem; }
  .card-title { font-size: 0.8rem; }
  .card-description { display: none; }

  #search-input { padding: 10px 15px; font-size: 1rem; }
  .results .movie-card { width: 45%; }
  .results .movie-card img { height: auto; aspect-ratio: 2/3; }
}

/* =================================== */
/* 9. MODAL DETAILS UPDATE          */
/* =================================== */

/* Adjust the title size to make room for new info */
.modal-text h2 {
  font-size: 2.2rem; /* Was 2.5rem */
}

.modal-extra-info {
  margin-top: 1.5rem;
  font-size: 0.9rem;
  line-height: 1.8;
  color: var(--text-color-secondary);
}

.modal-extra-info p {
  display: flex;
}

.modal-extra-info strong {
  color: var(--text-color);
  font-weight: 600;
  margin-right: 8px;
  flex-shrink: 0; /* Prevents the label from wrapping */
}