/* Skeleton Loader Component Styles */

/* Base skeleton animation */
@keyframes skeleton-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

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

@keyframes skeleton-wave {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* Base skeleton styles */
.skeleton {
  @apply bg-gray-200 dark:bg-gray-700;
  position: relative;
  overflow: hidden;
}

/* Animation variants */
.skeleton-pulse {
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.skeleton-shimmer {
  background: linear-gradient(
    90deg,
    #e5e7eb 0%,
    #f3f4f6 50%,
    #e5e7eb 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

.dark .skeleton-shimmer {
  background: linear-gradient(
    90deg,
    #374151 0%,
    #4b5563 50%,
    #374151 100%
  );
  background-size: 200% 100%;
}

.skeleton-wave::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  animation: skeleton-wave 1.5s infinite;
}

.dark .skeleton-wave::after {
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
}

/* Shape variants */
.skeleton-text {
  @apply h-4 rounded;
}

.skeleton-text-xs {
  @apply h-3 rounded;
}

.skeleton-text-sm {
  @apply h-3.5 rounded;
}

.skeleton-text-lg {
  @apply h-5 rounded;
}

.skeleton-text-xl {
  @apply h-6 rounded;
}

.skeleton-title {
  @apply h-7 rounded;
}

.skeleton-avatar {
  @apply rounded-full;
}

.skeleton-avatar-sm {
  @apply h-8 w-8 rounded-full;
}

.skeleton-avatar-md {
  @apply h-10 w-10 rounded-full;
}

.skeleton-avatar-lg {
  @apply h-12 w-12 rounded-full;
}

.skeleton-avatar-xl {
  @apply h-16 w-16 rounded-full;
}

.skeleton-image {
  @apply rounded-md;
}

.skeleton-button {
  @apply h-10 rounded-md;
}

.skeleton-button-sm {
  @apply h-8 rounded-md;
}

.skeleton-button-lg {
  @apply h-12 rounded-md;
}

.skeleton-card {
  @apply rounded-md;
}

.skeleton-badge {
  @apply h-5 rounded-full;
}

/* Width utilities for skeleton */
.skeleton-w-xs {
  @apply w-12;
}

.skeleton-w-sm {
  @apply w-20;
}

.skeleton-w-md {
  @apply w-32;
}

.skeleton-w-lg {
  @apply w-48;
}

.skeleton-w-xl {
  @apply w-64;
}

.skeleton-w-full {
  @apply w-full;
}

.skeleton-w-1\/2 {
  @apply w-1/2;
}

.skeleton-w-1\/3 {
  @apply w-1/3;
}

.skeleton-w-2\/3 {
  @apply w-2/3;
}

.skeleton-w-3\/4 {
  @apply w-3/4;
}

/* Animation speed variants */
.skeleton-slow {
  animation-duration: 2s !important;
}

.skeleton-fast {
  animation-duration: 0.8s !important;
}

/* Skeleton group for staggered animations */
.skeleton-group .skeleton:nth-child(1) { animation-delay: 0s; }
.skeleton-group .skeleton:nth-child(2) { animation-delay: 0.1s; }
.skeleton-group .skeleton:nth-child(3) { animation-delay: 0.2s; }
.skeleton-group .skeleton:nth-child(4) { animation-delay: 0.3s; }
.skeleton-group .skeleton:nth-child(5) { animation-delay: 0.4s; }
.skeleton-group .skeleton:nth-child(6) { animation-delay: 0.5s; }
