/* ========================================
   ANIMATIONS D'APPARITION ET INTERACTIONS
   ======================================== */

/* Keyframes pour les animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@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 scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Header animations */
.header {
    animation: fadeInDown 0.8s ease-out;
}

.logo {
    animation: fadeInLeft 0.8s ease-out 0.2s backwards;
}

.nav-menu li {
    animation: fadeInDown 0.6s ease-out backwards;
}

.nav-menu li:nth-child(1) {
    animation-delay: 0.3s;
}

.nav-menu li:nth-child(2) {
    animation-delay: 0.4s;
}

.nav-menu li:nth-child(3) {
    animation-delay: 0.5s;
}

.nav-menu li:nth-child(4) {
    animation-delay: 0.6s;
}

.nav-menu li:nth-child(5) {
    animation-delay: 0.7s;
}

.nav-menu li:nth-child(6) {
    animation-delay: 0.8s;
}

.lang-switcher {
    animation: fadeInRight 0.8s ease-out 0.3s backwards;
}

.mobile-toggle {
    animation: fadeInRight 0.8s ease-out 0.3s backwards;
}

/* Hero section animations */
.hero-content h1 {
    animation: fadeInUp 1s ease-out 0.4s backwards;
}

.hero-content .subtitle {
    animation: fadeInUp 1s ease-out 0.6s backwards;
}

.hero-content .cta-buttons,
.hero-content .btn {
    animation: fadeInUp 1s ease-out 0.8s backwards;
}

/* Scroll reveal animation */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Section titles */
.section-title {
    animation: fadeInUp 0.8s ease-out backwards;
}

/* Cards animations on hover */
.project-card,
.skill-card,
.experience-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card:hover,
.skill-card:hover,
.experience-card:hover {
    transform: translateY(-8px) scale(1.02);
}

/* Buttons enhanced hover */
.btn,
.cta-button {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn::before,
.cta-button::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, height 0.6s;
}

.btn:hover::before,
.cta-button:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover,
.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.3);
}

/* Nav links enhanced */
.nav-link {
    position: relative;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--color-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}

.nav-link:hover::before,
.nav-link.active::before {
    width: 80%;
}

/* Project cards enhanced */
.project-card {
    position: relative;
}

.project-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.4s;
    border-radius: inherit;
    pointer-events: none;
}

.project-card:hover::after {
    opacity: 1;
}

/* Skill items enhanced */
.skill-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.skill-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.2);
}

/* Timeline items */
.timeline-item {
    animation: fadeInLeft 0.8s ease-out backwards;
}

.timeline-item:nth-child(1) {
    animation-delay: 0.1s;
}

.timeline-item:nth-child(2) {
    animation-delay: 0.2s;
}

.timeline-item:nth-child(3) {
    animation-delay: 0.3s;
}

.timeline-item:nth-child(4) {
    animation-delay: 0.4s;
}

/* Tech cards */
.tech-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tech-card:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.2);
}

/* Contact form inputs */
.form-group input,
.form-group textarea {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-group input:focus,
.form-group textarea:focus {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.15);
}

/* Social links */
.social-link {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.social-link:hover {
    transform: translateY(-3px) scale(1.1);
}

/* Smooth transitions for all interactive elements */
a,
button,
input,
textarea,
select {
    transition: all 0.3s ease;
}

/* Stagger animation for grids */
.projects-grid>*,
.skills-grid>*,
.tech-grid>* {
    animation: scaleIn 0.6s ease-out backwards;
}

.projects-grid>*:nth-child(1),
.skills-grid>*:nth-child(1),
.tech-grid>*:nth-child(1) {
    animation-delay: 0.1s;
}

.projects-grid>*:nth-child(2),
.skills-grid>*:nth-child(2),
.tech-grid>*:nth-child(2) {
    animation-delay: 0.2s;
}

.projects-grid>*:nth-child(3),
.skills-grid>*:nth-child(3),
.tech-grid>*:nth-child(3) {
    animation-delay: 0.3s;
}

.projects-grid>*:nth-child(4),
.skills-grid>*:nth-child(4),
.tech-grid>*:nth-child(4) {
    animation-delay: 0.4s;
}

.projects-grid>*:nth-child(5),
.skills-grid>*:nth-child(5),
.tech-grid>*:nth-child(5) {
    animation-delay: 0.5s;
}

.projects-grid>*:nth-child(6),
.skills-grid>*:nth-child(6),
.tech-grid>*:nth-child(6) {
    animation-delay: 0.6s;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}