/* Global loading styles for preventing black screen perception */

/* Initial page load spinner - shown before React initializes */
#initial-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.3s ease;
}

#initial-loader.loaded {
  opacity: 0;
  pointer-events: none;
}

#initial-loader .spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

#initial-loader .text {
  margin-top: 20px;
  color: #666;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  font-size: 14px;
}

#initial-loader .timeout-warning {
  margin-top: 10px;
  color: #dc3545;
  font-size: 12px;
  display: none;
}

#initial-loader.timeout .timeout-warning {
  display: block;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Fallback for very slow connections */
@media (prefers-reduced-motion: reduce) {
  #initial-loader .spinner {
    animation: pulse 2s ease-in-out infinite;
  }
  
  @keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
  }
}
