/* ==========================================================================
   NeoWasmBootLoader - Boot loader visual para aplicaciones WASM
   Estilo: Microsoft Fluent Design
   Namespace: neo-wasm-
   ========================================================================== */

.neo-wasm-loader {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f2f5;
  font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: #1a1a2e;
  transition: opacity 0.35s ease;
}

.neo-wasm-loader.neo-wasm-hidden {
  opacity: 0;
  pointer-events: none;
}

.neo-wasm-loader.neo-wasm-removed {
  display: none;
}

/* --- Card principal --- */
.neo-wasm-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: 420px;
  width: 90%;
  padding: 48px 40px 40px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
  text-align: center;
  box-sizing: border-box;
}

/* --- Compact variant --- */
.neo-wasm-card.neo-wasm-compact {
  padding: 28px 24px 24px;
  max-width: 360px;
  gap: 4px;
}

.neo-wasm-card.neo-wasm-compact .neo-wasm-logo-container {
  width: 56px;
  height: 56px;
  margin-bottom: 4px;
}

.neo-wasm-card.neo-wasm-compact .neo-wasm-logo-container img {
  max-width: 32px;
  max-height: 32px;
}

.neo-wasm-card.neo-wasm-compact .neo-wasm-logo-fallback {
  font-size: 18px;
}

.neo-wasm-card.neo-wasm-compact .neo-wasm-app-title {
  font-size: 18px;
}

.neo-wasm-card.neo-wasm-compact .neo-wasm-app-subtitle {
  font-size: 13px;
}

.neo-wasm-card.neo-wasm-compact .neo-wasm-status-title {
  font-size: 13px;
}

.neo-wasm-card.neo-wasm-compact .neo-wasm-description {
  font-size: 12px;
}

.neo-wasm-card.neo-wasm-compact .neo-wasm-progress {
  margin: 8px 0 4px;
}

/* --- Logo --- */
.neo-wasm-logo-container {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  background: #f0f2f5;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  overflow: hidden;
  flex-shrink: 0;
}

.neo-wasm-logo-container img {
  display: block;
  max-width: 44px;
  max-height: 44px;
  object-fit: contain;
}

.neo-wasm-logo-fallback {
  font-size: 24px;
  font-weight: 700;
  color: #6b7280;
  user-select: none;
  line-height: 1;
}

/* --- Textos --- */
.neo-wasm-app-title {
  font-size: 22px;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0;
  line-height: 1.3;
}

.neo-wasm-app-subtitle {
  font-size: 14px;
  font-weight: 400;
  color: #6b7280;
  margin: 0 0 4px;
  line-height: 1.4;
}

.neo-wasm-status-title {
  font-size: 14px;
  font-weight: 600;
  color: #4b5563;
  margin: 12px 0 0;
  line-height: 1.4;
}

.neo-wasm-description {
  font-size: 13px;
  font-weight: 400;
  color: #9ca3af;
  margin: 2px 0 0;
  line-height: 1.4;
}

/* --- Progress bar --- */
.neo-wasm-progress {
  width: 100%;
  margin: 16px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.neo-wasm-progress-track {
  width: 100%;
  height: 4px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.neo-wasm-progress-indicator {
  height: 100%;
  border-radius: 4px;
  background: #2563eb;
  transition: width 0.3s ease;
  position: relative;
}

/* Indeterminate mode */
.neo-wasm-progress-indicator.neo-wasm-progress-indeterminate {
  width: 30% !important;
  animation: neo-wasm-indeterminate 1.8s ease-in-out infinite;
}

@keyframes neo-wasm-indeterminate {
  0% {
    transform: translateX(-100%);
  }
  50% {
    transform: translateX(200%);
  }
  100% {
    transform: translateX(350%);
  }
}

.neo-wasm-progress-text {
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
  margin-top: 2px;
}

/* --- Responsive --- */
@media (max-width: 480px) {
  .neo-wasm-card {
    padding: 32px 20px 28px;
    border-radius: 8px;
  }

  .neo-wasm-logo-container {
    width: 60px;
    height: 60px;
  }

  .neo-wasm-logo-container img {
    max-width: 36px;
    max-height: 36px;
  }

  .neo-wasm-app-title {
    font-size: 18px;
  }
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  .neo-wasm-progress-indicator.neo-wasm-progress-indeterminate {
    animation-duration: 3.6s;
  }

  .neo-wasm-loader {
    transition: none;
  }

  .neo-wasm-progress-indicator {
    transition: none;
  }
}
