/* Section Formations Améliorée */

.formations-enhanced {
  padding: 100px 0;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  position: relative;
  overflow: hidden;
}

.formations-enhanced::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 30% 30%, rgba(74, 144, 226, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 70% 70%, rgba(74, 144, 226, 0.03) 0%, transparent 50%);
  pointer-events: none;
}

/* Grille des formations */
.formations-grid-enhanced {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 30px;
  position: relative;
  z-index: 2;
}

/* Cards de formation */
.formation-card-enhanced {
  background: white;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
  transition: all 0.4s ease;
  position: relative;
  height: 100%;
  border: 1px solid rgba(74, 144, 226, 0.1);
}

.formation-card-enhanced:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
  border-color: var(--primary-color);
}

.formation-card-inner {
  padding: 30px 25px;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Wrapper d'icône */
.formation-icon-wrapper {
  position: relative;
  width: 70px;
  height: 70px;
  margin: 0 auto 25px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.formation-icon-bg {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  opacity: 0.15;
  transition: all 0.3s ease;
}

.formation-icon-bg.reading { background: #e74c3c; }
.formation-icon-bg.implementer { background: #3498db; }
.formation-icon-bg.auditor { background: #f39c12; }
.formation-icon-bg.risk { background: #9b59b6; }
.formation-icon-bg.rssi { background: #1abc9c; }
.formation-icon-bg.continuity { background: #e67e22; }
.formation-icon-bg.ccsk { background: #2ecc71; }
.formation-icon-bg.ccsp { background: #34495e; }

.formation-icon {
  font-size: 2rem;
  color: var(--primary-color);
  position: relative;
  z-index: 2;
  transition: all 0.3s ease;
}

.formation-card-enhanced:hover .formation-icon-bg {
  opacity: 0.25;
  transform: scale(1.1);
}

.formation-card-enhanced:hover .formation-icon {
  transform: scale(1.1);
  color: #007bff;
}

/* Contenu de la formation */
.formation-content-enhanced {
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.formation-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 15px;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.formation-description {
  font-size: 0.95rem;
  color: #6c757d;
  line-height: 1.6;
  margin-bottom: 25px;
  flex: 1;
  text-align: justify;
}

/* Lien de formation */
.formation-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--primary-color), #007bff);
  color: white;
  padding: 12px 20px;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  align-self: center;
  margin-top: auto;
}

.formation-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(74, 144, 226, 0.3);
  text-decoration: none;
  color: white;
}

.formation-link i {
  transition: transform 0.3s ease;
}

.formation-link:hover i {
  transform: translateX(3px);
}

/* Responsive Design */
@media (max-width: 1200px) {
  .formations-grid-enhanced {
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
  }
}

@media (max-width: 768px) {
  .formations-enhanced {
    padding: 80px 0;
  }
  
  .formations-grid-enhanced {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .formation-card-inner {
    padding: 25px 20px;
  }
  
  .formation-icon-wrapper {
    width: 60px;
    height: 60px;
    margin-bottom: 20px;
  }
  
  .formation-icon {
    font-size: 1.8rem;
  }
  
  .formation-title {
    font-size: 1.1rem;
  }
  
  .formation-description {
    font-size: 0.9rem;
    text-align: center;
  }
  
  .formation-link {
    padding: 10px 18px;
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .formations-enhanced {
    padding: 60px 0;
  }
  
  .formation-card-inner {
    padding: 20px 15px;
  }
  
  .formation-icon-wrapper {
    width: 50px;
    height: 50px;
    margin-bottom: 15px;
  }
  
  .formation-icon {
    font-size: 1.5rem;
  }
  
  .formation-title {
    font-size: 1rem;
  }
  
  .formation-description {
    font-size: 0.85rem;
  }
  
  .formation-link {
    padding: 8px 15px;
    font-size: 0.8rem;
  }
}

/* Animations d'entrée */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.formation-card-enhanced {
  animation: fadeInUp 0.6s ease-out;
}

.formation-card-enhanced:nth-child(1) { animation-delay: 0.1s; }
.formation-card-enhanced:nth-child(2) { animation-delay: 0.2s; }
.formation-card-enhanced:nth-child(3) { animation-delay: 0.3s; }
.formation-card-enhanced:nth-child(4) { animation-delay: 0.4s; }
.formation-card-enhanced:nth-child(5) { animation-delay: 0.5s; }
.formation-card-enhanced:nth-child(6) { animation-delay: 0.6s; }
.formation-card-enhanced:nth-child(7) { animation-delay: 0.7s; }
.formation-card-enhanced:nth-child(8) { animation-delay: 0.8s; }

/* Mode sombre */
.dark-theme .formations-enhanced {
  background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
}

.dark-theme .formation-card-enhanced {
  background: #2d3748;
  border-color: rgba(255, 255, 255, 0.1);
}

.dark-theme .formation-title {
  color: #e2e8f0;
}

.dark-theme .formation-description {
  color: #a0aec0;
}

.dark-theme .formation-icon {
  color: #63b3ed;
}

.dark-theme .formation-card-enhanced:hover .formation-icon {
  color: #90cdf4;
}

/* Effet de brillance sur hover */
.formation-card-enhanced::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
  z-index: 1;
}

.formation-card-enhanced:hover::before {
  left: 100%;
}

.formation-card-inner {
  position: relative;
  z-index: 2;
}

/* Effet de pulsation pour les icônes */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.formation-card-enhanced:hover .formation-icon {
  animation: pulse 2s infinite;
}

/* Bordure animée */
.formation-card-enhanced::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 15px;
  padding: 2px;
  background: linear-gradient(45deg, var(--primary-color), #007bff, var(--primary-color));
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.formation-card-enhanced:hover::after {
  opacity: 1;
}
