/* ================================================================================
   TRAININGS SECTION - HOMEPAGE
   Code copié de ServiceSection - TrainingsPage avec adaptations pour homePage
   
   Structure:
   1. Variables et utilitaires
   2. Background et effets visuels
   3. Layout et cartes
   4. Animations et interactions
   5. Tooltips
   6. Expandable items
   7. Responsive
================================================================================ */

/* ==== VARIABLES ET UTILITAIRES ==== */

/* Classes utilitaires réutilisables */
.service-bullet {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    flex-shrink: 0;
}

.service-bullet.yellow {
    background-color: rgb(250 204 21);
}

.service-bullet.pink {
    background-color: rgb(236 72 153);
}

.coaching-badge {
    background-color: transparent;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
}

/* ==== BACKGROUND ET EFFETS VISUELS ===== */

/* Background transparent - utilise le background partagé */
#trainings {
  position: relative;
  overflow: hidden;
  background: transparent; /* Utilise le background partagé de la page */
}

#trainings .container {
  position: relative;
  z-index: 2;
}

/* ==== LAYOUT ET CARTES ==== */

.training-cards-container {
    align-items: stretch;
}

.training-card-flex {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.training-card-flex .relative.z-10 {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.training-card-flex .mt-8.pt-3.border-t {
    margin-top: auto;
    padding-top: 1.5rem;
    margin-top: 2.5rem;
}

/* ==== ANIMATIONS ET INTERACTIONS ==== */

/* Animation de base pour toutes les cartes */
#trainings .training-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Animations desktop uniquement */
@media (min-width: 769px) {
    /* Hover cartes principales */
    #trainings .training-card:hover {
        transform: translateY(-8px) scale(1.02);
        filter: brightness(1.1);
        box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    }
    
    /* Animations des icônes */
    .training-card .fa-rocket,
    .training-card .fa-chart-line {
        transition: all 0.3s ease;
    }
    
    .training-card:hover .fa-rocket,
    .training-card:hover .fa-chart-line {
        transform: scale(1.2) rotate(15deg);
    }
    
    /* Animation éléments de liste */
    .training-card .space-y-4 > div {
        transition: all 0.3s ease;
    }
    
    .training-card:hover .space-y-4 > div {
        transform: translateX(8px);
    }
    
    /* Délais échelonnés */
    .training-card:hover .space-y-4 > div:nth-child(n) { 
        transition-delay: calc(50ms * (var(--order, 0))); 
    }
}

/* ==== ANIMATION COACHING BOUNCE ==== */
.coaching-bounce {
    transition: all 0.3s ease;
    transform: translateY(0px);
}

/* Animation au survol de la carte parent */
.training-card:hover .coaching-bounce {
    animation: coachingPop 0.6s ease-out;
}

@keyframes coachingPop {
    0% {
        transform: translateY(0px) scale(1);
    }
    30% {
        transform: translateY(-8px) scale(1.15);
    }
    60% {
        transform: translateY(-3px) scale(1.05);
    }
    100% {
        transform: translateY(0px) scale(1);
    }
}

/* ==== EXPANDABLE ITEMS ==== */

/* Structure des éléments dépliables */
.expandable-item {
    transition: none;
    position: relative;
}

.expandable-header {
    cursor: pointer;
    transition: background-color 0.2s ease;
    position: relative;
    border-radius: 8px;
    margin: -4px -8px;
    padding: 4px 8px;
}

.expandable-header:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.expand-icon {
    transition: transform 0.25s ease;
    font-size: 14px;
    margin-left: auto;
    margin-right: 1rem;
    will-change: transform;
}

/* Contenu dépliable - Performance optimisée */
.expandable-content {
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: top;
    will-change: transform;
}

.expandable-content.collapsed {
    transform: scaleY(0);
    height: 0;
    margin-top: 0;
    margin-bottom: 0;
}

.expandable-content.expanded {
    transform: scaleY(1);
    height: auto;
    margin-top: 0.75rem;
    margin-bottom: 0.5rem;
}

/* Points détaillés */
.expanded-points {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 1rem;
    border-left: 3px solid rgba(255, 255, 255, 0.2);
    margin-left: 3rem;
}

.expanded-point {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    transition: transform 0.2s ease;
    will-change: transform;
}

.expanded-point:last-child {
    margin-bottom: 0;
}

.expanded-point:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(4px);
}

.expanded-point span {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    font-weight: 400;
}

/* Animation simplifiée pour de meilleures performances */
.expandable-content.expanded .expanded-point {
    animation: fadeInUp 0.3s ease-out forwards;
    opacity: 0;
}

.expandable-content.expanded .expanded-point:nth-child(1) { animation-delay: 0.05s; }
.expandable-content.expanded .expanded-point:nth-child(2) { animation-delay: 0.1s; }
.expandable-content.expanded .expanded-point:nth-child(3) { animation-delay: 0.15s; }
.expandable-content.expanded .expanded-point:nth-child(4) { animation-delay: 0.2s; }
.expandable-content.expanded .expanded-point:nth-child(5) { animation-delay: 0.25s; }
.expandable-content.expanded .expanded-point:nth-child(6) { animation-delay: 0.3s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==== TOOLTIPS ==== */
.tooltip-container {
    position: relative;
}

/* Contenu du tooltip - caché par défaut */
.tooltip-content {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 10px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1000;
    pointer-events: none;
}

/* Style du texte du tooltip - fond clair */
.tooltip-text {
    display: inline-block;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.95);
    color: #000000 !important;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Flèche du tooltip - fond clair */
.tooltip-content::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 8px 8px 0 8px;
    border-color: rgba(255, 255, 255, 0.95) transparent transparent transparent;
}

/* Style de l'icône tooltip - 'i' blanc visible sur fond sombre */
.tooltip-icon {
    display: inline-block;
    color: #ffffff;
    font-size: 12px;
    font-weight: bold;
    margin-left: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    vertical-align: middle;
    line-height: 1;
}

.tooltip-icon:hover {
    transform: scale(1.15);
}

/* Affichage au survol de l'icône - Desktop */
@media (min-width: 769px) {
    .tooltip-icon:hover + .tooltip-content {
        opacity: 1;
        visibility: visible;
    }
}

/* ==== RESPONSIVE ==== */
@media (max-width: 768px) {
    /* Désactiver hover sur mobile */
    #trainings .training-card:hover {
        transform: none;
        filter: none;
        box-shadow: none;
    }
    
    /* Adaptation badges et boutons */
    .coaching-bounce {
        font-size: 10px;
        padding: 2px 8px;
        margin-right: 8px;
        animation: coachingAppear 1.2s ease-out 0.8s both;
    }
    
    .training-card .btn {
        font-size: 0.9rem;
        padding: 0.75rem 1.25rem;
        margin-top: 0.75rem;
    }
    
    .training-card .btn i {
        font-size: 0.8rem;
    }
    
    .training-card .bg-gradient-to-r.from-emerald-400 {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .training-card .bg-emerald-500\/20 {
        font-size: 11px;
        padding: 4px 8px;
    }
    
    /* Responsive pour les éléments dépliables */
    .expanded-points {
        margin-left: 2rem;
        padding: 0.75rem;
        background: rgba(0, 0, 0, 0.3);
        border-left: 2px solid rgba(255, 255, 255, 0.3);
    }
    
    .expanded-point {
        padding: 0.4rem;
        margin-bottom: 0.5rem;
        transition: none;
        background: rgba(255, 255, 255, 0.08);
        will-change: auto;
    }
    
    .expanded-point:hover {
        background: rgba(255, 255, 255, 0.08);
        transform: none;
    }
    
    .expanded-point span {
        font-size: 0.85rem;
    }
    
    .expand-icon {
        font-size: 12px;
        margin-right: 0.75rem;
        transition: transform 0.2s ease;
        will-change: transform;
    }
    
    .expandable-header {
        transition: none;
        padding: 4px 8px;
        margin: -4px -8px;
    }
    
    .expandable-header:hover {
        background-color: rgba(255, 255, 255, 0.05);
    }
    
    /* Optimisation mobile : animation plus simple */
    .expandable-content {
        transition: transform 0.25s ease;
        will-change: transform;
    }
    
    .expandable-content.collapsed {
        transform: scaleY(0);
        height: 0;
    }
    
    .expandable-content.expanded {
        transform: scaleY(1);
        height: auto;
    }
    
    /* Animation simplifiée sur mobile */
    .expandable-content.expanded .expanded-point {
        animation: mobileSlideIn 0.2s ease-out forwards;
        opacity: 0;
    }
    
    .expandable-content.expanded .expanded-point:nth-child(1) { animation-delay: 0.02s; }
    .expandable-content.expanded .expanded-point:nth-child(2) { animation-delay: 0.04s; }
    .expandable-content.expanded .expanded-point:nth-child(3) { animation-delay: 0.06s; }
    .expandable-content.expanded .expanded-point:nth-child(4) { animation-delay: 0.08s; }
    .expandable-content.expanded .expanded-point:nth-child(5) { animation-delay: 0.1s; }
    .expandable-content.expanded .expanded-point:nth-child(6) { animation-delay: 0.12s; }
    
    /* Version mobile - tap pour afficher tooltips */
    .tooltip-text {
        white-space: normal;
        max-width: 350px;
        min-width: 280px;
        font-size: 13px;
        line-height: 1.5;
        text-align: left;
    }
    
    /* Position ajustée pour mobile */
    .tooltip-content {
        bottom: auto;
        top: 100%;
        margin-top: 10px;
        margin-bottom: 0;
    }
    
    /* Flèche inversée pour mobile - fond clair */
    .tooltip-content::after {
        top: auto;
        bottom: 100%;
        border-width: 0 8px 8px 8px;
        border-color: transparent transparent rgba(255, 255, 255, 0.95) transparent;
    }
    
    /* Affichage sur tap */
    .tooltip-container.active .tooltip-content {
        opacity: 1;
        visibility: visible;
    }
    
    /* Stack vertical très petit écran */
    @media (max-width: 480px) {
        .training-card .flex.items-center.mt-3 {
            flex-direction: column;
            align-items: flex-start;
            gap: 8px;
        }
        
        .training-card .flex.items-center.mt-3 > div:first-child {
            margin-right: 0;
        }
    }
}

.grid.md\\:grid-cols-2.gap-10.lg\\:gap-12.mb-8 {
    margin-bottom: 1.5rem;
}

@keyframes coachingAppear {
    0% {
        opacity: 0;
        transform: translateY(10px) scale(0.8);
    }
    70% {
        opacity: 1;
        transform: translateY(-2px) scale(1.05);
    }
    100% {
        opacity: 1;
        transform: translateY(0px) scale(1);
    }
}

@keyframes mobileSlideIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}