@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

body {
  background-color: #2a1c4f;
  color: white;
  font-family: 'Poppins', sans-serif;
  margin: 0;
  padding: 20px;
}

h2 {
  font-size: 2rem;
  font-weight: 700;
}

h3 {
  color: #43acd1;
  font-size: 1.25rem;
  font-weight: 600;
}

p, label, select, option {
  font-size: 1rem;
}

form {
  max-width: 700px;
  margin: 0 auto;
}

.button {
  background-color: transparent;
  color: #43acd1;
  border: 2px solid #43acd1;
  border-radius: 999px; 
  padding: 10px 20px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
}

.button:hover {
  background-color: #43acd1;
  color: #1d193c;
}

.button:active {
  transform: translateY(2px);
}

.accent {
  color: #df5865;
}

input[type="radio"],
input[type="checkbox"] {
  accent-color: #df5865;
}

select, input[type="range"] {
  background-color: #2a2650; 
  color: white;
  border: none;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 1rem;
  margin-top: 5px;
  outline: none;
}

select:focus, input[type="range"]:focus {
  outline: 2px solid #43acd1;
}

.parent-container {
  display: flex;
  gap: 80px;
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

#results-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-top: 50px;
}

/* Each result card */
.result {
  background-color: #3a2c6f;
  border-radius: 12px;
  padding: 10px;
  width: 220px;
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease, height 0.3s ease;
  height: auto;
  overflow: hidden;
}

.result:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 12px 20px rgba(0,0,0,0.3);
}

/* Poster image */
.result img {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 10px;
}

/* Details */
.result .details {
  text-align: center;
}

.result .details strong {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 5px;
}

.result .year {
  font-size: 0.9rem;
  color: #43acd1;
  margin-bottom: 5px;
}

.result .overview {
  font-size: 0.85rem;
  height: 60px; /* initial fixed height */
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 5px;
  transition: height 0.3s ease;
}

/* Back to Top button */
#back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 10px 15px;
  border: none;
  border-radius: 8px;
  background: #333;
  color: white;
  font-size: 14px;
  cursor: pointer;
  display: none;
  z-index: 1000;
  transition: opacity 0.3s ease;
}

#back-to-top:hover {
  background: #555;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  #results-container {
    flex-direction: column;
    align-items: center;
  }

  .result {
    width: 90%;
  }

  .parent-container {
    flex-direction: column;
    gap: 20px;
  }
}
