.lazy {
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite ease-in-out;
  position: relative;
  overflow: hidden;
}

.lazy::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite ease-in-out;
}

.lazy-loading {
  opacity: 0.7;
}

.lazy-loaded {
  opacity: 1;
  background: none;
  animation: none;
}

.lazy-loaded::before {
  display: none;
}

@keyframes skeleton-shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.lazy-placeholder {
  position: relative;
  overflow: hidden;
}

.lazy-placeholder::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: placeholder-shimmer 1.5s infinite;
}

@keyframes placeholder-shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.lazy-image-container {
  position: relative;
  overflow: hidden;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite ease-in-out;
}

.lazy-image-container img {
  width: 100%;
  height: auto;
  display: block;
}

.lazy-skeleton-square {
  aspect-ratio: 1 / 1;
}

.lazy-skeleton-landscape {
  aspect-ratio: 16 / 9;
}

.lazy-skeleton-portrait {
  aspect-ratio: 3 / 4;
}

.lazy-skeleton-wide {
  aspect-ratio: 21 / 9;
}

.lazy-loading-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #3498db;
  border-radius: 50%;
  animation: lazy-loading-spin 1s linear infinite;
}

@keyframes lazy-loading-spin {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@media (prefers-contrast: high) {
  .lazy {
    background: linear-gradient(90deg, #000 25%, #333 50%, #000 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite ease-in-out;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lazy {
    animation: none;
    transition: opacity 0.1s ease-in-out;
    background: #f0f0f0;
  }

  .lazy::before {
    animation: none;
    background: #f0f0f0;
  }

  .lazy-placeholder::before {
    animation: none;
  }

  .lazy-loading-spinner {
    animation: none;
    border-top-color: #666;
  }
}
