/* Reset simple */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Style global */
body {
  font-family: Arial, sans-serif;
  background: #f5f5f5;
  color: #333;
}

/* Header */
header {
  text-align: center;
  padding: 20px;
  background-color: #222;
  color: white;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Formulaire */
.search {
  display: flex;
  justify-content: center;
  margin: 30px 0;
}

#search-form input {
  padding: 10px;
  width: 250px;
  border: 1px solid #ccc;
  border-radius: 4px 0 0 4px;
  outline: none;
}

#search-form input:focus {
  border-color: #007BFF;
}

#search-form button {
  padding: 10px 15px;
  cursor: pointer;
  border: 1px solid #007BFF;
  background-color: #007BFF;
  color: white;
  border-radius: 0 4px 4px 0;
  transition: background-color 0.3s ease;
}

#search-form button:hover {
  background-color: #0056b3;
}

/* Conteneur des films */
#movies-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 3 cartes par ligne */
  gap: 20px;
  padding: 20px;
}

/* Carte film (état initial) */
.movie-card {
  background: white;
  padding: 10px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.68, -0.55, 0.27, 1.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 350px; /* hauteur uniforme */
}

/* Carte film visible */
.movie-card.visible {
  opacity: 1;
  transform: scale(1);
}

/* Image film */
.movie-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 10px;
}

/* Titre et année */
.movie-card h3 {
  font-size: 1rem;
  text-align: center;
  margin-bottom: 5px;
}

.movie-card p {
  font-size: 0.9rem;
  margin-bottom: 10px;
}

/* Bouton */
.movie-card button {
  margin-top: auto; /* pousse le bouton en bas de la carte */
  padding: 8px 12px;
  border: none;
  background-color: #007BFF;
  color: white;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.movie-card button:hover {
  background-color: #0056b3;
  transform: scale(1.05);
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

/* Contenu modal compact */
.modal-content {
  background: white;
  padding: 15px;
  width: 90%;
  max-width: 400px; /* plus compact que 500px */
  border-radius: 6px;
  position: relative;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  text-align: center;
}

/* Bouton fermer modal */
.close-modal {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 28px;
  font-weight: bold;
  color: #333;
  border: none;
  background: none;
  cursor: pointer;
}

.close-modal:hover {
  color: #007BFF;
}

/* Contenu de la modal */
.modal-content h2 {
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.modal-content p {
  font-size: 0.95rem;
  margin-bottom: 8px;
}

/* Image dans la modal */
.modal-content img {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: 4px;
  margin-top: 10px;
}
