/* ============================================
   ANIMATIONS.CSS - Motion Design System
   Premium Animation Library
   ============================================ */

/* ============================================
   KEYFRAME ANIMATIONS
   ============================================ */

/* Glow Pulse */
@keyframes glowPulse {

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

    50% {
        box-shadow: 0 0 40px rgba(255, 106, 0, 0.5), 0 0 60px rgba(255, 106, 0, 0.3);
    }
}

/* Text Glow */
@keyframes textGlow {

    0%,
    100% {
        text-shadow: 0 0 10px rgba(255, 106, 0, 0.3);
    }

    50% {
        text-shadow: 0 0 20px rgba(255, 106, 0, 0.5), 0 0 30px rgba(255, 106, 0, 0.3);
    }
}

/* Fade In Up */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

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

/* Fade In Down */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-40px);
    }

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

/* Fade In Left */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }

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

/* Fade In Right */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }

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

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

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

/* Rotate In */
@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-10deg) scale(0.9);
    }

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

/* Float */
@keyframes float {

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

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

/* Float Horizontal */
@keyframes floatHorizontal {

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

    50% {
        transform: translateX(20px);
    }
}

/* Spin Slow */
@keyframes spinSlow {
    from {
        transform: rotate(0deg);
    }

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

/* Pulse */
@keyframes pulse {

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

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

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

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

/* Bounce */
@keyframes bounce {

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

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

    70% {
        animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
        transform: translateY(-8px);
    }

    80% {
        transform: translateY(0);
    }

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

/* Slide In From Bottom */
@keyframes slideInBottom {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

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

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

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

/* Morphing Shape */
@keyframes morphShape {

    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% 40% 60% / 30% 60% 60% 40%;
    }

    75% {
        border-radius: 60% 30% 60% 50% / 60% 40% 50% 60%;
    }
}

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

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

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

/* Line Draw */
@keyframes lineDraw {
    from {
        stroke-dashoffset: 1000;
    }

    to {
        stroke-dashoffset: 0;
    }
}

/* ============================================
   ANIMATION CLASSES
   ============================================ */

/* Glow Effects */
.animate-glow {
    animation: glowPulse 2s ease-in-out infinite;
}

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

/* Fade Animations */
.animate-fade-in-up {
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-fade-in-down {
    animation: fadeInDown 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-fade-in-right {
    animation: fadeInRight 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Scale & Rotate */
.animate-scale-in {
    animation: scaleIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-rotate-in {
    animation: rotateIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.animate-float-horizontal {
    animation: floatHorizontal 8s ease-in-out infinite;
}

/* Spin */
.animate-spin-slow {
    animation: spinSlow 20s linear infinite;
}

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

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

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

/* Morph */
.animate-morph {
    animation: morphShape 8s ease-in-out infinite;
}

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

/* ============================================
   ANIMATION DELAYS
   ============================================ */
.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;
}

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

.delay-700 {
    animation-delay: 0.7s;
}

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

.delay-900 {
    animation-delay: 0.9s;
}

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

/* ============================================
   ANIMATION DURATIONS
   ============================================ */
.duration-200 {
    animation-duration: 0.2s;
}

.duration-300 {
    animation-duration: 0.3s;
}

.duration-400 {
    animation-duration: 0.4s;
}

.duration-500 {
    animation-duration: 0.5s;
}

.duration-600 {
    animation-duration: 0.6s;
}

.duration-800 {
    animation-duration: 0.8s;
}

.duration-1000 {
    animation-duration: 1s;
}

/* ============================================
   HOVER TRANSITIONS
   ============================================ */

/* Lift on hover */
.hover-lift {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Scale on hover */
.hover-scale {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Glow on hover */
.hover-glow {
    transition: box-shadow 0.3s ease;
}

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

/* Border glow on hover */
.hover-border-glow {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid transparent;
}

.hover-border-glow:hover {
    border-color: var(--orange);
    box-shadow: 0 0 20px rgba(255, 106, 0, 0.3);
}

/* Icon rotation on hover */
.hover-rotate-icon .icon {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Text underline animation */
.hover-underline {
    position: relative;
}

.hover-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--orange);
    transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.hover-underline:hover::after {
    width: 100%;
}

/* ============================================
   SCROLL-TRIGGERED ANIMATION STATES
   GSAP handles all opacity/transform states via fromTo()
   No CSS hiding needed - prevents conflicts
   ============================================ */

/* Visible state marker (optional, for CSS-only fallback) */
[data-animate].is-visible {
    opacity: 1 !important;
    transform: none !important;
}

/* ============================================
   STAGGER ANIMATION HELPER
   (For text word-by-word animations)
   ============================================ */
.stagger-text .word,
.stagger-text .char {
    display: inline-block;
}

.stagger-text.is-visible .word,
.stagger-text.is-visible .char {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   LOADING / SKELETON STATES
   ============================================ */
.skeleton {
    background: linear-gradient(90deg,
            var(--black-light) 25%,
            rgba(255, 255, 255, 0.05) 50%,
            var(--black-light) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
}

.skeleton-title {
    height: 2em;
    width: 60%;
}

.skeleton-circle {
    border-radius: 50%;
}

/* ============================================
   PAGE TRANSITION OVERLAY
   ============================================ */
.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--black);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.page-transition.active {
    opacity: 1;
    pointer-events: all;
}

.page-transition .loader {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(255, 106, 0, 0.2);
    border-top-color: var(--orange);
    border-radius: 50%;
    animation: spinSlow 1s linear infinite;
}

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