* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

body {
  background: #98aac2;
  min-height: 100vh;
  padding: 40px 20px;
}

.container {
  max-width: 1200px;
  margin: auto;
  background: white;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

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

.controls {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.controls input {
  flex: 1;
  min-width: 220px;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 16px;
}

.controls button,
.controls select {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 16px;
}

.controls button {
  border: none;
  background: #222;
  color: white;
  cursor: pointer;
}

.controls button:hover {
  background: #444;
}

.controls select {
  border: 1px solid #ccc;
  background: white;
  cursor: pointer;
}

#message {
  text-align: center;
  margin-bottom: 20px;
  color: #444;
  font-weight: bold;
}

.movies-list {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
}

.movie-item {
  background: #fafafa;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 15px;
  text-align: center;
  min-height: 100%;
}

.movie-item img {
  width: 100%;
  height: 270px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 12px;
}

.movie-item h3 {
  margin-bottom: 8px;
  color: #222;
  font-size: 18px;
}

.movie-item p {
  margin-bottom: 10px;
  color: #555;
}

.movie-item button {
  padding: 10px 14px;
  border: none;
  background: #222;
  color: white;
  border-radius: 8px;
  cursor: pointer;
}

.movie-item button:hover {
  background: #444;
}

.pagination {
  margin-top: 25px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
}

.pagination button {
  padding: 10px 14px;
  border: none;
  background: #222;
  color: white;
  border-radius: 8px;
  cursor: pointer;
}

.pagination button:disabled {
  background: #999;
  cursor: not-allowed;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  z-index: 1000;
}

.hidden {
  display: none;
}

.modal-content {
  background: white;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 14px;
  padding: 25px;
  position: relative;
}

.close-btn {
  position: absolute;
  top: 12px;
  right: 15px;
  border: none;
  background: transparent;
  font-size: 32px;
  cursor: pointer;
  color: #222;
}

.modal-movie {
  display: flex;
  gap: 25px;
  align-items: flex-start;
}

.modal-movie img {
  width: 260px;
  max-width: 100%;
  border-radius: 12px;
  object-fit: cover;
}

.modal-details {
  flex: 1;
}

.modal-details h2 {
  margin-bottom: 12px;
  color: #222;
}

.modal-details p {
  margin-bottom: 10px;
  color: #444;
  line-height: 1.6;
}

@media (max-width: 1100px) {
  .movies-list {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 850px) {
  .movies-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 700px) {
  .controls {
    flex-direction: column;
  }

  .controls input,
  .controls button,
  .controls select {
    width: 100%;
  }

  .movies-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .modal-movie {
    flex-direction: column;
    align-items: center;
  }

  .modal-movie img {
    width: 220px;
  }
}

@media (max-width: 480px) {
  .movies-list {
    grid-template-columns: 1fr;
  }
}
