/* Global smooth transitions and performance optimizations */

/* Enable hardware acceleration for smoother animations */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Smooth transitions for all interactive elements */
a, button, input, select, textarea, .transition-all {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Prevent layout shift on hover */
button:hover, a:hover {
    transform: translateZ(0) scale(1.02);
}

/* Optimize shadow transitions */
.shadow-lg, .shadow-md, .shadow-sm, .shadow-xl {
    transition: box-shadow 0.2s ease-in-out;
}

/* Smooth color transitions */
.text-gray-700, .text-gray-600, .text-gray-500, .text-orange-500, .bg-orange-500, .bg-gray-100 {
    transition: color 0.2s ease-in-out, background-color 0.2s ease-in-out;
}

/* Page load - NO animation for instant loading */
body {
    /* Animation removed for instant page load */
}

/* Smooth dropdown animations */
.opacity-0 {
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
}

/* Optimize scroll performance */
html {
    scroll-behavior: smooth;
}

/* Prevent text selection flickering */
::selection {
    background-color: rgba(251, 146, 60, 0.2);
    color: inherit;
}

/* Smooth form focus transitions */
input:focus, textarea:focus, select:focus {
    transition: all 0.2s ease-in-out;
    outline: none;
}

/* Optimize card hover effects */
.hover\:shadow-xl:hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(-2px);
}

/* Smooth loading states */
.animate-spin {
    animation: spin 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Prevent button/link jitter on click */
button:active, a:active {
    transform: translateZ(0) scale(0.98);
    transition: transform 0.1s ease-in-out;
}

/* Remove tap highlight on mobile */
* {
    -webkit-tap-highlight-color: transparent;
}

/* Smooth focus states */
*:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(251, 146, 60, 0.1);
    transition: box-shadow 0.2s ease-in-out;
}

/* Prevent content shift on hover */
.hover\:scale-105 {
    will-change: transform;
}

/* Optimize dropdown animations */
#userDropdownMenu, #searchResults {
    transform-origin: top;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Smooth scrolling only - NO page load animation */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* GPU acceleration for navigation bar */
nav {
    transform: translateZ(0);
    will-change: transform;
}

/* Smooth sticky header */
.sticky {
    transition: all 0.3s ease-in-out;
}

/* Optimize image rendering */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Smooth modal/overlay transitions */
.fixed {
    animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Prevent layout shifts */
.max-w-7xl {
    contain: layout style;
}

/* Smooth tab transitions */
[role="tab"] {
    transition: all 0.2s ease-in-out;
}

/* Optimize performance for large lists */
.overflow-y-auto {
    will-change: scroll-position;
}

/* Smooth hover effects without jitter */
.group:hover .group-hover\:from-gray-800 {
    transition: all 0.3s ease-in-out;
}