/* erp-global-loader.css — branded global loading overlay */
html.elinom-page-loading body {
  overflow: hidden;
}

.module-loader,
.elinom-global-loader {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background:
    radial-gradient(ellipse 70% 55% at 50% 35%, rgba(59, 130, 246, 0.08), transparent 60%),
    linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
  border-radius: 20px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.module-loader.is-pending,
.elinom-global-loader.is-pending {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.module-loader.is-visible:not(.hidden),
.elinom-global-loader.is-visible:not(.hidden),
.module-loader:not(.hidden):not(.is-pending) {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.module-loader.hidden,
.elinom-global-loader.hidden {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.module-loader-brand,
.elinom-global-loader-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}

.module-loader-logo,
.elinom-global-loader-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  background: #fff;
}

.module-loader-mark,
.elinom-global-loader-mark {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #1d4ed8, #0ea5e9);
  color: #fff;
  font-weight: 800;
  font-size: 1.45rem;
  letter-spacing: -0.03em;
  box-shadow: 0 10px 28px rgba(29, 78, 216, 0.28);
  animation: elinomLoaderPulse 1.6s ease-in-out infinite;
}

.module-loader-brand-name,
.elinom-global-loader-brand-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}

.module-loader-bar,
.elinom-global-loader-bar {
  width: min(260px, 70vw);
  height: 6px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  position: relative;
}

.module-loader-bar::after,
.elinom-global-loader-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 40%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb, #38bdf8);
  animation: loaderSlide 1.2s ease-in-out infinite;
}

.module-loader-text,
.elinom-global-loader-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748b;
  letter-spacing: 0.02em;
  text-align: center;
  padding: 0 1rem;
}

.module-loader-skeleton {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 70%;
  max-width: 520px;
  margin-top: 0.35rem;
}

.module-loader-skeleton span {
  display: block;
  height: 14px;
  border-radius: 8px;
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
}

.module-loader-skeleton span:nth-child(1) { width: 100%; }
.module-loader-skeleton span:nth-child(2) { width: 80%; }
.module-loader-skeleton span:nth-child(3) { width: 60%; }

.elinom-global-loader--page {
  position: fixed;
  inset: 0;
  z-index: 99990;
  border-radius: 0;
}

.elinom-global-loader--host {
  position: absolute;
  inset: 0;
  z-index: 20;
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.92);
  backdrop-filter: blur(2px);
}

/* Compact host overlay used when uplifting table-row fa-spinners */
.elinom-global-loader--host .module-loader-skeleton,
.elinom-global-loader--host .elinom-global-loader-skeleton {
  max-width: 360px;
}

.elinom-global-loader--host .module-loader-logo,
.elinom-global-loader--host .elinom-global-loader-logo,
.elinom-global-loader--host .module-loader-mark,
.elinom-global-loader--host .elinom-global-loader-mark {
  width: 44px;
  height: 44px;
  font-size: 1.15rem;
  border-radius: 12px;
}

/* Hide raw table loading rows once branded overlay owns the wait state */
tr.elinom-loader-uplifted-row {
  visibility: hidden !important;
  pointer-events: none !important;
  height: 0 !important;
  max-height: 0 !important;
  line-height: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
}

tr.elinom-loader-uplifted-row > td {
  padding: 0 !important;
  border: 0 !important;
  height: 0 !important;
  line-height: 0 !important;
  overflow: hidden !important;
  font-size: 0 !important;
}

@keyframes elinomLoaderPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

@keyframes loaderSlide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .module-loader-mark,
  .elinom-global-loader-mark,
  .module-loader-bar::after,
  .elinom-global-loader-bar::after,
  .module-loader-skeleton span {
    animation: none !important;
  }
  .module-loader,
  .elinom-global-loader {
    transition: opacity 0.15s ease, visibility 0.15s ease;
  }
}

@media (max-width: 640px) {
  .module-loader-logo,
  .elinom-global-loader-logo,
  .module-loader-mark,
  .elinom-global-loader-mark {
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
  }
  .module-loader-skeleton {
    width: 84%;
  }
}
