/* Cards skills */
.card-container {
  display: flex; /* Utilise flexbox pour aligner les cartes en ligne */
  flex-wrap: wrap; /* Permet aux cartes de passer à la ligne suivante si l'espace est insuffisant */
  justify-content: center; /* Centre les cartes dans le conteneur */
  gap: 40px; /* Espace entre les cartes */
  padding: 20px; /* Ajoute un peu de padding autour du conteneur */
  box-sizing: border-box; /* Inclut le padding et la bordure dans la largeur et la hauteur totales */
  margin: 0px 30px;
}

.card {
  width: 180px; /* Diminue légèrement la largeur de la carte */
  height: 220px; /* Diminue légèrement la hauteur de la carte */
  padding: 10px;
  padding-top: 20px;
  background-color: var(--white);
  border-radius: 15px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
  overflow: visible;
  transform: scale(1); /* Par défaut, la carte est à sa taille normale */
  transition: transform 0.3s ease-in-out;
  text-align: center;
  position: relative; /* Pour l'effet sur l'image */
  z-index: 1;
}
.skill-badges {
  position: absolute;
  bottom: 12px;
  right: 12px;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  z-index: 6;
}

.skill-badge {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-decoration: none;
  position: relative;
  padding: 0;
}

.skill-badge img {
  width: 32px;
  height: auto;
  margin: 0;
  transition: transform 0.3s ease-in-out;
}

.skill-badge-text {
  display: none;
  position: absolute;
  bottom: -48px;
  right: -10px;
  width: 110px;
  font-size: 16px;
  font-weight: bold;
  color: white;
  background-color: rgba(0, 0, 0, 0.6);
  padding: 5px 10px;
  border-radius: 8px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
  text-align: center;
  z-index: 10;
}

.skill-badge:hover .skill-badge-text {
  display: block;
  opacity: 1;
  transform: translateY(0);
}
.card.always-visible {
  transform: scale(1) !important; /* Toujours visible */
}

.card.always-visible .card-description {
  opacity: 1;
}

.card:hover {
  transform: scale(1.1) !important; /* La carte grossit légèrement au survol */
  box-shadow: 0 15px 25px rgba(0, 0, 0, 0.3);
  z-index: 5;
}

.card img {
  height: 90px;
  max-width: 150px;
  object-fit: contain; /* Assure que l'image n'est pas déformée */
  margin-top: 15px; /* Ajoute du margin en haut pour éloigner l'image du bord supérieur */
  transition: transform 0.3s ease-in-out; /* Ajoute une légère animation à l'image */
}

.card .skill-badge img {
  width: 30px;
  height: auto;
  max-width: none;
  margin: 0;
}

.card .card-description {
  font-size: 18px; /* Augmente légèrement la taille de la police */
  font-weight: bold; /* Met le texte en gras */
  margin-top: 20px; /* Ajoute un espace entre l'image et le texte */
  opacity: 0; /* Cache le texte par défaut */
  transition: opacity 0.3s ease-in-out; /* Transition pour rendre le texte visible lors du survol */
  text-align: center; /* Centre le texte horizontalement */
  margin-top: 30px; /* Ajoute un espace au-dessus du texte */
}

.card:hover .card-description {
  opacity: 1; /* Le texte devient visible au survol */
}

@media (max-width: 768px) {
  .card-container {
    gap: clamp(6px, 3vw, 16px); /* réduit légèrement l'écart */
    padding: 10px; /* Réduit le padding pour les petits écrans */
    margin: 0 auto; /* Centre le conteneur horizontalement */
    max-width: 100%; /* Empêche le conteneur de dépasser la largeur de l'écran */
  }

  .card {
    width: clamp(50px, 12vw, 90px);  /* taille plus petite */
    height: clamp(70px, 18vw, 110px);
    margin: 0 !important;
  }

  .card img {
    width: clamp(36px, 10vw, 64px); /* image plus petite */
    height: auto;
  }

  .card .card-description {
    display: none;
  }
  .card-container .card img {
    margin: 0;
  }
  .skill-badges {
    bottom: 6px;
    right: 6px;
  }

  .skill-badge img {
    width: 20px;
  }

  .skill-badge-text {
    display: none;
  }
}


