/* Shell boot overlay — full-viewport loading + ripple reveal after login / fresh load */

/* Dock panels mount during boot but stay hidden until reveal finishes (prevents glass filter bleed) */
body.shell-boot-active .dock-panel-hosts-root .dock-panel-host,
body.shell-boot-active #help-panel-anchor .dock-panel-host {
  visibility: hidden;
  pointer-events: none;
}

.shell-boot-overlay {
  --shell-boot-duration: 1.1s;
  --shell-boot-glow-delay: 0.6s;
  /* Fixed grid — not tied to panel color prefs (those can set --ea-grid-bg-color to #000) */
  --shell-boot-grid-bg: #04060c;
  --shell-boot-grid-line: rgba(82, 191, 255, 0.07);
  --shell-boot-grid-glow-top: rgba(82, 191, 255, 0.14);
  --shell-boot-grid-glow-bottom: rgba(11, 114, 209, 0.1);
  --shell-boot-grid-size: 40px;
  --shell-boot-grid-image:
    linear-gradient(var(--shell-boot-grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--shell-boot-grid-line) 1px, transparent 1px),
    radial-gradient(ellipse 90% 55% at 50% -15%, var(--shell-boot-grid-glow-top), transparent 58%),
    radial-gradient(ellipse 50% 35% at 100% 100%, var(--shell-boot-grid-glow-bottom), transparent);
  --shell-boot-grid-bg-size:
    var(--shell-boot-grid-size) var(--shell-boot-grid-size),
    var(--shell-boot-grid-size) var(--shell-boot-grid-size),
    100% 100%,
    100% 100%;
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  background-color: var(--shell-boot-grid-bg);
  background-image: var(--shell-boot-grid-image);
  background-size: var(--shell-boot-grid-bg-size);
  background-position: center center;
  background-attachment: fixed;
}

.shell-boot-overlay-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  z-index: 2;
  width: min(380px, 88vw);
  padding: 28px 32px 24px;
  border-radius: 16px;
  transition: opacity 0.2s ease;
}

.shell-boot-overlay-inner > * {
  position: relative;
  z-index: 1;
}

.shell-boot-progress {
  width: min(280px, 72vw);
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.shell-boot-progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(82, 191, 255, 0.85), rgba(140, 220, 255, 0.95));
  box-shadow: 0 0 12px rgba(82, 191, 255, 0.45);
  transition: width 0.12s linear;
}

.shell-boot-overlay.shell-boot-dismissing .shell-boot-overlay-inner {
  opacity: 0;
}

.shell-boot-logo {
  width: min(220px, 52vw);
  height: auto;
  opacity: 0.92;
  filter: drop-shadow(0 0 24px rgba(82, 191, 255, 0.25));
}

.shell-boot-status {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.shell-boot-ripple {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 3;
}

.shell-boot-ripple[hidden] {
  display: none;
}

.shell-boot-ripple-splash {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(82, 191, 255, 0.5) 38%,
    transparent 74%
  );
  animation: shell-boot-ripple-splash 0.18s ease-out forwards;
}

.shell-boot-ripple-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--ripple-diameter, 1200px);
  height: var(--ripple-diameter, 1200px);
  transform: translate(-50%, -50%) scale(0);
  border-radius: 50%;
  border: 2px solid rgba(82, 191, 255, 0.55);
  box-shadow:
    0 0 22px rgba(82, 191, 255, 0.35),
    inset 0 0 10px rgba(255, 255, 255, 0.18);
  animation: shell-boot-ripple-wave var(--shell-boot-duration) cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.shell-boot-overlay.shell-boot-border-glow {
  animation: shell-boot-border-pulse 0.32s ease-out var(--shell-boot-glow-delay) forwards;
}

@keyframes shell-boot-ripple-wave {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0.95;
    border-width: 3px;
  }
  14% { opacity: 1; }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0;
    border-width: 0.5px;
  }
}

@keyframes shell-boot-ripple-splash {
  0% {
    transform: translate(-50%, -50%) scale(0.15);
    opacity: 0;
  }
  40% { opacity: 1; }
  100% {
    transform: translate(-50%, -50%) scale(2);
    opacity: 0;
  }
}

@keyframes shell-boot-border-pulse {
  0% { box-shadow: inset 0 0 0 0 rgba(82, 191, 255, 0); }
  35% { box-shadow: inset 0 0 0 2px rgba(82, 191, 255, 0.75), inset 0 0 40px rgba(82, 191, 255, 0.2); }
  100% { box-shadow: inset 0 0 0 0 rgba(82, 191, 255, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .shell-boot-ripple-ring,
  .shell-boot-ripple-splash,
  .shell-boot-overlay.shell-boot-border-glow {
    animation: none !important;
  }
}

/* Mobile — boot card matches dock-panel-host standard bottom sheet */
@media (max-width: 480px) {
  .shell-boot-overlay {
    align-items: flex-end;
    justify-content: stretch;
    padding: 0 var(--dock-panel-mobile-inset-x, 8px) var(--dock-panel-mobile-inset-bottom, 8px);
    box-sizing: border-box;
  }

  .shell-boot-overlay-inner {
    width: 100%;
    max-width: var(--dock-panel-mobile-max-width, 99dvw);
    height: var(--dock-panel-mobile-height, 46dvh);
    max-height: var(--dock-panel-mobile-max-height, 46dvh);
    border-radius: var(--dock-panel-mobile-radius, 50px);
    padding: 1.5rem 1.25rem 1.25rem;
    box-sizing: border-box;
    justify-content: center;
    overflow: hidden;
  }

  .shell-boot-logo {
    width: min(180px, 48vw);
  }

  .shell-boot-progress {
    width: min(240px, 70%);
  }
}
