/* =================================
   PORTFOLIO ANIMATIONS CSS
   Compatible avec Vercel
   ================================= */

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

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

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

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

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0, 0, 0);
    }
    40%, 43% {
        transform: translate3d(0, -10px, 0);
    }
    70% {
        transform: translate3d(0, -5px, 0);
    }
    90% {
        transform: translate3d(0, -2px, 0);
    }
}

@keyframes progressBarFill {
    from {
        width: 0%;
    }
    to {
        width: var(--target-width);
    }
}

/* SECTION ANIMATIONS */
.section-hidden {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.section-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ELEMENT ANIMATIONS */
.animate-element {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    transition-delay: 0.1s;
}

.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* HERO SECTION ANIMATIONS */
.hero-text .greeting {
    animation: fadeInLeft 1s ease 0.2s both;
}

.hero-text .hero-title {
    animation: fadeInLeft 1s ease 0.4s both;
}

.hero-text .hero-subtitle {
    animation: fadeInLeft 1s ease 0.6s both;
}

.hero-text .cta-btn {
    animation: fadeInUp 1s ease 0.8s both;
}

.profile-img {
    transform: scale(0.8);
    opacity: 0;
    transition: opacity 1s ease, transform 1s ease;
}

.profile-img.animate-in {
    transform: scale(1);
    opacity: 1;
    animation: scaleIn 1s ease;
}

/* ABOUT SECTION ANIMATIONS */
.about-text {
    animation: fadeInUp 0.8s ease 0.3s both;
}

.about-info .info-item {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.about-info.animate-in .info-item:nth-child(1) {
    animation: fadeInLeft 0.5s ease 0.3s both;
}

.about-info.animate-in .info-item:nth-child(2) {
    animation: fadeInLeft 0.5s ease 0.4s both;
}

.about-info.animate-in .info-item:nth-child(3) {
    animation: fadeInLeft 0.5s ease 0.5s both;
}

.about-info.animate-in .info-item:nth-child(4) {
    animation: fadeInLeft 0.5s ease 0.6s both;
}

.about-info.animate-in .info-item:nth-child(5) {
    animation: fadeInLeft 0.5s ease 0.7s both;
}

/* SKILLS SECTION ANIMATIONS */
.skill-item {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.skill-category.animate-in .skill-item:nth-child(1) {
    animation: fadeInLeft 0.6s ease 0.2s both;
}

.skill-category.animate-in .skill-item:nth-child(2) {
    animation: fadeInLeft 0.6s ease 0.3s both;
}

.skill-category.animate-in .skill-item:nth-child(3) {
    animation: fadeInLeft 0.6s ease 0.4s both;
}

.skill-category.animate-in .skill-item:nth-child(4) {
    animation: fadeInLeft 0.6s ease 0.5s both;
}

.skill-category.animate-in .skill-item:nth-child(5) {
    animation: fadeInLeft 0.6s ease 0.6s both;
}

/* PROGRESS BAR ANIMATIONS */
.progress-bar {
    width: 0;
    transition: width 1.5s ease-in-out;
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transform: translateX(-100%);
    transition: transform 1.5s ease-in-out;
}

.progress-bar.animate-in::after {
    transform: translateX(100%);
}

/* CERTIFICATIONS ANIMATIONS */
.certification-item {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.certifications-container .certification-item:nth-child(1) {
    animation: fadeInUp 0.8s ease 0.2s both;
}

.certifications-container .certification-item:nth-child(2) {
    animation: fadeInUp 0.8s ease 0.4s both;
}

.certifications-container .certification-item:nth-child(3) {
    animation: fadeInUp 0.8s ease 0.6s both;
}

.certifications-container .certification-item:nth-child(4) {
    animation: fadeInUp 0.8s ease 0.8s both;
}

/* PROJECTS SECTION ANIMATIONS */
.project-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.project-container .project-item:nth-child(1) .project-card {
    animation: fadeInUp 0.8s ease 0.2s both;
}

.project-container .project-item:nth-child(2) .project-card {
    animation: fadeInUp 0.8s ease 0.4s both;
}

.project-container .project-item:nth-child(3) .project-card {
    animation: fadeInUp 0.8s ease 0.6s both;
}

.project-container .project-item:nth-child(4) .project-card {
    animation: fadeInUp 0.8s ease 0.8s both;
}

/* CONTACT SECTION ANIMATIONS */
.contact-info {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    animation: fadeInLeft 0.8s ease 0.2s both;
}

.contact-form {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    animation: fadeInRight 0.8s ease 0.4s both;
}

/* CONTACT ICONS ANIMATIONS */
.contact-item .contact-icon {
    opacity: 0;
    transform: scale(0);
    transition: transform 0.5s ease, opacity 0.5s ease;
}

.contact-info.animate-in .contact-item:nth-child(1) .contact-icon {
    animation: scaleIn 0.5s ease 0.4s both;
}

.contact-info.animate-in .contact-item:nth-child(2) .contact-icon {
    animation: scaleIn 0.5s ease 0.6s both;
}

.contact-info.animate-in .contact-item:nth-child(3) .contact-icon {
    animation: scaleIn 0.5s ease 0.8s both;
}

/* HOVER ANIMATIONS */
.cta-btn:hover {
    animation: pulse 0.6s ease;
}

.project-card:hover {
    animation: bounce 0.6s ease;
}

.color-option:hover {
    animation: pulse 0.4s ease;
}

.nav-link:hover {
    animation: slideDown 0.3s ease;
}

.social-icon:hover {
    animation: bounce 0.5s ease;
}

.certification-item:hover {
    animation: pulse 0.6s ease;
}

/* LOADING ANIMATIONS */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* THEME COLOR TRANSITION ANIMATIONS */
.color-option {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.color-option.active {
    animation: pulse 0.8s ease;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

/* MODAL ANIMATIONS */
.modal.fade .modal-dialog {
    transition: transform 0.3s ease-out;
    transform: scale(0.8);
}

.modal.show .modal-dialog {
    transform: scale(1);
}

/* SCROLL ANIMATIONS */
.parallax-element {
    transition: transform 0.1s ease-out;
}

/* MOBILE ANIMATIONS */
@media (max-width: 576px) {
    .mobile-header {
        animation: slideDown 0.5s ease;
    }
    
    .sidebar {
        animation: slideUp 0.5s ease;
    }
    
    @keyframes slideUp {
        from {
            transform: translateY(100%);
        }
        to {
            transform: translateY(0);
        }
    }
    
    /* Réduire les animations sur mobile pour de meilleures performances */
    .animate-element {
        transition-duration: 0.4s;
    }
    
    .project-card:hover {
        animation: none;
        transform: translateY(-2px);
    }
    
    .certification-item:hover {
        animation: none;
        transform: scale(1.02);
    }
}

/* ACCESSIBILITY - REDUCED MOTION */
@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;
    }
    
    .animate-element {
        animation: none;
        opacity: 1;
        transform: none;
    }
    
    .progress-bar {
        transition: none;
    }
    
    .project-card:hover,
    .certification-item:hover,
    .cta-btn:hover {
        animation: none;
    }
}

/* PERFORMANCE OPTIMIZATIONS */
.will-animate {
    will-change: transform, opacity;
}

.animate-in {
    will-change: auto;
}

/* GPU ACCELERATION FOR SMOOTH ANIMATIONS */
.profile-img,
.project-card,
.certification-item,
.contact-icon,
.progress-bar {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* STAGGERED ANIMATIONS UTILITY CLASSES */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
.stagger-6 { animation-delay: 0.6s; }
.stagger-7 { animation-delay: 0.7s; }
.stagger-8 { animation-delay: 0.8s; }

/* CUSTOM ENTRANCE ANIMATIONS FOR DIFFERENT ELEMENTS */
.fade-in-up {
    animation: fadeInUp 0.8s ease both;
}

.fade-in-left {
    animation: fadeInLeft 0.8s ease both;
}

.fade-in-right {
    animation: fadeInRight 0.8s ease both;
}

.scale-in {
    animation: scaleIn 0.6s ease both;
}

.slide-down {
    animation: slideDown 0.5s ease both;
}