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

:root {
  --color-primary: #020d18;
  --color-secondary: #f1c40f;
}

body {
  font-family: "Poppins", sans-serif;
  font-size: 16px;
  background: var(--color-primary);
  color: #fff;
  overflow-x: hidden;
}

ul {
  list-style: none;
}

.welcome {
  margin: 20px 0;
  text-align: center;
  text-transform: uppercase;
  padding: 60px;
  background: url(./images/showcase-bg.jpg);
}

.text-primary {
  color: var(--color-secondary);
}

.text-secondary {
  color: var(--color-secondary);
}

.active {
  color: var(--color-secondary);
  font-weight: 700;
}

.back {
  margin-top: 30px;
}

.container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  grid-gap: 20px;
}

.btn {
  display: block;
  padding: 0.5rem 1rem;
  border: 1px solid var(--color-secondary);
  border-radius: 5px;
  color: #fff;
  cursor: pointer;
  background: transparent;
  transition: all 0.3s ease-in-out;
}

.btn:hover {
  background: var(--color-secondary);
  color: #000;
}

.btn:disabled {
  border-color: #ccc;
  cursor: not-allowed;
}

.btn:disabled:hover {
  background: transparent;
  color: #fff;
}

/* Card */
.card {
  background: #04376b;
  padding: 5px;
}

.card img {
  width: 100%;
}

.card-body {
  padding: 10px;
  font-size: 20px;
}

.card:hover {
  transform: scale(1.05);
  transition: all 0.5s ease-in-out;
  background: #0a4b8f;
}

.hide {
  display: none !important;
}

/* Movie  Details */
.movie-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
}
.movie-info {
  padding: 0 20px;
}

.details-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 50px 0 30px;
}

@media (max-width: 700px) {
  .details-top {
    display: block;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: #ccc solid 1px;
  }

  .details-top img {
    width: 100%;
    margin-right: 0;
    margin-bottom: 20px;
  }

  .details-top p {
    margin: 15px 0;
  }

  .details-top .btn {
    margin-top: 20px;
  }
}

/* Search */
#search-form {
  background-color: var(--primary-color);
  text-align: center;
  justify-content: center;
  display: flex;
  padding: 20px;
  margin: auto;
  gap: 10px;
  border-radius: 6px;
  box-shadow: 2px 5px 0 rgba(0, 0, 0, 0.3);
  width: 100%;
  justify-self: center;
  align-self: center;
  margin-top: 10px;
}

#search-form input {
  padding: 10px;
  width: 25%;
  border-radius: 5px;
  border: 1px solid #ccc;
}

#search-button {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: 1px solid var(--color-secondary);
  border-radius: 5px;
  color: #fff;
  cursor: pointer;
  background: transparent;
  transition: all 0.3s ease-in-out;
}

#search-button:hover {
  background: var(--color-secondary);
  color: #000;
}

#search-button:disabled {
  border-color: #ccc;
  cursor: not-allowed;
}

#search-button:disabled:hover {
  background: transparent;
  color: #fff;
}

h2 {
  text-align: center;
}

/* Spinner Container */
.spinner {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  display: none;
  z-index: 999;
}

/* Show the spinner */
.show {
  display: block;
}

/* Spinner Animation */
.spinner:after {
  content: "";
  width: 50px;
  height: 50px;
  border: 5px solid rgba(255, 255, 255, 0.3);
  border-top: 5px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  display: block;
}

/* Background Overlay */
.spinner::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
}

/* Spin Animation */
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Additional Mobile Adjustments */
@media (max-width: 600px) {
  #search-form input {
    width: 80%;
  }

  .container {
    padding: 0 10px;
  }

  .btn {
    padding: 0.4rem 0.8rem;
  }

  .card-body {
    padding: 8px;
    font-size: 16px;
  }

  h2 {
    font-size: 1.5rem;
  }
}
