/* =============================================
   ANIMATIONS ET EFFETS SPÉCIAUX
============================================= */

/* Keyframes principales */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(102, 126, 234, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.6);
    }
}

/* =============================================
   ANIMATIONS D'ENTRÉE POUR LES SECTIONS
============================================= */

.hero {
    animation: fadeInDown 1s ease-out;
}

.hero-content {
    animation: fadeInUp 1s ease-out 0.3s both;
}

.hero-image {
    animation: scaleIn 1s ease-out 0.5s both;
}

.section-header {
    animation: fadeInUp 0.8s ease-out;
}

/* =============================================
   ANIMATIONS DE NAVIGATION
============================================= */

.navbar {
    animation: slideInFromTop 0.6s ease-out;
}

@keyframes slideInFromTop {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

/* =============================================
   ANIMATIONS DES BOUTONS
============================================= */

.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover {
    transform: translateY(-3px);
}

.btn:active {
    transform: translateY(-1px);
}

/* Animation de pulsation pour les boutons CTA */
.btn-primary {
    animation: pulse 2s infinite alternate;
}

.btn-primary:hover {
    animation: none;
}

/* =============================================
   ANIMATIONS DES CARTES
============================================= */

.project-card,
.skill-category,
.timeline-item,
.contact-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card:hover {
    transform: translateY(-10px);
}

.skill-category:hover {
    transform: translateY(-5px);
}

.contact-item:hover {
    transform: translateY(-5px) scale(1.02);
}

/* =============================================
   ANIMATIONS DES COMPÉTENCES
============================================= */

.skill-progress {
    overflow: hidden;
    position: relative;
}

.skill-progress::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 2s infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.skill-progress:hover::before {
    opacity: 1;
}

.skill-item.visible {
    animation: slideInFromBottom 0.6s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* Délais échelonnés pour les compétences */
.skill-item:nth-child(1) { animation-delay: 0.1s; }
.skill-item:nth-child(2) { animation-delay: 0.2s; }
.skill-item:nth-child(3) { animation-delay: 0.3s; }
.skill-item:nth-child(4) { animation-delay: 0.4s; }

/* =============================================
   ANIMATIONS DE LA TIMELINE
============================================= */

.timeline-item.visible {
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.timeline-dot {
    animation: scaleIn 0.5s ease-out;
    animation-fill-mode: both;
}

.timeline-content:hover {
    animation: pulse 0.6s ease-in-out;
}

/* Animation de la ligne de timeline */
.timeline::before {
    animation: drawLine 2s ease-out;
    transform-origin: top;
}

@keyframes drawLine {
    from {
        transform: translateX(-50%) scaleY(0);
    }
    to {
        transform: translateX(-50%) scaleY(1);
    }
}

/* =============================================
   ANIMATIONS D'INTERACTION
============================================= */

.social-link:hover {
    animation: bounce 0.6s ease;
}

@keyframes bounce {
    0%, 20%, 60%, 100% {
        transform: translateY(0) scale(1);
    }
    40% {
        transform: translateY(-10px) scale(1.1);
    }
    80% {
        transform: translateY(-5px) scale(1.05);
    }
}

/* =============================================
   ANIMATIONS DE FORMULAIRE
============================================= */

.form-group input:focus,
.form-group textarea:focus {
    animation: inputFocus 0.3s ease;
}

@keyframes inputFocus {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}

/* =============================================
   ANIMATIONS POUR PRÉFÉRENCES RÉDUITES
============================================= */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .reduce-motion * {
        animation: none !important;
        transition: none !important;
    }
}

/* =============================================
   ANIMATIONS RESPONSIVES
============================================= */

@media (max-width: 768px) {
    /* Réduire les animations sur mobile pour les performances */
    .skill-progress::before {
        display: none;
    }
    
    .timeline::before {
        animation: none;
    }
    
    /* Simplifier les animations de hover sur mobile */
    .project-card:hover,
    .skill-category:hover,
    .contact-item:hover {
        transform: translateY(-2px);
    }
}