/* Search container */
.flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

#search-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  z-index: 10;
}

#search {
  background: linear-gradient(90deg,
      rgba(25, 25, 27, 1) 0%,
      rgba(180, 132, 65, 1) 25%,
      rgba(239, 239, 136, 1) 50%,
      rgba(186, 138, 79, 1) 75%,
      rgba(30, 32, 31, 1) 100%);
  padding: 0 17px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50px;
  outline: none;
  width: 40%;
  text-align: center;
  font-size: 18px;
  color: #000;
  z-index: 2;
}

#search:focus {
  border: 1px solid rgba(253, 253, 253, 0.514);
  border-radius: 12px;
  animation: glow 0.4s ease-in-out forwards;
}

::placeholder {
  font-family: Trebuchet MS;
  color: black;
  opacity: 5;
  font-size: large;
}

@keyframes glow {
  from {
    box-shadow: 0 0 0 rgba(239, 239, 136, 0);
  }

  to {
    box-shadow: 0 0 15px rgba(239, 239, 136, 0.5);
  }
}

/* Suggestions */
#suggestions {
  margin-top: 10px;
  width: 40%;
  background-color: rgba(0, 0, 0, 0.85);
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(239, 239, 136, 0.3);
  max-height: 300px;
  overflow-y: auto;
  z-index: 15;
  animation: fadeIn 0.3s ease-out;
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
}

.suggestion-item {
  display: flex;
  align-items: center;
  padding: 10px;
  color: #fff;
  cursor: pointer;
}

.suggestion-item:hover {
  background-color: rgba(239, 239, 136, 0.1);
}

.suggestion-item img {
  width: 50px;
  height: auto;
  border-radius: 5px;
  margin-right: 15px;
}

/*Scrollbar Styles*/
#suggestions::-webkit-scrollbar,
#movie-card::-webkit-scrollbar {
  width: 10px;
}

#suggestions::-webkit-scrollbar-track,
#movie-card::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.6);
  border-radius: 10px;
}

#suggestions::-webkit-scrollbar-thumb,
#movie-card::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg,
      rgba(180, 132, 65, 1) 0%,
      rgba(239, 239, 136, 1) 50%,
      rgba(186, 138, 79, 1) 100%);
  border-radius: 10px;
}

#suggestions::-webkit-scrollbar-thumb:hover,
#movie-card::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg,
      rgba(239, 239, 136, 1) 0%,
      rgba(186, 138, 79, 1) 100%);
}

/* Recently Watched */
#recentlyWatchedContainer {
  position: fixed;
  bottom: 2%;
  left: 1%;
  color: #fff;
  z-index: 9;
  width: 350px;
  max-width: 90vw;
  font-family: "Poppins", sans-serif;
}

#recentlyWatchedContainer h3 {
  margin-bottom: 5px;
  font-size: 16px;
  color: #efef88;
}

.recently-watched-scroll {
  display: flex;
  overflow-x: auto;
  gap: 10px;
  padding: 5px 0;
}

.recently-watched-scroll::-webkit-scrollbar {
  height: 8px;
}

.recently-watched-scroll::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.5);
  border-radius: 5px;
}

.recently-watched-scroll::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg,
      rgba(180, 132, 65, 1) 0%,
      rgba(239, 239, 136, 1) 50%,
      rgba(186, 138, 79, 1) 100%);
  border-radius: 5px;
}

.recently-watched-item {
  min-width: 70px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  font-size: 12px;
  color: #fff;
}

.recently-watched-item img {
  width: 70px;
  height: 100px;
  border-radius: 5px;
  object-fit: cover;
  margin-bottom: 3px;
}

/* ===========================
    Mobile Responsive Styles
   =========================== */
@media (max-width: 768px) {

  /* Search */
  #search {
    width: 90% !important;
    font-size: 16px;
  }

  #suggestions {
    width: 90% !important;
    max-height: 250px;
  }

  /* Movie Card */
  #movie-card {
    width: 90% !important;
    max-height: 80% !important;
    padding: 15px !important;
    font-size: 14px;
  }

  #movie-card img {
    max-height: 300px;
    object-fit: cover;
  }

  /* Recently Watched */
  #recentlyWatchedContainer {
    width: 95vw !important;
    left: 2.5% !important;
    font-size: 12px;
  }

  .recently-watched-item img {
    width: 50px !important;
    height: 75px !important;
  }
}
