/* Scroll-triggered Animations */
[data-delay] {
    animation-delay: calc(var(--delay) * 1ms);
}

[data-delay="100"] { --delay: 100; }
[data-delay="200"] { --delay: 200; }
[data-delay="300"] { --delay: 300; }
[data-delay="400"] { --delay: 400; }
[data-delay="500"] { --delay: 500; }
[data-delay="600"] { --delay: 600; }
[data-delay="700"] { --delay: 700; }
[data-delay="800"] { --delay: 800; }

/* Fade Animations */
.fade-in {
    animation: fadeIn 0.6s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-down {
    animation: fadeInDown 0.6s ease forwards;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-left {
    animation: fadeInLeft 0.6s ease forwards;
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fade-in-right {
    animation: fadeInRight 0.6s ease forwards;
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale Animations */
.scale-in {
    animation: scaleIn 0.6s ease forwards;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.scale-in-center {
    animation: scaleInCenter 0.6s ease forwards;
}

@keyframes scaleInCenter {
    from {
        opacity: 0;
        transform: scale(0);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Rotate Animations */
.rotate-in {
    animation: rotateIn 0.6s ease forwards;
}

@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-180deg);
    }
    to {
        opacity: 1;
        transform: rotate(0);
    }
}

/* Slide Animations */
.slide-in-left {
    animation: slideInLeft 0.6s ease forwards;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

.slide-in-right {
    animation: slideInRight 0.6s ease forwards;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

.slide-in-top {
    animation: slideInTop 0.6s ease forwards;
}

@keyframes slideInTop {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

.slide-in-bottom {
    animation: slideInBottom 0.6s ease forwards;
}

@keyframes slideInBottom {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Bounce Animations */
.bounce-in {
    animation: bounceIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

.bounce {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-30px);
    }
    60% {
        transform: translateY(-15px);
    }
}

/* Pulse Animation */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Shake Animation */
.shake {
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-10px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(10px);
    }
}

/* Flip Animations */
.flip-in-x {
    animation: flipInX 0.6s ease forwards;
}

@keyframes flipInX {
    from {
        transform: perspective(400px) rotateX(90deg);
        opacity: 0;
    }
    to {
        transform: perspective(400px) rotateX(0);
        opacity: 1;
    }
}

.flip-in-y {
    animation: flipInY 0.6s ease forwards;
}

@keyframes flipInY {
    from {
        transform: perspective(400px) rotateY(90deg);
        opacity: 0;
    }
    to {
        transform: perspective(400px) rotateY(0);
        opacity: 1;
    }
}

/* Glow Animation */
.glow {
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        box-shadow: 0 0 10px rgba(0, 128, 255, 0.5);
    }
    to {
        box-shadow: 0 0 20px rgba(0, 128, 255, 0.8), 0 0 30px rgba(0, 128, 255, 0.6);
    }
}

/* Text Animations */
.text-reveal {
    overflow: hidden;
}

.text-reveal span {
    display: inline-block;
    animation: textReveal 0.8s ease forwards;
    animation-delay: calc(var(--char-index) * 0.05s);
}

@keyframes textReveal {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading Animations */
.skeleton {
    background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Ripple Effect */
.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.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::before {
    width: 300px;
    height: 300px;
}

/* Hover Effects */
.hover-lift {
    transition: transform 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
}

.hover-grow {
    transition: transform 0.3s ease;
}

.hover-grow:hover {
    transform: scale(1.05);
}

.hover-shrink {
    transition: transform 0.3s ease;
}

.hover-shrink:hover {
    transform: scale(0.95);
}

.hover-rotate {
    transition: transform 0.3s ease;
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

/* Gradient Animation */
.gradient-animate {
    background: linear-gradient(135deg, #0080ff, #00d4ff, #0080ff);
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Counter Animation */
.counter {
    display: inline-block;
}

/* Parallax Classes */
.parallax {
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.parallax-slow {
    transition: transform 1s cubic-bezier(0.23, 1, 0.32, 1);
}

.parallax-fast {
    transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Stagger Animation */
.stagger-animation > * {
    opacity: 0;
    transform: translateY(20px);
}

.stagger-animation.animated > * {
    animation: staggerFadeIn 0.6s ease forwards;
    animation-delay: calc(var(--stagger-index) * 0.1s);
}

@keyframes staggerFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Typewriter Effect */
.typewriter {
    overflow: hidden;
    border-right: 2px solid #0080ff;
    white-space: nowrap;
    animation: typewriter 3s steps(40, end), blinkCursor 0.75s step-end infinite;
}

@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blinkCursor {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: #0080ff;
    }
}

/* 3D Card Flip */
.card-3d {
    perspective: 1000px;
}

.card-3d-inner {
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.card-3d:hover .card-3d-inner {
    transform: rotateY(180deg);
}

.card-3d-front,
.card-3d-back {
    backface-visibility: hidden;
}

.card-3d-back {
    transform: rotateY(180deg);
}

/* Attention Seekers */
.attention-pulse {
    animation: attentionPulse 1s ease-in-out;
}

@keyframes attentionPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.attention-shake {
    animation: attentionShake 0.5s;
}

@keyframes attentionShake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

/* Smooth Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollBounce 2s infinite;
}

@keyframes scrollBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}