/* ============================================================ */
/* PETCARE v3.0 — SKELETON LOADERS                               */
/* Shimmer placeholder animation for loading states              */
/* ============================================================ */

/* ============================================================ */
/* 1. SHIMMER ANIMATION                                          */
/* ============================================================ */
@keyframes skeletonShimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

@keyframes skeletonPulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

/* ============================================================ */
/* 2. BASE SKELETON CLASS                                        */
/* ============================================================ */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--pc-paper) 25%,
    var(--pc-border-light) 50%,
    var(--pc-paper) 75%
  );
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s ease-in-out infinite;
  border-radius: 8px;
  display: block;
}

/* Dark mode shimmer */
body.dark-mode .skeleton {
  background: linear-gradient(
    90deg,
    #241A14 25%,
    #3A2C22 50%,
    #241A14 75%
  );
  background-size: 200% 100%;
}

/* ============================================================ */
/* 3. SKELETON SHAPES                                            */
/* ============================================================ */

/* Circle — for avatars */
.skeleton-circle {
  border-radius: 50%;
  flex-shrink: 0;
}

/* Rectangle — for images */
.skeleton-rect {
  border-radius: 12px;
}

/* Pill — for buttons/chips */
.skeleton-pill {
  border-radius: 50px;
}

/* Text line */
.skeleton-line {
  height: 12px;
  border-radius: 6px;
  margin-bottom: 8px;
}

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

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

.skeleton-line.long {
  width: 90%;
}

.skeleton-line.full {
  width: 100%;
}

/* ============================================================ */
/* 4. SKELETON LAYOUTS                                           */
/* ============================================================ */

/* ---------- CARD SKELETON ---------- */
.skeleton-card {
  background: var(--pc-card);
  border-radius: var(--pc-radius);
  padding: var(--pc-card-padding);
  margin-bottom: 16px;
  box-shadow: var(--pc-shadow-sm);
  border: 1px solid var(--pc-border-light);
}

/* ---------- HERO SKELETON ---------- */
.skeleton-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 150px;
}

.skeleton-hero-text {
  flex: 1;
  min-width: 0;
}

.skeleton-hero-image {
  width: 120px;
  height: 120px;
  border-radius: 16px;
  flex-shrink: 0;
}

/* ---------- PET SELECTOR SKELETON ---------- */
.skeleton-pet-row {
  display: flex;
  gap: 12px;
  padding: 4px 0;
  overflow: hidden;
}

.skeleton-pet-chip {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ---------- PRODUCT CARD SKELETON ---------- */
.skeleton-products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.skeleton-product {
  background: var(--pc-card);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--pc-border-light);
  padding-bottom: 12px;
}

.skeleton-product-img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 0;
}

.skeleton-product-body {
  padding: 12px;
}

.skeleton-product-name {
  height: 14px;
  border-radius: 6px;
  margin-bottom: 8px;
}

.skeleton-product-meta {
  height: 10px;
  width: 60%;
  border-radius: 5px;
  margin-bottom: 10px;
}

.skeleton-product-price {
  height: 16px;
  width: 40%;
  border-radius: 6px;
}

/* ---------- POST SKELETON ---------- */
.skeleton-post {
  background: var(--pc-card);
  border-radius: var(--pc-radius);
  padding: 16px;
  margin-bottom: 14px;
  border: 1px solid var(--pc-border-light);
}

.skeleton-post-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.skeleton-post-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  flex-shrink: 0;
}

.skeleton-post-author {
  flex: 1;
  min-width: 0;
}

.skeleton-post-body {
  margin-bottom: 12px;
}

.skeleton-post-image {
  width: 100%;
  aspect-ratio: 16/10;
  border-radius: 12px;
  margin-bottom: 12px;
}

.skeleton-post-actions {
  display: flex;
  gap: 16px;
  padding-top: 10px;
  border-top: 1px solid var(--pc-border-light);
}

.skeleton-post-action {
  height: 14px;
  width: 50px;
  border-radius: 7px;
}

/* ---------- PROFILE SKELETON ---------- */
.skeleton-profile-hero {
  position: relative;
  background: var(--pc-card);
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 14px;
  border: 1px solid var(--pc-border-light);
}

.skeleton-profile-cover {
  width: 100%;
  height: 140px;
  border-radius: 0;
}

.skeleton-profile-identity {
  padding: 0 16px 16px;
  margin-top: -40px;
  position: relative;
  z-index: 2;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.skeleton-profile-avatar {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  border: 3px solid var(--pc-card);
  flex-shrink: 0;
}

.skeleton-profile-info {
  flex: 1;
  min-width: 0;
  padding-top: 46px;
}

.skeleton-profile-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 14px 8px 12px;
  border-top: 1px solid var(--pc-border-light);
  margin: 0 14px;
}

.skeleton-profile-stat {
  height: 40px;
  border-radius: 8px;
}

/* ---------- VET/STORE SKELETON ---------- */
.skeleton-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--pc-paper);
  border-radius: 14px;
  margin-bottom: 10px;
}

.skeleton-list-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
}

.skeleton-list-info {
  flex: 1;
  min-width: 0;
}

/* ---------- CALENDAR SKELETON ---------- */
.skeleton-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 16px;
}

.skeleton-cal-day {
  aspect-ratio: 1;
  border-radius: 10px;
}

/* ---------- CHART SKELETON ---------- */
.skeleton-chart {
  width: 100%;
  height: 160px;
  border-radius: 14px;
}

/* ============================================================ */
/* 5. FADE IN ANIMATION (when real content replaces skeleton)    */
/* ============================================================ */
@keyframes contentFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.content-loaded {
  animation: contentFadeIn 0.35s ease;
}

/* ============================================================ */
/* 6. RESPONSIVE                                                 */
/* ============================================================ */
@media (max-width: 480px) {
  .skeleton-hero-image {
    width: 90px;
    height: 90px;
  }

  .skeleton-profile-avatar {
    width: 70px;
    height: 70px;
  }

  .skeleton-profile-cover {
    height: 120px;
  }
}

/* ============================================================ */
/* 7. REDUCED MOTION                                             */
/* ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .skeleton {
    animation: none;
    background: var(--pc-paper);
  }

  .content-loaded {
    animation: none;
  }
}