/**
 * Loading Overlay Component
 * 
 * Smooth, branded loading experience for controlled reloads
 */

.neuron-loading-overlay {
  /* Positioning */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  
  /* Visual */
  background: linear-gradient(
    135deg,
    rgba(15, 15, 25, 0.98) 0%,
    rgba(20, 20, 35, 0.98) 50%,
    rgba(15, 15, 25, 0.98) 100%
  );
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  
  /* Layout */
  display: flex;
  align-items: center;
  justify-content: center;
  
  /* Transition */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.neuron-loading-overlay--visible {
  opacity: 1;
  pointer-events: all;
}

.neuron-loading-overlay__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  text-align: center;
}

/* Spinner */
.neuron-loading-overlay__spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(124, 58, 237, 0.2);
  border-top-color: #7c3aed;
  border-radius: 50%;
  animation: neuron-spin 0.8s linear infinite;
  
  /* Add glow effect */
  box-shadow: 
    0 0 20px rgba(124, 58, 237, 0.3),
    0 0 40px rgba(124, 58, 237, 0.1);
}

@keyframes neuron-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Loading Text */
.neuron-loading-overlay__text {
  font-family: var(--font-primary, Vazir, Tahoma, Arial, sans-serif);
  font-size: 1rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
  letter-spacing: 0.01em;
  
  /* Subtle fade animation */
  animation: neuron-fade 1.5s ease-in-out infinite;
}

@keyframes neuron-fade {
  0%, 100% {
    opacity: 0.9;
  }
  50% {
    opacity: 0.5;
  }
}

/* Responsive adjustments */
@media (max-width: 48rem) {
  .neuron-loading-overlay__spinner {
    width: 40px;
    height: 40px;
  }
  
  .neuron-loading-overlay__text {
    font-size: 0.92rem;
    padding: 0 1.5rem;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .neuron-loading-overlay {
    transition: opacity 0.01ms;
  }
  
  .neuron-loading-overlay__spinner {
    animation: neuron-spin 2s linear infinite;
  }
  
  .neuron-loading-overlay__text {
    animation: none;
    opacity: 0.9;
  }
}

/* Print: hide loading overlay */
@media print {
  .neuron-loading-overlay {
    display: none !important;
  }
}
