.competences-container {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 25px;
  padding: 40px;
  width: 95%;
  margin: 40px auto;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 30px;
  backdrop-filter: blur(10px);
  

  min-height: 600px;
  position: relative;
  overflow: visible;
}

.competence-cube {
  width: calc((100% - 125px) / 6); /* 6 cases avec 25px de gap */
  height: 200px;
  background: white;
  cursor: pointer;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  transform-style: preserve-3d;
  perspective: 1000px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  animation: float 3s ease-in-out infinite;
  overflow: hidden;
  border: 2px solid transparent;
 
  flex-shrink: 0;
}

.competence-cube:nth-child(1) { border-color: #F1C40F; background: rgba(241, 196, 15, 0.1); }
.competence-cube:nth-child(2) { border-color: #D72638; background: rgba(215, 38, 56, 0.1); }
.competence-cube:nth-child(3) { border-color: #2ECC71; background: rgba(46, 204, 113, 0.1); }
.competence-cube:nth-child(4) { border-color: #00aaff; background: rgba(0, 170, 255, 0.1); }
.competence-cube:nth-child(5) { border-color: #F1C40F; background: rgba(241, 196, 15, 0.1); }
.competence-cube:nth-child(6) { border-color: #D72638; background: rgba(215, 38, 56, 0.1); }

.cube-title {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: black;
  font-size: 1.2em;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-align: center;
  width: 100%;
  padding: 15px;
  transition: all 0.3s ease;
  font-family: "Nohemi", sans-serif;
}

.competence-cube:hover {
  transform: scale(1.05) translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.competences-container:has(.expanded) {
  flex-wrap: wrap;
  min-height: 800px;
  gap: 25px;
}

.competences-container:has(.expanded) .competence-cube:not(.expanded) {
  width: calc((100% - 100px) / 5); /* 5 cases avec 25px de gap */
  height: 150px;
  transform: scale(0.9);
  opacity: 0.8;
  margin-top: 450px; /* Pour les positionner en bas */
}

.competence-cube.expanded {
  width: 90%;
  height: 400px;
  z-index: 10;
  transform: scale(1);
  position: absolute;
  top: 40px;
  left: 5%;
}

.competence-cube:nth-child(1).expanded { background: linear-gradient(135deg, #F1C40F, rgba(241, 196, 15, 0.9)); }
.competence-cube:nth-child(2).expanded { background: linear-gradient(135deg, #D72638, rgba(215, 38, 56, 0.9)); }
.competence-cube:nth-child(3).expanded { background: linear-gradient(135deg, #2ECC71, rgba(46, 204, 113, 0.9)); }
.competence-cube:nth-child(4).expanded { background: linear-gradient(135deg, #00aaff, rgba(0, 170, 255, 0.9)); }
.competence-cube:nth-child(5).expanded { background: linear-gradient(135deg, #F1C40F, rgba(241, 196, 15, 0.9)); }
.competence-cube:nth-child(6).expanded { background: linear-gradient(135deg, #D72638, rgba(215, 38, 56, 0.9)); }

.competence-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  color: white;
  text-align: center;
  padding: 20px;
  box-sizing: border-box;
  opacity: 0;
  transition: all 0.4s ease;
  transform: translateY(20px);
  
 
}

.competence-cube.expanded .competence-content {
  opacity: 1;
  transform: translateY(0);
}

.competence-cube.expanded .cube-title {
  opacity: 0;
}

.competence-description {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  width: 100%;
  height: 75%;
  padding: 10px;
  overflow: hidden;
}

.competence-content h3 {
  margin: 0 0 20px 0;
  font-size: 1.6em;
  text-transform: uppercase;
  letter-spacing: 3px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.2);
  padding: 12px 25px;
  border-radius: 10px;
  width: auto;
 
  font-family: "Nohemi", sans-serif;
}

.competence-content ul {
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: left;
  width: 95%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

.competence-content li {
  margin-bottom: 0;
  font-size: 0.9em;
  line-height: 1.4;
  position: relative;
  padding: 10px 10px 10px 25px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
  font-family: "Nohemi2", sans-serif;
}

.competence-content li:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateX(5px);
}

.competence-content li:before {
  content: "→";
  position: absolute;
  left: 10px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: bold;
}

.projet-section {
  width: 100%;
  padding: 15px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 15px;
  margin-top: 15px;
  height: 90px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.1);

}

.blocs{
  margin-top: 10vw;
}
.projet-btn {
  display: inline-block;
  padding: 12px 25px;
  background: white;
  text-decoration: none;
  border-radius: 25px;
  font-weight: bold;
  transition: all 0.3s ease;
  cursor: pointer;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 0.9em;
  font-family: "Nohemi", sans-serif;
  color: #000000;
}

.projet-btn:hover{
  transform: scale(1.05);
}

.projet-title {
  font-size: 0.9em;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.9);
  font-family: "Nohemi2", sans-serif;
}

@media screen and (max-width: 1200px) {
  .competences-container {
    flex-wrap: wrap;
    gap: 20px;
    padding: 30px;
  }

  .competence-cube {
    width: calc((100% - 100px) / 4);
    height: 180px;
  }

  .cube-title {
    font-size: 1.1em;
  }

  .competences-container:has(.expanded) .competence-cube:not(.expanded) {
    width: calc((100% - 75px) / 3);
    height: 140px;
  }
}

@media screen and (max-width: 900px) {
  .competences-container {
    gap: 15px;
    padding: 20px;
  }

  .competence-cube {
    width: calc((100% - 75px) / 3);
    height: 160px;
  }

  .cube-title {
    font-size: 1em;
  }

  .competences-container:has(.expanded) .competence-cube:not(.expanded) {
    width: calc((100% - 50px) / 2);
    height: 130px;
  }

  .competence-cube.expanded {
    width: 95%;
    height: 350px;
  }

  .competence-content h3 {
    font-size: 1.4em;
  }
}

@media screen and (max-width: 600px) {
  .competences-container {
    gap: 8px;
    padding: 10px;
    width: 100%;
    margin: 20px auto;
    min-height: 400px;
    display: flex;
    flex-direction: column;
  }

  .competence-cube {
    width: calc((100% - 16px) / 2);
    height: 120px;
    border-radius: 15px;
  }

  .cube-title {
    font-size: 0.8em;
    padding: 10px;
    letter-spacing: 1px;
  }

  .competences-container:has(.expanded) {
    min-height: 500px;
    gap: 8px;
  }

  .competences-container:has(.expanded) .competence-cube:not(.expanded) {
    width: 100%;
    height: 100px;
    margin-top: 0;
    transform: scale(0.9);
  }

  .competences-container:has(.expanded) .competence-cube:not(.expanded):nth-of-type(1) {
    margin-top: 290px;
  }

  .competence-cube.expanded {
    width: 100%;
    height: 280px;
    position: absolute;
    top: 10px;
    left: 0;
  }

  .competence-content {
    padding: 15px;
  }

  .competence-content h3 {
    font-size: 1.1em;
    padding: 8px 15px;
    margin-bottom: 15px;
  }

  .competence-content ul {
    grid-template-columns: 1fr;
    gap: 8px;
    width: 100%;
  }

  .competence-content li {
    font-size: 0.8em;
    padding: 8px 8px 8px 20px;
    line-height: 1.3;
  }
}

@media screen and (max-width: 400px) {
  .competences-container {
    padding: 8px;
    margin: 15px auto;
    min-height: 350px;
    display: flex;
    flex-direction: column;
  }

  .competence-cube {
    width: 100%;
    height: 100px;
    border-radius: 12px;
  }

  .cube-title {
    font-size: 0.75em;
    padding: 8px;
    letter-spacing: 1px;
  }

  .competences-container:has(.expanded) {
    min-height: 450px;
  }

  .competences-container:has(.expanded) .competence-cube:not(.expanded) {
    margin-top: 0;
  }

  .competences-container:has(.expanded) .competence-cube:not(.expanded):nth-of-type(1) {
    margin-top: 230px;
  }

  .competence-cube.expanded {
    height: 220px;
    position: absolute;
    top: 5px;
    left: 0;
  }

  .competence-content {
    padding: 12px;
  }

  .competence-content h3 {
    font-size: 1em;
    padding: 6px 12px;
    margin-bottom: 12px;
  }

  .competence-content ul {
    gap: 6px;
  }

  .competence-content li {
    font-size: 0.75em;
    padding: 6px 6px 6px 18px;
  }

  .projet-section {
    height: 80px;
    padding: 10px;
  }

  .projet-title {
    font-size: 0.8em;
    margin-bottom: 8px;
  }

  .projet-btn {
    padding: 8px 20px;
    font-size: 0.8em;
  }
} 