.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(255, 255, 255, 0.3);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 8999; /* Increased z-index */
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  /* Force hardware acceleration for better mobile performance */
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

.loading-gif {
  width: 64px;
  height: 64px;
  margin-bottom: 1rem;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
  /* Prevent image optimization issues on mobile */
  image-rendering: pixelated;
}

.loading-spinner {
  width: 64px;
  height: 64px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid #575257;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
  /* Force hardware acceleration */
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

.loading-message {
  color: #575257;
  font-weight: bold;
  text-align: center;
  font-size: 1.1rem;
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.8);
  background-color: rgba(255, 255, 255, 0.7);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Mobile-specific adjustments */
@media (max-width: 768px) {
  .loading-overlay {
    /* Ensure it covers mobile viewport including address bar */
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height for mobile browsers */
  }

  .loading-message {
    font-size: 1rem;
    padding: 0.75rem 1.25rem;
    max-width: 80vw;
    word-wrap: break-word;
  }
}
