/* Skeleton loader overlay — see script/skeleton.js */

.ps-skeleton {
  --sk-base: rgba(120, 190, 255, 0.1);
  --sk-shine: rgba(160, 215, 255, 0.24);
  --sk-border: rgba(120, 190, 255, 0.18);

  position: fixed;
  inset: 0;
  z-index: 9999;
  overflow: hidden;
  font-family: "Outfit", ui-sans-serif, system-ui, sans-serif;
  /* Same backdrop as body.ps-body so the hand-off is seamless */
  background-color: #020b18;
  background-image:
    radial-gradient(ellipse 90% 55% at 50% 0%, rgba(20, 70, 140, 0.45), transparent 60%),
    linear-gradient(180deg, rgba(2, 10, 24, 0.35) 0%, rgba(2, 10, 24, 0.55) 45%, rgba(2, 8, 20, 0.88) 100%),
    url("./images/bg-mountains.jpg");
  background-size: cover;
  background-position: center top;
  opacity: 1;
  transition: opacity 0.35s ease, visibility 0s linear 0.35s;
}

.ps-skeleton.is-leaving {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.ps-skeleton *,
.ps-skeleton *::before,
.ps-skeleton *::after {
  box-sizing: border-box;
}

.ps-sk-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.ps-sk-layout {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  height: 100%;
}

/* ---------- Shimmer block ---------- */

.ps-sk {
  display: block;
  border-radius: 0.5rem;
  background-color: var(--sk-base);
  background-image: linear-gradient(
    100deg,
    transparent 20%,
    var(--sk-shine) 50%,
    transparent 80%
  );
  background-size: 200% 100%;
  background-repeat: no-repeat;
  background-attachment: fixed; /* all blocks shimmer as one sweep */
  animation: ps-sk-shimmer 1.4s ease-in-out infinite;
}

@keyframes ps-sk-shimmer {
  0% {
    background-position: 150% 0;
  }
  100% {
    background-position: -50% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ps-sk {
    animation: none;
    background-image: none;
  }
  .ps-skeleton {
    transition: none;
  }
}

/* ---------- Primitives ---------- */

.ps-sk-line {
  height: 0.85rem;
}

.ps-sk-line-sm {
  height: 0.6rem;
}

.ps-sk-title {
  height: 1.4rem;
  border-radius: 0.6rem;
}

.ps-sk-input {
  height: 2.75rem;
  width: 100%;
  border-radius: 0.85rem;
}

.ps-sk-button {
  height: 2.9rem;
  width: 100%;
  border-radius: 999px;
  background-color: rgba(61, 184, 255, 0.2);
}

.ps-sk-button-ghost {
  background-color: transparent;
  border: 1px solid var(--sk-border);
}

.ps-sk-pill {
  height: 2rem;
  width: 5.5rem;
  border-radius: 999px;
}

.ps-sk-pill-wide {
  width: 7.5rem;
}

.ps-sk-brandmark {
  height: 1.1rem;
  width: 9rem;
}

.ps-sk-center {
  margin-left: auto;
  margin-right: auto;
}

.ps-sk-w-24 { width: 6rem; }
.ps-sk-w-30 { width: 30%; }
.ps-sk-w-40 { width: 40%; }
.ps-sk-w-50 { width: 50%; }
.ps-sk-w-60 { width: 60%; }
.ps-sk-w-70 { width: 70%; }
.ps-sk-w-80 { width: 80%; }
.ps-sk-w-85 { width: 85%; }

/* topbar beta tag uses fixed widths since its container shrinks to fit */
.ps-sk-topbar-end .ps-sk-w-24 { width: 6.5rem; }
.ps-sk-topbar-end .ps-sk-w-40 { width: 11rem; }

.ps-sk-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.ps-sk-row-center {
  justify-content: center;
}

.ps-sk-stack {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.ps-sk-align-end {
  align-items: flex-end;
}

/* ---------- Page chrome ---------- */

.ps-sk-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem 0.5rem;
}

.ps-sk-topbar-end {
  justify-content: flex-end;
}

.ps-sk-menubar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--sk-border);
  background: rgba(4, 16, 34, 0.82);
}

.ps-sk-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.15rem 1.25rem;
}

.ps-sk-stage {
  width: 100%;
  max-width: 26rem;
}

.ps-sk-brand {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1.35rem;
}

.ps-sk-logo {
  width: min(92%, 22rem);
  aspect-ratio: 16 / 9;
  margin: 0 auto;
  border-radius: 1.25rem;
}

.ps-sk-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.5rem 1.35rem 1.25rem;
  border: 1px solid rgba(120, 190, 255, 0.35);
  border-radius: 1.35rem;
  background: rgba(8, 24, 48, 0.55);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

.ps-sk-divider {
  display: block;
  height: 1px;
  margin: 0.25rem 0;
  background: var(--sk-border);
}

.ps-sk-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin-top: 0.25rem;
}

.ps-sk-feature {
  height: 3.75rem;
  border-radius: 0.85rem;
}

.ps-sk-footer {
  padding: 0.5rem 1.15rem 1.35rem;
}

/* ---------- Dashboard ---------- */

.ps-sk-dash {
  width: min(100%, 72rem);
  margin: 0 auto;
  padding: 0.5rem 0.75rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.ps-sk-dash-title {
  height: 1.8rem;
  max-width: 18rem;
}

.ps-sk-dash-tabs {
  margin-bottom: 0.25rem;
}

.ps-sk-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.ps-sk-card-dash {
  padding: 1.15rem;
  background: rgba(8, 24, 48, 0.42);
}

.ps-sk-chart {
  height: 11rem;
  border-radius: 0.85rem;
}

.ps-sk-table-row {
  height: 2.25rem;
  border-radius: 0.6rem;
}

/* ---------- Small screens ---------- */

@media (max-width: 640px) {
  .ps-sk-hide-sm {
    display: none;
  }
  .ps-sk-grid {
    grid-template-columns: 1fr;
  }
  .ps-sk-features {
    grid-template-columns: 1fr;
  }
  .ps-sk-feature {
    height: 2.5rem;
  }
}

.ps-sk-footer .ps-sk-w-40 {
  width: min(60%, 14rem);
}
