body {
  background: #111;
  color: white;
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
}

.container {
  max-width: 900px;
  margin: auto;
  padding: 20px;
}

h1 {
  text-align: center;
  margin-bottom: 20px;
}

.search-box {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 20px;
}

input {
  width: 300px;
  padding: 10px;
  border-radius: 6px;
  border: none;
}

button {
  padding: 10px 20px;
  background: #ff4d4d;
  border: none;
  border-radius: 6px;
  color: white;
  cursor: pointer;
  font-weight: bold;
}

button:hover {
  background: #ff1a1a;
}

.loading,
.error {
  text-align: center;
  margin-top: 10px;
  font-size: 18px;
}

.movies {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

.movie-card {
  background: #222;
  padding: 10px;
  border-radius: 8px;
  text-align: center;
  transition: 0.2s;
}

.movie-card:hover {
  transform: scale(1.05);
}

.movie-card img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: 6px;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
}

.modal-content {
  background: #222;
  padding: 20px;
  border-radius: 10px;
  width: 90%;
  max-width: 500px;
  color: white;
  position: relative;
  text-align: center;
  max-height: 80vh;        
  overflow-y: auto;       
  scrollbar-width: thin;
  scrollbar-color: #555 #222;
}

.modal-poster {
  width: 200px;
  border-radius: 10px;
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #ff4d4d;
  border: none;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  color: white;
  font-size: 16px;
}

@media (max-width: 600px) {
  .modal-content {
    width: 95%;
    max-height: 85vh;
  }
}