/* ========================================================================
   Skeleton Loader Styles (Facebook-style)
   ======================================================================== */

/* Base skeleton shimmer animation */
@keyframes skeleton-shimmer {
  0% {
    background-position: -468px 0;
  }
  100% {
    background-position: 468px 0;
  }
}

/* Skeleton base class */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 0px, #f8f8f8 40px, #f0f0f0 80px);
  background-size: 468px;
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
  border-radius: 4px;
}

.skeleton-dark {
  background: linear-gradient(90deg, #2a2a2a 0px, #3a3a3a 40px, #2a2a2a 80px);
  background-size: 468px;
}

/* Skeleton shapes */
.skeleton-text {
  height: 16px;
  margin-bottom: 8px;
  width: 100%;
}

.skeleton-text-sm {
  height: 12px;
}

.skeleton-text-lg {
  height: 20px;
}

.skeleton-title {
  height: 32px;
  width: 60%;
  margin-bottom: 16px;
}

.skeleton-subtitle {
  height: 20px;
  width: 40%;
  margin-bottom: 12px;
}

.skeleton-circle {
  border-radius: 50%;
}

.skeleton-square {
  border-radius: 0;
}

.skeleton-rounded {
  border-radius: 8px;
}

/* Skeleton components */
.skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.skeleton-avatar-sm {
  width: 32px;
  height: 32px;
}

.skeleton-avatar-lg {
  width: 64px;
  height: 64px;
}

.skeleton-button {
  height: 40px;
  width: 120px;
  border-radius: 4px;
}

.skeleton-image {
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  position: relative;
}

.skeleton-image-square {
  padding-bottom: 100%;
}

.skeleton-card {
  padding: 20px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

/* Page skeleton layouts */
.skeleton-page {
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.skeleton-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.skeleton-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

/* Event card skeleton */
.skeleton-event-card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.skeleton-event-card .skeleton-image {
  padding-bottom: 60%;
}

.skeleton-event-card .skeleton-content {
  padding: 16px;
}

/* Blog post skeleton */
.skeleton-blog-post {
  margin-bottom: 32px;
}

.skeleton-blog-post .skeleton-image {
  margin-bottom: 16px;
}

/* Comment skeleton */
.skeleton-comment {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.skeleton-comment-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* List item skeleton */
.skeleton-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid #eee;
}

.skeleton-list-item-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Table skeleton */
.skeleton-table-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid #eee;
}

/* Navigation skeleton */
.skeleton-nav {
  display: flex;
  gap: 24px;
  padding: 16px 0;
}

.skeleton-nav-item {
  height: 20px;
  width: 80px;
}

/* Footer skeleton */
.skeleton-footer {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
  padding: 40px 0;
}

.skeleton-footer-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Hide real content while loading */
.skeleton-loading .skeleton-hide {
  display: none;
}

/* Show skeleton only during loading */
.skeleton-wrapper:not(.skeleton-loading) .skeleton,
.skeleton-wrapper:not(.skeleton-loading) [class*="skeleton-"] {
  display: none;
}

/* Pulse animation alternative */
@keyframes skeleton-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.skeleton-pulse {
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  background: #f0f0f0;
}

/* Width variations */
.skeleton-w-25 {
  width: 25%;
}
.skeleton-w-50 {
  width: 50%;
}
.skeleton-w-75 {
  width: 75%;
}
.skeleton-w-full {
  width: 100%;
}

/* Spacing utilities */
.skeleton-mb-1 {
  margin-bottom: 8px;
}
.skeleton-mb-2 {
  margin-bottom: 16px;
}
.skeleton-mb-3 {
  margin-bottom: 24px;
}
.skeleton-mb-4 {
  margin-bottom: 32px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .skeleton-grid {
    grid-template-columns: 1fr;
  }

  .skeleton-footer {
    grid-template-columns: 1fr;
  }

  .skeleton-title {
    width: 80%;
  }

  .skeleton-subtitle {
    width: 60%;
  }
}

/* Accessibility */
.skeleton[aria-busy="true"] {
  cursor: wait;
}

/* Print styles */
@media print {
  .skeleton,
  [class*="skeleton-"] {
    display: none !important;
  }
}
