/* ==================== ANIMATIONS ==================== */

/* AOS (Animate On Scroll) Custom Styles */
[data-aos] {
    pointer-events: auto;
}

[data-aos="fade-up"] {
    transform: translate3d(0, 50px, 0);
    opacity: 0;
    transition-property: transform, opacity;
}

[data-aos="fade-up"].aos-animate {
    transform: translate3d(0, 0, 0);
    opacity: 1;
}

[data-aos="fade-down"] {
    transform: translate3d(0, -50px, 0);
    opacity: 0;
}

[data-aos="fade-down"].aos-animate {
    transform: translate3d(0, 0, 0);
    opacity: 1;
}

[data-aos="fade-left"] {
    transform: translate3d(50px, 0, 0);
    opacity: 0;
}

[data-aos="fade-left"].aos-animate {
    transform: translate3d(0, 0, 0);
    opacity: 1;
}

[data-aos="fade-right"] {
    transform: translate3d(-50px, 0, 0);
    opacity: 0;
}

[data-aos="fade-right"].aos-animate {
    transform: translate3d(0, 0, 0);
    opacity: 1;
}

[data-aos="zoom-in"] {
    transform: scale(0.8);
    opacity: 0;
}

[data-aos="zoom-in"].aos-animate {
    transform: scale(1);
    opacity: 1;
}

[data-aos="zoom-out"] {
    transform: scale(1.2);
    opacity: 0;
}

[data-aos="zoom-out"].aos-animate {
    transform: scale(1);
    opacity: 1;
}

/* ==================== LOADING ANIMATION ==================== */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader {
    position: relative;
    width: 100px;
    height: 100px;
}

.loader-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid transparent;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loader-ring:nth-child(2) {
    width: 80%;
    height: 80%;
    top: 10%;
    left: 10%;
    border-top-color: var(--secondary);
    animation-duration: 1.5s;
    animation-direction: reverse;
}

.loader-ring:nth-child(3) {
    width: 60%;
    height: 60%;
    top: 20%;
    left: 20%;
    border-top-color: var(--accent);
    animation-duration: 2s;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==================== TEXT ANIMATIONS ==================== */
@keyframes typewriter {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink {
    50% { border-color: transparent; }
}

.typewriter-text {
    overflow: hidden;
    border-right: 3px solid var(--primary);
    white-space: nowrap;
    animation: 
        typewriter 3s steps(40) 1s 1 normal both,
        blink 0.75s step-end infinite;
}

/* ==================== GLITCH EFFECT ==================== */
.glitch {
    position: relative;
    animation: glitch-skew 1s infinite linear alternate-reverse;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 var(--primary);
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 var(--secondary);
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim2 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% { clip: rect(10px, 9999px, 31px, 0); }
    5% { clip: rect(70px, 9999px, 71px, 0); }
    10% { clip: rect(60px, 9999px, 87px, 0); }
    15% { clip: rect(20px, 9999px, 20px, 0); }
    20% { clip: rect(85px, 9999px, 28px, 0); }
    25% { clip: rect(90px, 9999px, 43px, 0); }
    30% { clip: rect(65px, 9999px, 14px, 0); }
    35% { clip: rect(40px, 9999px, 81px, 0); }
    40% { clip: rect(95px, 9999px, 66px, 0); }
    45% { clip: rect(50px, 9999px, 12px, 0); }
    50% { clip: rect(75px, 9999px, 82px, 0); }
    100% { clip: rect(1px, 9999px, 94px, 0); }
}

@keyframes glitch-anim2 {
    0% { clip: rect(65px, 9999px, 100px, 0); }
    5% { clip: rect(52px, 9999px, 74px, 0); }
    10% { clip: rect(79px, 9999px, 85px, 0); }
    15% { clip: rect(75px, 9999px, 5px, 0); }
    20% { clip: rect(67px, 9999px, 61px, 0); }
    25% { clip: rect(14px, 9999px, 79px, 0); }
    30% { clip: rect(1px, 9999px, 66px, 0); }
    35% { clip: rect(86px, 9999px, 30px, 0); }
    40% { clip: rect(23px, 9999px, 98px, 0); }
    45% { clip: rect(98px, 9999px, 81px, 0); }
    50% { clip: rect(82px, 9999px, 55px, 0); }
    100% { clip: rect(48px, 9999px, 29px, 0); }
}

@keyframes glitch-skew {
    0% { transform: skew(0deg); }
    10% { transform: skew(-2deg); }
    20% { transform: skew(2deg); }
    30% { transform: skew(0deg); }
    40% { transform: skew(1deg); }
    50% { transform: skew(-1deg); }
    60% { transform: skew(0deg); }
    70% { transform: skew(-2deg); }
    80% { transform: skew(2deg); }
    90% { transform: skew(0deg); }
    100% { transform: skew(-1deg); }
}

/* ==================== NEON GLOW ==================== */
.neon-text {
    color: #fff;
    text-shadow:
        0 0 7px #fff,
        0 0 10px #fff,
        0 0 21px #fff,
        0 0 42px var(--primary),
        0 0 82px var(--primary),
        0 0 92px var(--primary),
        0 0 102px var(--primary),
        0 0 151px var(--primary);
    animation: neon-flicker 1.5s infinite alternate;
}

@keyframes neon-flicker {
    0%, 18%, 22%, 25%, 53%, 57%, 100% {
        text-shadow:
            0 0 4px #fff,
            0 0 11px #fff,
            0 0 19px #fff,
            0 0 40px var(--primary),
            0 0 80px var(--primary),
            0 0 90px var(--primary),
            0 0 100px var(--primary),
            0 0 150px var(--primary);
    }
    20%, 24%, 55% {
        text-shadow: none;
    }
}

/* ==================== GRADIENT ANIMATION ==================== */
.animated-gradient {
    background: linear-gradient(
        270deg,
        var(--primary),
        var(--secondary),
        var(--accent),
        var(--primary)
    );
    background-size: 400% 400%;
    animation: gradient-shift 15s ease infinite;
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ==================== SHAKE ANIMATION ==================== */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

.shake {
    animation: shake 0.5s;
}

/* ==================== BOUNCE ANIMATION ==================== */
@keyframes bounce-in {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.bounce-in {
    animation: bounce-in 0.6s ease-out;
}

/* ==================== SLIDE ANIMATIONS ==================== */
@keyframes slide-in-left {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slide-in-right {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slide-in-top {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slide-in-bottom {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.slide-in-left { animation: slide-in-left 0.5s ease-out; }
.slide-in-right { animation: slide-in-right 0.5s ease-out; }
.slide-in-top { animation: slide-in-top 0.5s ease-out; }
.slide-in-bottom { animation: slide-in-bottom 0.5s ease-out; }

/* ==================== ROTATE ANIMATION ==================== */
@keyframes rotate-center {
    0% { transform: rotate(0); }
    100% { transform: rotate(360deg); }
}

.rotate-center {
    animation: rotate-center 2s linear infinite;
}

/* ==================== SCALE ANIMATION ==================== */
@keyframes scale-up {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.scale-up {
    animation: scale-up 2s ease-in-out infinite;
}

/* ==================== FADE ANIMATIONS ==================== */
@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

.fade-in { animation: fade-in 0.5s ease-in; }
.fade-out { animation: fade-out 0.5s ease-out; }

/* ==================== FLIP ANIMATION ==================== */
@keyframes flip-horizontal {
    0% { transform: rotateY(0); }
    100% { transform: rotateY(360deg); }
}

@keyframes flip-vertical {
    0% { transform: rotateX(0); }
    100% { transform: rotateX(360deg); }
}

.flip-horizontal { animation: flip-horizontal 1s ease; }
.flip-vertical { animation: flip-vertical 1s ease; }

/* ==================== WOBBLE ANIMATION ==================== */
@keyframes wobble {
    0%, 100% { transform: translateX(0%); }
    15% { transform: translateX(-25%) rotate(-5deg); }
    30% { transform: translateX(20%) rotate(3deg); }
    45% { transform: translateX(-15%) rotate(-3deg); }
    60% { transform: translateX(10%) rotate(2deg); }
    75% { transform: translateX(-5%) rotate(-1deg); }
}

.wobble { animation: wobble 1s ease; }

/* ==================== HEARTBEAT ANIMATION ==================== */
@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    10%, 30% { transform: scale(0.9); }
    20%, 40%, 60%, 80% { transform: scale(1.1); }
    50%, 70% { transform: scale(1.05); }
}

.heartbeat { animation: heartbeat 1.3s ease-in-out infinite; }

/* ==================== RIPPLE EFFECT ==================== */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

.ripple-container {
    position: relative;
    overflow: hidden;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    animation: ripple 0.6s ease-out;
    pointer-events: none;
}

/* ==================== PARTICLE EFFECT ==================== */
@keyframes particle-float {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(50px) rotate(360deg);
        opacity: 0;
    }
}

.particle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 50%;
    animation: particle-float 10s linear infinite;
    opacity: 0.6;
}

/* ==================== HOVER EFFECTS ==================== */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.hover-grow {
    transition: transform 0.3s ease;
}

.hover-grow:hover {
    transform: scale(1.05);
}

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 30px var(--primary);
}

.hover-rotate {
    transition: transform 0.3s ease;
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

/* ==================== SCROLL ANIMATIONS ==================== */
.reveal {
    position: relative;
    transform: translateY(50px);
    opacity: 0;
    transition: all 0.8s ease;
}

.reveal.active {
    transform: translateY(0);
    opacity: 1;
}

/* ==================== CURSOR TRAIL EFFECT ==================== */
.cursor-trail {
    position: fixed;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    pointer-events: none;
    z-index: 9999;
    animation: cursor-fade 1s ease-out forwards;
}

@keyframes cursor-fade {
    to {
        transform: scale(2);
        opacity: 0;
    }
}

/* ==================== SKELETON LOADING ==================== */
@keyframes skeleton-loading {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.05) 25%, 
        rgba(255, 255, 255, 0.1) 50%, 
        rgba(255, 255, 255, 0.05) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
}

/* ==================== NOTIFICATION ANIMATIONS ==================== */
@keyframes notification-slide-in {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes notification-slide-out {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.notification {
    animation: notification-slide-in 0.5s ease-out;
}

.notification.removing {
    animation: notification-slide-out 0.5s ease-in forwards;
}

/* ==================== PROGRESS BAR ANIMATION ==================== */
@keyframes progress-bar {
    0% {
        width: 0%;
    }
    100% {
        width: 100%;
    }
}

.progress-bar {
    height: 4px;
    background: var(--gradient-primary);
    animation: progress-bar 2s ease-out;
}

/* ==================== MODAL ANIMATIONS ==================== */
@keyframes modal-fade-in {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes modal-fade-out {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

.modal-enter {
    animation: modal-fade-in 0.3s ease-out;
}

.modal-exit {
    animation: modal-fade-out 0.3s ease-in;
}

/* ==================== BACKGROUND ANIMATIONS ==================== */
@keyframes bg-pan {
    0% {
        background-position: 0% 0%;
    }
    100% {
        background-position: 100% 100%;
    }
}

.animated-bg {
    background-size: 200% 200%;
    animation: bg-pan 20s ease infinite;
}

/* ==================== UTILITY ANIMATIONS ==================== */
.no-animation {
    animation: none !important;
    transition: none !important;
}

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }

.duration-fast { animation-duration: 0.3s; }
.duration-normal { animation-duration: 0.5s; }
.duration-slow { animation-duration: 1s; }

.ease-in { animation-timing-function: ease-in; }
.ease-out { animation-timing-function: ease-out; }
.ease-in-out { animation-timing-function: ease-in-out; }
.linear { animation-timing-function: linear; }
