/* Loading Overlay and Animation Styles */

/* Full page loading overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 15, 15, 0.98); /* Dark background with slight transparency */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999; /* Ensure it's above everything */
  transition: opacity 0.3s ease-out;
}

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

/* Loading content container */
.loading-content {
  text-align: center;
  color: #ffffff;
}

/* Karaoke microphone animation */
.loading-animation {
  width: 120px;
  height: 120px;
  margin: 0 auto 2rem;
  position: relative;
}

/* Microphone icon */
.microphone {
  width: 60px;
  height: 60px;
  margin: 0 auto;
  position: relative;
  animation: bounce 1.5s ease-in-out infinite;
}

.microphone::before {
  content: "🎤";
  font-size: 60px;
  display: block;
  animation: rotate 3s linear infinite;
}

/* Sound waves animation */
.sound-waves {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.wave {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border-radius: 50%;
  border: 2px solid #bb86fc;
  opacity: 0;
  animation: wave-animation 2s linear infinite;
}

.wave:nth-child(2) {
  animation-delay: 0.5s;
}

.wave:nth-child(3) {
  animation-delay: 1s;
}

/* Loading text */
.loading-text {
  font-size: 1.25rem;
  font-weight: 600;
  color: #bb86fc;
  margin-bottom: 0.5rem;
}

.loading-subtext {
  font-size: 0.875rem;
  color: #b3b3b3;
  opacity: 0.8;
}

/* Animations */
@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes wave-animation {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(4);
    opacity: 0;
  }
}

/* Dots animation for loading text */
.loading-dots::after {
  content: '';
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
  100% { content: ''; }
}

/* Ensure body content is hidden during loading */
body.loading-active {
  overflow: hidden;
}

body.loading-active > *:not(.loading-overlay) {
  opacity: 0;
  pointer-events: none;
}

/* Admin page specific styling */
.admin-loading .loading-text {
  color: #4caf50;
}

.admin-loading .wave {
  border-color: #4caf50;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .loading-animation {
    width: 100px;
    height: 100px;
  }
  
  .microphone::before {
    font-size: 50px;
  }
  
  .loading-text {
    font-size: 1.125rem;
  }
  
  .loading-subtext {
    font-size: 0.8rem;
  }
}