/*
  ========================================
  SKELETON LOADING — GLOBAL COMPONENT
  ========================================
  Loaded on every page via templates/header_meta.php so all four portals
  (admin, library staff, faculty, student) share one shimmer system.

  Class prefix "skel-" is intentional: it avoids colliding with the older,
  page-local .skeleton / @keyframes shimmer still present in analytics.css.

  Helpers in assets/js/skeleton.js emit markup that uses these classes.

  KEY CLASSES:
  - .skel              the shimmer base (any block/line/circle)
  - .skel-line         a text-line placeholder (add .sm / .lg for height)
  - .skel-circle       an avatar / icon placeholder
  - .skel-card         KPI stat-card placeholder (icon tile + two lines)
  - .skel-panel        chart / panel placeholder
  - .skel-tr           a <tr> of placeholder cells
  ========================================
*/

.skel {
  position: relative;
  overflow: hidden;
  background: #e9edf5;
  border-radius: 6px;
  display: inline-block;
  vertical-align: middle;
}

.skel::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    rgba(233, 237, 245, 0) 0%,
    rgba(255, 255, 255, 0.65) 50%,
    rgba(233, 237, 245, 0) 100%
  );
  animation: skel-shimmer 1.3s ease-in-out infinite;
}

@keyframes skel-shimmer {
  100% {
    transform: translateX(100%);
  }
}

@keyframes skel-surface-shimmer {
  100% {
    background-position: -200% 0;
  }
}

/* Text-line placeholders */
.skel-line {
  height: 12px;
  border-radius: 4px;
}

.skel-line.sm {
  height: 10px;
}

.skel-line.lg {
  height: 16px;
}

/* Avatar / icon placeholders */
.skel-circle {
  border-radius: 50%;
}

/* Table rows: let the shimmer blocks inherit the real table's cell padding */
.skel-tr td {
  color: transparent !important;
}

.skel-tr td .skel {
  width: 100%;
}

/* KPI stat-card placeholder — mirrors the canonical analytics/predictive card */
.skel-card {
  background: #fff;
  border: 2px solid #e8eaf0;
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
}

.skel-card .skel-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
}

.skel-card .skel-lines {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

/* Chart / panel body placeholder */
.skel-panel {
  width: 100%;
  border-radius: 10px;
  display: block;
}

/* Respect the user's motion preference */
@media (prefers-reduced-motion: reduce) {
  .skel::after {
    animation: none;
  }
}
