/* ============================================
   LOADING SKELETONS
   ============================================
   Week 1 Day 4-5: Improve perceived performance
   Better UX than spinners
*/

/* Skeleton base styles */
.skeleton {
  background: linear-gradient(
    90deg,
    #f0f0f0 25%,
    #e0e0e0 50%,
    #f0f0f0 75%
  );
  background-size: 200% 100%;
  animation: loading 1.5s ease-in-out infinite;
  border-radius: 4px;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Meme image skeleton */
.skeleton-meme {
  width: 100%;
  max-width: 600px;
  height: 400px;
  margin: 20px auto;
}

/* Text skeleton */
.skeleton-text {
  height: 16px;
  margin: 8px 0;
}

.skeleton-text--title {
  width: 70%;
  height: 24px;
}

.skeleton-text--subtitle {
  width: 50%;
  height: 16px;
}

/* Button skeleton */
.skeleton-button {
  width: 120px;
  height: 44px;
  display: inline-block;
  margin: 0 8px;
}

/* Grid skeleton */
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  padding: 20px;
}

.skeleton-card {
  height: 300px;
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .skeleton-meme {
    height: 300px;
  }
  
  .skeleton-grid {
    grid-template-columns: 1fr;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .skeleton {
    background: linear-gradient(
      90deg,
      #2a2a2a 25%,
      #1a1a1a 50%,
      #2a2a2a 75%
    );
  }
}
