/* پنجرهٔ اتصال دوباره به سرور؛ کلاس‌های components-reconnect-* را خود Blazor می‌گذارد */

.np-reconnect {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.45);
  font-family: var(--np-font-fa, inherit);
}

.np-reconnect.components-reconnect-show,
.np-reconnect.components-reconnect-retrying,
.np-reconnect.components-reconnect-failed,
.np-reconnect.components-reconnect-rejected,
.np-reconnect.components-reconnect-paused,
.np-reconnect.components-reconnect-resume-failed {
  display: flex;
}

.np-reconnect-card {
  display: grid;
  justify-items: center;
  gap: 0.75rem;
  width: min(26rem, 100%);
  padding: 1.5rem;
  border-radius: var(--np-radius, 12px);
  border: 1px solid var(--np-color-border, #d0d5dd);
  background: var(--np-color-surface, #fff);
  color: var(--np-color-text, #101828);
  box-shadow: var(--np-shadow-lg, 0 20px 40px rgba(15, 23, 42, 0.25));
  text-align: center;
  overflow-wrap: anywhere;
}

.np-reconnect-card p {
  margin: 0;
  line-height: 1.6;
}

.np-reconnect-spinner,
.np-reconnect-card [class*="np-rc-"] {
  display: none;
}

.np-reconnect-spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid color-mix(in srgb, var(--np-color-accent, #1a4a7a) 25%, transparent);
  border-top-color: var(--np-color-accent, #1a4a7a);
  border-radius: 50%;
  animation: np-reconnect-spin 0.9s linear infinite;
}

@keyframes np-reconnect-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .np-reconnect-spinner {
    animation: none;
  }
}

.np-reconnect-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.np-reconnect-actions button {
  border-radius: var(--np-radius-sm, 6px);
  cursor: pointer;
}

.np-rc-next {
  color: var(--np-color-muted, #667085);
  font-size: 0.9em;
}

/* در حال اتصال (اولین تلاش و تلاش‌های بعدی) */
.components-reconnect-show .np-reconnect-spinner,
.components-reconnect-retrying .np-reconnect-spinner {
  display: block;
}

.components-reconnect-show .np-rc-connecting,
.components-reconnect-retrying .np-rc-connecting {
  display: block;
}

.components-reconnect-retrying .np-rc-next {
  display: block;
}

/* همهٔ تلاش‌ها شکست خورد */
.components-reconnect-failed .np-rc-failed,
.components-reconnect-failed .np-rc-retry,
.components-reconnect-failed .np-rc-reload {
  display: block;
}

/* نشست موقتاً متوقف شده */
.components-reconnect-paused .np-rc-paused,
.components-reconnect-paused .np-rc-resume {
  display: block;
}

.components-reconnect-resume-failed .np-rc-resume-failed,
.components-reconnect-resume-failed .np-rc-resume,
.components-reconnect-resume-failed .np-rc-reload {
  display: block;
}

/* نشست روی سرور تمام شده */
.components-reconnect-rejected .np-rc-rejected,
.components-reconnect-rejected .np-rc-reload {
  display: block;
}
