body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: #f0f0f0;
}

#imageForm {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 600px;
  padding: 20px;
  background-color: white;
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-top: 20px;
}

select {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  margin-bottom: 10px;
  width: 100%;
  background-color: white;
  cursor: pointer;
}

select:hover {
  border-color: #3498db;
}

label {
  margin-bottom: 10px;
}

input[type="text"] {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  margin-bottom: 10px;
  width: 100%;
}

button {
  padding: 10px 20px;
  background-color: #3498db;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  margin-bottom: 10px;
  transition: background-color 0.3s ease;
}

button:hover {
  background-color: #2980b9;
}

#styles {
  display: flex;
  justify-content: center;
  gap: 10px; /* Adds space between buttons */
  margin-top: 20px;
}

#styles button.selected-style {
  background-color: #4CAF50;
  color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#imageContainer {
  margin-top: 20px;
  max-width: 600px;
}

img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
}

.loader {
  border: 8px solid #f3f3f3;
  border-top: 8px solid #3498db;
  border-radius: 50%;
  width: 35px;
  height: 35px;
  display: none;
  margin: auto;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

#carousel {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 20px;
  margin-bottom: 20px;
}

#carouselItems {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* Crée 3 colonnes de largeur égale */
  gap: 10px; /* Espacement entre les images */
  justify-items: center; /* Centre les images dans chaque cellule de la grille */
}

#carouselItems a {
    display: block;
    text-decoration: none;
    cursor: pointer;
}

#carouselItems img {
  max-width: 204px; /* Largeur maximale de chaque image */
  height: auto;
  width: 100%; /* Assure que l'image remplit la cellule de la grille */
}

/* Fix for title moving */
#image-history-title {
  margin-top: 20px;
}

/* Media Queries for Responsiveness */
@media (max-width: 768px) {
  #imageContainer {
    margin-top: 20px;
    max-width: 90%;
  }

  #imageForm {
    max-width: 90%;
  }

  #carouselItems {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); /* Adjust column width for smaller screens */
  }
}

@media (max-width: 480px) {

  #carouselItems {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); /* Further adjust for very small screens */
  }
}
