/* Site-wide loading screen — sydiney.com + faded Kenya flag */

/* Kenya flag: black, white, red, white, green */
:root {
  --ke-black: #000000;
  --ke-white: #ffffff;
  --ke-red: #bb0000;
  --ke-green: #006b3f;
}

body.course-is-loading {
  overflow: hidden;
}

.course-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: #0f172a;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

/* Faded horizontal flag stripes */
.course-loading-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.82) 0%,
    rgba(0, 0, 0, 0.82) 31.5%,
    rgba(255, 255, 255, 0.22) 31.5%,
    rgba(255, 255, 255, 0.22) 33.5%,
    rgba(187, 0, 0, 0.75) 33.5%,
    rgba(187, 0, 0, 0.75) 64.5%,
    rgba(255, 255, 255, 0.22) 64.5%,
    rgba(255, 255, 255, 0.22) 66.5%,
    rgba(0, 107, 63, 0.82) 66.5%,
    rgba(0, 107, 63, 0.82) 100%
  );
  opacity: 0.48;
  pointer-events: none;
}

/* Soft vignette so text stays readable */
.course-loading-overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 70% at 50% 42%, rgba(255, 255, 255, 0.06), transparent 62%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.35) 0%, rgba(15, 23, 42, 0.5) 100%);
  opacity: 0.9;
  pointer-events: none;
}

.course-loading-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.course-loading-overlay__panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
  max-width: 22rem;
  padding: 2rem 2.5rem;
  background: rgba(15, 23, 42, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 1.125rem;
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.38);
  opacity: 0.94;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: course-loading-panel-in 0.55s ease forwards;
}

.course-loading-overlay__spinner {
  width: 2.75rem;
  height: 2.75rem;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--ke-white);
  border-right-color: rgba(187, 0, 0, 0.85);
  border-bottom-color: rgba(0, 107, 63, 0.85);
  border-radius: 50%;
  opacity: 0.92;
  animation: course-loading-spin 0.85s linear infinite;
}

.course-loading-overlay__brand {
  margin: 0;
  font-family: var(--font, system-ui, sans-serif);
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  line-height: 1.2;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.45);
  opacity: 0.98;
}

.course-loading-overlay__tagline {
  margin: 0;
  font-family: var(--font-heading, Georgia, serif);
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.45;
  opacity: 0.88;
}

@keyframes course-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes course-loading-panel-in {
  from {
    opacity: 0;
    transform: translateY(0.35rem) scale(0.98);
  }
  to {
    opacity: 0.94;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .course-loading-overlay {
    transition: opacity 0.15s ease, visibility 0.15s ease;
  }

  .course-loading-overlay__panel {
    animation: none;
    opacity: 0.94;
  }

  .course-loading-overlay__spinner {
    animation: none;
    border-top-color: rgba(255, 255, 255, 0.65);
  }
}
