/* Animation Utilities */

/* Fade In Animations */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeIn 0.8s ease-out forwards;
}

.fade-in-delay {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeIn 0.8s ease-out 0.2s forwards;
}

.fade-in-delay-2 {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeIn 0.8s ease-out 0.4s forwards;
}

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

/* Slide In Animations */
.slide-in-left {
    opacity: 0;
    transform: translateX(-50px);
    animation: slideInLeft 0.8s ease-out forwards;
}

.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
    animation: slideInRight 0.8s ease-out forwards;
}

@keyframes slideInLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Zoom In Animation */
.zoom-in {
    opacity: 0;
    transform: scale(0.8);
    animation: zoomIn 0.8s ease-out forwards;
}

@keyframes zoomIn {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Glow Effects */
.glow-blue {
    position: relative;
}

.glow-blue::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--color-accent-blue), transparent, var(--color-accent-blue));
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    animation: glowPulse 2s ease-in-out infinite;
}

.glow-copper {
    position: relative;
}

.glow-copper::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--color-accent-copper), transparent, var(--color-accent-copper));
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    animation: glowPulse 2s ease-in-out infinite 1s;
}

@keyframes glowPulse {
    0%, 100% {
        opacity: 0;
    }
    50% {
        opacity: 0.7;
    }
}

/* Floating Animation */
.floating {
    animation: floating 3s ease-in-out infinite;
}

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

/* Rotation Animation */
.rotate-slow {
    animation: rotateSlow 20s linear infinite;
}

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

/* Parallax Effect */
.parallax {
    transform: translateZ(0);
    will-change: transform;
}

/* Text Typing Effect */
.typing-effect {
    overflow: hidden;
    border-right: 3px solid var(--color-accent-blue);
    white-space: nowrap;
    margin: 0 auto;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

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

@keyframes blink-caret {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: var(--color-accent-blue);
    }
}

/* Count Up Animation */
.count-up {
    counter-reset: count;
    animation: countUp 2s ease-out forwards;
}

@keyframes countUp {
    from {
        counter-increment: count 0;
    }
    to {
        counter-increment: count var(--target);
    }
}

/* Stagger Animation for Lists */
.stagger-item {
    opacity: 0;
    transform: translateY(20px);
}

.stagger-item:nth-child(1) { animation: fadeIn 0.6s ease-out 0.1s forwards; }
.stagger-item:nth-child(2) { animation: fadeIn 0.6s ease-out 0.2s forwards; }
.stagger-item:nth-child(3) { animation: fadeIn 0.6s ease-out 0.3s forwards; }
.stagger-item:nth-child(4) { animation: fadeIn 0.6s ease-out 0.4s forwards; }
.stagger-item:nth-child(5) { animation: fadeIn 0.6s ease-out 0.5s forwards; }
.stagger-item:nth-child(6) { animation: fadeIn 0.6s ease-out 0.6s forwards; }

/* Hover Effects */
.hover-scale {
    transition: transform 0.3s ease;
}

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

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

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

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Pulse Animation */
.pulse {
    animation: pulse 2s ease-in-out infinite;
}

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

/* Shake Animation */
.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Reveal Animation for Images */
.reveal-image {
    overflow: hidden;
    position: relative;
}

.reveal-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--color-accent-blue), transparent);
    z-index: 2;
    animation: reveal 1.5s ease-out forwards;
}

.reveal-image img {
    transform: scale(1.1);
    animation: scaleDown 1.5s ease-out 0.3s forwards;
}

@keyframes reveal {
    0% {
        left: -100%;
    }
    50% {
        left: 0;
    }
    100% {
        left: 100%;
    }
}

@keyframes scaleDown {
    to {
        transform: scale(1);
    }
}

/* Morphing Background */
.morphing-bg {
    background: linear-gradient(-45deg, 
        var(--color-accent-blue), 
        var(--color-accent-copper), 
        var(--color-primary), 
        var(--color-anthracite));
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

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

/* Text Highlight Effect */
.text-highlight {
    background: linear-gradient(45deg, var(--color-accent-blue), var(--color-accent-copper));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: textHighlight 3s ease-in-out infinite;
}

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

/* Page Transitions */
.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, var(--color-accent-blue), var(--color-accent-copper));
    z-index: 9999;
    transform: translateX(-100%);
    transition: transform 0.5s ease-in-out;
}

.page-transition.active {
    transform: translateX(0);
}

/* Intersection Observer Animations */
.observe-fade {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

.observe-slide-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

.observe-slide-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

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

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

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}