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

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

.loading-content {
  width: 90%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.loading-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Glitch Text Effect */
.glitch-text {
  font-size: 2.5rem;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  position: relative;
  text-shadow: 
    0 0 10px var(--accent-glow),
    0 0 20px var(--accent-glow),
    0 0 40px var(--accent-glow);
  animation: textGlow 2s infinite alternate;
}

.glitch-text:last-child {
  font-size: 1.5rem;
  color: var(--accent-highlight);
}

.glitch-text::before,
.glitch-text::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.8;
}

.glitch-text::before {
  animation: glitch-1 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) both infinite;
  color: var(--accent-secondary);
  z-index: -1;
}

.glitch-text::after {
  animation: glitch-2 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) reverse both infinite;
  color: var(--accent-primary);
  z-index: -2;
}

/* Loading Status */
.loading-status {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.status-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  letter-spacing: 0.1em;
}

.status-label {
  color: var(--accent-highlight);
  animation: textPulse 2s infinite;
}

.status-progress {
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
}

.loading-quadrant {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto;
}

.progress-ring {
  transform: rotate(-90deg);
}

.progress-ring circle {
  fill: none;
  stroke-width: 4;
}

.progress-ring-bg {
  stroke: var(--bg-surface);
}

.progress-ring circle {
  stroke-dasharray: 565.48; /* 2πr = 2 * π * 90 */
  stroke-dashoffset: 565.48;
  transition: stroke-dashoffset 0.5s ease-in-out;
}

.progress-ring-q1 {
  stroke: var(--accent-primary);
  opacity: 0;
}

.progress-ring-q2 {
  stroke: var(--accent-secondary);
  opacity: 0;
}

.progress-ring-q3 {
  stroke: var(--accent-highlight);
  opacity: 0;
}

.progress-ring-q4 {
  stroke: var(--text-primary);
  opacity: 0;
}

.loading-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.status-progress {
  font-size: 2rem;
  font-weight: 600;
  color: var(--accent-highlight);
  font-family: 'JetBrains Mono', monospace;
  text-shadow: 0 0 10px var(--accent-glow);
}

.quadrant-label {
  font-size: 0.75rem;
  color: var(--accent-secondary);
  letter-spacing: 0.2em;
  animation: textPulse 2s infinite;
}

/* Active quadrant animations */
.progress-ring circle.active {
  opacity: 1;
  animation: ringPulse 2s infinite;
}

@keyframes ringPulse {
  0% {
    stroke-width: 4;
    filter: drop-shadow(0 0 2px var(--accent-glow));
  }
  50% {
    stroke-width: 6;
    filter: drop-shadow(0 0 8px var(--accent-glow));
  }
  100% {
    stroke-width: 4;
    filter: drop-shadow(0 0 2px var(--accent-glow));
  }
}

.loading-details {
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
  height: 1.5em;
  overflow: hidden;
}

/* Animations */
@keyframes textGlow {
  0% {
    text-shadow: 
      0 0 10px var(--accent-glow),
      0 0 20px var(--accent-glow),
      0 0 40px var(--accent-glow);
  }
  100% {
    text-shadow: 
      0 0 15px var(--accent-glow),
      0 0 30px var(--accent-glow),
      0 0 60px var(--accent-glow);
  }
}

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

@keyframes glitch-1 {
  0% {
    transform: translate(0);
  }
  20% {
    transform: translate(-2px, 2px);
  }
  40% {
    transform: translate(-2px, -2px);
  }
  60% {
    transform: translate(2px, 2px);
  }
  80% {
    transform: translate(2px, -2px);
  }
  100% {
    transform: translate(0);
  }
}

@keyframes glitch-2 {
  0% {
    transform: translate(0);
  }
  20% {
    transform: translate(2px, -2px);
  }
  40% {
    transform: translate(2px, 2px);
  }
  60% {
    transform: translate(-2px, -2px);
  }
  80% {
    transform: translate(-2px, 2px);
  }
  100% {
    transform: translate(0);
  }
}

/* Media Queries */
@media (max-width: 640px) {
  .glitch-text {
    font-size: 2rem;
  }
  
  .glitch-text:last-child {
    font-size: 1.25rem;
  }
}