/* ==========================================
   ANIMATIONS & EFFECTS
   ========================================== */

/* AOS (Animate On Scroll) Styles */
[data-aos] {
    opacity: 0;
    transition-property: opacity, transform;
    transition-duration: 0.6s;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

[data-aos].aos-animate {
    opacity: 1;
}

[data-aos="fade-up"] {
    transform: translateY(50px);
}

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

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

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

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

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

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

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

[data-aos="zoom-in"] {
    transform: scale(0.8);
}

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

[data-aos-delay="100"] {
    transition-delay: 0.1s;
}

[data-aos-delay="200"] {
    transition-delay: 0.2s;
}

[data-aos-delay="300"] {
    transition-delay: 0.3s;
}

/* ==========================================
   FLOATING ANIMATION
   ========================================== */

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

.float-animation {
    animation: float 3s ease-in-out infinite;
}

/* ==========================================
   PULSE ANIMATION
   ========================================== */

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

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

/* ==========================================
   SLIDE IN ANIMATIONS
   ========================================== */

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

/* ==========================================
   SCALE ANIMATIONS
   ========================================== */

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

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

/* ==========================================
   ROTATE ANIMATIONS
   ========================================== */

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

@keyframes rotateIn {
    from {
        transform: rotate(-200deg) scale(0);
        opacity: 0;
    }
    to {
        transform: rotate(0) scale(1);
        opacity: 1;
    }
}

/* ==========================================
   BOUNCE ANIMATIONS
   ========================================== */

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ==========================================
   SHAKE ANIMATION
   ========================================== */

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

/* ==========================================
   GLOW ANIMATION
   ========================================== */

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(255,107,53,0.5),
                    0 0 10px rgba(255,107,53,0.3),
                    0 0 15px rgba(255,107,53,0.1);
    }
    50% {
        box-shadow: 0 0 10px rgba(255,107,53,0.8),
                    0 0 20px rgba(255,107,53,0.6),
                    0 0 30px rgba(255,107,53,0.4);
    }
}

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

/* ==========================================
   GRADIENT ANIMATION
   ========================================== */

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

.gradient-animation {
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

/* ==========================================
   PARTICLES ANIMATION
   ========================================== */

@keyframes particleFloat {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(50px);
        opacity: 0;
    }
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
    animation: particleFloat linear infinite;
}

/* ==========================================
   RIPPLE EFFECT
   ========================================== */

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    animation: ripple 0.6s ease-out;
}

/* ==========================================
   TEXT EFFECTS
   ========================================== */

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

@keyframes blink {
    50% {
        border-color: transparent;
    }
}

.typewriter-text {
    overflow: hidden;
    border-right: 2px solid;
    white-space: nowrap;
    animation: typewriter 3s steps(40) 1s 1 normal both,
               blink 0.75s step-end infinite;
}

/* ==========================================
   SHINE EFFECT
   ========================================== */

@keyframes shine {
    0% {
        left: -100%;
    }
    20%, 100% {
        left: 100%;
    }
}

.shine-effect {
    position: relative;
    overflow: hidden;
}

.shine-effect::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent,
        rgba(255,255,255,0.3),
        transparent);
    animation: shine 3s infinite;
}

/* ==========================================
   LOADING ANIMATIONS
   ========================================== */

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    border: 4px solid rgba(255,255,255,0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spinner 0.8s linear infinite;
}

@keyframes dots {
    0%, 20% {
        color: rgba(255,255,255,0.2);
        text-shadow: .25em 0 0 rgba(255,255,255,0.2),
                     .5em 0 0 rgba(255,255,255,0.2);
    }
    40% {
        color: white;
        text-shadow: .25em 0 0 rgba(255,255,255,0.2),
                     .5em 0 0 rgba(255,255,255,0.2);
    }
    60% {
        text-shadow: .25em 0 0 white,
                     .5em 0 0 rgba(255,255,255,0.2);
    }
    80%, 100% {
        text-shadow: .25em 0 0 white,
                     .5em 0 0 white;
    }
}

.loading-dots::after {
    content: ' .';
    animation: dots 2s steps(5, end) infinite;
}

/* ==========================================
   PARALLAX EFFECT
   ========================================== */

.parallax {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* ==========================================
   HOVER EFFECTS
   ========================================== */

.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.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.5s ease;
}

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

.hover-skew {
    transition: transform 0.3s ease;
}

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

/* ==========================================
   BORDER ANIMATIONS
   ========================================== */

@keyframes borderPulse {
    0%, 100% {
        border-color: var(--primary-color);
    }
    50% {
        border-color: var(--secondary-color);
    }
}

.border-pulse {
    animation: borderPulse 2s ease-in-out infinite;
}

@keyframes borderGrow {
    0% {
        border-width: 2px;
    }
    50% {
        border-width: 4px;
    }
    100% {
        border-width: 2px;
    }
}

.border-grow {
    animation: borderGrow 1.5s ease-in-out infinite;
}

/* ==========================================
   BACKGROUND ANIMATIONS
   ========================================== */

@keyframes bgPulse {
    0%, 100% {
        background-color: var(--primary-color);
    }
    50% {
        background-color: var(--primary-light);
    }
}

.bg-pulse {
    animation: bgPulse 3s ease-in-out infinite;
}

/* ==========================================
   NUMBER COUNTER ANIMATION
   ========================================== */

.counter {
    transition: all 0.5s ease;
}

/* ==========================================
   MORPHING ANIMATION
   ========================================== */

@keyframes morph {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
    25% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
    50% {
        border-radius: 50% 60% 30% 60% / 30% 60% 70% 40%;
    }
    75% {
        border-radius: 60% 40% 60% 40% / 70% 30% 50% 60%;
    }
}

.morph-animation {
    animation: morph 8s ease-in-out infinite;
}

/* ==========================================
   WAVE ANIMATION
   ========================================== */

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

.wave {
    animation: wave 10s cubic-bezier(0.36, 0.45, 0.63, 0.53) infinite;
}

/* ==========================================
   GLITCH EFFECT
   ========================================== */

@keyframes glitch {
    0% {
        transform: translate(0);
    }
    20% {
        transform: translate(-2px, 2px);
    }
    40% {
        transform: translate(-2px, -2px);
    }
    60% {
        transform: translate(2px, 2px);
    }
    80% {
        transform: translate(2px, -2px);
    }
    100% {
        transform: translate(0);
    }
}

.glitch:hover {
    animation: glitch 0.3s infinite;
}

/* ==========================================
   STAGGER ANIMATIONS
   ========================================== */

.stagger-animation > * {
    animation: fadeInUp 0.6s ease-out backwards;
}

.stagger-animation > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-animation > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-animation > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-animation > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-animation > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-animation > *:nth-child(6) { animation-delay: 0.6s; }

/* ==========================================
   PAGE TRANSITIONS
   ========================================== */

.page-transition {
    animation: fadeIn 0.5s ease-in-out;
}

/* ==========================================
   SCROLL ANIMATIONS
   ========================================== */

.scroll-reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================
   UTILITY CLASSES
   ========================================== */

.animate-once {
    animation-iteration-count: 1 !important;
}

.animate-twice {
    animation-iteration-count: 2 !important;
}

.animate-infinite {
    animation-iteration-count: infinite !important;
}

.animation-delay-1 { animation-delay: 0.1s !important; }
.animation-delay-2 { animation-delay: 0.2s !important; }
.animation-delay-3 { animation-delay: 0.3s !important; }
.animation-delay-4 { animation-delay: 0.4s !important; }
.animation-delay-5 { animation-delay: 0.5s !important; }

.animation-fast {
    animation-duration: 0.3s !important;
}

.animation-normal {
    animation-duration: 0.6s !important;
}

.animation-slow {
    animation-duration: 1s !important;
}

.animation-slower {
    animation-duration: 2s !important;
}

/* ==========================================
   3D TRANSFORMS
   ========================================== */

.transform-3d {
    transform-style: preserve-3d;
    perspective: 1000px;
}

.flip-card {
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flip-card:hover {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    backface-visibility: hidden;
}

.flip-card-back {
    transform: rotateY(180deg);
}
