/* ===== ANIMATION UTILITIES ===== */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

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

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

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

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

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

.scale-in {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.8s ease-out;
}

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

/* ===== STAGGER ANIMATIONS ===== */
.stagger-item {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.stagger-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.stagger-item:nth-child(1) {
    transition-delay: 0.1s;
}

.stagger-item:nth-child(2) {
    transition-delay: 0.2s;
}

.stagger-item:nth-child(3) {
    transition-delay: 0.3s;
}

.stagger-item:nth-child(4) {
    transition-delay: 0.4s;
}

.stagger-item:nth-child(5) {
    transition-delay: 0.5s;
}

.stagger-item:nth-child(6) {
    transition-delay: 0.6s;
}

/* ===== HOVER ANIMATIONS ===== */
.hover-lift {
    transition: transform var(--transition-normal);
}

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

.hover-scale {
    transition: transform var(--transition-normal);
}

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

.hover-rotate {
    transition: transform var(--transition-normal);
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

/* ===== LOADING ANIMATIONS ===== */
@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);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

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

@keyframes slideInUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
    }

    to {
        transform: translateY(0);
    }
}

/* ===== PARTICLE ANIMATIONS ===== */
.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    pointer-events: none;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {

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

    50% {
        transform: translateY(-20px) rotate(180deg);
        opacity: 0.8;
    }
}

.particle:nth-child(1) {
    width: 10px;
    height: 10px;
    left: 10%;
    animation-delay: 0s;
    animation-duration: 6s;
}

.particle:nth-child(2) {
    width: 15px;
    height: 15px;
    left: 20%;
    animation-delay: 1s;
    animation-duration: 8s;
}

.particle:nth-child(3) {
    width: 8px;
    height: 8px;
    left: 30%;
    animation-delay: 2s;
    animation-duration: 7s;
}

.particle:nth-child(4) {
    width: 12px;
    height: 12px;
    left: 40%;
    animation-delay: 3s;
    animation-duration: 9s;
}

.particle:nth-child(5) {
    width: 18px;
    height: 18px;
    left: 50%;
    animation-delay: 4s;
    animation-duration: 6s;
}

.particle:nth-child(6) {
    width: 14px;
    height: 14px;
    left: 60%;
    animation-delay: 5s;
    animation-duration: 8s;
}

.particle:nth-child(7) {
    width: 11px;
    height: 11px;
    left: 70%;
    animation-delay: 6s;
    animation-duration: 7s;
}

.particle:nth-child(8) {
    width: 16px;
    height: 16px;
    left: 80%;
    animation-delay: 7s;
    animation-duration: 9s;
}

.particle:nth-child(9) {
    width: 9px;
    height: 9px;
    left: 90%;
    animation-delay: 8s;
    animation-duration: 6s;
}

/* ===== TYPING ANIMATION ===== */
.typing-text {
    overflow: hidden;
    border-right: 3px solid var(--primary-color);
    white-space: nowrap;
    animation: typing 3s 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(--primary-color);
    }
}

/* ===== PROGRESS ANIMATIONS ===== */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--gray-200);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    transform: translateX(-100%);
    transition: transform 1.5s ease-out;
}

.progress-fill.animate {
    transform: translateX(0);
}

/* ===== COUNTER ANIMATIONS ===== */
.counter {
    font-weight: 700;
    font-size: 2rem;
    color: var(--primary-color);
}

/* ===== MORPHING SHAPES ===== */
.morphing-shape {
    width: 100px;
    height: 100px;
    background: var(--gradient-primary);
    border-radius: 50%;
    animation: morph 4s ease-in-out infinite;
}

@keyframes morph {

    0%,
    100% {
        border-radius: 50%;
        transform: rotate(0deg);
    }

    25% {
        border-radius: 25% 75% 75% 25%;
        transform: rotate(90deg);
    }

    50% {
        border-radius: 75% 25% 25% 75%;
        transform: rotate(180deg);
    }

    75% {
        border-radius: 25% 75% 25% 75%;
        transform: rotate(270deg);
    }
}

/* ===== GLITCH EFFECT ===== */
.glitch {
    position: relative;
    color: var(--white);
    font-size: 2rem;
    font-weight: 700;
    text-transform: uppercase;
    animation: glitch 2s linear infinite;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    animation: glitch-1 0.5s linear infinite reverse;
    color: #ff0040;
    z-index: -1;
}

.glitch::after {
    animation: glitch-2 0.5s linear infinite reverse;
    color: #00ffff;
    z-index: -2;
}

@keyframes glitch {

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

    20% {
        transform: translate(-2px, 2px);
    }

    40% {
        transform: translate(-2px, -2px);
    }

    60% {
        transform: translate(2px, 2px);
    }

    80% {
        transform: translate(2px, -2px);
    }
}

@keyframes glitch-1 {

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

    20% {
        transform: translate(-2px, 2px);
    }

    40% {
        transform: translate(-2px, -2px);
    }

    60% {
        transform: translate(2px, 2px);
    }

    80% {
        transform: translate(2px, -2px);
    }
}

@keyframes glitch-2 {

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

    20% {
        transform: translate(2px, -2px);
    }

    40% {
        transform: translate(2px, 2px);
    }

    60% {
        transform: translate(-2px, -2px);
    }

    80% {
        transform: translate(-2px, 2px);
    }
}

/* ===== 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.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::before {
    width: 300px;
    height: 300px;
}

/* ===== SHAKE ANIMATION ===== */
.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {

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

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

/* ===== WOBBLE ANIMATION ===== */
.wobble {
    animation: wobble 1s ease-in-out;
}

@keyframes wobble {

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

    15% {
        transform: translateX(-25px) rotate(-5deg);
    }

    30% {
        transform: translateX(20px) rotate(3deg);
    }

    45% {
        transform: translateX(-15px) rotate(-3deg);
    }

    60% {
        transform: translateX(10px) rotate(2deg);
    }

    75% {
        transform: translateX(-5px) rotate(-1deg);
    }
}

/* ===== FLIP ANIMATION ===== */
.flip {
    animation: flip 0.6s ease-in-out;
}

@keyframes flip {
    0% {
        transform: perspective(400px) rotateY(0);
    }

    40% {
        transform: perspective(400px) rotateY(-90deg);
    }

    60% {
        transform: perspective(400px) rotateY(-90deg);
    }

    100% {
        transform: perspective(400px) rotateY(0);
    }
}

/* ===== ZOOM ANIMATIONS ===== */
.zoom-in {
    animation: zoomIn 0.5s ease-out;
}

@keyframes zoomIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: scale(1);
    }
}

.zoom-out {
    animation: zoomOut 0.5s ease-out;
}

@keyframes zoomOut {
    0% {
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.3);
    }

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

/* ===== RESPONSIVE ANIMATIONS ===== */
@media (prefers-reduced-motion: reduce) {

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

@media (max-width: 768px) {
    .particle {
        display: none;
    }

    .morphing-shape {
        width: 60px;
        height: 60px;
    }

    .glitch {
        font-size: 1.5rem;
    }
}
