/* ============================================================
   StuderaHP — Skeleton screens ("Focus Sweep")
   Enda källa för laddningsskelett. Laddas globalt av functions.php.
   Ljust tema (matchar produktens fasta varumärkesfärger).
   ============================================================ */

:root {
  --shp-sweep: linear-gradient(
    105deg,
    #edf1f7 0%,
    #edf1f7 38%,
    #dde7f8 47%,
    #e9f1fe 50%,
    #dde7f8 53%,
    #edf1f7 62%,
    #edf1f7 100%
  );
  --shp-ease: cubic-bezier(0.45, 0.05, 0.35, 1);
}

@keyframes shp-sweep {
  0% {
    background-position: 180% 0;
  }
  100% {
    background-position: -80% 0;
  }
}
@keyframes shp-radio-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
    border-color: #cbd5e1;
  }
  50% {
    box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.12);
    border-color: #2563eb;
  }
}
@keyframes shp-dot-bounce {
  0%,
  80%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

/* Grund-primitiv: det diagonala blå svepet */
.shp-sk {
  background: var(--shp-sweep);
  background-size: 260% 100%;
  animation: shp-sweep 1.7s var(--shp-ease) infinite;
  border-radius: 8px;
}

/* ---- Prov: frågeyta (verbalt-prov / kvantitativt-prov)
   Skelettet återanvänder de RIKTIGA klasserna .category-title och .question
   som wrappers, så att bredd/marginaler/brytpunkter ärvs exakt och skelettet
   hamnar på precis samma plats som de riktiga frågorna (mobil + desktop).
   Endast innehållet nedan är skelett-specifikt. ---- */
.shp-exam {
  width: 100%;
}
.shp-exam__titlebar {
  width: 40%;
  max-width: 240px;
  height: 1.15em;
  border-radius: 6px;
}
.shp-q__line {
  margin-bottom: 10px;
}
.shp-q__opts {
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin-top: 16px;
}
.shp-q__opt {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 14px;
  border: 1.5px solid #e8ecf2;
  border-radius: 10px;
}
.shp-radio {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  flex: 0 0 auto;
}
.shp-radio--live {
  animation: shp-radio-pulse 1.7s ease-in-out infinite;
}

/* ---- Dokument (veckorapport-modal) ---- */
.shp-doc {
  padding: 20px 22px;
}
.shp-doc__stats {
  display: flex;
  gap: 10px;
  margin: 18px 0 20px;
}
.shp-doc__stats .shp-sk {
  flex: 1;
  height: 52px;
  border-radius: 12px;
}
.shp-doc__p {
  height: 11px;
  margin-bottom: 9px;
}

/* ---- Flashcard ---- */
.shp-flash {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  height: 100%;
}
.shp-flash__lines {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 11px;
  width: 100%;
}

/* ---- Sidladdare (helskärms-overlay på provsidorna) ---- */
.shp-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.shp-loader__bar {
  width: min(200px, 44vw);
  height: 12px;
  border-radius: 999px;
}

/* ---- Prickar (laddningsindikator) ---- */
.shp-dots {
  display: inline-flex;
  gap: 7px;
}
.shp-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2563eb;
  display: inline-block;
  animation: shp-dot-bounce 1.4s ease-in-out infinite;
}

/* ============================================================
   Översikt (dashboard) — klass-styrt: #overview-stats-content.shp-loading
   Ritar skelett ovanpå befintlig markup utan att röra render-logiken.
   ============================================================ */
.shp-loading .display-per,
.shp-loading .percent-per {
  color: transparent !important;
  position: relative;
}
.shp-loading .display-per::after,
.shp-loading .percent-per::after {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 6px;
  background: var(--shp-sweep);
  background-size: 260% 100%;
  animation: shp-sweep 1.7s var(--shp-ease) infinite;
}
.shp-loading .display-per::after {
  width: 68px;
  height: 24px;
}
.shp-loading .percent-per::after {
  width: 40px;
  height: 12px;
}

/* Linjediagram + donut */
.shp-loading #scoreChart,
.shp-loading #donutChart {
  visibility: hidden;
}
.shp-loading #snittgraf-container {
  position: relative;
}
.shp-loading #snittgraf-container::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  height: 55%;
  border-radius: 12px;
  background: var(--shp-sweep);
  background-size: 260% 100%;
  animation: shp-sweep 1.7s var(--shp-ease) infinite;
}
.shp-loading .chart-container {
  position: relative;
}
.shp-loading .chart-container::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 128px;
  height: 128px;
  border-radius: 50%;
  background: var(--shp-sweep);
  background-size: 260% 100%;
  animation: shp-sweep 1.7s var(--shp-ease) infinite;
  -webkit-mask: radial-gradient(circle, transparent 36px, #000 37px);
  mask: radial-gradient(circle, transparent 36px, #000 37px);
}
