/* Animations et effets visuels */

/* Keyframes */
@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
    }
}

@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.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

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

@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(59, 130, 246, 0.5);
    }
}

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

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

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

/* Classes d'animation */
.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.8s ease-out forwards;
}

.animate-fade-in-right {
    animation: fadeInRight 0.8s ease-out forwards;
}

.animate-scale-in {
    animation: scaleIn 0.6s ease-out forwards;
}

.animate-slide-in-top {
    animation: slideInFromTop 0.8s ease-out forwards;
}

.animate-bounce-in {
    animation: bounceIn 1s ease-out forwards;
}

.animate-slide-up {
    animation: slideUp 0.8s ease-out forwards;
}

/* Délais d'animation */
.delay-100 {
    animation-delay: 0.1s;
}

.delay-200 {
    animation-delay: 0.2s;
}

.delay-300 {
    animation-delay: 0.3s;
}

.delay-400 {
    animation-delay: 0.4s;
}

.delay-500 {
    animation-delay: 0.5s;
}

/* États initiaux pour les animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Effets de survol animés - versions améliorées avec couleurs spécifiques */
.hover-glow:hover {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4), 0 0 40px rgba(59, 130, 246, 0.2);
    transform: translateY(-2px);
    transition: all 0.3s ease;
}

.hover-pulse:hover {
    transform: scale(1.02);
    transition: all 0.3s ease;
}

.hover-rotate:hover {
    transform: rotate(2deg) scale(1.02);
    transition: all 0.3s ease;
}

/* Effets hover spécifiques aux couleurs */
.hover-pulse-javascript:hover {
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(247, 223, 30, 0.4), 0 0 40px rgba(247, 223, 30, 0.2);
    transition: all 0.3s ease;
}

.hover-pulse-python:hover {
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(55, 118, 171, 0.4), 0 0 40px rgba(55, 118, 171, 0.2);
    transition: all 0.3s ease;
}

.hover-pulse-docker:hover {
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(36, 150, 237, 0.4), 0 0 40px rgba(36, 150, 237, 0.2);
    transition: all 0.3s ease;
}

.hover-pulse-security:hover {
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(220, 38, 38, 0.4), 0 0 40px rgba(220, 38, 38, 0.2);
    transition: all 0.3s ease;
}

.hover-pulse-mobile:hover {
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(249, 115, 22, 0.4), 0 0 40px rgba(249, 115, 22, 0.2);
    transition: all 0.3s ease;
}

.hover-pulse-network:hover {
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.4), 0 0 40px rgba(6, 182, 212, 0.2);
    transition: all 0.3s ease;
}

.hover-pulse-users:hover {
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4), 0 0 40px rgba(59, 130, 246, 0.2);
    transition: all 0.3s ease;
}

.hover-pulse-education:hover {
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.4), 0 0 40px rgba(16, 185, 129, 0.2);
    transition: all 0.3s ease;
}

.hover-pulse-support:hover {
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.4), 0 0 40px rgba(245, 158, 11, 0.2);
    transition: all 0.3s ease;
}

/* Particules animées */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.particle {
    position: absolute;
    background: var(--primary-light);
    border-radius: 50%;
    pointer-events: none;
    opacity: 0.1;
}

.particle-1 {
    width: 4px;
    height: 4px;
    animation: float 15s infinite linear;
    top: 10%;
    left: 10%;
}

.particle-2 {
    width: 6px;
    height: 6px;
    animation: float 20s infinite linear reverse;
    top: 20%;
    left: 80%;
    animation-delay: -5s;
}

.particle-3 {
    width: 3px;
    height: 3px;
    animation: float 25s infinite linear;
    top: 60%;
    left: 20%;
    animation-delay: -10s;
}

.particle-4 {
    width: 5px;
    height: 5px;
    animation: float 18s infinite linear reverse;
    top: 80%;
    left: 70%;
    animation-delay: -15s;
}

/* Effet de typing */
.typing-effect {
    overflow: hidden;
    border-right: 3px solid var(--primary-light);
    white-space: nowrap;
    animation: typing 3s steps(40, end), blink 0.75s step-end infinite;
}

/* Effet de shimmer sur les boutons */
.shimmer {
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

/* Scroll progress indicator */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--gradient-tech);
    z-index: 9999;
    transition: width 0.3s ease;
}

/* Loading animation */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 212, 255, 0.3);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: rotate 1s linear infinite;
}

/* Staggered animations */
.stagger-children > * {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease-out forwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.6s; }

/* Parallax effect */
.parallax-element {
    will-change: transform;
}

/* Glitch effect pour un style tech */
.glitch {
    position: relative;
    display: inline-block;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    color: #ff0000;
    z-index: -1;
    animation: glitch-1 0.3s infinite;
}

.glitch::after {
    color: #00ffff;
    z-index: -1;
    animation: glitch-2 0.3s infinite;
}

@keyframes glitch-1 {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
}

@keyframes glitch-2 {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(2px, 2px); }
    40% { transform: translate(2px, -2px); }
    60% { transform: translate(-2px, 2px); }
    80% { transform: translate(-2px, -2px); }
}

/* Code matrix rain effect */
.matrix-rain {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.matrix-column {
    position: absolute;
    top: -100%;
    color: var(--primary-light);
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.2;
    opacity: 0.2;
    animation: matrix-fall 10s linear infinite;
}

@keyframes matrix-fall {
    to {
        transform: translateY(100vh);
    }
}
