@tailwind base;
@tailwind components;
@tailwind utilities;

/* Performance Optimizations */
/* Preload critical resources */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* Optimize font loading */
.font-sans {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-display: swap;
}

/* Image optimization classes */
.img-optimized {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  backface-visibility: hidden;
  transform: translateZ(0);
}

/* Lazy loading enhancement */
.lazy-load {
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.lazy-load.loaded {
  opacity: 1;
}

/* Critical CSS for above-the-fold content */
.critical-content {
  content-visibility: auto;
  contain-intrinsic-size: 0 500px;
}

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

/* Critical CSS for above-the-fold content */
.hero-section {
  opacity: 1;
  transition: opacity 0.3s ease-in-out;
}

.navigation {
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.logo {
  max-width: 100%;
  height: auto;
  will-change: transform;
}

/* Optimized animations for better performance */
.animate-fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-fade-in.animate-triggered {
  opacity: 1;
  transform: translateY(0);
}

.animate-slide-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.animate-slide-up.animate-triggered {
  opacity: 1;
  transform: translateY(0);
}

.animate-slide-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.animate-slide-left.animate-triggered {
  opacity: 1;
  transform: translateX(0);
}

.animate-slide-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.animate-slide-right.animate-triggered {
  opacity: 1;
  transform: translateX(0);
}

/* Optimized button styles */
.cta-button {
  background: linear-gradient(45deg, #f97316, #ea580c);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
  will-change: transform;
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

/* Mobile performance optimizations */
@media (max-width: 768px) {
  .mobile-optimized .animate-bounce {
    animation-duration: 2s;
  }
  
  .mobile-optimized .animate-pulse {
    animation-duration: 2s;
  }
  
  /* Reduce motion on mobile for better performance */
  .mobile-optimized * {
    animation-duration: 1.5s !important;
  }
}

/* Image optimization */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

.lazy {
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.lazy.loaded {
  opacity: 1;
}

/* Form optimization */
.error {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Loading states */
.loading {
  opacity: 0.7;
  pointer-events: none;
}

/* Optimized transitions */
* {
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

/* Reduce layout shift */
img, video, iframe {
  aspect-ratio: attr(width) / attr(height);
}

/* Optimize for Core Web Vitals */
.content-visibility-auto {
  content-visibility: auto;
  contain-intrinsic-size: 0 500px;
}

/* Critical rendering path optimization */
.critical {
  content-visibility: auto;
  contain-intrinsic-size: 0 300px;
}

/* Custom Animations */
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slide-down {
  from { opacity: 0; transform: translateY(-40px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slide-left {
  from { opacity: 0; transform: translateX(-40px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes slide-right {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes bounce-slow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes zoom-in {
  from { transform: scale(1.08); opacity: 0.7; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes carousel {
  0% { transform: translateX(0); }
  100% { transform: translateX(-25%); }
}
@keyframes spin-slow {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@keyframes spin-reverse {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(-360deg); }
}

.animate-fade-in {
  animation: fade-in 1s cubic-bezier(.4,0,.2,1) both;
}
.animate-fade-up {
  animation: fade-up 1s cubic-bezier(.4,0,.2,1) both;
}
.animate-slide-down {
  animation: slide-down 1s cubic-bezier(.4,0,.2,1) both;
}
.animate-slide-left {
  animation: slide-left 1s cubic-bezier(.4,0,.2,1) both;
}
.animate-slide-right {
  animation: slide-right 1s cubic-bezier(.4,0,.2,1) both;
}
.animate-bounce-slow {
  animation: bounce-slow 2.5s infinite;
}
.animate-zoom-in {
  animation: zoom-in 2s cubic-bezier(.4,0,.2,1) both;
  }
.animate-carousel {
  animation: carousel 20s linear infinite;
}
.animate-spin-slow {
  animation: spin-slow 18s linear infinite;
}
.animate-spin-reverse {
  animation: spin-reverse 24s linear infinite;
}

/* Animation delays for staggered effects */
.delay-100 { animation-delay: 0.15s; }
.delay-200 { animation-delay: 0.3s; }
.delay-300 { animation-delay: 0.45s; }

/* Footer animated background (optional) */
.footer-animated-bg {
  background: linear-gradient(90deg, #155e75 0%, #1e293b 100%);
  background-size: 200% 200%;
  animation: footer-gradient 8s ease-in-out infinite alternate;
}
@keyframes footer-gradient {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

.navbar-scrolled {
  background-color: rgba(255,255,255,0.97) !important;
  box-shadow: 0 2px 16px 0 rgba(30,41,59,0.08), 0 1.5px 4px 0 rgba(30,41,59,0.04);
  transition: background-color 0.3s, box-shadow 0.3s;
}

/* Enhanced Professional Image Styles */
.shadow-3xl {
  box-shadow: 0 35px 60px -12px rgba(0, 0, 0, 0.25);
}

/* Professional Image Hover Effects */
.group:hover .group-hover\:scale-105 {
  transform: scale(1.05);
}

.group:hover .group-hover\:shadow-3xl {
  box-shadow: 0 35px 60px -12px rgba(0, 0, 0, 0.25);
}

/* Enhanced Tag Hover Effects */
.hover\:scale-105:hover {
  transform: scale(1.05);
}

/* Professional Badge Styles */
.backdrop-blur-sm {
  backdrop-filter: blur(4px);
}

/* Enhanced Image Container */
.image-container-professional {
  position: relative;
  overflow: hidden;
  border-radius: 1.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.image-container-professional:hover {
  transform: scale(1.02);
  box-shadow: 0 35px 60px -12px rgba(0, 0, 0, 0.3);
}

/* Professional Gradient Overlays */
.professional-gradient {
  background: linear-gradient(135deg, rgba(21, 94, 117, 0.2) 0%, transparent 50%, rgba(251, 146, 60, 0.2) 100%);
}

/* Enhanced Animation Delays */
.delay-1000 {
  animation-delay: 1s;
}

.delay-1500 {
  animation-delay: 1.5s;
}

/* Professional Section Badge */
.section-badge {
  background: linear-gradient(135deg, #155e75 0%, #f97316 100%);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.875rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.section-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 15px -3px rgba(0, 0, 0, 0.2);
}

/* Performance optimizations for images */
img {
  max-width: 100%;
  height: auto;
  will-change: transform;
}

/* Optimize critical rendering path */
.critical-section {
  contain: layout style paint;
}

/* Reduce layout shifts */
.stable-layout {
  min-height: 200px;
  contain: layout;
}

/* Optimize for mobile performance */
@media (max-width: 768px) {
  .mobile-optimized {
    transform: translateZ(0);
    backface-visibility: hidden;
  }
}

/* Preload critical images */
.preload-critical {
  position: absolute;
  top: -9999px;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

