/* Loading Screen Styles - Loads first */
body.loading {
  overflow: hidden;
}

.loading-screen {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #05060b 0%, #0b0f1a 50%, #05060b 100%);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.8s ease-out, visibility 0.8s ease-out;
}

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

.loading-content {
  text-align: center;
  width: 100%;
  max-width: 600px;
  padding: 40px;
}

.loading-terminal {
  background: linear-gradient(135deg, rgba(8, 10, 20, 0.98), rgba(5, 7, 15, 0.98));
  border: 1px solid rgba(124, 107, 255, 0.4);
  border-radius: 16px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.6),
              0 0 50px rgba(124, 107, 255, 0.25);
  overflow: hidden;
  margin-bottom: 40px;
  font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Courier New', monospace;
  position: relative;
  will-change: transform, opacity;
  transition: opacity 0.2s ease;
}

.loading-terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: linear-gradient(180deg, rgba(15, 18, 30, 0.95), rgba(10, 14, 24, 0.9));
  border-bottom: 1px solid rgba(124, 107, 255, 0.2);
}

.loading-terminal-buttons {
  display: flex;
  gap: 8px;
}

.loading-terminal-buttons span {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
}

.loading-terminal-buttons span:nth-child(1) {
  background: linear-gradient(135deg, #ff5f56, #ff3b30);
}

.loading-terminal-buttons span:nth-child(2) {
  background: linear-gradient(135deg, #ffbd2e, #ff9500);
}

.loading-terminal-buttons span:nth-child(3) {
  background: linear-gradient(135deg, #27c93f, #1db954);
}

.loading-terminal-title {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
  text-transform: lowercase;
  letter-spacing: 1.5px;
  font-weight: 500;
}

.loading-terminal-body {
  padding: 20px;
  min-height: 150px;
}

.loading-line {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}

.loading-prompt {
  color: #27e7ff;
  margin-right: 10px;
  font-weight: 600;
  text-shadow: 0 0 8px rgba(39, 231, 255, 0.4);
}

.loading-command {
  color: #e8e8e8;
  font-weight: 400;
}

.loading-cursor {
  display: inline-block;
  width: 2px;
  height: 18px;
  background: #27e7ff;
  margin-left: 4px;
  animation: blink 1s infinite;
  box-shadow: 0 0 6px rgba(39, 231, 255, 0.6);
}

.loading-output {
  margin-top: 12px;
}

.loading-output-line {
  color: #b3b8c5;
  font-size: 0.85rem;
  margin-bottom: 6px;
  opacity: 0;
  animation: fadeInUp 0.5s ease forwards;
}

.loading-output-line:nth-child(1) {
  animation-delay: 0.3s;
}

.loading-output-line:nth-child(2) {
  animation-delay: 0.6s;
}

.loading-progress {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 30px;
  transition: opacity 0.5s ease;
}

.loading-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #7c6bff, #27e7ff);
  border-radius: 999px;
  width: 0%;
  box-shadow: 0 0 20px rgba(124, 107, 255, 0.6);
  transition: width 0.3s ease;
}

.loading-symbols {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  transition: opacity 0.5s ease;
}

.loading-symbol {
  font-size: 2rem;
  color: rgba(124, 107, 255, 0.6);
  font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Courier New', monospace;
  font-weight: 600;
  opacity: 0;
  animation: symbolFloat 2s ease-in-out infinite;
  text-shadow: 0 0 15px rgba(124, 107, 255, 0.5);
}

.loading-symbol:nth-child(1) { animation-delay: 0s; }
.loading-symbol:nth-child(2) { animation-delay: 0.2s; }
.loading-symbol:nth-child(3) { animation-delay: 0.4s; }
.loading-symbol:nth-child(4) { animation-delay: 0.6s; }
.loading-symbol:nth-child(5) { animation-delay: 0.8s; }
.loading-symbol:nth-child(6) { animation-delay: 1s; }

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

@keyframes symbolFloat {
  0%, 100% {
    opacity: 0.4;
    transform: translateY(0) scale(1);
  }
  50% {
    opacity: 1;
    transform: translateY(-15px) scale(1.1);
  }
}

@media (max-width: 900px) {
  .loading-terminal {
    display: none;
  }
}

@media (max-width: 700px) {
  .loading-content {
    padding: 20px;
    max-width: 90%;
  }

  .loading-terminal {
    display: none;
  }

  .loading-terminal-body {
    padding: 16px;
    min-height: 120px;
  }

  .loading-symbols {
    gap: 15px;
  }

  .loading-symbol {
    font-size: 1.5rem;
  }
}
