/* ============================================ */
/* ELEGANT LOADING SCREEN - Premium Design */
/* ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700;900&family=Inter:wght@300;400;500;600;700&display=swap');

#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #0a0118 0%, #0f0624 50%, #0a0a1a 100%);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 1;
  transition: opacity 0.8s ease;
  overflow: hidden;
}

/* Animated background particles */
#loading-screen::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 50%, rgba(0, 170, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(138, 43, 226, 0.1) 0%, transparent 50%);
  animation: pulseBackground 8s ease-in-out infinite;
}

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

/* Floating geometric shapes */
#loading-screen::after {
  content: '';
  position: absolute;
  top: 10%;
  left: 10%;
  width: 300px;
  height: 300px;
  background: linear-gradient(45deg, rgba(0, 170, 255, 0.05), transparent);
  border-radius: 50%;
  filter: blur(60px);
  animation: float 10s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(50px, -50px) scale(1.2); }
}

#loading-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}

/* Loading Container */
.loading-container {
  text-align: center;
  max-width: 600px;
  padding: 60px 40px;
  width: 100%;
  position: relative;
  z-index: 10;
  background: rgba(10, 10, 26, 0.3);
  backdrop-filter: blur(20px);
  border-radius: 30px;
  border: 1px solid rgba(0, 170, 255, 0.2);
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Logo Styling */
.loading-logo {
  margin-bottom: 40px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.loading-logo img {
  width: 180px;
  height: 180px;
  object-fit: contain;
  opacity: 1;
  filter: drop-shadow(0 0 30px rgba(0, 170, 255, 0.4));
  animation: logoFloat 3s ease-in-out infinite;
}

/* Text Styling */
.loading-text {
  margin-bottom: 50px;
}

.loading-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 2.8rem;
  font-weight: 900;
  letter-spacing: 6px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #00aaff 0%, #00ffaa 50%, #8a2be2 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 4s ease infinite;
  text-shadow: 0 0 30px rgba(0, 170, 255, 0.3);
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.loading-subtitle {
  font-family: 'Inter', sans-serif;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 3px;
  text-transform: uppercase;
  animation: fadeInOut 2s ease-in-out infinite;
}

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

/* Progress Container */
.progress-container {
  width: 100%;
  margin: 0 auto;
}

/* Progress Bar - Modern Design */
.progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 20px;
  position: relative;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, 
    #00aaff 0%, 
    #00ffaa 50%, 
    #8a2be2 100%);
  border-radius: 10px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  box-shadow: 
    0 0 20px rgba(0, 170, 255, 0.6),
    0 0 40px rgba(0, 170, 255, 0.4);
}

/* Animated shimmer effect on progress bar */
.progress-fill::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 200%; }
}

/* Glowing dot at the end of progress bar */
.progress-fill::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 0;
  transform: translate(50%, -50%);
  width: 12px;
  height: 12px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 
    0 0 15px rgba(255, 255, 255, 0.8),
    0 0 30px rgba(0, 170, 255, 0.6);
  animation: dotPulse 1s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% { transform: translate(50%, -50%) scale(1); }
  50% { transform: translate(50%, -50%) scale(1.3); }
}

/* Progress Info */
.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  padding: 0 5px;
}

.progress-percent {
  font-family: 'Orbitron', sans-serif;
  color: #00aaff;
  font-weight: 600;
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(0, 170, 255, 0.5);
}

.progress-status {
  color: rgba(255, 255, 255, 0.6);
  font-weight: 400;
  letter-spacing: 1px;
}

/* Device Info Box */
.device-info {
  margin-top: 40px;
  padding: 20px 25px;
  background: rgba(0, 170, 255, 0.05);
  border: 1px solid rgba(0, 170, 255, 0.2);
  border-radius: 15px;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.8;
  backdrop-filter: blur(10px);
  animation: slideUp 0.6s ease;
}

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

.device-info strong {
  color: #00aaff;
  font-weight: 600;
  text-shadow: 0 0 10px rgba(0, 170, 255, 0.3);
}

/* Loading Footer */
.loading-footer {
  margin-top: 50px;
  color: rgba(255, 255, 255, 0.4);
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.loading-footer .separator {
  margin: 0 15px;
  opacity: 0.3;
}

/* Responsive Design */
@media (max-width: 768px) {
  .loading-container {
    padding: 40px 25px;
    max-width: 90%;
    margin: 0 20px;
  }
  
  .loading-logo img {
    width: 120px;
  }
  
  .loading-logo::before {
    width: 160px;
    height: 160px;
  }
  
  .loading-title {
    font-size: 1.8rem;
    letter-spacing: 4px;
  }
  
  .loading-subtitle {
    font-size: 0.85rem;
    letter-spacing: 2px;
  }
  
  .progress-percent {
    font-size: 1rem;
  }
  
  .device-info {
    padding: 15px 20px;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .loading-container {
    padding: 30px 20px;
    border-radius: 20px;
  }
  
  .loading-title {
    font-size: 1.5rem;
    letter-spacing: 3px;
  }
  
  .loading-subtitle {
    font-size: 0.75rem;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .loading-container {
    border: 2px solid rgba(0, 170, 255, 0.5);
  }
  
  .progress-bar {
    background: rgba(255, 255, 255, 0.2);
  }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  .loading-logo img,
  .loading-logo::before,
  .progress-fill::before,
  .progress-fill::after,
  .loading-title,
  .loading-subtitle {
    animation: none;
  }
  
  #loading-screen::before,
  #loading-screen::after {
    animation: none;
  }
}
