/**
 * public/css/transitions.css
 * Page transition system:
 *   - Thin progress bar across the top (like YouTube/GitHub style)
 *   - Full-page fade-out on leave, fade-in on arrive
 *   - Logo mark spins briefly in the centre on slow loads
 */

/* ── Progress bar ─────────────────────────────────────────── */
#page-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  z-index: 9999;
  background: linear-gradient(
    90deg,
    var(--si-accent, #e53935) 0%,
    var(--secondary, #e8b84b) 60%,
    var(--si-accent, #e53935) 100%
  );
  background-size: 200% 100%;
  animation: progress-shimmer 1.4s linear infinite;
  transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.3s ease;
  pointer-events: none;
  box-shadow: 0 0 10px rgba(229,57,53,.6);
}
#page-progress.done {
  width: 100% !important;
  opacity: 0;
}
@keyframes progress-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position:   0% 0; }
}

/* ── Page fade wrapper ────────────────────────────────────── */
#page-content-wrap {
  animation: page-in 0.32s cubic-bezier(0.4, 0, 0.2, 1) both;
}
@keyframes page-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0);    }
}

/* Outgoing fade (added by JS before navigation) */
.page-leaving {
  animation: page-out 0.22s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
}
@keyframes page-out {
  from { opacity: 1; transform: translateY(0);    }
  to   { opacity: 0; transform: translateY(-8px); }
}

/* ── Centre spinner (shows only on slow loads > 400ms) ───── */
#page-spinner {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
#page-spinner.visible { display: flex; }
.spinner-ring {
  width: 44px; height: 44px;
  border: 3px solid var(--light-gray, #e8ecf0);
  border-top-color: var(--si-accent, #e53935);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner-dot {
  position: absolute;
  width: 10px; height: 10px;
  background: var(--si-base, #2d2d2d);
  border-radius: 50%;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Icon system CSS ──────────────────────────────────────── */
.si {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.si-svg {
  width:  1em;
  height: 1em;
  display: block;
}

/* Nav icon sizing */
.nav-icon { font-size: 18px; width: 18px; height: 18px; }
.nav-icon .si-svg { width: 18px; height: 18px; }

/* Service card icon */
.service-card-icon .si-svg { width: 36px; height: 36px; }

/* Highlight bar icon */
.highlight-icon .si-svg  { width: 26px; height: 26px; }

/* Stat card icon */
.stat-icon { font-size: 26px; }
.stat-icon .si-svg { width: 26px; height: 26px; }

/* Dashboard step icons */
.step-icon .si-svg { width: 40px; height: 40px; }

/* Inline text icons */
.si-inline { font-size: 1em; vertical-align: middle; }
.si-inline .si-svg { width: 1em; height: 1em; display: inline-block; vertical-align: middle; }

/* Sizes */
.si-sm  .si-svg { width: 16px; height: 16px; }
.si-md  .si-svg { width: 20px; height: 20px; }
.si-lg  .si-svg { width: 28px; height: 28px; }
.si-xl  .si-svg { width: 40px; height: 40px; }
.si-2xl .si-svg { width: 56px; height: 56px; }
