/* GuruMerdeka Loading Animations - Optimized */

/* Base loading overlay */
.loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  z-index: 9999;
  overflow: hidden;
  /* Optimize rendering */
  will-change: opacity;
  transform: translateZ(0);
}

/* Remove background effects - no animation */
.loading::before {
  display: none;
}

/* Content container */
.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(24px, 5vw, 40px);
  z-index: 1;
  text-align: center;
  padding: clamp(16px, 4vw, 32px);
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.05);
  border-radius: clamp(16px, 4vw, 24px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  max-width: min(90vw, 480px);
  /* Optimize animations */
  will-change: transform;
}

/* Logo container - simplified */
.logo-container {
  position: relative;
  width: clamp(120px, 20vw, 160px);
  height: clamp(120px, 20vw, 160px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo {
  width: clamp(100px, 18vw, 140px);
  height: clamp(100px, 18vw, 140px);
  border-radius: 50%;
  background: linear-gradient(145deg, #ffffff, #f8fafc);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  animation: logoFloat 3s ease-in-out infinite;
  position: relative;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.2);
  /* Optimize performance */
  will-change: transform;
}

.logo img {
  width: clamp(60px, 12vw, 90px);
  height: clamp(60px, 12vw, 90px);
  object-fit: contain;
  z-index: 2;
  position: relative;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
}

/* Progress indicators removed - only dots remain */
.progress-container {
  display: none !important;
}

.progress-bar {
  display: none !important;
}

.progress-fill {
  display: none !important;
}

/* Dots indicator - Enhanced bouncing animation */
.dots-container {
  display: flex;
  gap: clamp(8px, 2vw, 12px);
  align-items: center;
  justify-content: center;
}

.dot {
  width: clamp(10px, 2.5vw, 14px);
  height: clamp(10px, 2.5vw, 14px);
  border-radius: 50%;
  background: linear-gradient(145deg, #3498db, #2980b9);
  animation: dotBounce 1.4s ease-in-out infinite;
  box-shadow: 
    0 8px 25px rgba(52, 152, 219, 0.3),
    0 4px 12px rgba(52, 152, 219, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.8);
  /* Optimize animations */
  will-change: transform, opacity;
  position: relative;
}

.dot::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 60%;
  height: 60%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.6), transparent);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: dotGlow 1.4s ease-in-out infinite;
}

.dot:nth-child(1) { animation-delay: 0s; }
.dot:nth-child(2) { animation-delay: 0.15s; }
.dot:nth-child(3) { animation-delay: 0.3s; }

/* Typography */
.app-title {
  font-size: clamp(28px, 6vw, 42px);
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  letter-spacing: clamp(1px, 0.2vw, 2px);
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', sans-serif;
}

.app-subtitle {
  font-size: clamp(14px, 3.5vw, 18px);
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
  font-weight: 500;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  letter-spacing: clamp(0.5px, 0.1vw, 1px);
}

/* Enhanced animations - bouncing dots */
@keyframes logoFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}

@keyframes progressAnimation {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(0%); }
  100% { transform: translateX(100%); }
}

@keyframes dotBounce {
  0%, 80%, 100% { 
    transform: scale(0.8) translateY(0px);
    opacity: 0.7;
    box-shadow: 
      0 8px 25px rgba(52, 152, 219, 0.2),
      0 4px 12px rgba(52, 152, 219, 0.15);
  }
  40% { 
    transform: scale(1.3) translateY(-8px);
    opacity: 1;
    box-shadow: 
      0 12px 35px rgba(52, 152, 219, 0.4),
      0 8px 20px rgba(52, 152, 219, 0.3);
  }
}

@keyframes dotGlow {
  0%, 100% { 
    opacity: 0.4;
    transform: translate(-50%, -50%) scale(0.8);
  }
  50% { 
    opacity: 0.9;
    transform: translate(-50%, -50%) scale(1.4);
  }
}

/* Dark mode optimization */
@media (prefers-color-scheme: dark) {
  .loading {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  }
  
  .loading-content {
    background: rgba(15, 23, 42, 0.3);
    border: 1px solid rgba(59, 130, 246, 0.2);
  }
  
  .logo {
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border: 2px solid rgba(59, 130, 246, 0.3);
  }
  
  .logo img {
    filter: invert(1) drop-shadow(0 4px 12px rgba(59, 130, 246, 0.3));
  }
  
  .progress-bar {
    background-color: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(59, 130, 246, 0.2);
  }
  
  .progress-fill {
    background: linear-gradient(90deg, #3b82f6, #10b981, #f59e0b);
  }
  
  .dot {
    background: linear-gradient(145deg, #3b82f6, #2563eb);
    box-shadow: 
      0 8px 25px rgba(59, 130, 246, 0.4),
      0 4px 12px rgba(59, 130, 246, 0.3);
    border: 2px solid rgba(148, 163, 184, 0.6);
  }
  
  .dot::after {
    background: radial-gradient(circle, rgba(203, 213, 225, 0.6), transparent);
  }
  
  .app-title {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }
  
  .app-subtitle {
    color: rgba(226, 232, 240, 0.9);
  }
}

/* Mobile optimization */
@media (max-width: 480px) {
  .loading-content {
    gap: 24px;
    padding: 20px 16px;
    border-radius: 16px;
    max-width: 95vw;
  }
  
  .progress-bar {
    width: 260px;
    height: 5px;
  }
  
  .dots-container {
    gap: 10px;
  }
}

/* Performance optimizations */
@media (prefers-reduced-motion: reduce) {
  .loading *,
  .loading *::before,
  .loading *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Version info positioning */
.version-info {
  position: absolute;
  bottom: clamp(20px, 4vw, 32px);
  right: clamp(20px, 4vw, 32px);
  font-size: clamp(11px, 2.5vw, 13px);
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.08);
  padding: clamp(6px, 1.5vw, 10px) clamp(12px, 3vw, 16px);
  border-radius: clamp(16px, 4vw, 20px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-weight: 500;
}

@media (prefers-color-scheme: dark) {
  .version-info {
    color: rgba(203, 213, 225, 0.8);
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(59, 130, 246, 0.2);
  }
}