/**
 * JamWatHQ Agency List Skeleton Loaders
 * UX-001: Improve perceived performance during agency data fetch
 * Created: 2026-01-10
 */

/* ============================================
   SKELETON CONTAINER
   Grid layout matching actual agency cards
   ============================================ */

.skeleton-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  padding: 2rem;
  animation: fadeIn 0.3s ease-in;
}

/* ============================================
   SKELETON CARD
   Matches actual agency card structure
   ============================================ */

.skeleton-card {
  background: #fff;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* ============================================
   SKELETON ELEMENTS
   Shimmer animation for loading effect
   ============================================ */

.skeleton-header {
  height: 24px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.skeleton-line {
  height: 16px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
  margin-bottom: 0.75rem;
}

.skeleton-line.short {
  width: 60%;
}

.skeleton-line.medium {
  width: 80%;
}

.skeleton-rating {
  height: 20px;
  width: 120px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
  margin-top: 1rem;
}

/* ============================================
   SHIMMER ANIMATION
   Creates loading effect
   ============================================ */

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

/* ============================================
   FADE IN ANIMATION
   Smooth appearance
   ============================================ */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ============================================
   HIDE SKELETON WHEN DATA LOADS
   JavaScript toggles this class
   ============================================ */

.skeleton-container.hidden {
  display: none;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   Mobile-first design
   ============================================ */

@media screen and (max-width: 768px) {
  .skeleton-container {
    grid-template-columns: 1fr;
    padding: 1rem;
  }
}

@media screen and (max-width: 480px) {
  .skeleton-card {
    padding: 1rem;
  }
}

/* ============================================
   ACCESSIBILITY
   Reduced motion support
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  .skeleton-header,
  .skeleton-line,
  .skeleton-rating {
    animation: none;
    background: #f0f0f0;
  }

  .skeleton-container {
    animation: none;
  }
}
