/* Shared terminal load overlay — used by BTLoading + route panels. */

.bt-load-frame {
  position: relative;
  min-height: 280px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  background: #0e1420;
  border: 1px solid var(--border, #1e293b);
  border-radius: 3px;
  overflow: hidden;
}

.bt-load-host {
  position: relative;
}

.bt-load-host.is-bt-loading {
  overflow: hidden;
  min-height: 220px;
}

.bt-load-host.is-bt-loading > *:not(.bt-load-overlay) {
  /* keep layout for absolute overlay hosts; chart hosts hide children */
}

.bt-load-host.bt-load-hide-children.is-bt-loading > *:not(.bt-load-overlay) {
  visibility: hidden;
  pointer-events: none;
}

.bt-load-overlay[hidden] {
  display: none !important;
}

.bt-load-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px 16px;
  background: #0e1420;
  z-index: 40;
  inset: 0;
}

.bt-load-host > .bt-load-overlay {
  position: absolute;
}

.bt-load-frame > .bt-load-overlay {
  position: relative;
  flex: 1 1 auto;
  min-height: 260px;
}

.bt-load-radar {
  position: relative;
  width: min(420px, 88vw);
  height: 88px;
  border: 1px solid var(--border, #1e293b);
  border-radius: 3px;
  background: #0a1018;
  overflow: hidden;
}

.bt-load-scan {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent, #38bdf8);
  opacity: 0.85;
  animation: bt-scan 1.6s linear infinite;
  z-index: 2;
  pointer-events: none;
}

@keyframes bt-scan {
  0% { top: 0; opacity: 0.2; }
  15% { opacity: 0.9; }
  85% { opacity: 0.9; }
  100% { top: calc(100% - 2px); opacity: 0.2; }
}

.bt-load-cells {
  position: absolute;
  inset: 8px;
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 4px;
  z-index: 1;
}

.bt-load-cell {
  border: 1px solid var(--border, #1e293b);
  border-radius: 2px;
  background: transparent;
  opacity: 0.35;
  transition: background 0.15s ease, opacity 0.15s ease, border-color 0.15s ease;
}

.bt-load-cell.is-lit {
  background: var(--accent, #38bdf8);
  border-color: var(--accent, #38bdf8);
  opacity: 0.55;
}

.bt-load-cell.is-head {
  opacity: 1;
  animation: bt-cell-blink 0.7s steps(2, end) infinite;
}

@keyframes bt-cell-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

.bt-load-kicker {
  font-family: "SF Mono", Menlo, monospace;
  font-size: 10px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--faint, #64748b);
  margin-top: 4px;
}

.bt-load-msg {
  font-family: "SF Mono", Menlo, monospace;
  font-size: 12px;
  color: var(--dim, #94a3b8);
  text-align: center;
  max-width: 520px;
  line-height: 1.35;
  min-height: 2.7em;
}

.bt-load-pct {
  font-family: "SF Mono", Menlo, monospace;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  color: var(--accent, #38bdf8);
  letter-spacing: 0.02em;
}

.bt-load-pulse {
  display: flex;
  gap: 6px;
  margin-top: 2px;
}

.bt-load-pulse span {
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background: var(--accent, #38bdf8);
  opacity: 0.25;
  animation: bt-pulse-dot 1s ease-in-out infinite;
}

.bt-load-pulse span:nth-child(2) { animation-delay: 0.15s; }
.bt-load-pulse span:nth-child(3) { animation-delay: 0.3s; }

@keyframes bt-pulse-dot {
  0%, 100% { opacity: 0.2; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-3px); }
}

.bt-load-bar {
  display: none;
  width: min(420px, 88vw);
  height: 6px;
  border-radius: 2px;
  background: var(--border, #1e293b);
  overflow: hidden;
  position: relative;
  margin-top: 2px;
}

.bt-load-overlay.is-progress .bt-load-bar {
  display: block;
}

.bt-load-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent, #38bdf8);
  transition: width 0.25s ease;
  position: relative;
  z-index: 1;
}

.bt-load-bar-chase {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 28%;
  height: 100%;
  background: var(--accent, #38bdf8);
  opacity: 0.35;
  animation: bt-chase 1.1s linear infinite;
}

.bt-load-overlay.is-indeterminate .bt-load-bar-chase {
  display: block;
}

@keyframes bt-chase {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(420%); }
}

/* Route #view cover */
#view.bt-load-host.is-bt-loading {
  min-height: calc(100vh - 180px);
}
