:root {
  --primary: #1c1c1c;
  --accent: #e50914;
  --accent-2: #40c9ff;
  --text-light: #f5f5f5;
  --text-muted: #a0a0a0;
  --bg-light: #2a2a2a;
  --gradient: linear-gradient(135deg, #ff6ec4, #40c9ff, #e50914);
  /* --gradient: linear-gradient(135deg, #0f2027, #203a43, #2c5364); */
  /* --gradient: linear-gradient(135deg, #f6d365, #fda085); */
}

body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--primary);
  color: var(--text-light);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-wrapper {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

.hidden {
  display: none;
}

button {
  padding: 0.75rem 2.1rem;
  background: var(--gradient);
  border: none;
  color: white;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  border: 1px white solid;
  transition: all 0.3s ease;
}

button:hover {
  transform: translateY(-3px) scale(1.02);
  background: linear-gradient(135deg, #f06595, #cc5de8);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
}

header {
  background: var(--gradient);
  padding: 1.5rem 2rem;
  text-align: center;
  color: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

header h1 {
  margin: 0;
  font-size: 2.5rem;
}

.header-title {
  cursor: pointer;
}



.search-container input {
  width: 90%;
  max-width: 500px;
  padding: 0.75rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
}






/* Make the search bar centred at first */
.search-container.search-centered {
  display: flex;
  gap: 1rem;
  justify-content: center;
  align-items: center; /* Vertically center content */
  flex-grow: 1; /* Allow container to fill vertical space */
  transition: all 0.5s ease;
}

/* After search, move it to the top */
.search-container.search-top {
  display: flex;
  align-items: flex-start;
  padding: 2rem 0;
  justify-content: center;
  margin: 1rem 0;
  gap: 1rem;
}

/* Input styling */
#search-input {
  padding: 0.8rem 1rem;
  font-size: 1.2rem;
  width: 60vw;
  max-width: 600px;
  transition: all 0.3s ease;
  padding-left: 40px; /* space for the icon */
  background-image: url('/images/search-icon.svg');
  background-repeat: no-repeat;
  background-size: 23px 23px;
  background-position: 10px center;
}

input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 30px white inset !important; /* Change 'white' to your input bg */
  -webkit-text-fill-color: #000 !important; /* Text colour */
  background-image: url('images/search-icon.svg') !important; /* Reapply your icon */
  background-repeat: no-repeat !important;
  background-position: 10px center !important;
  background-size: 18px 18px !important;
}


/* Shrink input when at top */
.search-container.search-top #search-input {
  font-size: 1.2rem;
  width: 300px;
}

.search-container button{
  padding: 1.1rem 2rem;  
}

.search-container.search-top button{
  padding: 0.8rem 2rem;  
}









.related-results {
  padding: 1rem;
  background: var(--bg-light);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.6);
  border-radius: 12px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.results-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.result-card {
  display: flex;
  padding: 1rem;
  background: #333;
  color: white;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.3s ease;
}

.result-card img {
  border-radius: 10px;
}

.result-card:hover {
  background: #444;
}

.search-results-movie-title {
  font-weight: bold;
  font-size: 1.1rem;
  color: white;
}

.search-results-release-year {
  font-weight: normal;
  font-size: 0.95rem;
  color: #b9b9b9;
}

#background-poster {
  /* The background-image will be set dynamically via JavaScript. */
  /* Using a placeholder for now to show the effect. */
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
  padding: 2rem 0; /* Add vertical padding to space out the content inside */
}

.movie-details {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.movie-header {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  background-color: rgba(42, 42, 42, 0.9); /* Semi-transparent version of --bg-light to see the poster behind */
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.6);
  max-width: 1200px;
  margin: auto;
}

.movie-title {
  margin-bottom: 0.6rem;
}

#votes {
  font-size: 0.9rem;
}

.title-and-rating-container {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-content: center;
  gap: 2.3rem;
}

#movie-rating {
  display: inline-flex;
  align-items: center;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-weight: 600;
  font-size: 1.5rem;
  color: #ffb400; /* warm gold for rating */
  gap: 0.5rem;
}

#movie-rating .star-icon {
  width: 20px;
  height: 20px;
  fill: #ffb400;
}

/* Optional: add a subtle tooltip on hover */
#movie-rating:hover {
  cursor: default;
  color: #ffcc33;
}

.poster {
  flex: 1 1 300px;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  align-items: center;
}

.poster img {
  width: 100%;
  height: auto;
  display: block;
}

.info {
  flex: 2 1 500px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.info h2 {
  margin-top: 0;
  font-size: 2rem;
  color: #fff;
}

.info-group, .movie-reviews-content {
  background: #1e1e1e;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

.info-group p, .additional-info-card p, .movie-reviews-section p, .movie-recommended-section p {
  margin: 0.5rem 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.actors-section, .additional-info-section, .movie-reviews-section, .recommended-movies-section {
  background-color: var(--bg-light);
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.5);
  width: 100%;
  max-width: 1200px;
  margin: auto;
}

.actors-section h3, .additional-info-section h3, .movie-reviews-section h3, .recommended-movies-section h3 {
  margin-top: 0;
  color: #40c9ff;
}

.actor-list {
  display: flex;
  flex-wrap: row;
  gap: 1rem;
  margin-top: 1rem;
}

.actor-card {
  background-color: #333;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  flex: 1 1 150px;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.additional-info-content {
  display: flex;
  flex-direction: row;
  gap: 30px;
}

.additional-info-card {
  height: auto;
  width: 33%;
  background: #1e1e1e;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  justify-content: space-evenly;
  flex-wrap: wrap;
}

.movie-reviews-container {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.movie-reviews-content {
  display: flex;
  flex-direction: column;
}



.site-footer {
  background: var(--gradient);
  padding: 2rem;
  color: #fff;
  font-family: 'Segoe UI', sans-serif;
  margin-top: 4rem;
  bottom: 0;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
}

.footer-left h3 {
  margin: 0;
  font-size: 1.5rem;
}

.footer-left p {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
}

.footer-right a {
  margin-left: 1rem;
  text-decoration: none;
  color: #fff;
  font-weight: 500;
  transition: opacity 0.3s ease;
}

.footer-left a {
  text-decoration: none;
  color: #fff;
  font-weight: 500;
  transition: opacity 0.3s ease;
}

.footer-right a:hover {
  opacity: 0.8;
}

@media (max-width: 600px) {
  .footer-content {
    flex-direction: column;
    text-align: center;
  }

  .footer-right {
    margin-top: 1rem;
  }

  .footer-right a {
    margin: 0 0.5rem;
  }
}

@media (max-width: 768px) {
  .movie-header{
    border-radius: 0;
  }
  .movie-header, .additional-info-content {
    flex-direction: column;
  }
  .additional-info-card {
    width: 100%;
  }
  .search-container.search-centered {
    flex-direction: column;
  }
  .search-container.search-top {
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

  #search-input {
    width: 90vw !important;
    height: 50px !important;
  }

  #background-poster {
    padding: 0;
  }

  .poster {
    max-width: 100%;
    align-items: start;
    padding: 1.5rem 1.5rem 0 1.5rem;
  }
  .poster img{
    width: 100%;
    border-radius: 8px;
  }

  .actors-section, .additional-info-section, .movie-reviews-section, .recommended-movies-section {
    border-radius: 0;
  }

  .related-results {
    border-radius: 0;
  }

}