/* ================================================
   ANIMATIONS - Premium Motion Design
   ================================================ */

/* -------------------- Keyframe Animations -------------------- */

/* Fade Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@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);
    }
}

/* Scale Animations */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes scaleUp {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.05);
    }
}

/* Float Animation */
@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

@keyframes floatSlow {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-10px) rotate(2deg);
    }
}

/* Pulse Animation */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(0, 217, 255, 0.3);
    }

    50% {
        box-shadow: 0 0 40px rgba(0, 217, 255, 0.6);
    }
}

/* Shimmer Effect */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* Rotate Animation */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

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

    to {
        transform: rotate(360deg);
    }
}

/* Bounce Animation */
@keyframes bounce {

    0%,
    20%,
    53%,
    80%,
    100% {
        animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
        transform: translateY(0);
    }

    40%,
    43% {
        animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
        transform: translateY(-15px);
    }

    70% {
        animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
        transform: translateY(-7px);
    }

    90% {
        transform: translateY(-3px);
    }
}

/* Wave Animation for Background */
@keyframes wave {
    0% {
        transform: translateX(0) translateZ(0) scaleY(1);
    }

    50% {
        transform: translateX(-25%) translateZ(0) scaleY(0.55);
    }

    100% {
        transform: translateX(-50%) translateZ(0) scaleY(1);
    }
}

/* Gradient Animation */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Typing Cursor */
@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

/* Counter Animation */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

/* -------------------- Animation Classes -------------------- */

/* Base transition for all animated elements */
[data-animate] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-animate].animated {
    opacity: 1;
    transform: translateY(0);
}

/* Animation Delays */
[data-animate-delay="100"] {
    transition-delay: 100ms;
}

[data-animate-delay="200"] {
    transition-delay: 200ms;
}

[data-animate-delay="300"] {
    transition-delay: 300ms;
}

[data-animate-delay="400"] {
    transition-delay: 400ms;
}

[data-animate-delay="500"] {
    transition-delay: 500ms;
}

[data-animate-delay="600"] {
    transition-delay: 600ms;
}

[data-animate-delay="700"] {
    transition-delay: 700ms;
}

[data-animate-delay="800"] {
    transition-delay: 800ms;
}

/* Specific Animation Types */
[data-animate="fade-up"] {
    transform: translateY(30px);
}

[data-animate="fade-down"] {
    transform: translateY(-30px);
}

[data-animate="fade-left"] {
    transform: translateX(30px);
}

[data-animate="fade-right"] {
    transform: translateX(-30px);
}

[data-animate="scale"] {
    transform: scale(0.9);
}

[data-animate="fade-up"].animated,
[data-animate="fade-down"].animated {
    transform: translateY(0);
}

[data-animate="fade-left"].animated,
[data-animate="fade-right"].animated {
    transform: translateX(0);
}

[data-animate="scale"].animated {
    transform: scale(1);
}

/* -------------------- Utility Classes -------------------- */

/* Float Effect */
.animate-float {
    animation: float 6s ease-in-out infinite;
}

.animate-float-slow {
    animation: floatSlow 8s ease-in-out infinite;
}

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

.animate-pulse-glow {
    animation: pulseGlow 2s ease-in-out infinite;
}

/* Shimmer Effect */
.animate-shimmer {
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.1),
            transparent);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

/* Rotate Effects */
.animate-rotate {
    animation: rotate 20s linear infinite;
}

.animate-rotate-slow {
    animation: rotateSlow 60s linear infinite;
}

/* Bounce */
.animate-bounce {
    animation: bounce 2s infinite;
}

/* Gradient Animation */
.animate-gradient {
    background-size: 200% 200%;
    animation: gradientShift 5s ease infinite;
}

/* -------------------- Hover Effects -------------------- */

/* Lift on hover */
.hover-lift {
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Scale on hover */
.hover-scale {
    transition: transform var(--transition-normal);
}

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

/* Glow on hover */
.hover-glow {
    transition: box-shadow var(--transition-normal);
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(0, 217, 255, 0.4);
}

/* -------------------- Page Load Animations -------------------- */

/* Stagger animation for children */
.stagger-children>* {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease 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;
}

/* Hero specific animations */
.hero-content {
    animation: fadeInUp 0.8s ease 0.2s both;
}

.hero-image {
    animation: fadeInUp 0.8s ease 0.4s both;
}

/* -------------------- Background Effects -------------------- */

/* Animated gradient background */
.bg-gradient-animated {
    background: linear-gradient(-45deg,
            var(--color-bg-primary),
            var(--color-bg-secondary),
            var(--color-bg-tertiary),
            var(--color-bg-secondary));
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

/* Floating particles container */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: -1;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--color-accent-cyan);
    border-radius: 50%;
    opacity: 0.3;
    animation: float 10s ease-in-out infinite;
}

/* -------------------- Scroll Progress -------------------- */

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--gradient-primary);
    z-index: 9999;
    width: 0%;
    transition: width 0.1s linear;
}

/* -------------------- Loading States -------------------- */

.skeleton {
    background: linear-gradient(90deg,
            var(--color-bg-tertiary) 25%,
            var(--color-bg-secondary) 50%,
            var(--color-bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

/* -------------------- Reduced Motion -------------------- */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    [data-animate] {
        opacity: 1;
        transform: none;
    }
}