/**
 * Modern Animations & Transitions - Click Village
 * Smooth animations and micro-interactions for better UX
 */

/* Base animation settings */
:root {
    --animation-speed: 0.3s;
    --animation-easing: cubic-bezier(0.4, 0, 0.2, 1);
    --bounce-easing: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Global smooth transitions */
* {
    transition: transform var(--animation-speed) var(--animation-easing),
                opacity var(--animation-speed) var(--animation-easing),
                box-shadow var(--animation-speed) var(--animation-easing),
                background var(--animation-speed) var(--animation-easing),
                color var(--animation-speed) var(--animation-easing);
}

/* Remove transitions on page load */
.preload * {
    transition: none !important;
}

/* 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 slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

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

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

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

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

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

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

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

/* Loading Animations */
@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

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

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

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

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

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

.animate-slide-in-up {
    animation: slideInUp 0.8s var(--bounce-easing);
}

.animate-slide-in-down {
    animation: slideInDown 0.8s var(--bounce-easing);
}

.animate-zoom-in {
    animation: zoomIn 0.5s var(--bounce-easing);
}

.animate-bounce-in {
    animation: bounceIn 0.8s var(--bounce-easing);
}

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

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

.animate-rotate {
    animation: rotate 2s linear infinite;
}

/* Hover Animations */
.hover-lift {
    transition: transform 0.3s var(--animation-easing), box-shadow 0.3s var(--animation-easing);
}

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

.hover-scale {
    transition: transform 0.3s var(--animation-easing);
}

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

.hover-rotate {
    transition: transform 0.3s var(--animation-easing);
}

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

.hover-glow {
    transition: box-shadow 0.3s var(--animation-easing);
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(255, 84, 90, 0.5);
}

/* Button Animations */
.btn-animated {
    position: relative;
    overflow: hidden;
    transition: all 0.3s var(--animation-easing);
}

.btn-animated::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-animated:hover::before {
    left: 100%;
}

.btn-bounce {
    transition: transform 0.3s var(--bounce-easing);
}

.btn-bounce:hover {
    transform: scale(1.1);
}

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

/* Ripple Effect */
.ripple-effect {
    position: relative;
    overflow: hidden;
}

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

.ripple-effect:active::after {
    width: 300px;
    height: 300px;
}

/* Loading States */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 8px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #ff545a;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

.loading-dots {
    display: flex;
    justify-content: center;
    gap: 4px;
}

.loading-dots div {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff545a;
    animation: loading-dots 1.4s infinite ease-in-out both;
}

.loading-dots div:nth-child(1) { animation-delay: -0.32s; }
.loading-dots div:nth-child(2) { animation-delay: -0.16s; }

@keyframes loading-dots {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Scroll Animations */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s var(--animation-easing);
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger animations for multiple elements */
.stagger-item {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease-out forwards;
}

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

/* Form Animations */
.form-group {
    position: relative;
}

.form-control {
    transition: all 0.3s var(--animation-easing);
}

.form-control:focus {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 84, 90, 0.2);
}

.form-control:invalid {
    animation: shake 0.5s;
}

/* Navigation Animations */
.nav-item {
    transition: all 0.3s var(--animation-easing);
}

.nav-item:hover {
    transform: translateY(-2px);
}

/* Card Animations */
.card-animated {
    transition: all 0.3s var(--animation-easing);
    position: relative;
}

.card-animated::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 84, 90, 0.1), transparent);
    transform: translateX(-100%) rotate(45deg);
    transition: transform 0.6s;
    pointer-events: none;
}

.card-animated:hover::before {
    transform: translateX(100%) rotate(45deg);
}

.card-animated:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Image Animations */
.image-zoom {
    overflow: hidden;
}

.image-zoom img {
    transition: transform 0.5s var(--animation-easing);
}

.image-zoom:hover img {
    transform: scale(1.1);
}

.image-tilt {
    transition: transform 0.3s var(--animation-easing);
}

.image-tilt:hover {
    transform: rotate(2deg) scale(1.05);
}

/* Text Animations */
.text-focus {
    transition: all 0.3s var(--animation-easing);
}

.text-focus:hover {
    color: #ff545a;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* Gradient Animations */
.gradient-animated {
    background: linear-gradient(45deg, #ff545a, #f43032, #ff545a, #f43032);
    background-size: 400% 400%;
    animation: gradient-shift 3s ease infinite;
}

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

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

@media (max-width: 768px) {
    /* Reduce animation intensity on mobile */
    .hover-lift:hover {
        transform: translateY(-3px);
    }
    
    .hover-scale:hover {
        transform: scale(1.02);
    }
    
    .card-animated:hover {
        transform: translateY(-5px) scale(1.01);
    }
}