/**
 * FLARE CUSTOM - Premium Animations
 * Modern, smooth, performant animations
 * Version 3.0 - Complete Redesign
 */

/* ============================================
   FADE ANIMATIONS - Smooth & Elegant
   ============================================ */

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

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

@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 fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ============================================
   SLIDE ANIMATIONS - Fluid Motion
   ============================================ */

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

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

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

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

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

@keyframes slideOutRight {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(100%);
    }
}

/* ============================================
   SCALE ANIMATIONS - Premium Feel
   ============================================ */

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

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

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

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    70% {
        transform: scale(1.02);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes elasticIn {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    70% {
        transform: scale(1.05);
    }
    85% {
        transform: scale(0.98);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============================================
   PULSE & GLOW - Attention Grabbing
   ============================================ */

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

@keyframes pulseSoft {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(255, 61, 0, 0.5);
    }
    50% {
        box-shadow: 0 0 30px rgba(255, 61, 0, 0.8), 0 0 50px rgba(255, 61, 0, 0.3);
    }
}

@keyframes glowPrimary {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 61, 0, 0.5);
    }
    50% {
        box-shadow: 0 0 0 15px rgba(255, 61, 0, 0);
    }
}

@keyframes glowCyan {
    0%, 100% {
        box-shadow: 0 0 5px rgba(0, 212, 255, 0.5);
    }
    50% {
        box-shadow: 0 0 30px rgba(0, 212, 255, 0.8), 0 0 50px rgba(0, 212, 255, 0.3);
    }
}

@keyframes breathe {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 8px 24px rgba(255, 61, 0, 0.2);
    }
    50% {
        transform: scale(1.01);
        box-shadow: 0 12px 32px rgba(255, 61, 0, 0.3);
    }
}

/* ============================================
   BOUNCE ANIMATIONS - Playful Energy
   ============================================ */

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
        animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
    }
    50% {
        transform: translateY(-15px);
        animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
    }
}

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

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

@keyframes bounceHorizontal {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(5px);
    }
}

/* ============================================
   ROTATE & SPIN - Dynamic Motion
   ============================================ */

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

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

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

@keyframes swing {
    20% {
        transform: rotate(10deg);
    }
    40% {
        transform: rotate(-8deg);
    }
    60% {
        transform: rotate(5deg);
    }
    80% {
        transform: rotate(-3deg);
    }
    100% {
        transform: rotate(0deg);
    }
}

/* ============================================
   SHAKE ANIMATIONS - Attention & Error
   ============================================ */

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

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

@keyframes wiggle {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-4deg);
    }
    75% {
        transform: rotate(4deg);
    }
}

/* ============================================
   SKELETON & LOADING
   ============================================ */

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

@keyframes skeleton {
    0% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.5;
    }
}

@keyframes loadingDots {
    0%, 20% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 0.5;
    }
}

@keyframes progressIndeterminate {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(400%);
    }
}

/* ============================================
   SPECIAL EFFECTS - Premium Visual
   ============================================ */

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    33% {
        transform: translateY(-8px) rotate(1deg);
    }
    66% {
        transform: translateY(-4px) rotate(-1deg);
    }
}

@keyframes floatShadow {
    0%, 100% {
        transform: translateY(0);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    }
    50% {
        transform: translateY(-10px);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    }
}

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

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

@keyframes shine {
    0% {
        transform: translateX(-100%) skewX(-15deg);
    }
    100% {
        transform: translateX(200%) skewX(-15deg);
    }
}

@keyframes reveal {
    from {
        clip-path: inset(0 100% 0 0);
    }
    to {
        clip-path: inset(0 0 0 0);
    }
}

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

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

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

@keyframes blink {
    0%, 50%, 100% {
        opacity: 1;
    }
    25%, 75% {
        opacity: 0;
    }
}

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

@keyframes ping {
    75%, 100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* ============================================
   ENTRANCE ANIMATIONS - Page Load
   ============================================ */

@keyframes heroReveal {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes staggerIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes cardReveal {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

.animate-fade-in {
    animation: fadeIn 400ms var(--ease-out) forwards;
}

.animate-fade-in-up {
    animation: fadeInUp 600ms var(--ease-out) forwards;
}

.animate-fade-in-down {
    animation: fadeInDown 600ms var(--ease-out) forwards;
}

.animate-fade-in-left {
    animation: fadeInLeft 600ms var(--ease-out) forwards;
}

.animate-fade-in-right {
    animation: fadeInRight 600ms var(--ease-out) forwards;
}

.animate-fade-in-scale {
    animation: fadeInScale 500ms var(--ease-spring) forwards;
}

.animate-slide-up {
    animation: slideUp 500ms var(--ease-out) forwards;
}

.animate-scale-in {
    animation: scaleIn 400ms var(--ease-spring) forwards;
}

.animate-elastic-in {
    animation: elasticIn 700ms var(--ease-out) forwards;
}

.animate-pop-in {
    animation: popIn 500ms var(--ease-spring) forwards;
}

.animate-pulse {
    animation: pulse 2s var(--ease-in-out) infinite;
}

.animate-breathe {
    animation: breathe 3s var(--ease-in-out) infinite;
}

.animate-bounce {
    animation: bounce 1s var(--ease-in-out) infinite;
}

.animate-bounce-light {
    animation: bounceLight 2s var(--ease-in-out) infinite;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

.animate-spin-slow {
    animation: spinSlow 3s linear infinite;
}

.animate-float {
    animation: float 4s var(--ease-in-out) infinite;
}

.animate-float-shadow {
    animation: floatShadow 4s var(--ease-in-out) infinite;
}

.animate-glow {
    animation: glow 2s var(--ease-in-out) infinite;
}

.animate-glow-cyan {
    animation: glowCyan 2s var(--ease-in-out) infinite;
}

.animate-shimmer {
    background: linear-gradient(
        90deg,
        var(--color-gray-200) 0%,
        var(--color-gray-100) 20%,
        var(--color-gray-200) 40%,
        var(--color-gray-200) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

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

.animate-hero-reveal {
    animation: heroReveal 800ms var(--ease-out) forwards;
}

.animate-card-reveal {
    animation: cardReveal 600ms var(--ease-out) forwards;
}

/* Shine effect on hover */
.animate-shine {
    position: relative;
    overflow: hidden;
}

.animate-shine::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        110deg,
        transparent 20%,
        rgba(255, 255, 255, 0.2) 40%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0.2) 60%,
        transparent 80%
    );
    transform: translateX(-100%) skewX(-15deg);
    transition: none;
}

.animate-shine:hover::after {
    animation: shine 0.8s ease-out;
}

/* Animation delays */
.animate-delay-75 { animation-delay: 75ms; }
.animate-delay-100 { animation-delay: 100ms; }
.animate-delay-150 { animation-delay: 150ms; }
.animate-delay-200 { animation-delay: 200ms; }
.animate-delay-300 { animation-delay: 300ms; }
.animate-delay-400 { animation-delay: 400ms; }
.animate-delay-500 { animation-delay: 500ms; }
.animate-delay-700 { animation-delay: 700ms; }
.animate-delay-1000 { animation-delay: 1000ms; }

/* Stagger animation for lists */
.animate-stagger > * {
    opacity: 0;
    animation: staggerIn 500ms var(--ease-out) forwards;
}

.animate-stagger > *:nth-child(1) { animation-delay: 0ms; }
.animate-stagger > *:nth-child(2) { animation-delay: 75ms; }
.animate-stagger > *:nth-child(3) { animation-delay: 150ms; }
.animate-stagger > *:nth-child(4) { animation-delay: 225ms; }
.animate-stagger > *:nth-child(5) { animation-delay: 300ms; }
.animate-stagger > *:nth-child(6) { animation-delay: 375ms; }
.animate-stagger > *:nth-child(7) { animation-delay: 450ms; }
.animate-stagger > *:nth-child(8) { animation-delay: 525ms; }
.animate-stagger > *:nth-child(9) { animation-delay: 600ms; }
.animate-stagger > *:nth-child(10) { animation-delay: 675ms; }

/* Pause animation on hover */
.animate-pause-hover:hover {
    animation-play-state: paused;
}

/* Running state control */
.animate-running {
    animation-play-state: running;
}

.animate-paused {
    animation-play-state: paused;
}

/* Reduced motion support */
@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;
    }

    .animate-stagger > * {
        opacity: 1;
        animation: none;
    }
}
