/* ===== PAGE LOADER OVERLAY ===== */
#page-loader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #fff;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  opacity: 1;
  transition: opacity .35s ease;
  pointer-events: all;
}
#page-loader.loader-hiding {
  opacity: 0;
  pointer-events: none;
}

/* ── shared state container ── */
.loader-state {
  display: none;
  width: 100%;
  height: 100%;
}
.loader-state.active { display: flex; }

/* ════════════════════════════════════
   SKELETON LOADER
   ════════════════════════════════════ */
#loaderSkeleton {
  flex-direction: column;
  background: #fff;
}

@keyframes sk-shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position:  600px 0; }
}
.sk-pulse {
  background: linear-gradient(90deg, #f0f2f0 25%, #e4e8e4 50%, #f0f2f0 75%);
  background-size: 600px 100%;
  animation: sk-shimmer 1.4s infinite linear;
  border-radius: 6px;
}

/* Navbar skeleton */
.sk-nav {
  height: 60px;
  background: #1e2d1e;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 0 2rem;
  gap: 2rem;
}
.sk-nav-logo {
  width: 120px; height: 22px;
  background: rgba(255,255,255,.15);
  border-radius: 4px;
  flex-shrink: 0;
}
.sk-nav-links {
  display: flex; gap: 1.5rem; flex: 1;
}
.sk-nav-link {
  height: 14px; border-radius: 4px;
  background: rgba(255,255,255,.1);
}

/* Hero skeleton */
.sk-hero {
  height: 340px;
  background: linear-gradient(135deg, #d6dfd4 0%, #b8c9b5 100%);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 0 8%;
  gap: 1rem;
  flex-direction: column;
  justify-content: center;
}
.sk-hero-line {
  height: 28px; border-radius: 6px;
  background: rgba(255,255,255,.35);
  background-size: 600px 100%;
  animation: sk-shimmer 1.4s infinite linear;
}

/* Content area skeleton */
.sk-body {
  flex: 1;
  padding: 2.5rem 8%;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.sk-row {
  display: flex;
  gap: 1.5rem;
}
.sk-block {
  flex: 1;
  border-radius: 12px;
  overflow: hidden;
}
.sk-block-img {
  height: 160px;
  border-radius: 12px 12px 0 0;
}
.sk-block-lines {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  background: #fafafa;
  border-radius: 0 0 12px 12px;
}
.sk-line { height: 12px; border-radius: 4px; }
.sk-line-short { width: 55%; }

/* ════════════════════════════════════
   DONUT SPINNER
   ════════════════════════════════════ */
#loaderDonut {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  background: #fff;
}

.donut-wrap {
  position: relative;
  width: 72px; height: 72px;
}

@keyframes donut-spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.donut-ring {
  width: 72px; height: 72px;
  border-radius: 50%;
  border: 5px solid #e3e9e2;
  border-top-color: #485D4B;
  border-right-color: #739072;
  animation: donut-spin .9s linear infinite;
}
.donut-label {
  font-family: 'Mitr', sans-serif;
  font-size: .88rem;
  font-weight: 300;
  color: #739072;
  letter-spacing: .05em;
}

/* ════════════════════════════════════
   PROGRESS BAR
   ════════════════════════════════════ */
#loaderProgress {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.8rem;
  background: #fff;
}

.progress-track {
  width: min(420px, 80vw);
  height: 6px;
  background: #e3e9e2;
  border-radius: 99px;
  overflow: hidden;
}

@keyframes progress-ease {
  0%   { width: 0%; }
  30%  { width: 45%; }
  65%  { width: 72%; }
  85%  { width: 88%; }
  100% { width: 94%; }
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #485D4B, #739072);
  border-radius: 99px;
  transition: width .3s ease;
}
.progress-fill.running {
  animation: progress-ease 8s ease forwards;
}
.progress-fill.complete {
  animation: none;
  width: 100% !important;
  transition: width .25s ease;
}

.progress-label {
  font-family: 'Mitr', sans-serif;
  font-size: .88rem;
  font-weight: 300;
  color: #9ca3af;
  letter-spacing: .03em;
}
.progress-pct {
  font-size: .78rem;
  color: #739072;
  font-family: 'Mitr', sans-serif;
}

/* ── Top progress stripe (always visible while loading) ── */
#loaderTopBar {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #485D4B, #a3c8a0);
  z-index: 100000;
  transition: width .3s ease, opacity .4s ease;
  pointer-events: none;
}
