/* public/css/loading.css */
/* FULL VIEWPORT REFACTOR - All px values converted to vw/vh where applicable */

#loading-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: opacity 0.6s ease-in-out;
  opacity: 1;
  overflow: hidden;
}

#loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s ease-in-out;
}

.loading-particles {
  position: absolute;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  overflow: hidden;
  z-index: 0;
}

.loading-particle {
  position: absolute;
  width: 0.4vh; height: 0.4vh;
  background: rgba(96, 165, 250, 0.6);
  border-radius: 50%;
  animation: float-particle 8s infinite ease-in-out;
}

.loading-particle:nth-child(1) { left: 10%; animation-delay: 0s; animation-duration: 6s; }
.loading-particle:nth-child(2) { left: 20%; animation-delay: 1s; animation-duration: 8s; }
.loading-particle:nth-child(3) { left: 30%; animation-delay: 2s; animation-duration: 7s; }
.loading-particle:nth-child(4) { left: 40%; animation-delay: 0.5s; animation-duration: 9s; }
.loading-particle:nth-child(5) { left: 50%; animation-delay: 1.5s; animation-duration: 6.5s; }
.loading-particle:nth-child(6) { left: 60%; animation-delay: 2.5s; animation-duration: 7.5s; }
.loading-particle:nth-child(7) { left: 70%; animation-delay: 0.8s; animation-duration: 8.5s; }
.loading-particle:nth-child(8) { left: 80%; animation-delay: 1.8s; animation-duration: 6.8s; }
.loading-particle:nth-child(9) { left: 90%; animation-delay: 3s; animation-duration: 7.2s; }

@keyframes float-particle {
  0%, 100% { transform: translateY(100vh) scale(0); opacity: 0; }
  10% { opacity: 1; transform: translateY(90vh) scale(1); }
  90% { opacity: 1; transform: translateY(10vh) scale(1); }
  100% { transform: translateY(0vh) scale(0); opacity: 0; }
}

.loading-logo-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(3vh); }
  to { opacity: 1; transform: translateY(0); }
}

.loading-logo {
  width: clamp(80px, 12vw, 140px);
  height: clamp(80px, 12vw, 140px);
  border-radius: 50%;
  object-fit: cover;
  animation: pulse-glow 2s ease-in-out infinite;
  box-shadow: 0 0 4vw rgba(96, 165, 250, 0.3);
}

@keyframes pulse-glow {
  0%, 100% { transform: scale(1); box-shadow: 0 0 4vw rgba(96, 165, 250, 0.3); }
  50% { transform: scale(1.05); box-shadow: 0 0 6vw rgba(96, 165, 250, 0.5), 0 0 8vw rgba(96, 165, 250, 0.3); }
}

.loading-logo-ring {
  position: absolute;
  width: clamp(100px, 16vw, 180px);
  height: clamp(100px, 16vw, 180px);
  border: 0.2vw solid transparent;
  border-top-color: rgba(96, 165, 250, 0.8);
  border-radius: 50%;
  animation: spin-ring 2s linear infinite;
}

.loading-logo-ring::before {
  content: '';
  position: absolute;
  top: 0.5vh; left: 0.5vh; right: 0.5vh; bottom: 0.5vh;
  border: 0.2vw solid transparent;
  border-bottom-color: rgba(139, 92, 246, 0.8);
  border-radius: 50%;
  animation: spin-ring 3s linear infinite reverse;
}

@keyframes spin-ring { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

#loading-message {
  color: #e5e7eb;
  font-family: 'Righteous', 'Arial', sans-serif;
  font-size: clamp(1rem, 1.25vw, 1.5rem);
  font-weight: 400;
  text-shadow: 0 0 2vw rgba(96, 165, 250, 0.5);
  margin-top: 4vh;
  letter-spacing: 0.2vw;
  animation: fadeIn 1s ease-out 0.3s both;
  position: relative;
  z-index: 1;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.loading-dots { display: inline-block; }
.loading-dots::after { content: '...'; animation: loading-dots-text 1.5s infinite; }

@keyframes loading-dots-text {
  0%, 20% { content: '.'; }
  40% { content: '..'; }
  60%, 100% { content: '...'; }
}

.loading-progress-container {
  width: clamp(150px, 20vw, 240px);
  height: 0.4vh;
  background: rgba(75, 85, 99, 0.3);
  border-radius: 0.2vh;
  margin-top: 2vh;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.loading-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #60a5fa, #a78bfa);
  border-radius: 0.2vh;
  animation: progress-shimmer 2s ease-in-out infinite;
}

@keyframes progress-shimmer {
  0% { width: 0%; }
  50% { width: 70%; }
  100% { width: 100%; }
}

.loading-waves {
  position: absolute;
  bottom: 0; left: 0;
  width: 100vw; height: 10vh;
  overflow: hidden;
  z-index: 0;
}

.wave {
  position: absolute;
  bottom: 0; left: 0;
  width: 200vw; height: 100%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320'%3E%3Cpath fill='%2360a5fa' fill-opacity='0.1' d='M0,192L48,197.3C96,203,192,213,288,229.3C384,245,480,267,576,250.7C672,235,768,181,864,181.3C960,181,1056,235,1152,234.7C1248,235,1344,181,1392,154.7L1440,128L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z'%3E%3C/path%3E%3C/svg%3E") repeat-x;
  background-size: 50% 100%;
  animation: wave 10s linear infinite;
}

.wave:nth-child(2) { bottom: 1vh; opacity: 0.5; animation: wave 8s linear infinite reverse; }

@keyframes wave { from { transform: translateX(0); } to { transform: translateX(-50%); } }
