/* ===================================================
   SIMPLE MINIMALIST PRELOADER
   Black galaxy with stars and simple loading bar
   Design by @itzzVeer - Simple and crispy
=================================================== */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Rajdhani:wght@300;400;500;600;700&display=swap');

/* Color Variables */
:root {
  --preloader-bg: #000000;
  --preloader-cyan: #00f5ff;
  --preloader-purple: #bf00ff;
  --preloader-white: rgba(255, 255, 255, 0.8);
  --preloader-white-dim: rgba(255, 255, 255, 0.6);
}

/* Main Loader Container - Pure Black Background */
.loading-screen {
  background: var(--preloader-bg);
  overflow: hidden;
  position: relative;
}

/* Starfield Background */
.loading-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(2px 2px at 20% 30%, white, transparent),
    radial-gradient(2px 2px at 60% 70%, white, transparent),
    radial-gradient(1px 1px at 50% 50%, white, transparent),
    radial-gradient(1px 1px at 80% 10%, white, transparent),
    radial-gradient(2px 2px at 90% 60%, white, transparent),
    radial-gradient(1px 1px at 33% 80%, white, transparent),
    radial-gradient(1px 1px at 15% 90%, white, transparent),
    radial-gradient(2px 2px at 70% 40%, white, transparent);
  background-size: 200% 200%;
  background-position: 0% 0%;
  animation: starTwinkle 8s ease-in-out infinite;
  opacity: 0.8;
}

@keyframes starTwinkle {
  0%, 100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

/* Loading Bar Container */
.loading-logo-wrapper {
  position: relative;
  width: 400px;
  height: auto;
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Simple Loading Bar */
.hex-ring {
  position: relative;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.hex-ring::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--preloader-cyan), var(--preloader-purple), var(--preloader-cyan));
  background-size: 200% 100%;
  border-radius: 2px;
  animation: loadingBar 2.5s ease-in-out infinite;
  box-shadow: 
    0 0 10px rgba(0, 245, 255, 0.6),
    0 0 20px rgba(191, 0, 255, 0.4);
}

@keyframes loadingBar {
  0% {
    width: 0%;
    background-position: 0% 0%;
  }
  50% {
    width: 70%;
    background-position: 100% 0%;
  }
  100% {
    width: 100%;
    background-position: 200% 0%;
  }
}

/* Hide other blob layers - only use first one for loading bar */
.hex-ring-1 {
  display: block;
  animation: none;
  opacity: 1;
}

.hex-ring-2,
.hex-ring-3,
.hex-ring-4 {
  display: none;
}

/* Loading Text - Minimalist */
.loading-logo {
  position: relative;
  bottom: auto;
  left: auto;
  transform: none;
  margin-top: 1.5rem;
  z-index: 10;
  font-family: 'Orbitron', monospace;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 4px;
  color: var(--preloader-white);
  text-shadow: 0 0 10px rgba(0, 245, 255, 0.5);
  white-space: nowrap;
  text-transform: uppercase;
}

/* Floating stars - Enhanced starfield */
.loading-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.loading-particles .particle {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.8);
  opacity: 0;
  animation: particleFloat 6s ease-in-out infinite;
}

/* Create a starfield effect */
.loading-particles .particle:nth-child(1) {
  top: 10%;
  left: 15%;
  animation-delay: 0s;
}

.loading-particles .particle:nth-child(2) {
  top: 20%;
  right: 20%;
  animation-delay: 1s;
}

.loading-particles .particle:nth-child(3) {
  top: 40%;
  left: 10%;
  animation-delay: 2s;
}

.loading-particles .particle:nth-child(4) {
  top: 60%;
  right: 15%;
  animation-delay: 0.5s;
}

.loading-particles .particle:nth-child(5) {
  bottom: 30%;
  left: 25%;
  animation-delay: 1.5s;
}

.loading-particles .particle:nth-child(6) {
  bottom: 20%;
  right: 30%;
  animation-delay: 2.5s;
}

@keyframes particleFloat {
  0%, 100% {
    opacity: 0;
    transform: translateY(0) scale(1);
  }
  10% {
    opacity: 1;
  }
  50% {
    opacity: 1;
    transform: translateY(-20px) scale(1.5);
  }
  90% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-40px) scale(1);
  }
}

/* Loading text - Simple minimal */
.loading-text-wrapper {
  margin-top: 0;
  text-align: center;
}

.loading-text {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1rem;
  font-weight: 300;
  color: var(--preloader-white-dim);
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* Loading dots - Simple pulse */
.loading-dots {
  display: inline-flex;
  gap: 8px;
  margin-left: 8px;
  align-items: center;
}

.loading-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--preloader-white);
  animation: dotPulse 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(1) {
  animation-delay: 0s;
}

.loading-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes dotPulse {
  0%, 80%, 100% {
    opacity: 0.3;
    transform: scale(1);
  }
  40% {
    opacity: 1;
    transform: scale(1.3);
  }
}

/* Energy burst effect on completion */
.preloader-flash {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle, 
    rgba(0, 245, 255, 0.3) 0%, 
    rgba(0, 200, 255, 0.2) 30%,
    rgba(0, 150, 255, 0.1) 60%,
    transparent 90%
  );
  opacity: 0;
  pointer-events: none;
  z-index: 99999;
  animation: energyBurst 1s ease-out forwards;
}

@keyframes energyBurst {
  0% { 
    opacity: 0;
    transform: scale(0.5);
  }
  50% { 
    opacity: 1;
    transform: scale(1.2);
  }
  100% { 
    opacity: 0;
    transform: scale(2);
  }
}

/* Energy wave effect overlay */
.water-wave-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(to bottom, transparent 0%, rgba(0, 200, 255, 0.05) 100%);
  pointer-events: none;
  z-index: 99998;
  opacity: 0;
  animation: waveFadeIn 0.8s ease-out forwards;
}

@keyframes waveFadeIn {
  0% {
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

/* ===================================================
   RESPONSIVE DESIGN
=================================================== */

@media (max-width: 768px) {
  .loading-logo-wrapper {
    width: 300px;
  }
  
  .loading-logo {
    font-size: 0.8rem;
    letter-spacing: 3px;
  }
  
  .loading-text {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .loading-logo-wrapper {
    width: 250px;
  }
  
  .loading-logo {
    font-size: 0.7rem;
    letter-spacing: 2px;
  }
  
  .loading-text {
    font-size: 0.8rem;
  }
  
  .loading-dots span {
    width: 4px;
    height: 4px;
  }
}
