/* ===== VALHMC LOADER - VIKING STYLE ===== */

/* Loader Container */
#valhmc-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #0a0a17;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

/* Background Pattern */
#valhmc-loader::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 20% 50%, rgba(78, 208, 242, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(212, 175, 55, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.02) 0%, transparent 50%);
  animation: loaderBgPulse 4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes loaderBgPulse {
  0%, 100% {
    opacity: 0.5;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

/* Viking Particles Background */
.loader-particles {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}

.loader-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--particle-color, #4ed0f2);
  border-radius: 50%;
  opacity: 0;
  animation: particleFloat 8s linear infinite;
}

@keyframes particleFloat {
  0% {
    opacity: 0;
    transform: translateY(100vh) scale(0);
  }
  10% {
    opacity: 0.6;
    transform: translateY(90vh) scale(1);
  }
  90% {
    opacity: 0.6;
    transform: translateY(10vh) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(0) scale(0);
  }
}

/* Logo Container */
.loader-logo-container {
  position: relative;
  margin-bottom: 3rem;
  animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-15px) scale(1.02);
  }
}

.loader-logo {
  width: 150px;
  height: 150px;
  filter: drop-shadow(0 0 40px rgba(78, 208, 242, 0.8));
  animation: logoPulse 2s ease-in-out infinite;
  position: relative;
  z-index: 2;
}

@keyframes logoPulse {
  0%, 100% {
    filter: drop-shadow(0 0 40px rgba(78, 208, 242, 0.8));
  }
  50% {
    filter: drop-shadow(0 0 60px rgba(78, 208, 242, 1));
  }
}

/* Glow Effect Behind Logo */
.loader-logo-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(78, 208, 242, 0.3) 0%, transparent 70%);
  border-radius: 50%;
  filter: blur(30px);
  animation: glowPulse 3s ease-in-out infinite;
  z-index: 1;
}

@keyframes glowPulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.6;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.3);
    opacity: 0.3;
  }
}

/* Energy Lines Effect */
.loader-energy-lines {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 250px;
  height: 250px;
  pointer-events: none;
}

.energy-line {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2px;
  height: 100px;
  background: linear-gradient(to bottom, transparent, #4ed0f2, transparent);
  transform-origin: center bottom;
  opacity: 0;
  animation: energyFlow 3s ease-in-out infinite;
}

.energy-line:nth-child(1) {
  transform: translate(-50%, -50%) rotate(0deg);
  animation-delay: 0s;
}

.energy-line:nth-child(2) {
  transform: translate(-50%, -50%) rotate(72deg);
  animation-delay: 0.6s;
}

.energy-line:nth-child(3) {
  transform: translate(-50%, -50%) rotate(144deg);
  animation-delay: 1.2s;
}

.energy-line:nth-child(4) {
  transform: translate(-50%, -50%) rotate(216deg);
  animation-delay: 1.8s;
}

.energy-line:nth-child(5) {
  transform: translate(-50%, -50%) rotate(288deg);
  animation-delay: 2.4s;
}

@keyframes energyFlow {
  0%, 100% {
    opacity: 0;
    height: 50px;
  }
  50% {
    opacity: 0.8;
    height: 120px;
  }
}

/* Loading Text */
.loader-text {
  font-family: "Nunito", sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 2.5rem;
  opacity: 0.95;
  position: relative;
}

.loader-text::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #4ed0f2, transparent);
  animation: textUnderline 2s ease-in-out infinite;
}

@keyframes textUnderline {
  0%, 100% {
    width: 50px;
    opacity: 0.5;
  }
  50% {
    width: 100px;
    opacity: 1;
  }
}

/* Progress Bar Container */
.loader-progress-container {
  width: 300px;
  max-width: 80vw;
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
  margin-bottom: 1rem;
  border: 1px solid rgba(78, 208, 242, 0.1);
}

/* Progress Bar */
.loader-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #4ed0f2 0%, #6ee7ff 50%, #4ed0f2 100%);
  background-size: 200% 100%;
  border-radius: 10px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: progressGradient 2s linear infinite;
  position: relative;
  overflow: hidden;
}

.loader-progress-bar::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
  animation: progressShine 2s ease-in-out infinite;
}

@keyframes progressGradient {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}

@keyframes progressShine {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* Progress Text */
.loader-progress-text {
  font-family: "Nunito", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #b8c5d6;
  margin-bottom: 0.5rem;
}

/* Loading Status */
.loader-status {
  font-family: "Nunito", sans-serif;
  font-size: 0.9rem;
  color: #94a3b8;
  opacity: 0.8;
  min-height: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.4;
  margin-top: 0.5rem;
}

.loader-status small {
  display: block;
  margin-top: 0.3rem;
}

/* Rune Decorations */
.loader-runes {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 1.5rem;
  opacity: 0.2;
}

.loader-rune {
  font-size: 1.5rem;
  color: #4ed0f2;
  opacity: 0;
  animation: runeFade 4s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
  filter: blur(0.5px);
}

@keyframes runeFade {
  0%, 100% {
    opacity: 0;
    transform: translateY(10px);
  }
  50% {
    opacity: 0.6;
    transform: translateY(0);
  }
}

/* Fade Out Animation */
#valhmc-loader.fade-out {
  opacity: 0;
  pointer-events: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .loader-logo {
    width: 120px;
    height: 120px;
  }
  
  /* Remove shield reference */
  
  .loader-text {
    font-size: 1.4rem;
  }
  
  .loader-progress-container {
    width: 250px;
  }
  
  .loader-runes {
    bottom: 30px;
    gap: 1.5rem;
  }
  
  .loader-rune {
    font-size: 1.5rem;
  }
  
  /* Reduce particles on mobile */
  .loader-particle:nth-child(n+15) {
    display: none;
  }
  
  /* Simplify animations on mobile */
  .loader-energy-lines {
    display: none;
  }
  
  @keyframes logoFloat {
    0%, 100% {
      transform: translateY(0) scale(1);
    }
    50% {
      transform: translateY(-10px) scale(1.02);
    }
  }
}

/* Extra Small Devices */
@media (max-width: 480px) {
  .loader-logo {
    width: 100px;
    height: 100px;
  }
  
  /* Remove shield reference */
  
  .loader-text {
    font-size: 1.2rem;
    letter-spacing: 2px;
  }
  
  .loader-progress-container {
    width: 200px;
  }
}

/* Loading Complete Animation */
.loader-complete {
  animation: completeFlash 0.6s ease-out;
}

@keyframes completeFlash {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
    filter: brightness(1.5);
  }
  100% {
    transform: scale(1);
  }
}

/* Modern Accent Lines */
.loader-accent-line {
  position: absolute;
  width: 100px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #d4af37, transparent);
  opacity: 0.5;
}

.loader-accent-line.top {
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  animation: lineSlide 3s ease-in-out infinite;
}

.loader-accent-line.bottom {
  bottom: 20%;
  left: 50%;
  transform: translateX(-50%);
  animation: lineSlide 3s ease-in-out infinite reverse;
}

@keyframes lineSlide {
  0%, 100% {
    transform: translateX(-50%) scaleX(0.5);
    opacity: 0.3;
  }
  50% {
    transform: translateX(-50%) scaleX(1.5);
    opacity: 0.8;
  }
}