/**
 * Skeleton Loaders
 * CSS-only loading placeholders for better perceived performance
 */

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

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

/* Skeleton Variants */
.skeleton-text {
  height: 16px;
  margin-bottom: 8px;
  width: 100%;
}

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

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

.skeleton-title {
  height: 24px;
  width: 40%;
  margin-bottom: 16px;
}

.skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.skeleton-avatar-large {
  width: 80px;
  height: 80px;
}

.skeleton-button {
  height: 40px;
  width: 120px;
  border-radius: 4px;
}

.skeleton-card {
  height: 200px;
  border-radius: 8px;
}

.skeleton-thumbnail {
  width: 100%;
  height: 150px;
  border-radius: 4px;
}

/* Document Card Skeleton */
.skeleton-document-card {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.skeleton-document-header {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.skeleton-document-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Flashcard Stats Skeleton */
.skeleton-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.skeleton-stat-card {
  background: #fff;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.skeleton-stat-value {
  height: 32px;
  width: 60%;
  margin-bottom: 8px;
}

.skeleton-stat-label {
  height: 16px;
  width: 80%;
}

/* Quiz Content Skeleton */
.skeleton-quiz-header {
  margin-bottom: 24px;
}

.skeleton-quiz-question {
  background: #fff;
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.skeleton-question-text {
  height: 20px;
  margin-bottom: 16px;
}

.skeleton-answer-option {
  height: 48px;
  margin-bottom: 12px;
  border-radius: 6px;
}

/* List Item Skeleton */
.skeleton-list-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: #fff;
  border-radius: 8px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.skeleton-list-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .skeleton {
    background: linear-gradient(
      90deg,
      #2b2b2b 0%,
      #333 50%,
      #2b2b2b 100%
    );
  }

  .skeleton-document-card,
  .skeleton-stat-card,
  .skeleton-quiz-question,
  .skeleton-list-item {
    background: #1e1e1e;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .skeleton {
    animation: none;
    background: #f0f0f0;
  }

  @media (prefers-color-scheme: dark) {
    .skeleton {
      background: #2b2b2b;
    }
  }
}

/* Hide skeleton when content loads */
.skeleton-hide {
  display: none;
}

