#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.6s ease-out, visibility 0.6s ease-out;
}

#preloader.hidden {
  opacity: 0;
  visibility: hidden;
}

.preloader-logo {
  max-width: 400px;
  width: 80%;
  height: auto;
  animation: pulse 2s ease-in-out infinite;
  filter: invert(1)
          drop-shadow(0 0 30px rgba(59, 130, 246, 0.6))
          drop-shadow(0 0 60px rgba(59, 130, 246, 0.4))
          brightness(1.1) contrast(1.1);
}

.preloader-text {
  margin-top: 30px;
  color: #60a5fa;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 3px;
  text-transform: uppercase;
  animation: fadeInOut 1.5s ease-in-out infinite;
}

.spinner {
  margin-top: 20px;
  width: 50px;
  height: 50px;
  border: 3px solid rgba(59, 130, 246, 0.1);
  border-top: 3px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    filter: invert(1)
            drop-shadow(0 0 30px rgba(59, 130, 246, 0.6))
            drop-shadow(0 0 60px rgba(59, 130, 246, 0.4))
            brightness(1.1) contrast(1.1);
  }
  50% {
    transform: scale(1.05);
    filter: invert(1)
            drop-shadow(0 0 40px rgba(59, 130, 246, 0.8))
            drop-shadow(0 0 80px rgba(59, 130, 246, 0.5))
            brightness(1.2) contrast(1.2);
  }
}

@keyframes fadeInOut {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Hide body content while loading */
body:not(.loaded) #root {
  opacity: 0;
}

body.loaded #root {
  opacity: 1;
  animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
