/* ===========================
   Keyframe Animations
   =========================== */

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

@keyframes scroll {
    0%, 100% {
        transform: translate(-50%, 0);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, 10px);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideLeft {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideRight {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

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

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

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

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

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

/* ===========================
   Animation Classes
   =========================== */

.fade-in {
    animation: fadeIn 1s ease-in;
}

.slide-up {
    animation: slideUp 0.8s ease-out;
}

.slide-down {
    animation: slideDown 0.8s ease-out;
}

.slide-left {
    animation: slideLeft 0.8s ease-out;
}

.slide-right {
    animation: slideRight 0.8s ease-out;
}

.bounce-in {
    animation: bounceIn 1s ease-out;
}

.zoom-in {
    animation: zoomIn 0.6s ease-out;
}

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

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

/* Animation Delays */
.delay-1 {
    animation-delay: 0.2s;
}

.delay-2 {
    animation-delay: 0.4s;
}

.delay-3 {
    animation-delay: 0.6s;
}

.delay-4 {
    animation-delay: 0.8s;
}

.delay-5 {
    animation-delay: 1s;
}

/* ===========================
   Scroll Animations
   =========================== */

.animate-on-scroll {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease-out;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Different animation types for scroll */
.animate-on-scroll.fade-left {
    transform: translateX(-50px);
}

.animate-on-scroll.fade-left.animated {
    transform: translateX(0);
}

.animate-on-scroll.fade-right {
    transform: translateX(50px);
}

.animate-on-scroll.fade-right.animated {
    transform: translateX(0);
}

.animate-on-scroll.zoom {
    transform: scale(0.8);
}

.animate-on-scroll.zoom.animated {
    transform: scale(1);
}

/* ===========================
   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(255, 122, 0, 0.3);
}

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

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

.hover-tilt:hover {
    transform: perspective(1000px) rotateY(10deg);
}

/* ===========================
   Loading Animations
   =========================== */

.skeleton {
    background: linear-gradient(90deg,
        #f0f0f0 0%,
        #e0e0e0 50%,
        #f0f0f0 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 122, 0, 0.2);
    border-top-color: #ff7a00;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.dots {
    display: flex;
    gap: 8px;
}

.dot {
    width: 12px;
    height: 12px;
    background-color: #ff7a00;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
}

.dot:nth-child(1) {
    animation-delay: -0.32s;
}

.dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ===========================
   Particle Effect
   =========================== */

.particle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    pointer-events: none;
}

@keyframes float-particle {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(var(--drift));
        opacity: 0;
    }
}

/* ===========================
   Text Effects
   =========================== */

.text-gradient {
    background: linear-gradient(135deg, #ff7a00, #ff9933, #ffb366);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient 3s ease infinite;
}

.text-shadow-glow {
    text-shadow:
        0 0 10px rgba(255, 122, 0, 0.5),
        0 0 20px rgba(255, 122, 0, 0.3),
        0 0 30px rgba(255, 122, 0, 0.2);
}

.typing-effect {
    overflow: hidden;
    border-right: 2px solid #ff7a00;
    white-space: nowrap;
    animation: typing 3.5s 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: #ff7a00;
    }
}

/* ===========================
   Button Effects
   =========================== */

.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 50%;
    left: 50%;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.6s;
}

.ripple:active::after {
    transform: translate(-50%, -50%) scale(2);
    transition: transform 0s;
}

/* ===========================
   Reveal Animations
   =========================== */

.reveal-left {
    clip-path: inset(0 100% 0 0);
    animation: revealLeft 1s ease-out forwards;
}

@keyframes revealLeft {
    to {
        clip-path: inset(0 0 0 0);
    }
}

.reveal-right {
    clip-path: inset(0 0 0 100%);
    animation: revealRight 1s ease-out forwards;
}

@keyframes revealRight {
    to {
        clip-path: inset(0 0 0 0);
    }
}

.reveal-up {
    clip-path: inset(100% 0 0 0);
    animation: revealUp 1s ease-out forwards;
}

@keyframes revealUp {
    to {
        clip-path: inset(0 0 0 0);
    }
}

/* ===========================
   Counter Animation
   =========================== */

.counter {
    transition: all 0.5s ease;
}

/* ===========================
   Smooth Transitions
   =========================== */

.smooth-transition {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.smooth-scale {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ===========================
   Parallax Effect
   =========================== */

.parallax {
    transition: transform 0.1s ease-out;
}

/* ===========================
   Stagger Animation
   =========================== */

.stagger-animation > * {
    animation: fadeIn 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; }
.stagger-animation > *:nth-child(7) { animation-delay: 0.7s; }
.stagger-animation > *:nth-child(8) { animation-delay: 0.8s; }

/* ===========================
   Performance Optimization
   =========================== */

.gpu-accelerated {
    transform: translateZ(0);
    will-change: transform;
}

.reduce-motion {
    animation: none !important;
    transition: none !important;
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
