/**
 * 1click - Loading Screen Styles
 * Provides smooth loading transitions for all pages
 */

/* ========================================
   LOADING SCREEN
   ======================================== */

.loading-screen {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Logo Animation */
.loading-logo {
  font-size: clamp(4rem, 15vw, 8rem);
  animation: loadingPulse 1.5s ease-in-out infinite;
  filter: drop-shadow(0 0 30px rgba(20, 184, 166, 0.5));
}

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

/* Loading Text */
.loading-text {
  margin-top: 2rem;
  font-family: 'Poppins', sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  background: linear-gradient(135deg, #14b8a6 0%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Progress Bar */
.loading-progress {
  width: min(300px, 80vw);
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  margin-top: 1.5rem;
  overflow: hidden;
  position: relative;
}

.loading-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #14b8a6 0%, #06b6d4 100%);
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s ease;
  animation: loadingProgress 2s ease-in-out infinite;
}

@keyframes loadingProgress {
  0% {
    width: 0%;
    left: 0;
  }
  50% {
    width: 70%;
    left: 15%;
  }
  100% {
    width: 0%;
    left: 100%;
  }
}

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

.loading-spinner::before,
.loading-spinner::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid transparent;
}

.loading-spinner::before {
  border-top-color: #14b8a6;
  border-right-color: #06b6d4;
  animation: spin 1s linear infinite;
}

.loading-spinner::after {
  border-bottom-color: #14b8a6;
  border-left-color: #06b6d4;
  animation: spin 1.5s linear infinite reverse;
}

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

/* ========================================
   SOUND TOGGLE BUTTON
   ======================================== */

.sound-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #14b8a6 0%, #06b6d4 100%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 15px rgba(20, 184, 166, 0.4);
  transition: all 0.3s ease;
  z-index: 1000;
}

.sound-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(20, 184, 166, 0.5);
}

.sound-toggle:active {
  transform: scale(0.95);
}

.sound-toggle.muted {
  background: linear-gradient(135deg, #64748b 0%, #475569 100%);
  box-shadow: 0 4px 15px rgba(100, 116, 139, 0.4);
}

.sound-toggle.muted:hover {
  box-shadow: 0 6px 20px rgba(100, 116, 139, 0.5);
}

/* ========================================
   PAGE TRANSITIONS
   ======================================== */

.page-transition {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.page-transition.active {
  opacity: 1;
  visibility: visible;
}

/* Fade in animation for content */
.fade-in {
  animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stagger animation for cards */
.stagger-in > * {
  opacity: 0;
  animation: staggerFadeIn 0.5s ease forwards;
}

.stagger-in > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-in > *:nth-child(2) { animation-delay: 0.15s; }
.stagger-in > *:nth-child(3) { animation-delay: 0.2s; }
.stagger-in > *:nth-child(4) { animation-delay: 0.25s; }
.stagger-in > *:nth-child(5) { animation-delay: 0.3s; }
.stagger-in > *:nth-child(6) { animation-delay: 0.35s; }
.stagger-in > *:nth-child(7) { animation-delay: 0.4s; }
.stagger-in > *:nth-child(8) { animation-delay: 0.45s; }

@keyframes staggerFadeIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================
   GAME LOADING SPECIFIC
   ======================================== */

.game-loading {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.game-loading.hidden {
  opacity: 0;
  visibility: hidden;
}

.game-loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(20, 184, 166, 0.2);
  border-top-color: #14b8a6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.game-loading-text {
  margin-top: 1rem;
  color: #94a3b8;
  font-size: 1rem;
}
