/* Loading Screen Styles */
.loader-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader-container.hidden {
  opacity: 0;
  visibility: hidden;
}

/* Spinner */
.loader {
  width: 60px;
  height: 60px;
  border: 3px solid rgba(255, 107, 43, 0.1);
  border-top: 3px solid var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 24px;
}

/* Loading Text */
.loader-text {
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
  animation: pulse 2s ease-in-out infinite;
  text-align: center;
  margin-bottom: 8px;
}

/* Progress Bar Container */
.progress-bar {
  width: 200px;
  height: 2px;
  background: rgba(255, 107, 43, 0.1);
  border-radius: 1px;
  margin-top: 16px;
  overflow: hidden;
  position: relative;
}

/* Progress Bar Fill */
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #ff8a54);
  width: 0%;
  border-radius: 1px;
  transition: width 0.3s ease-out;
  position: relative;
}

/* Progress Bar Shimmer Effect */
.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  animation: shimmer 1.5s infinite;
}

/* Spinner Animation */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Text Pulse Animation */
@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* Progress Bar Shimmer Animation */
@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Loading Dots Animation */
.loading-dots {
  display: inline-block;
}

.loading-dots::after {
  content: '';
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
  0%, 20% { content: ''; }
  40% { content: '.'; }
  60% { content: '..'; }
  80%, 100% { content: '...'; }
}

/* Responsive Loader */
@media (max-width: 480px) {
  .loader {
    width: 50px;
    height: 50px;
    margin-bottom: 20px;
  }

  .progress-bar {
    width: 180px;
  }

  .loader-text {
    font-size: 13px;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .loader {
    animation: none;
    border: 3px solid var(--accent);
  }

  .loader-text {
    animation: none;
    opacity: 0.8;
  }

  .progress-fill::after {
    animation: none;
  }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .loader-container {
    background: #000;
  }

  .loader {
    border-color: #fff;
    border-top-color: var(--accent);
  }

  .loader-text {
    color: #fff;
  }

  .progress-bar {
    background: #333;
    border: 1px solid #fff;
  }
}