/* Performance Optimizations for Smooth Website Experience */

/* Hardware Acceleration */
.smooth-transition {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
    will-change: transform, opacity;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

/* Optimized Images */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    max-width: 100%;
    height: auto;
}

/* Smooth Button Transitions */
.btn-smooth {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateZ(0);
}

.btn-smooth:hover {
    transform: translateY(-2px) translateZ(0);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.btn-smooth:active {
    transform: translateY(0) translateZ(0);
}

/* Smooth Card Animations */
.card-smooth {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateZ(0);
}

.card-smooth:hover {
    transform: translateY(-4px) translateZ(0);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Smooth Fade In Animations */
.fade-in {
    animation: fadeIn 0.6s ease-out;
}

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

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

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

/* Optimized Form Elements */
input, textarea, select {
    transition: all 0.2s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

input:focus, textarea:focus, select:focus {
    transform: translateZ(0);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Smooth Navigation */
.nav-smooth {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-smooth a {
    position: relative;
    transition: color 0.3s ease;
}

.nav-smooth a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #2563eb, #1e40af);
    transition: width 0.3s ease;
}

.nav-smooth a:hover::after {
    width: 100%;
}

/* Performance Optimizations */
.reduce-motion * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
}

/* Optimize for different devices */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High DPI Optimization */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* Mobile Performance */
@media (max-width: 768px) {
    .smooth-transition {
        transition: all 0.2s ease;
    }

    .card-smooth:hover {
        transform: translateY(-2px) translateZ(0);
    }
}
