/**
 * Animations CSS
 * Additional animations and transitions for enhanced UX
 */

/* ============================================
   FADE IN ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

/* ============================================
   SLIDE ANIMATIONS
   ============================================ */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

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

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

/* ============================================
   SCALE ANIMATIONS
   ============================================ */
@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 pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* ============================================
   BOUNCE ANIMATIONS
   ============================================ */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

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

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

/* ============================================
   SPIN/ROTATE ANIMATIONS
   ============================================ */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

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

/* ============================================
   SHIMMER EFFECT
   ============================================ */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.shimmer {
    animation: shimmer 2s infinite;
    background: linear-gradient(
        to right,
        #f0f0f0 0%,
        #f8f8f8 50%,
        #f0f0f0 100%
    );
    background-size: 1000px 100%;
}

/* ============================================
   RIPPLE EFFECT (for button clicks)
   ============================================ */
@keyframes ripple {
    from {
        opacity: 1;
        transform: scale(0);
    }
    to {
        opacity: 0;
        transform: scale(4);
    }
}

/* ============================================
   GLOW EFFECT
   ============================================ */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(26, 172, 184, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(26, 172, 184, 0.8);
    }
}

/* ============================================
   UTILITY ANIMATION CLASSES
   ============================================ */
.animate-fadeIn {
    animation: fadeIn 0.5s ease-out;
}

.animate-fadeInUp {
    animation: fadeInUp 0.5s ease-out;
}

.animate-fadeInDown {
    animation: fadeInDown 0.5s ease-out;
}

.animate-slideInLeft {
    animation: slideInLeft 0.4s ease-out;
}

.animate-slideInRight {
    animation: slideInRight 0.4s ease-out;
}

.animate-scaleIn {
    animation: scaleIn 0.3s ease-out;
}

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

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

.animate-shake {
    animation: shake 0.5s ease-in-out;
}

/* ============================================
   TRANSITION CLASSES
   ============================================ */
.transition-all {
    transition: all 300ms ease;
}

.transition-fast {
    transition: all 150ms ease;
}

.transition-slow {
    transition: all 500ms ease;
}

/* ============================================
   HOVER EFFECTS
   ============================================ */
.hover-lift {
    transition: transform 300ms ease, box-shadow 300ms ease;
}

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

.hover-grow {
    transition: transform 300ms ease;
}

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

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

/* ============================================
   PAGE TRANSITION ANIMATIONS
   ============================================ */
.page-transition-enter {
    animation: fadeInUp 0.5s ease-out;
}

.page-transition-exit {
    animation: fadeOut 0.3s ease-out;
}

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

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

/* ============================================
   SWIPE ANIMATIONS (Card Slides)
   ============================================ */
@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

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

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

.swipe-slide-in-right {
    animation: slideInFromRight 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.swipe-slide-in-left {
    animation: slideInFromLeft 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.swipe-slide-out-right {
    animation: slideOutToRight 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.swipe-slide-out-left {
    animation: slideOutToLeft 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ============================================
   CHOICE SELECTION ANIMATIONS
   ============================================ */
@keyframes choicePop {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes checkmarkBounce {
    0% {
        opacity: 0;
        transform: scale(0);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.choice-pop {
    animation: choicePop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.checkmark-bounce {
    animation: checkmarkBounce 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================
   MOBILE-SPECIFIC ANIMATIONS
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Optimize animations for mobile */
@media (max-width: 768px) {
    .animate-fadeInUp,
    .animate-slideInLeft,
    .animate-slideInRight {
        animation-duration: 0.3s;
    }
}
