:root {
  --primary-color: #121212;
  --secondary-color: #fffffc;
  --title-font: "Roboto", sans-serif;
  --text-font: "Poppins", sans-serif;
}

body {
  padding: 0 20px;
  font-size: 16px;
  font-family: var(--text-font);
  background-image: linear-gradient(rgba(0, 0, 0, 1), rgba(0, 0, 0, 0.6)), url("src/mars.jpg");
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--secondary-color);
}

.bold {
  font-weight: bold;
}

.title {
  text-align: center;
  margin-top: 50px;
  margin-bottom: 25px;
}

.intro {
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}

.card-container {
  display: grid;
  padding-top: 30px;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.card {
  display: flex;
  flex-direction: column;
  padding: 25px;
  border: 2px solid var(--secondary-color);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.04);
}

.card:nth-last-child(1) {
  justify-content: center;
}

.card h2 {
  margin-bottom: 10px;
}

.card ul {
  margin-top: 5px;
  margin-left: 10px;
}

.card ul li {
  margin-bottom: 5px;
}

.curiosity-btn {
  margin: auto auto 0 auto;
  width: 200px;
  padding: 15px 0;
  border: 2px solid var(--secondary-color);
  border-radius: 5px;
  color: var(--secondary-color);
  cursor: pointer;
  transition: 0.3s ease;
}
.curiosity-btn:hover {
  background: var(--secondary-color);
  color: var(--primary-color);
}

.pictures {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
  justify-content: center;
}

.mars-photo {
  width: 300px;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: 0.3s ease;
}

.mars-photo:hover {
  scale: 1.02;
}

.photo-box {
  display: flex;
  flex-direction: column;
  width: 300px;
  height: auto;
  margin-bottom: 15px;
}

.photo-description {
  color: var(--secondary-color);
  font-size: 0.9rem;
  text-align: center;
  margin-top: 5px;
}

/* Overlay caché par défaut */
.image-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8); /* Fond sombre semi-transparent */
  backdrop-filter: blur(10px); /* Flou sur l'arrière-plan */
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Contenu du mode plein écran */
.overlay-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
}

/* Image en grand */
.fullscreen-img {
  width: auto;
  height: auto;
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 5px;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

/* Bouton de fermeture */
.close-btn {
  position: absolute;
  top: -10px;
  right: -10px;
  background: white;
  color: black;
  border: none;
  font-size: 30px;
  font-weight: bold;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.close-btn:hover {
  background: red;
  color: white;
}

/* Affichage du mode plein écran */
.image-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Loader */

#loading-spinner {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.loading-spinner__circle {
  width: 40px;
  height: 40px;
  background: #121212;
  background: conic-gradient(#121212, #eb5757, #e20202);
  border-radius: 50%;
  display: none;
  justify-content: center;
  align-items: center;
  margin-bottom: 10px;
}

.loading-spinner__circle::after {
  content: "";
  background: var(--primary-color);
  width: 100%;
  height: 100%;
  transform: scale(0.7);
  border-radius: 50%;
}

.loading {
  display: flex;
  animation: rotate 2s ease-in-out infinite;
  opacity: 1;
  transition: all 1s;
}

@keyframes rotate {
  0% {
    rotate: 0deg;
  }
  100% {
    rotate: 720deg;
  }
}

@media only screen and (max-width: 800px) {
  .card-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
  }

  .curiosity-btn {
    margin-top: 15px;
  }
}
