/* css/loading.css - Loading Screen Styles */

/* Loading Screen Overlay */
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

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

/* Cube Container */
.cube-container {
  display: flex;
  gap: 8px;
  perspective: 1000px;
}

/* Individual Cube */
.cube {
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 4px;
  animation: cubeJump 1.2s ease-in-out infinite;
  box-shadow: 
    0 0 20px rgba(24, 174, 243, 0.4),
    0 0 40px rgba(24, 174, 243, 0.2);
}

/* Stagger the animation for each cube */
.cube:nth-child(1) { animation-delay: 0s; }
.cube:nth-child(2) { animation-delay: 0.1s; }
.cube:nth-child(3) { animation-delay: 0.2s; }
.cube:nth-child(4) { animation-delay: 0.3s; }
.cube:nth-child(5) { animation-delay: 0.4s; }

/* Cube Jump Animation */
@keyframes cubeJump {
  0%, 100% {
    transform: translateY(0) scale(1) rotateX(0deg);
    opacity: 0.6;
    background: rgba(255, 255, 255, 0.7);
  }
  25% {
    transform: translateY(-25px) scale(1.1) rotateX(15deg);
    opacity: 1;
    background: #fff;
    box-shadow: 
      0 20px 30px rgba(24, 174, 243, 0.3),
      0 0 50px rgba(24, 174, 243, 0.5);
  }
  50% {
    transform: translateY(-15px) scale(0.95) rotateX(-10deg);
    opacity: 0.9;
  }
  75% {
    transform: translateY(-5px) scale(1.05) rotateX(5deg);
    opacity: 0.8;
  }
}

/* Additional Glow Effect */
.cube::after {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg, rgba(24, 174, 243, 0.5), rgba(25, 111, 151, 0.3));
  border-radius: 6px;
  z-index: -1;
  opacity: 0;
  animation: cubeGlow 1.2s ease-in-out infinite;
}

.cube:nth-child(1)::after { animation-delay: 0s; }
.cube:nth-child(2)::after { animation-delay: 0.1s; }
.cube:nth-child(3)::after { animation-delay: 0.2s; }
.cube:nth-child(4)::after { animation-delay: 0.3s; }
.cube:nth-child(5)::after { animation-delay: 0.4s; }

@keyframes cubeGlow {
  0%, 100% { opacity: 0; }
  25% { opacity: 0.8; }
  50% { opacity: 0.4; }
}

/* Light mode adjustments */
html[data-theme="light"] .loading-screen {
  background: var(--bg);
}

html[data-theme="light"] .cube {
  background: var(--accent);
  box-shadow: 
    0 0 20px rgba(12, 163, 233, 0.5),
    0 0 40px rgba(12, 163, 233, 0.3);
}

html[data-theme="light"] .cube::after {
  background: linear-gradient(135deg, rgba(12, 163, 233, 0.6), rgba(25, 111, 151, 0.4));
}

@keyframes cubeJump {
  0%, 100% {
    transform: translateY(0) scale(1) rotateX(0deg);
    opacity: 0.6;
  }
  25% {
    transform: translateY(-25px) scale(1.1) rotateX(15deg);
    opacity: 1;
  }
  50% {
    transform: translateY(-15px) scale(0.95) rotateX(-10deg);
    opacity: 0.9;
  }
  75% {
    transform: translateY(-5px) scale(1.05) rotateX(5deg);
    opacity: 0.8;
  }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  .cube {
    animation: cubePulse 2s ease-in-out infinite;
  }
  
  @keyframes cubePulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
  }
}
