/* assets/css/animations.css */

/* ============================================
   COOL ANIMATIONS FOR YOUNG & TRENDY AESTHETIC
   ============================================ */

/* Sparkle Animation */
@keyframes sparkle {
    0%, 100% { 
        opacity: 0; 
        transform: scale(0) rotate(0deg);
    }
    50% { 
        opacity: 1; 
        transform: scale(1) rotate(180deg);
    }
}

/* Neon Glow Pulse */
@keyframes neonPulse {
    0%, 100% {
        box-shadow: 0 0 5px rgba(244, 63, 94, 0.5),
                    0 0 10px rgba(244, 63, 94, 0.3),
                    0 0 20px rgba(244, 63, 94, 0.2);
    }
    50% {
        box-shadow: 0 0 10px rgba(244, 63, 94, 0.8),
                    0 0 20px rgba(244, 63, 94, 0.5),
                    0 0 40px rgba(244, 63, 94, 0.3);
    }
}

/* Gradient Border Animation */
@keyframes gradientBorder {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Wiggle / Shake */
@keyframes wiggle {
    0%, 100% { transform: rotate(-3deg); }
    50% { transform: rotate(3deg); }
}

/* Heartbeat */
@keyframes heartbeat {
    0% { transform: scale(1); }
    14% { transform: scale(1.1); }
    28% { transform: scale(1); }
    42% { transform: scale(1.1); }
    70% { transform: scale(1); }
}

/* Squeeze */
@keyframes squeeze {
    0%, 100% { transform: scaleX(1); }
    50% { transform: scaleX(0.95); }
}

/* Pop */
@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Slide Up Bounce */
@keyframes slideUpBounce {
    0% {
        opacity: 0;
        transform: translateY(50px);
    }
    60% {
        opacity: 1;
        transform: translateY(-10px);
    }
    80% {
        transform: translateY(5px);
    }
    100% {
        transform: translateY(0);
    }
}

/* Rubber Band */
@keyframes rubberBand {
    0% { transform: scale(1, 1); }
    30% { transform: scale(1.25, 0.75); }
    40% { transform: scale(0.75, 1.25); }
    50% { transform: scale(1.15, 0.85); }
    65% { transform: scale(0.95, 1.05); }
    75% { transform: scale(1.05, 0.95); }
    100% { transform: scale(1, 1); }
}

/* Zoom In */
@keyframes zoomIn {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Rotate In */
@keyframes rotateIn {
    0% {
        opacity: 0;
        transform: rotate(-180deg) scale(0.5);
    }
    100% {
        opacity: 1;
        transform: rotate(0deg) scale(1);
    }
}

/* Focus Pulse */
@keyframes focusPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(244, 63, 94, 0);
    }
}

/* Moving Gradient Background */
@keyframes movingGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Float with Rotation */
@keyframes floatWiggle {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-15px) rotate(5deg);
    }
    50% {
        transform: translateY(0) rotate(0deg);
    }
    75% {
        transform: translateY(-10px) rotate(-5deg);
    }
}

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

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

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

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

@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 scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

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

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

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

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

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(79, 70, 229, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(79, 70, 229, 0.6);
    }
}

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

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

@keyframes floatRotate {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-10px) rotate(5deg);
    }
    50% {
        transform: translateY(-20px) rotate(0deg);
    }
    75% {
        transform: translateY(-10px) rotate(-5deg);
    }
}

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

@keyframes wave {
    0% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(5px);
    }
    50% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
    100% {
        transform: translateX(0);
    }
}

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

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

@keyframes blob {
    0% {
        transform: translate(0px, 0px) scale(1);
    }
    33% {
        transform: translate(30px, -50px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
    100% {
        transform: translate(0px, 0px) scale(1);
    }
}

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

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

/* Animation Classes */
.animate-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

.animate-fade-in-down {
    animation: fadeInDown 0.6s ease-out forwards;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.6s ease-out forwards;
}

.animate-fade-in-right {
    animation: fadeInRight 0.6s ease-out forwards;
}

.animate-scale-in {
    animation: scaleIn 0.4s ease-out forwards;
}

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

.animate-bounce-in {
    animation: bounceIn 0.6s ease-out forwards;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

.animate-pulse-glow {
    animation: pulseGlow 2s infinite;
}

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

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

.animate-float-rotate {
    animation: floatRotate 8s ease-in-out infinite;
}

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

.animate-wave {
    animation: wave 1s ease-in-out;
}

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

.animate-blob {
    animation: blob 7s infinite;
}

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

.animate-ripple::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 50%;
    left: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 60%);
    transform: translate(-50%, -50%) scale(0);
    animation: ripple 0.6s ease-out;
}

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

/* Duration Classes */
.duration-fast { animation-duration: 0.15s; }
.duration-normal { animation-duration: 0.3s; }
.duration-slow { animation-duration: 0.5s; }
.duration-slower { animation-duration: 0.8s; }

/* Hover Animations */
.hover-lift {
    transition: transform var(--transition-normal);
}

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

.hover-scale {
    transition: transform var(--transition-normal);
}

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

.hover-glow {
    transition: box-shadow var(--transition-normal);
}

.hover-glow:hover {
    box-shadow: var(--shadow-glow);
}

.hover-float {
    transition: transform var(--transition-normal);
}

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

/* Icon Animations */
.icon-spin:hover {
    animation: spin 1s linear infinite;
}

.icon-bounce:hover {
    animation: bounce 0.5s ease-out;
}

.icon-pulse:hover {
    animation: pulse 1s ease-in-out infinite;
}

/* Page Transitions */
.page-enter {
    opacity: 0;
    transform: translateY(20px);
}

.page-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.page-exit {
    opacity: 1;
}

.page-exit-active {
    opacity: 0;
    transition: opacity 0.3s ease-in;
}

/* Loading Skeleton Animation */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--color-gray-200) 25%,
        var(--color-gray-100) 50%,
        var(--color-gray-200) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

/* Gradient Text Animation */
.gradient-animate {
    background: linear-gradient(
        -45deg,
        var(--color-primary-600),
        var(--color-accent-600),
        var(--color-pink-500),
        var(--color-primary-600)
    );
    background-size: 400% 400%;
    animation: gradientShift 5s ease infinite;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Floating Elements Animation */
.floating-element {
    animation: float 6s ease-in-out infinite;
}

.floating-element:nth-child(2) {
    animation-delay: -2s;
}

.floating-element:nth-child(3) {
    animation-delay: -4s;
}

/* Card Hover Animation */
.card-hover {
    transition: all var(--transition-normal);
}

.card-hover:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
}

/* Button Press Animation */
.btn-press {
    transition: transform var(--transition-fast);
}

.btn-press:active {
    transform: scale(0.95);
}

/* Notification Badge Animation */
.badge-pulse {
    animation: pulseGlow 2s infinite;
}

/* Loading Spinner */
.spinner-circle {
    border: 3px solid var(--color-gray-200);
    border-top-color: var(--color-primary-600);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Success Checkmark Animation */
.checkmark-draw {
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
    animation: drawCheck 0.5s ease-out forwards;
}

@keyframes drawCheck {
    to {
        stroke-dashoffset: 0;
    }
}

/* Parallax Background */
.parallax-bg {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

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

/* Sparkle */
.animate-sparkle {
    animation: sparkle 1.5s ease-in-out infinite;
}

/* Neon Glow */
.animate-neon {
    animation: neonPulse 2s ease-in-out infinite;
}

/* Gradient Border */
.gradient-border {
    position: relative;
    background: var(--bg-surface);
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: inherit;
    background: linear-gradient(135deg, #f43f5e, #a855f7, #14b8a6, #f43f5e);
    background-size: 300% 300%;
    animation: movingGradient 3s ease infinite;
    z-index: -1;
    border-radius: calc(var(--radius-2xl) + 3px);
}

/* Wiggle */
.animate-wiggle {
    animation: wiggle 0.5s ease-in-out;
}

/* Heartbeat */
.animate-heartbeat {
    animation: heartbeat 1.5s ease-in-out infinite;
}

/* Squeeze */
.animate-squeeze {
    animation: squeeze 0.3s ease-in-out;
}

/* Pop */
.animate-pop {
    animation: pop 0.3s ease-out;
}

/* Slide Up Bounce */
.animate-slide-up {
    animation: slideUpBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

/* Rubber Band */
.animate-rubber {
    animation: rubberBand 0.8s ease-out;
}

/* Zoom In */
.animate-zoom-in {
    animation: zoomIn 0.4s ease-out forwards;
}

/* Rotate In */
.animate-rotate-in {
    animation: rotateIn 0.5s ease-out forwards;
}

/* Focus Pulse for Inputs */
.input-pulse:focus {
    animation: focusPulse 1.5s ease-out infinite;
}

/* Morphing Blob */
.animate-morph {
    animation: morphBlob 8s ease-in-out infinite;
}

/* Float Wiggle */
.animate-float-wiggle {
    animation: floatWiggle 4s ease-in-out infinite;
}

/* Glitch Effect */
.animate-glitch:hover {
    animation: glitch 0.3s ease-in-out;
}

/* Stagger Children Animation */
.stagger-children > * {
    opacity: 0;
    animation: slideUpBounce 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

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

/* Hover Effects */
.hover-wiggle:hover {
    animation: wiggle 0.4s ease-in-out;
}

.hover-pop:hover {
    animation: pop 0.3s ease-out;
}

.hover-heartbeat:hover {
    animation: heartbeat 0.8s ease-in-out;
}

.hover-neon:hover {
    animation: neonPulse 1s ease-in-out;
}

/* Icon Animations */
.icon-snap:hover {
    animation: rubberBand 0.3s ease-out;
}

/* Button Micro-interactions */
.btn-bounce:active {
    animation: pop 0.15s ease-out;
}

.btn-wiggle:hover {
    animation: wiggle 0.4s ease-in-out;
}

/* Input Focus Glow */
.input-glow:focus {
    box-shadow: 0 0 0 4px rgba(244, 63, 94, 0.15),
                0 0 20px rgba(244, 63, 94, 0.1);
    border-color: var(--color-primary-500);
}

/* Link Hover Underline Animation */
.link-underline {
    position: relative;
}

.link-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #f43f5e, #a855f7);
    transition: width 0.3s ease;
}

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

/* Loading Dots Animation */
.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

/* ============================================
   RESPONSIVE ANIMATIONS
   ============================================ */

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
