/* Image Optimization Styles */

/* Lazy loading styles */
.lazy {
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  background-color: #f0f0f0;
  background-image: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

.lazy.loaded {
  opacity: 1;
  background: none;
  animation: none;
}

.lazy.error {
  opacity: 1;
  background-color: #ffebee;
  border: 1px solid #f44336;
}

/* Loading animation */
@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Progressive loading for hero and home slide backgrounds */
.hero,
.home-slide-banner {
  transition: background-image 0.5s ease-in-out, opacity 0.3s ease-in-out;
  position: relative;
}

/* Background loading states */
.bg-loading {
  background-color: #f0f0f0;
  background-image: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

.bg-loaded {
  background-color: transparent;
  animation: none;
}

.bg-error {
  background-color: #ffebee;
  border: 1px solid #f44336;
}

/* Image optimization for different screen sizes */
.responsive-image {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Optimized image containers */
/* Leadership team profile image placeholder and fade-in */
.image-container {
  position: relative;
  width: 120px;
  height: 120px;
  background-color: #e0e0e0;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  flex: 0 0 120px;
  max-width: 120px;
  max-height: 120px;
  min-width: 120px;
  min-height: 120px;
  box-sizing: border-box;
}

.profile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.4s;
  display: block;
  background-color: #e0e0e0;
  aspect-ratio: 1 / 1;
  max-width: 120px;
  max-height: 120px;
  min-width: 0;
  min-height: 0;
  box-sizing: border-box;
}

.profile-img.loaded {
  opacity: 1;
}

.image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease-in-out;
}

.image-container:hover img {
  transform: scale(1.05);
}

/* Blur-up effect for progressive loading */
.blur-up {
  filter: blur(10px);
  transition: filter 0.3s ease-in-out;
}

.blur-up.loaded {
  filter: blur(0);
}

/* Critical image preloading */
.critical-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* Image loading states */
.image-loading {
  position: relative;
}

.image-loading::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  z-index: -1;
}

/* Optimized background images */
.optimized-bg {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: background-image 0.3s ease-in-out;
}

/* Carousel specific optimizations */
.carousel-item {
  transition: opacity 0.3s ease-in-out;
}

.carousel-item.bg-loading {
  opacity: 0.8;
}

.carousel-item.bg-loaded {
  opacity: 1;
}

/* Remove all debugging borders and keep only production styles */
.image-container {
  position: relative;
  width: 120px;
  height: 120px;
  background-color: #e0e0e0;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  flex: 0 0 120px;
  max-width: 120px;
  max-height: 120px;
  min-width: 120px;
  min-height: 120px;
  box-sizing: border-box;
}

.profile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.4s;
  display: block;
  background-color: #e0e0e0;
  aspect-ratio: 1 / 1;
  max-width: 120px;
  max-height: 120px;
  min-width: 0;
  min-height: 0;
  box-sizing: border-box;
}

.profile-img.loaded {
  opacity: 1;
}

.leadership-member {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.member-photo {
  margin-bottom: 1rem;
}

/* Mobile-specific optimizations */
@media (max-width: 768px) {
  .lazy {
    min-height: 150px;
  }
  
  .hero,
  .home-slide-banner {
    min-height: 200px;
  }
  
  /* .image-container {
    min-height: 200px;
  } */
}

/* Tablet-specific optimizations */
@media (min-width: 769px) and (max-width: 991px) {
  .lazy {
    min-height: 200px;
  }
  
  .hero,
  .home-slide-banner {
    min-height: 250px;
  }
  
  /* .image-container {
    min-height: 250px;
  } */
}

/* Desktop-specific optimizations */
@media (min-width: 992px) {
  .lazy {
    min-height: 250px;
  }
  
  .hero,
  .home-slide-banner {
    min-height: 300px;
  }
  
  /* .image-container {
    min-height: 300px;
  } */
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .optimized-bg {
    background-size: cover;
  }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  .lazy,
  .hero,
  .home-slide-banner,
  .optimized-bg,
  .carousel-item {
    transition: none;
  }
  
  .image-container img {
    transition: none;
  }
  
  @keyframes loading {
    0%, 100% {
      background-position: 0 0;
    }
  }
}

/* Performance optimizations for slow connections */
@media (prefers-reduced-data: reduce) {
  .lazy {
    background-image: none;
    background-color: #f0f0f0;
  }
  
  .bg-loading {
    background-image: none;
    background-color: #f0f0f0;
  }
} 