/* 
==========================================================================
ANIMATIONS PROFESSIONNELLES PORTFOLIO JULIEN PINOT
Animations modernes et performantes pour un portfolio original
==========================================================================
*/

/* ==================== KEYFRAMES ANIMATIONS ==================== */

/* Animation d'entrée en fondu avec slide */
@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 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);
    }
}

/* Animation de rotation subtile */
@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-10deg) scale(0.9);
    }
    to {
        opacity: 1;
        transform: rotate(0deg) scale(1);
    }
}

/* Animation de pulsation */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Animation de flottement */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Animation de brillance */
@keyframes shine {
    0% {
        background-position: -200% center;
    }
    100% {
        background-position: 200% center;
    }
}

/* Animation de typewriter */
@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    50% {
        border-color: transparent;
    }
}

/* Animation de zoom doux */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Animation de slide en diagonale */
@keyframes slideInDiagonal {
    from {
        opacity: 0;
        transform: translate(-50px, -50px);
    }
    to {
        opacity: 1;
        transform: translate(0, 0);
    }
}

/* Animation de flip 3D */
@keyframes flipIn {
    from {
        opacity: 0;
        transform: perspective(400px) rotateX(-90deg);
    }
    to {
        opacity: 1;
        transform: perspective(400px) rotateX(0deg);
    }
}

/* Animation de révélation par balayage */
@keyframes revealFromBottom {
    from {
        clip-path: inset(100% 0 0 0);
    }
    to {
        clip-path: inset(0 0 0 0);
    }
}

@keyframes revealFromLeft {
    from {
        clip-path: inset(0 100% 0 0);
    }
    to {
        clip-path: inset(0 0 0 0);
    }
}

/* ==================== CLASSES D'ANIMATION ==================== */

/* Animations d'entrée */
.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
}

.animate-fade-in-down {
    animation: fadeInDown 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-rotate-in {
    animation: rotateIn 1s ease-out forwards;
}

.animate-zoom-in {
    animation: zoomIn 0.8s ease-out forwards;
}

.animate-slide-diagonal {
    animation: slideInDiagonal 1s ease-out forwards;
}

.animate-flip-in {
    animation: flipIn 1s ease-out forwards;
}

.animate-reveal-bottom {
    animation: revealFromBottom 1s ease-out forwards;
}

.animate-reveal-left {
    animation: revealFromLeft 1s ease-out forwards;
}

/* Animations continues */
.animate-pulse {
    animation: pulse 2s infinite;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

/* Délais d'animation pour créer des séquences */
.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;
}

.delay-600 {
    animation-delay: 0.6s;
}

.delay-700 {
    animation-delay: 0.7s;
}

.delay-800 {
    animation-delay: 0.8s;
}

/* ==================== ANIMATIONS INTERACTIVES ==================== */

/* Effet de brillance au hover */
.shine-effect {
    position: relative;
    overflow: hidden;
}

.shine-effect::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.shine-effect:hover::before {
    animation: shine 0.8s ease-in-out;
}

/* Effet de morphing subtil */
.morph-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.morph-hover:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Effet de tilt 3D */
.tilt-3d {
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

.tilt-3d:hover {
    transform: perspective(1000px) rotateX(5deg) rotateY(5deg);
}

/* Effet de glitch subtil */
.glitch-effect {
    position: relative;
}

.glitch-effect:hover {
    animation: glitch 0.3s ease-in-out;
}

@keyframes glitch {
    0%, 100% {
        transform: translate(0);
    }
    20% {
        transform: translate(-1px, 1px);
    }
    40% {
        transform: translate(-1px, -1px);
    }
    60% {
        transform: translate(1px, 1px);
    }
    80% {
        transform: translate(1px, -1px);
    }
}

/* Effet de ondulation */
.ripple-effect {
    position: relative;
    overflow: hidden;
}

.ripple-effect::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple-effect:hover::after {
    width: 300px;
    height: 300px;
}

/* ==================== ANIMATIONS SPÉCIFIQUES SECTIONS ==================== */

/* Animation du header */
.header-animate {
    animation: fadeInDown 1s ease-out;
}

/* Animation du hero */
.hero-title-animate {
    overflow: hidden;
    border-right: 2px solid var(--primary-blue);
    white-space: nowrap;
    animation: typewriter 3s steps(20) 1s both, blink 1s step-end infinite;
}

/* Animation des cartes en cascade */
.cards-cascade > * {
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
}

.cards-cascade > *:nth-child(1) { animation-delay: 0.1s; }
.cards-cascade > *:nth-child(2) { animation-delay: 0.2s; }
.cards-cascade > *:nth-child(3) { animation-delay: 0.3s; }
.cards-cascade > *:nth-child(4) { animation-delay: 0.4s; }
.cards-cascade > *:nth-child(5) { animation-delay: 0.5s; }
.cards-cascade > *:nth-child(6) { animation-delay: 0.6s; }

/* Animation des skills bars */
.skill-bar {
    position: relative;
    overflow: hidden;
}

.skill-progress {
    transform: translateX(-100%);
    animation: fillProgress 2s ease-out forwards;
    animation-delay: 0.5s;
}

@keyframes fillProgress {
    to {
        transform: translateX(0);
    }
}

/* ==================== ANIMATIONS RESPONSIVES ==================== */

/* Réduction des animations sur mobile pour les performances */
@media (max-width: 768px) {
    .animate-fade-in-up,
    .animate-fade-in-down,
    .animate-fade-in-left,
    .animate-fade-in-right {
        animation-duration: 0.6s;
    }
    
    .morph-hover:hover {
        transform: translateY(-3px) scale(1.01);
    }
    
    .tilt-3d:hover {
        transform: none;
    }
}

/* Respect des préférences utilisateur pour les animations */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==================== UTILITIES POUR OBSERVERS ==================== */

/* Classes pour l'intersection observer */
.observe-fade {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.observe-fade.visible {
    opacity: 1;
    transform: translateY(0);
}

.observe-slide-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.observe-slide-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.observe-slide-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.observe-slide-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.observe-zoom {
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.observe-zoom.visible {
    opacity: 1;
    transform: scale(1);
}

/* ==================== ANIMATIONS AVANCÉES ==================== */

/* Particules flottantes en arrière-plan */
.floating-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.particle {
    position: absolute;
    background: var(--primary-blue);
    border-radius: 50%;
    opacity: 0.1;
    animation: floatParticle 20s linear infinite;
}

@keyframes floatParticle {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.1;
    }
    90% {
        opacity: 0.1;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

/* Effet de typing en continu */
.typing-effect {
    position: relative;
}

.typing-effect::after {
    content: '|';
    animation: blink 1s infinite;
    color: var(--primary-blue);
}
