/* Universal Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Body Styling */
body {
  font-family: Arial, sans-serif;
  background: #111;
  color: #fff;
}

/* Navbar Styling */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background: #222;
  position: relative;
  height: 50px;
}

.navbar-left {
  display: flex;
  align-items: center;
}

.navbar-name {
  color: white;
  font-size: 20px;
  font-weight: bold;
  animation: colorChange 5s infinite; /* Ensure animation is applied */
  transition: color 0.3s ease;
}

.navbar img {
  height: 40px;
  display: block;
  max-width: 100%;
}

.navbar .nav-right {
  display: flex;
  justify-content: center;
  align-items: center;
}

.search-icon {
  font-size: 25px;
  cursor: pointer;
  color: #fff;
  transition: transform 0.3s ease;
}

.search-icon:hover {
  transform: scale(1.2);
}

/* Grid Layout for Trending Sections */
.container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  padding: 20px;
}

.trending-section {
  background: #333;
  padding: 10px;
  border-radius: 10px;
}

.trending-title {
  font-size: 24px;
  font-weight: bold;
  animation: colorChange 5s infinite; /* Animation for title colors */
  display: inline-block;
  white-space: nowrap;
}

/* Movie List */
.list {
  display: flex;
  overflow-x: auto;
  gap: 10px;
  padding: 10px 0;
}

.list img {
  width: 150px;
  cursor: pointer;
  border-radius: 5px;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.list img:hover {
  transform: scale(1.05);
  filter: brightness(1.2);
  z-index: 2;
}

/* Banner Styling */
.banner {
  height: 50vh;
  position: relative;
  overflow: hidden;
  background-color: #000;
}

.banner-slide {
  display: flex;
  transition: transform 1s ease;
}

.banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  flex-shrink: 0;
}

.banner h1 {
  background: rgba(0, 0, 0, 0.7);
  padding: 10px;
  position: absolute;
  bottom: 20px;
  left: 20px;
  font-size: 2em;
  color: #fff;
  z-index: 2;
}

/* Modal Styling */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10;
}

.modal-content {
  background: #222;
  padding: 20px;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  text-align: center;
  border-radius: 10px;
}

.modal-body {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.modal-body img {
  width: 30%;
  border-radius: 5px;
}

.modal-text {
  flex: 1;
  text-align: left;
}

.stars {
  color: gold;
}

/* Search Modal */
.search-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 15;
  padding-top: 10vh;
}

.search-modal input {
  width: 300px;
  padding: 10px;
  border-radius: 25px;
  border: none;
  margin-bottom: 20px;
  font-size: 16px;
  color: #fff;
  background-color: #333;
}

.search-modal .results {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.search-modal img {
  width: 120px;
  border-radius: 5px;
  cursor: pointer;
}

/* Close Button for Search Modal */
.search-modal .close {
  position: absolute;
  top: 20px;
  right: 30px; /* Positioned to the right of the modal */
  font-size: 35px; /* Increased the size for better visibility */
  color: #fff; /* White color for the "X" */
  cursor: pointer;
  z-index: 20; /* Ensure it's above all other content */
  transition: color 0.3s ease;
}

.search-modal .close:hover {
  color: #ff6347; /* Change color on hover (red shade) */
}

/* Close Button for Movie Modal */
.modal .close {
  position: absolute;
  top: 20px;
  right: 30px; /* Positioned to the top-right corner */
  font-size: 35px; /* Increased the size for better visibility */
  color: #fff; /* White color for the "X" */
  cursor: pointer;
  z-index: 20; /* Ensure it's above all other content */
  transition: color 0.3s ease;
}

.modal .close:hover {
  color: #ff6347; /* Change color on hover (red shade) */
}

/* Footer */
.footer {
  background: #222;
  color: #ccc;
  padding: 20px;
  text-align: center;
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 15px;
}

.footer-links a {
  color: red;
  text-decoration: none;
  transition: color 0.3s;
}

.footer-links a:hover {
  color: #fff;
}

/* Mobile Display */
@media (max-width: 768px) {
  .navbar {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
  }
  .banner {
    height: 30vh;
  }
  .modal-body img {
    width: 40%;
  }
  .list {
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .trending-title {
    font-size: 20px;
  }
}

/* Color changing animation */
@keyframes colorChange {
  0% { color: rgb(255, 87, 34); } /* Red */
  20% { color: rgb(33, 150, 243); } /* Blue */
  40% { color: rgb(76, 175, 80); } /* Green */
  60% { color: rgb(255, 193, 7); } /* Yellow */
  80% { color: rgb(156, 39, 176); } /* Purple */
  100% { color: rgb(255, 87, 34); } /* Back to Red */
}
