/* Styles personnalisés pour Pia Formation */

/* ============================================
   TABLE DES MATIÈRES
   ============================================
   1. Base & Reset
   2. Layout
   3. Composants
   4. Animations (@keyframes)
   5. Classes utilitaires
   6. Responsive
   7. Accessibilité
   8. Optimisations
   ============================================ */


/* ============================================
   1. BASE & RESET
   ============================================ */
/* ✅ APRÈS - Ciblé sur les zones importantes */

/* Hero section - évite le layout shift */
section:first-of-type {
    min-height: 500px; /* Ajustez selon votre design */
}

/* Alternative : cibler directement le hero */
.hero-section {
    min-height: 500px;
}


/* Bouton retour en haut - évite layout shift */
#backToTop {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    /* Le bouton est toujours dans le DOM mais invisible */
}

#backToTop.visible,
#backToTop.opacity-100 {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Garde ta règle existante */
a, button {
  min-height: 48px;
  min-width: 48px;
  padding: 12px 16px;
}

/* Exception pour le footer */
footer a {
  min-height: 44px;
  min-width: 44px;
  padding: 8px 6px;
  line-height: 1.5;
}

main {
    min-height: 100vh; /* Force une hauteur complète */
}

/* Ajouter aussi */
section.gradient-animated:first-of-type,
section.relative.gradient-animated {
    min-height: 600px;
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Transitions ciblées (plus performant que * {}) */
a, button, input, select, textarea,
.card, .btn, [class*="hover"],
[class*="transition"] {
    transition: all 0.2s ease-in-out;
}

/* Focus pour accessibilité */
a:focus, button:focus, input:focus, textarea:focus, select:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}


/* ============================================
   2. LAYOUT
   ============================================ */

/* Logo container */
.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-container img {
    max-height: 50px;
    width: auto;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: bold;
    line-height: 1.2;
}

/* Menu mobile */
#mobileMenu {
    transition: max-height 0.3s ease-in-out;
}

/* Loading bar au top de la page */
.page-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(to right, #f97316, #ea580c);
    z-index: 9999;
    transition: width 0.2s ease;
    box-shadow: 0 2px 10px rgba(249, 115, 22, 0.5);
}


/* ============================================
   3. COMPOSANTS
   ============================================ */

/* Formulaires */
input[type="text"],
input[type="email"],
input[type="tel"],
textarea,
select {
    transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
textarea:focus,
select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Cartes */
.hover\:shadow-xl:hover {
    transform: translateY(-5px);
}

.group:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.group:hover .group-hover\:scale-110 {
    animation: bounce-small 0.5s ease-in-out;
}

/* Liens */
a.group {
    text-decoration: none;
    display: block;
}

/* Effet de hover moderne sur les cartes */
.card-hover-effect {
    position: relative;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card-hover-effect::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 1rem;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.card-hover-effect:hover::before {
    opacity: 1;
}

.card-hover-effect:hover {
    transform: translateY(-8px) scale(1.02);
}

/* Effet de hover sur les informations pratiques */
.info-card-hover {
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.info-card-hover:hover {
    transform: translateY(-10px) rotate(2deg);
}

.info-card-hover:hover .text-4xl {
    animation: float 1s ease-in-out infinite;
}

/* Effet de shine sur les images au hover */
.image-shine {
    position: relative;
    overflow: hidden;
}

.image-shine::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to bottom right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(45deg) translateX(-100%);
    transition: transform 0.6s ease;
}

.image-shine:hover::after {
    transform: rotate(45deg) translateX(100%);
}

/* Boutons */
.btn-hover-effect {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-hover-effect::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-hover-effect:hover::before {
    width: 300px;
    height: 300px;
}

/* Badges */
.badge-animated {
    animation: pulse 2s infinite;
}

/* Listes */
.list-item-animated {
    position: relative;
    padding-left: 30px;
    transition: transform 0.3s ease;
}

.list-item-animated::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: #f97316;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.list-item-animated:hover {
    transform: translateX(5px);
}

.list-item-animated:hover::before {
    width: 20px;
    border-radius: 3px;
}

/* Compteurs */
.counter {
    transition: transform 0.3s ease;
}

.counter:hover {
    transform: scale(1.1);
}


/* ============================================
   4. ANIMATIONS (@keyframes)
   ============================================ */

/* Animation fade-in */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animation de glissement */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Animation de pulsation */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(249, 115, 22, 0);
    }
}

/* Animation bounce */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    25% { transform: translateY(-10px); }
    50% { transform: translateY(-5px); }
    75% { transform: translateY(-7px); }
}

@keyframes bounce-small {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Animation float */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Gradient animé */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Progress bar */
@keyframes progressBar {
    from { width: 0%; }
    to { width: 100%; }
}


/* ============================================
   5. CLASSES UTILITAIRES
   ============================================ */

/* Animations de base */
.fade-in {
    animation: fadeIn 0.6s ease-out;
}

.progress-animated {
    animation: progressBar 2s ease-out;
}

/* Classes d'animation au scroll */
.animate-on-scroll {
    opacity: 0;
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.animated {
    opacity: 1;
}

/* Directions d'animation */
.slide-up {
    transform: translateY(30px);
}

.slide-up.animated {
    transform: translateY(0);
}

.slide-left {
    transform: translateX(-50px);
}

.slide-left.animated {
    transform: translateX(0);
}

.slide-right {
    transform: translateX(50px);
}

.slide-right.animated {
    transform: translateX(0);
}

.scale-in {
    transform: scale(0.9);
}

.scale-in.animated {
    transform: scale(1);
}

/* Gradient animé */
.gradient-animated {
    background: linear-gradient(45deg, #f97316, #ea580c, #c2410c, #ea580c, #f97316);
    background-size: 300% 300%;
    animation: gradientShift 8s ease infinite;
}

/* Animation des icônes */
.icon-bounce:hover {
    animation: bounce 0.6s ease;
}

/* Effet parallax */
.parallax-element {
    transition: transform 0.3s ease-out;
}

/* Stagger animation pour listes */
.stagger-animation > * {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

.stagger-animation > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-animation > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-animation > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-animation > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-animation > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-animation > *:nth-child(6) { animation-delay: 0.6s; }


/* ============================================
   6. RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    table {
        font-size: 0.875rem;
    }
}

@media (max-width: 640px) {
    .logo-container img {
        max-height: 40px;
    }
    
    .logo-text {
        font-size: 1.25rem;
    }
}


/* ============================================
   7. ACCESSIBILITÉ
   ============================================ */

/* Désactiver animations si préférence utilisateur */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}


/* ============================================
   8. OPTIMISATIONS PERFORMANCES
   ============================================ */

/* Optimisation GPU pour éléments animés */
.animate-on-scroll,
.card-hover-effect,
.btn-hover-effect,
.image-shine,
.gradient-animated {
    will-change: transform, opacity;
}

/* Retirer will-change après animation (géré par JS) */
.animate-on-scroll.animated {
    will-change: auto;
}

/* Optimisation des transformations */
.card-hover-effect,
.btn-hover-effect,
.info-card-hover {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Dans assets/css/style.css */

.gradient-animated {
    background: linear-gradient(135deg, #f97316 0%, #c2410c 100%);
}

.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

.slide-left {
    transform: translateX(-50px);
}

.slide-right {
    transform: translateX(50px);
}

.slide-up {
    transform: translateY(50px);
}

.scale-in {
    transform: scale(0.95);
}

.image-shine {
    overflow: hidden;
    position: relative;
}

.image-shine::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to bottom right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(45deg);
    transition: all 0.5s;
}

.image-shine:hover::before {
    left: 100%;
}
