/* Custom Styles for CosmicImage Lab */

@keyframes float {
    0%, 100% {
        transform: translate3d(0, 0, 0);
    }
    50% {
        transform: translate3d(0, -20px, 0);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
    will-change: transform;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Performance optimizations */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Optimize transforms for better performance */
.transform,
.hover\:scale-\[1\.02\],
.hover\:-translate-y-2,
.hover\:rotate-1,
.hover\:-rotate-1,
.hover\:scale-105 {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #1e293b;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #06b6d4, #14b8a6);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #22d3ee, #2dd4bf);
}

/* Glass morphism effect - optimized */
.glass {
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(6, 182, 212, 0.3);
    will-change: backdrop-filter;
}

/* Reduce backdrop blur on scroll for better performance */
@media (prefers-reduced-motion: no-preference) {
    .backdrop-blur-xl {
        will-change: backdrop-filter;
    }
}

/* Gradient text animation */
.gradient-text {
    background: linear-gradient(90deg, #06b6d4, #14b8a6, #fbbf24);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s linear infinite;
}

/* Hover effects for cards - optimized */
.card-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    will-change: transform;
    transform: translateZ(0);
}

.card-hover:hover {
    transform: translate3d(0, -5px, 0);
    box-shadow: 0 20px 40px rgba(6, 182, 212, 0.3);
}

/* Loading animation */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(6, 182, 212, 0.5);
    }
    50% {
        box-shadow: 0 0 40px rgba(6, 182, 212, 0.8);
    }
}

.pulse-glow {
    animation: pulse-glow 2s ease-in-out infinite;
}

/* Mobile menu animation */
#mobile-menu {
    transition: all 0.3s ease;
}

/* Image optimization */
img, [style*="background-image"] {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* 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;
    }
}

/* Optimize scrolling performance */
body {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
}

/* Number counter animation */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.count-up {
    animation: countUp 0.6s ease-out;
}

