/**
 * Lazy Loading Styles for Dream Cards
 * Optimizes page loading performance by loading content as needed
 */

/* Dream Card Base Styles */
.dream-card {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity, transform;
}

/* Loaded State */
.dream-card.loaded {
  opacity: 1;
  transform: translateY(0);
}

/* Hover Effects */
.dream-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Loading Skeleton */
.dream-card.loading {
  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;
  }
}

/* Staggered Animation */
.dream-card:nth-child(1) {
  transition-delay: 0.1s;
}
.dream-card:nth-child(2) {
  transition-delay: 0.2s;
}
.dream-card:nth-child(3) {
  transition-delay: 0.3s;
}
.dream-card:nth-child(4) {
  transition-delay: 0.4s;
}
.dream-card:nth-child(5) {
  transition-delay: 0.5s;
}
.dream-card:nth-child(6) {
  transition-delay: 0.6s;
}
.dream-card:nth-child(7) {
  transition-delay: 0.7s;
}
.dream-card:nth-child(8) {
  transition-delay: 0.8s;
}
.dream-card:nth-child(9) {
  transition-delay: 0.9s;
}
.dream-card:nth-child(10) {
  transition-delay: 1s;
}

/* Image Lazy Loading */
.dream-card img {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.dream-card img.loaded {
  opacity: 1;
}

/* Content Fade In */
.dream-card .card-body {
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.4s ease 0.2s;
}

.dream-card.loaded .card-body {
  opacity: 1;
  transform: translateY(0);
}

/* Button Animation */
.dream-card .btn {
  opacity: 0;
  transform: scale(0.9);
  transition: all 0.3s ease 0.4s;
}

.dream-card.loaded .btn {
  opacity: 1;
  transform: scale(1);
}

/* Search Results Animation */
.search-results {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease;
}

.search-results.loaded {
  opacity: 1;
  transform: translateY(0);
}

/* Pagination Animation */
.pagination {
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease 0.5s;
}

.pagination.loaded {
  opacity: 1;
  transform: translateY(0);
}

/* Loading Spinner */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Intersection Observer Fallback */
.no-intersection-observer .dream-card {
  opacity: 1;
  transform: translateY(0);
}

/* Performance Optimizations */
.dream-card {
  contain: layout style paint;
  backface-visibility: hidden;
  perspective: 1000px;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .dream-card {
    transition: none;
    opacity: 1;
    transform: none;
  }

  .dream-card.loaded {
    opacity: 1;
    transform: none;
  }

  .dream-card:hover {
    transform: none;
  }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
  .dream-card {
    transform: translateY(10px);
  }

  .dream-card.loaded {
    transform: translateY(0);
  }

  .dream-card:hover {
    transform: none; /* Disable hover on mobile */
  }
}

/* High DPI Display Optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .dream-card {
    will-change: auto; /* Reduce GPU usage on high DPI */
  }
}

/* Print Styles */
@media print {
  .dream-card {
    opacity: 1 !important;
    transform: none !important;
    break-inside: avoid;
  }
}































