/**
 * Skeleton Loaders - DominicanToDo
 * Version: v1.0.0
 *
 * Usage: Add .skeleton class to any element while loading
 */

/* Base skeleton animation */
@keyframes skeleton-shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.skeleton {
  background: linear-gradient(
    90deg,
    #f0f0f0 0%,
    #e0e0e0 20%,
    #f0f0f0 40%,
    #f0f0f0 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: 4px;
  pointer-events: none;
  user-select: none;
}

.skeleton * {
  visibility: hidden !important;
}

/* Skeleton variants */
.skeleton-text {
  height: 1em;
  margin-bottom: 0.5em;
  border-radius: 4px;
}

.skeleton-title {
  height: 2em;
  width: 60%;
  margin-bottom: 0.75em;
  border-radius: 6px;
}

.skeleton-image {
  width: 100%;
  height: 200px;
  border-radius: 8px;
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.skeleton-button {
  height: 40px;
  width: 120px;
  border-radius: 6px;
}

/* Card skeleton for destinations grid */
.skeleton-card {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.skeleton-card-image {
  width: 100%;
  height: 200px;
  background: linear-gradient(
    90deg,
    #e0e0e0 0%,
    #d0d0d0 20%,
    #e0e0e0 40%,
    #e0e0e0 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

.skeleton-card-body {
  padding: 16px;
}

.skeleton-card-title {
  height: 1.5em;
  width: 70%;
  background: linear-gradient(
    90deg,
    #f0f0f0 0%,
    #e0e0e0 20%,
    #f0f0f0 40%,
    #f0f0f0 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: 4px;
  margin-bottom: 8px;
}

.skeleton-card-text {
  height: 1em;
  width: 90%;
  background: linear-gradient(
    90deg,
    #f0f0f0 0%,
    #e0e0e0 20%,
    #f0f0f0 40%,
    #f0f0f0 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: 4px;
  margin-bottom: 6px;
}

.skeleton-card-text:last-child {
  width: 60%;
}

/* Skeleton grid for ciudad.html destinations */
.skeleton-destinations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  margin: 24px 0;
}

/* Skeleton for blog list */
.skeleton-blog-item {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: white;
  border-radius: 8px;
  margin-bottom: 16px;
}

.skeleton-blog-thumbnail {
  width: 120px;
  height: 120px;
  flex-shrink: 0;
  background: linear-gradient(
    90deg,
    #e0e0e0 0%,
    #d0d0d0 20%,
    #e0e0e0 40%,
    #e0e0e0 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: 6px;
}

.skeleton-blog-content {
  flex: 1;
}

/* Skeleton for calendar */
.skeleton-calendar-event {
  padding: 12px;
  background: white;
  border-radius: 6px;
  border-left: 4px solid #e0e0e0;
  margin-bottom: 12px;
}

/* Utility classes */
.skeleton-hidden {
  display: none;
}

.skeleton-visible {
  display: block;
}

/* Dark mode skeleton (optional, if you add dark mode later) */
@media (prefers-color-scheme: dark) {
  .skeleton {
    background: linear-gradient(
      90deg,
      #2a2a2a 0%,
      #3a3a3a 20%,
      #2a2a2a 40%,
      #2a2a2a 100%
    );
  }

  .skeleton-card-image,
  .skeleton-blog-thumbnail {
    background: linear-gradient(
      90deg,
      #1a1a1a 0%,
      #2a2a2a 20%,
      #1a1a1a 40%,
      #1a1a1a 100%
    );
  }
}
