/* Inspect247 circuit reconnect — Imagine brand emblem with handshake motion.
   Keep Blazor state rules in ReconnectModal.razor.css; visuals live here
   so they are not scoped and do not collide with desk-cost / miles theming. */

#components-reconnect-modal {
  --reconnect-swoosh: #1e6fe3;
  --reconnect-swoosh-soft: rgba(30, 111, 227, 0.22);
  --reconnect-accent: #c40040;
  --reconnect-ring: rgba(30, 111, 227, 0.42);
  --reconnect-halo: rgba(30, 111, 227, 0.4);
  --reconnect-sheen: rgba(255, 255, 255, 0.55);
  --reconnect-tick: #1e6fe3;
  background: var(--i247-card, #ffffff);
  color: var(--i247-text, #1a2332);
  width: min(24rem, calc(100vw - 2rem));
  margin: 18vh auto;
  padding: 1.6rem 1.4rem 1.45rem;
  border: 1px solid var(--i247-border, #e0e6ed);
  border-radius: 16px;
  box-shadow: 0 18px 48px rgba(11, 31, 58, 0.18);
  opacity: 0;
  transition: display 0.5s allow-discrete, overlay 0.5s allow-discrete;
  animation: components-reconnect-modal-fadeOutOpacity 0.5s both;
  color-scheme: inherit;
}

#components-reconnect-modal[open] {
  animation: components-reconnect-modal-slideUp 1.5s cubic-bezier(.05, .89, .25, 1.02) 0.3s, components-reconnect-modal-fadeInOpacity 0.5s ease-in-out 0.3s;
  animation-fill-mode: both;
}

@media (prefers-color-scheme: dark) {
  #components-reconnect-modal {
    --reconnect-swoosh: #5ba3ff;
    --reconnect-swoosh-soft: rgba(91, 163, 255, 0.28);
    --reconnect-accent: #ff5a8a;
    --reconnect-ring: rgba(91, 163, 255, 0.5);
    --reconnect-halo: rgba(91, 163, 255, 0.46);
    --reconnect-sheen: rgba(255, 255, 255, 0.38);
    --reconnect-tick: #8ec4ff;
    background: var(--i247-card, #1a2332);
    color: var(--i247-text, #e8eef3);
    border-color: var(--i247-border, #2d3a47);
    box-shadow: 0 22px 56px rgba(0, 0, 0, 0.42);
  }
}

html[data-theme="light"] #components-reconnect-modal {
  --reconnect-swoosh: #1e6fe3;
  --reconnect-swoosh-soft: rgba(30, 111, 227, 0.22);
  --reconnect-accent: #c40040;
  --reconnect-ring: rgba(30, 111, 227, 0.42);
  --reconnect-halo: rgba(30, 111, 227, 0.4);
  --reconnect-sheen: rgba(255, 255, 255, 0.55);
  --reconnect-tick: #1e6fe3;
  background: var(--i247-card, #ffffff);
  color: var(--i247-text, #1a2332);
  border-color: var(--i247-border, #e0e6ed);
  box-shadow: 0 18px 48px rgba(11, 31, 58, 0.18);
}

html[data-theme="dark"] #components-reconnect-modal {
  --reconnect-swoosh: #5ba3ff;
  --reconnect-swoosh-soft: rgba(91, 163, 255, 0.28);
  --reconnect-accent: #ff5a8a;
  --reconnect-ring: rgba(91, 163, 255, 0.5);
  --reconnect-halo: rgba(91, 163, 255, 0.46);
  --reconnect-sheen: rgba(255, 255, 255, 0.38);
  --reconnect-tick: #8ec4ff;
  background: var(--i247-card, #1a2332);
  color: var(--i247-text, #e8eef3);
  border-color: var(--i247-border, #2d3a47);
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.42);
}

#components-reconnect-modal::backdrop {
  background-color: rgba(11, 31, 58, 0.48);
  animation: components-reconnect-modal-fadeInOpacity 0.5s ease-in-out;
  opacity: 1;
}

@media (prefers-color-scheme: dark) {
  #components-reconnect-modal::backdrop {
    background-color: rgba(7, 21, 38, 0.72);
  }
}

html[data-theme="light"] #components-reconnect-modal::backdrop {
  background-color: rgba(11, 31, 58, 0.48);
}

html[data-theme="dark"] #components-reconnect-modal::backdrop {
  background-color: rgba(7, 21, 38, 0.72);
}

@keyframes components-reconnect-modal-slideUp {
  0% { transform: translateY(30px) scale(0.95); }
  100% { transform: translateY(0); }
}

@keyframes components-reconnect-modal-fadeInOpacity {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes components-reconnect-modal-fadeOutOpacity {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

.components-reconnect-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.components-reconnect-actions {
  display: none;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

#components-reconnect-modal p {
  margin: 0;
  text-align: center;
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.45;
}

#components-reconnect-modal button {
  border: 0;
  background-color: #1565c0;
  color: #fff;
  padding: 0.5rem 1.15rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

#components-reconnect-modal button:hover {
  background-color: #0d47a1;
}

#components-reconnect-modal button:active {
  background-color: #1565c0;
}

#components-reload-button {
  background-color: #455a64;
}

#components-reload-button:hover {
  background-color: #37474f;
}

#components-reconnect-modal .components-rejoining-animation {
  position: relative;
  width: min(228px, 68vw);
  height: auto;
  aspect-ratio: 1;
}

#components-reconnect-modal .reconnect-logo {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  animation: reconnect-logo-float 3.8s ease-in-out 1.1s infinite;
}

#components-reconnect-modal .reconnect-logo-halo {
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--reconnect-halo) 0%, transparent 70%);
  filter: blur(8px);
  animation: reconnect-halo 2.4s ease-in-out 0.4s infinite;
  pointer-events: none;
}

#components-reconnect-modal .reconnect-scene {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

#components-reconnect-modal .reconnect-logo-core {
  position: absolute;
  inset: 11%;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(11, 31, 58, 0.22);
  animation: reconnect-logo-in 0.95s cubic-bezier(0.16, 0.84, 0.32, 1.12) 0.12s both;
}

#components-reconnect-modal .reconnect-logo-mark {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#components-reconnect-modal .reconnect-logo-sheen {
  position: absolute;
  inset: -30%;
  background: linear-gradient(118deg, transparent 36%, var(--reconnect-sheen) 49%, transparent 62%);
  transform: translateX(-70%);
  animation: reconnect-sheen 4.2s ease-in-out 1.35s infinite;
  pointer-events: none;
}

#components-reconnect-modal .reconnect-orbit {
  fill: none;
  stroke: url(#i247ReconnectOrbit);
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-dasharray: 8 7;
  transform-box: view-box;
  transform-origin: center;
  animation: reconnect-orbit-spin 9s linear infinite;
}

#components-reconnect-modal .reconnect-orbit-spin {
  transform-box: view-box;
  transform-origin: center;
  animation: reconnect-orbit-spin 6.4s linear infinite;
}

#components-reconnect-modal .reconnect-orbit-node-blue { fill: var(--reconnect-swoosh); }
#components-reconnect-modal .reconnect-orbit-node-red { fill: var(--reconnect-accent); }

#components-reconnect-modal .reconnect-pulse {
  fill: none;
  stroke: var(--reconnect-ring);
  stroke-width: 2.4;
  transform-box: view-box;
  transform-origin: center;
}

#components-reconnect-modal .reconnect-pulse-a {
  animation: reconnect-pulse 2.35s ease-out 0.35s infinite;
}

#components-reconnect-modal .reconnect-pulse-b {
  animation: reconnect-pulse 2.35s ease-out 1.5s infinite;
}

#components-reconnect-modal .reconnect-tick {
  fill: var(--reconnect-tick);
  transform-box: fill-box;
  transform-origin: center;
  animation: reconnect-tick 1.8s ease-in-out infinite;
}

#components-reconnect-modal .reconnect-tick:nth-child(2) { animation-delay: 0.22s; }
#components-reconnect-modal .reconnect-tick:nth-child(3) { animation-delay: 0.44s; }
#components-reconnect-modal .reconnect-tick:nth-child(4) { animation-delay: 0.66s; }

@keyframes reconnect-logo-in {
  0% { opacity: 0; transform: scale(0.72) rotate(-8deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

@keyframes reconnect-logo-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@keyframes reconnect-halo {
  0%, 100% { opacity: 0.55; transform: scale(0.96); }
  50% { opacity: 1; transform: scale(1.08); }
}

@keyframes reconnect-sheen {
  0%, 62% { transform: translateX(-70%); opacity: 0; }
  70% { opacity: 1; }
  86%, 100% { transform: translateX(70%); opacity: 0; }
}

@keyframes reconnect-orbit-spin {
  to { transform: rotate(360deg); }
}

@keyframes reconnect-pulse {
  0% { opacity: 0.55; transform: scale(0.78); }
  100% { opacity: 0; transform: scale(1.16); }
}

@keyframes reconnect-tick {
  0%, 55%, 100% { opacity: 0.25; transform: scale(0.7); }
  70% { opacity: 1; transform: scale(1.35); }
}

@media (prefers-reduced-motion: reduce) {
  #components-reconnect-modal .reconnect-logo,
  #components-reconnect-modal .reconnect-logo-halo,
  #components-reconnect-modal .reconnect-logo-core,
  #components-reconnect-modal .reconnect-logo-sheen,
  #components-reconnect-modal .reconnect-orbit,
  #components-reconnect-modal .reconnect-orbit-spin,
  #components-reconnect-modal .reconnect-pulse,
  #components-reconnect-modal .reconnect-tick {
    animation: none !important;
    opacity: 1;
    transform: none;
  }
}
