/* =================================
   ADVANCED ANIMATIONS & TRANSITIONS
   Kyle Dallafior UI/UX Portfolio
   ================================= */

/* =================================
   SCROLL-TRIGGERED ANIMATIONS
   ================================= */

.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

.slide-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.slide-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.slide-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.scale-in {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.scale-in.visible {
    opacity: 1;
    transform: scale(1);
}

/* =================================
   STAGGERED ANIMATIONS
   ================================= */

.stagger-children > * {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

.stagger-children.visible > * {
    opacity: 1;
    transform: translateY(0);
}

/* =================================
   FLOATING ANIMATIONS
   ================================= */

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

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

.float {
    animation: float 6s ease-in-out infinite;
}

.float-reverse {
    animation: floatReverse 8s ease-in-out infinite;
}

.float-delay-1 {
    animation-delay: 1s;
}

.float-delay-2 {
    animation-delay: 2s;
}

.float-delay-3 {
    animation-delay: 3s;
}

/* =================================
   ROTATION ANIMATIONS
   ================================= */

@keyframes subtleFloat {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    33% {
        transform: translateY(-15px) rotate(5deg);
    }
    66% {
        transform: translateY(-5px) rotate(-3deg);
    }
}

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

.slow-rotate {
    animation: subtleFloat 12s ease-in-out infinite;
}

.pulse {
    animation: pulse 3s ease-in-out infinite;
}

/* =================================
   HOVER ANIMATIONS
   ================================= */

.hover-lift {
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

.hover-scale {
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-tilt {
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.hover-tilt:hover {
    /* Tilt animation disabled */
    transform: none;
}

/* =================================
   PARTICLE ANIMATIONS
   ================================= */

/* particle-float animation removed - no floating elements */

/* Particle elements removed - no background circles */

/* =================================
   LOADING ANIMATIONS
   ================================= */

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

.shimmer {
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

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

.spin {
    animation: spin 1s linear infinite;
}

/* =================================
   TEXT ANIMATIONS
   ================================= */

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

@keyframes blinkCursor {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: var(--accent-red);
    }
}

.typewriter {
    overflow: hidden;
    border-right: 2px solid var(--accent-red);
    white-space: nowrap;
    animation: 
        typewriter 3s steps(40, end),
        blinkCursor 0.75s step-end infinite;
}

/* =================================
   GLITCH EFFECT
   ================================= */

@keyframes glitch {
    0% {
        text-shadow: 
            0.05em 0 0 var(--accent-red),
            -0.05em -0.025em 0 cyan,
            0.025em 0.05em 0 yellow;
    }
    15% {
        text-shadow: 
            0.05em 0 0 var(--accent-red),
            -0.05em -0.025em 0 cyan,
            0.025em 0.05em 0 yellow;
    }
    16% {
        text-shadow: 
            -0.05em -0.025em 0 var(--accent-red),
            0.025em 0.025em 0 cyan,
            -0.05em -0.05em 0 yellow;
    }
    49% {
        text-shadow: 
            -0.05em -0.025em 0 var(--accent-red),
            0.025em 0.025em 0 cyan,
            -0.05em -0.05em 0 yellow;
    }
    50% {
        text-shadow: 
            0.025em 0.05em 0 var(--accent-red),
            0.05em 0 0 cyan,
            0 -0.05em 0 yellow;
    }
    99% {
        text-shadow: 
            0.025em 0.05em 0 var(--accent-red),
            0.05em 0 0 cyan,
            0 -0.05em 0 yellow;
    }
    100% {
        text-shadow: 
            0.05em 0 0 var(--accent-red),
            -0.05em -0.025em 0 cyan,
            0.025em 0.05em 0 yellow;
    }
}

.glitch {
    animation: glitch 0.3s linear infinite;
}

/* =================================
   MORPHING SHAPES
   ================================= */

@keyframes morph {
    0%, 100% {
        border-radius: 40% 60% 70% 30% / 40% 40% 60% 50%;
    }
    34% {
        border-radius: 70% 30% 50% 50% / 30% 30% 70% 70%;
    }
    67% {
        border-radius: 100% 60% 60% 100% / 100% 100% 60% 60%;
    }
}

.morph {
    animation: morph 8s ease-in-out infinite;
}

/* =================================
   GRADIENT ANIMATIONS
   ================================= */

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.gradient-shift {
    background: linear-gradient(
        -45deg,
        var(--accent-red),
        var(--medium-gray),
        var(--dark-gray)
    );
    background-size: 400% 400%;
    animation: gradientShift 8s ease infinite;
}

/* =================================
   REVEAL ANIMATIONS
   ================================= */

@keyframes revealFromLeft {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes revealFromRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

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

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

.reveal-left {
    animation: revealFromLeft 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal-right {
    animation: revealFromRight 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal-top {
    animation: revealFromTop 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal-bottom {
    animation: revealFromBottom 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* =================================
   MAGNETIC HOVER EFFECT
   ================================= */

.magnetic {
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* =================================
   PARALLAX SCROLL EFFECTS
   ================================= */

.parallax-slow {
    will-change: transform;
}

.parallax-medium {
    will-change: transform;
}

.parallax-fast {
    will-change: transform;
}

/* Cursor follower removed per user request */

/* =================================
   PERFORMANCE OPTIMIZATIONS
   ================================= */

.gpu-accelerated {
    will-change: transform, opacity;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* =================================
   INTERSECTION OBSERVER CLASSES
   ================================= */

.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

/* =================================
   LOADING STATES
   ================================= */

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.fade-placeholder {
    background: var(--light-gray);
    animation: pulse 2s ease-in-out infinite;
}

/* =================================
   MICRO-INTERACTIONS
   ================================= */

.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::before {
    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:active::before {
    width: 300px;
    height: 300px;
}

/* =================================
   ACCESSIBILITY ANIMATIONS
   ================================= */

@media (prefers-reduced-motion: reduce) {
    .fade-in,
    .slide-in-left,
    .slide-in-right,
    .scale-in,
    .float,
    .float-reverse,
    .slow-rotate,
    .pulse,
    /* .particle removed, */
    .shimmer,
    .spin,
    .typewriter,
    .glitch,
    .morph,
    .gradient-shift {
        animation: none !important;
        transition: none !important;
    }
    
    .animate-on-scroll {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* =================================
   THEME TRANSITIONS
   ================================= */

* {
    transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform;
    transition-duration: 0.3s;
    transition-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}