body {
  font-family: 'Arial', sans-serif;
  background-color: #0E3FA9;
  color: #FFA903;
  margin: 0;
  padding: 20px;
  text-align: center;
  background-image: radial-gradient(circle, rgba(14, 63, 169, 0.8) 20%, rgba(0, 0, 0, 0.9) 80%);
}

h1 {
  font-size: 3rem;
  text-transform: uppercase;
  font-weight: bold;
  text-shadow: 3px 3px 10px rgba(0, 0, 0, 0.6);
  margin-bottom: 20px;
}

form {
  margin-bottom: 30px;
}

input[type="text"] {
  width: 60%;
  padding: 14px;
  font-size: 20px;
  border-radius: 16px;
  border: 4px solid rgba(255, 169, 3, 0.6);
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  color: white;
  text-align: center;
  box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.4);
  outline: none;
  transition: all 0.3s ease;
}

input[type="text"]:focus {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 201, 65, 0.8);
}

/* ✅ Navigation Button Styling */
.navigation {
  margin-bottom: 20px;
}

.nav-button {
  display: inline-block;
  background: rgba(255, 169, 3, 0.8);
  color: #0E3FA9;
  font-size: 18px;
  font-weight: bold;
  padding: 12px 24px;
  border-radius: 16px;
  text-decoration: none;
  box-shadow: 4px 4px 16px rgba(0, 0, 0, 0.5);
  transition: background 0.3s, transform 0.2s;
}

.nav-button:hover {
  background: rgba(255, 201, 65, 0.9);
  transform: scale(1.08);
}

/* ✅ "Already in Library" Status - Checkmark Badge */
.status-library {
    background-color: #4CAF50;  /* Green */
    color: white;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ✅ Add checkmark before text */
.status-library::before {
    content: "✔";
    font-size: 16px;
}

/* ✅ Progress Bar Container */
.progress-container {
  width: 100%;
  max-width: 250px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  overflow: hidden;
  margin: 10px auto;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* ✅ Progress Bar Fill */
.progress-bar {
  width: 0%;
  height: 20px;
  background-color: #0E3FA9;
  text-align: center;
  line-height: 20px;
  color: #FFA903;
  font-weight: bold;
  transition: width 0.4s ease-in-out;
}

/* ✅ Grid layout for search results, downloads, and history */
.grid-container, #results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 30px;
  justify-items: center;
  padding: 30px;
  align-items: start;
}

.movie-tile {
  background: rgba(255, 169, 3, 0.2);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  padding: 20px;
  width: 100%;
  max-width: 250px;
  transition: transform 0.3s, box-shadow 0.3s;
  text-align: center;
  position: relative;
  border: 2px solid rgba(255, 169, 3, 0.3);
  cursor: pointer;
}

.movie-tile:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6);
}

.movie-tile img {
  width: 100%;
  height: 350px;
  object-fit: cover;
  border-bottom: 5px solid rgba(14, 63, 169, 0.8);
  border-radius: 16px 16px 0 0;
}

/* ✅ Popup Modal Styles - Enable Scrolling */
.popup {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60%;
  max-width: 500px;
  max-height: 80vh; /* ✅ Prevents taking over the screen */
  background: rgba(255, 169, 3, 0.95);
  color: #0E3FA9;
  padding: 20px;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  text-align: center;
  z-index: 1000;
  overflow-y: auto; /* ✅ Allows scrolling inside pop-up */
}

/* ✅ Ensuring the content doesn't overflow */
.popup-content {
  max-height: 75vh; /* ✅ Keeps content contained */
  overflow-y: auto;
  padding: 10px;
}

.popup-title {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 10px;
}

.popup-poster {
  width: 100%;
  max-width: 300px;
  border-radius: 16px;
  margin: 10px 0;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* ✅ Reduce Space Between Rotten Tomatoes Logo and Percentage */
.popup-rotten {
  font-size: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0px;
}

/* ✅ Maintain Large Logo but Perfect Alignment */
.rotten-logo {
  width: 6em;
  height: auto;
  max-height: 6em;
  object-fit: contain;
  display: inline-block;
  vertical-align: middle;
  margin-right: -5px;
}

/* ✅ Close (X) Button Styling */
.close-button {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  color: #0E3FA9;
  background: rgba(255, 169, 3, 0.9);
  border-radius: 50%;
  padding: 5px 10px;
  transition: background 0.3s, transform 0.2s;
}

.close-button:hover {
  background: rgba(255, 201, 65, 0.9);
  transform: scale(1.1);
}

/* ✅ Ensuring button consistency */
button {
  background: rgba(255, 169, 3, 0.7);
  color: #0E3FA9;
  border: none;
  padding: 14px 28px;
  font-size: 20px;
  cursor: pointer;
  border-radius: 16px;
  font-weight: bold;
  transition: background 0.3s ease, transform 0.2s;
  box-shadow: 4px 4px 16px rgba(0, 0, 0, 0.5);
}

button:hover {
  background: rgba(255, 201, 65, 0.9);
  transform: scale(1.08);
  box-shadow: 4px 4px 16px rgba(0, 0, 0, 0.3);
}

.clear-button {
  margin: 20px auto;
  display: block;
}

@media (max-width: 768px) {
  input[type="text"] {
    width: 80%;
  }
  .movie-tile {
    width: 200px;
  }
  .movie-tile img {
    height: 280px;
  }
  .popup {
    width: 90%;
  }
}

/* ✅ AI Loading Container */
.ai-loading {
  display: flex;
  flex-direction: column; /* Stack elements vertically */
  justify-content: center;
  align-items: center;
  text-align: center;
  width: 100%;
  margin-top: 20px; /* Ensures spacing below the search bar */
}

/* ✅ Loading GIF Styling */
.matrix-gif {
  width: 100px; /* Adjust as needed */
  height: auto;
  display: block;
  margin: 10px auto; /* Center and add spacing */
  border-radius: 8px; /* Optional rounded corners */
}

/* ✅ AI Text Styling */
.matrix-text {
  font-size: 18px;
  font-weight: bold;
  color: #FFA903;
  text-shadow: 0 0 5px rgba(255, 169, 3, 0.8);
  margin-top: 10px; /* Spacing from GIF */
  animation: aiTextFade 2s infinite alternate ease-in-out;
}

/* ✅ AI Text Glowing Effect */
@keyframes aiTextFade {
  0% { opacity: 0.6; }
  100% { opacity: 1; }
}

/* ✅ Blockbuster Logo Styling */
#blockbuster-logo {
  width: 300px; 
  display: block;
  margin: 20px auto;
  opacity: 0;
  transform: translateY(-50px);
  animation: fadeInSlide 1.5s ease-out forwards;
  
  /* ✅ Drop Shadow */
  box-shadow: 0px 8px 20px rgba(0, 0, 0, 0.6); /* Darker shadow for depth */
  border-radius: 8px; /* Smooth edges */
  position: relative; /* Required for gloss effect */
  overflow: hidden;
}

/* ✅ Gloss Effect */
#blockbuster-logo::before {
  content: "";
  position: absolute;
  top: -100%;
  left: -100%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0.1) 20%,
    rgba(255, 255, 255, 0.5) 50%,
    rgba(255, 255, 255, 0.1) 80%
  );
  transform: rotate(25deg);
  animation: glossEffect 3s infinite linear;
}

/* ✅ Keyframe Animations */
@keyframes fadeInSlide {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ✅ Flowing Gloss Animation */
@keyframes glossEffect {
  0% {
    top: -100%;
    left: -100%;
  }
  100% {
    top: 100%;
    left: 100%;
  }
}

