/* ============================================
   LOADING SCREEN - Ironic Messages
   ============================================ */

.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(165deg, #1e293b 0%, #334155 50%, #475569 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.loading-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}

/* Loading Mascot */
.loading-mascot {
  width: auto;
  height: 560px;
  max-width: 400px;
  margin-bottom: 2rem;
  animation: loadingBounce 1.5s ease-in-out infinite;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.3));
  object-fit: contain;
}

@keyframes loadingBounce {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-20px) scale(1.05);
  }
}

/* Loading Spinner */
.loading-spinner {
  width: 60px;
  height: 60px;
  margin-bottom: 2rem;
  position: relative;
}

.loading-spinner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 4px solid rgba(212, 175, 55, 0.2);
  border-radius: 50%;
  border-top-color: #D4AF37;
  animation: spin 1s linear infinite;
}

.loading-spinner::after {
  content: '';
  position: absolute;
  top: 8px;
  left: 8px;
  width: calc(100% - 16px);
  height: calc(100% - 16px);
  border: 3px solid rgba(243, 156, 18, 0.3);
  border-radius: 50%;
  border-bottom-color: #f39c12;
  animation: spin 1.5s linear infinite reverse;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Loading Message Container */
.loading-message-container {
  text-align: center;
  max-width: 600px;
  padding: 0 2rem;
}

.loading-message {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 0.75rem;
  min-height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.5s ease;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.loading-message.fade {
  opacity: 0;
}

.loading-submessage {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 400;
  margin-top: 1rem;
}

/* Loading Dots Animation */
.loading-dots {
  display: inline-flex;
  gap: 0.4rem;
  margin-left: 0.5rem;
}

.loading-dots span {
  width: 8px;
  height: 8px;
  background: #D4AF37;
  border-radius: 50%;
  animation: dotPulse 1.4s ease-in-out infinite;
}

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

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

@keyframes dotPulse {
  0%, 60%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  30% {
    transform: scale(1.3);
    opacity: 0.7;
  }
}

/* Fun hover effect on the whole screen */
.loading-screen::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(212, 175, 55, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(243, 156, 18, 0.08) 0%, transparent 50%);
  animation: gradientPulse 8s ease-in-out infinite;
  pointer-events: none;
}

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

/* Responsive Design */
@media (max-width: 768px) {
  .loading-mascot {
    height: 440px;
    max-width: 320px;
    margin-bottom: 1.5rem;
  }

  .loading-spinner {
    width: 50px;
    height: 50px;
    margin-bottom: 1.5rem;
  }

  .loading-message {
    font-size: 1.25rem;
    min-height: 2.5rem;
  }

  .loading-submessage {
    font-size: 0.875rem;
  }
}

@media (max-width: 480px) {
  .loading-mascot {
    height: 360px;
    max-width: 260px;
    margin-bottom: 1.25rem;
  }

  .loading-spinner {
    width: 45px;
    height: 45px;
  }

  .loading-message {
    font-size: 1.1rem;
  }

  .loading-message-container {
    padding: 0 1.5rem;
  }
}

/* ============================================
   ACCESSIBILITY - REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  /* Disable specific animations */
  .loading-mascot,
  .loading-spinner,
  .loading-spinner::before,
  .loading-spinner::after,
  .loading-dots span,
  .loading-screen::before {
    animation: none !important;
  }

  /* Keep fade transitions instant */
  .loading-screen.fade-out {
    transition: opacity 0.01ms !important;
  }
}
