/* ========================================
   Premium Bootloader - MagnusIBA
   Shared across all pages
   ======================================== */
.bootloader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: stretch;
  justify-content: center;
  background: #000;
  overflow: hidden;
}

.bootloader.hidden {
  display: none;
}

.boot-stack {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.boot-bar {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.boot-yellow-top {
  background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%);
  animation: bootSlideDown 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transform: translateY(-100%);
}

.boot-black {
  background: linear-gradient(180deg, #0a0a0a 0%, #1a1a1a 50%, #0a0a0a 100%);
  animation: bootFadeIn 0.4s 0.3s ease-out forwards;
  opacity: 0;
  overflow: hidden;
}

.boot-yellow-bottom {
  background: linear-gradient(0deg, #fbbf24 0%, #f59e0b 100%);
  animation: bootSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transform: translateY(100%);
  position: relative;
}

@keyframes bootSlideDown {
  to { transform: translateY(0); }
}

@keyframes bootSlideUp {
  to { transform: translateY(0); }
}

@keyframes bootFadeIn {
  to { opacity: 1; }
}

/* Vocabulary Display */
.boot-vocabulary {
  font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  font-size: clamp(24px, 5vw, 56px);
  font-weight: 700;
  color: #fbbf24;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  text-align: center;
  padding: 0 20px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-shadow:
    0 0 40px rgba(251, 191, 36, 0.5),
    0 0 80px rgba(251, 191, 36, 0.3),
    0 0 120px rgba(251, 191, 36, 0.1);
  animation: vocabGlow 2s ease-in-out infinite alternate;
}

@keyframes vocabGlow {
  0% {
    text-shadow:
      0 0 40px rgba(251, 191, 36, 0.5),
      0 0 80px rgba(251, 191, 36, 0.3);
  }
  100% {
    text-shadow:
      0 0 60px rgba(251, 191, 36, 0.7),
      0 0 100px rgba(251, 191, 36, 0.5),
      0 0 140px rgba(251, 191, 36, 0.2);
  }
}

/* Animated Dots */
.boot-dots {
  display: inline-flex;
  margin-left: 4px;
}

.boot-dots span {
  animation: bootDotBounce 1.4s ease-in-out infinite;
  opacity: 0;
}

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

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

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

@keyframes bootDotBounce {
  0%, 60%, 100% {
    opacity: 0;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-8px);
  }
}

/* Logo Circle */
.boot-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: clamp(90px, 22vw, 160px);
  height: clamp(90px, 22vw, 160px);
  background: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 0 8px rgba(0, 0, 0, 0.1),
    0 20px 60px rgba(0, 0, 0, 0.3),
    0 0 100px rgba(251, 191, 36, 0.4);
  animation: bootCircleIn 0.8s 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0);
}

@keyframes bootCircleIn {
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.boot-logo {
  width: 55%;
  height: 55%;
  object-fit: contain;
  border-radius: 50%;
  animation: bootLogoSpin 3s ease-in-out infinite;
}

@keyframes bootLogoSpin {
  0%, 100% {
    transform: rotate(0deg) scale(1);
  }
  25% {
    transform: rotate(5deg) scale(1.05);
  }
  50% {
    transform: rotate(0deg) scale(1);
  }
  75% {
    transform: rotate(-5deg) scale(1.05);
  }
}

.boot-pulse {
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 3px solid #fbbf24;
  animation: bootPulse 1.5s ease-out infinite;
}

.boot-pulse::before,
.boot-pulse::after {
  content: '';
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 2px solid #fbbf24;
  animation: bootPulse 1.5s ease-out infinite;
}

.boot-pulse::before {
  animation-delay: 0.3s;
}

.boot-pulse::after {
  animation-delay: 0.6s;
}

@keyframes bootPulse {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

/* Fade out animation */
.bootloader.fade-out {
  animation: bootFadeOut 0.5s ease-out forwards;
}

@keyframes bootFadeOut {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

/* Mobile adjustments */
@media (max-width: 600px) {
  .boot-vocabulary {
    font-size: clamp(18px, 4.5vw, 32px);
    letter-spacing: 0.08em;
  }

  .boot-circle {
    width: 100px;
    height: 100px;
  }
}
