/* ===== PERFORMANCE OPTIMIZATIONS ===== */

/* Carousel progress indicator */
.carousel-progress {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  overflow: hidden;
  z-index: 10;
}

.carousel-progress .progress-bar {
  height: 100%;
  background: #ffc107;
  border-radius: 2px;
  transition: width 0.3s ease;
  width: 0%;
}

/* Preload critical images */
.hero-carousel .item {
  background-attachment: fixed;
  will-change: transform;
}

/* Lazy loading for images */
.lazy-load {
  opacity: 0;
  transition: opacity 0.3s;
}

.lazy-load.loaded {
  opacity: 1;
}

/* Optimize carousel transitions */
.hero-carousel {
  overflow: hidden;
}

.hero-carousel .item {
  height: 100vh;
  min-height: 600px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Performance optimizations */
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000px;
  will-change: transform;
}

/* Faster overlay animations */
.hero-carousel .overlay {
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  text-align: center;
  padding: 3rem 2rem;
  border-radius: 12px;
  max-width: 750px;
  width: 90%;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  /* Hardware acceleration */
  transform: translateZ(0);
  will-change: transform, opacity;
}

/* Optimized text animations - Show by default, enhance when active */
.hero-slide .overlay h1,
.hero-slide .overlay p,
.hero-slide .overlay a {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform, opacity;
}

.hero-slide:not(.active) .overlay h1,
.hero-slide:not(.active) .overlay p,
.hero-slide:not(.active) .overlay a {
  opacity: 0.9;
  transform: translate3d(0, 10px, 0);
}

.hero-slide.active .overlay h1 {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  transition-delay: 0.1s;
}

.hero-slide.active .overlay p {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  transition-delay: 0.2s;
}

.hero-slide.active .overlay a {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  transition-delay: 0.3s;
}

/* Enhanced button hover effects */
.btn {
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform: translateZ(0);
}

.btn:hover {
  transform: translateY(-2px) translateZ(0);
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* Image loading optimization */
.img-fluid {
  transition: all 0.3s ease;
  will-change: transform;
}

.animate-image:hover {
  transform: scale(1.03) translateZ(0);
}

/* Link animations */
.animate-link {
  transition: transform 0.3s ease;
}

/* Testimonial carousel optimization */
.carousel-item {
  transition: transform 0.5s ease-in-out;
  backface-visibility: hidden;
  transform: translateZ(0);
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Loading states */
.loading-skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Responsive optimizations */
@media (max-width: 768px) {
  .hero-carousel .item {
    height: 70vh;
    min-height: 500px;
  }
  
  .hero-carousel .overlay {
    padding: 2rem 1rem;
    max-width: 90%;
  }
  
  .hero-carousel h1 {
    font-size: 2rem;
  }
  
  .hero-carousel p {
    font-size: 1.1rem;
  }
  
  .carousel-progress {
    width: 150px;
    bottom: 15px;
  }
}

/* Preloader styles */
.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.5s ease-out;
}

.page-loader.hide {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #00796B;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Hover shadow effect for cards */
.hover-shadow {
  transition: box-shadow 0.3s ease;
}

.hover-shadow:hover {
  box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
  transform: translateY(-2px);
}

/* Navbar scroll effect */
.navbar.scrolled {
  background-color: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}