/* GuruMerdeka Loading Animations - Modern Professional Design */

/* Base loading overlay with modern gradient */
.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, #ffffff 0%, #f0f9ff 25%, #f5fbff 50%, #ffffff 100%);
  z-index: 9999;
  overflow: hidden;
  /* Optimize rendering */
  will-change: opacity;
  transform: translateZ(0);
}

/* Animated background gradient */
.loading::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 50%, rgba(52, 152, 219, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(6, 182, 212, 0.05) 0%, transparent 50%);
  animation: gradientShift 8s ease-in-out infinite;
  z-index: 0;
  will-change: background;
}

/* Content container - transparent */
.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(28px, 5.5vw, 48px);
  z-index: 1;
  text-align: center;
  padding: 0;
  background: transparent;
  border-radius: 0;
  border: none;
  box-shadow: none;
  max-width: 100%;
  will-change: transform;
  position: relative;
}

/* Logo container with modern design */
.logo-container {
  position: relative;
  width: auto;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo {
  width: clamp(110px, 22vw, 180px);
  height: auto;
  border-radius: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  border: none;
  animation: logoFloat 4s cubic-bezier(0.4, 0.0, 0.2, 1) infinite;
  position: relative;
  overflow: visible;
  backdrop-filter: none;
}

.logo::before {
  content: '';
  position: absolute;
  inset: 0;
  background: transparent;
  border-radius: 0;
  opacity: 0;
  z-index: 0;
}

.logo-container > img {
  width: clamp(50px, 15vw, 100px);
  height: clamp(50px, 15vw, 100px);
  object-fit: contain;
  z-index: 2;
  position: relative;
  filter: drop-shadow(0 4px 12px rgba(30, 64, 175, 0.15)) brightness(1) contrast(1.2);
  /* Ensure image is always visible */
  opacity: 1 !important;
  visibility: visible !important;
  display: block !important;
}

/* Progress indicators removed - only dots remain */
.progress-container {
  display: none !important;
}

.progress-bar {
  display: none !important;
}

.progress-fill {
  display: none !important;
}

/* Dots indicator - Modern animated dots */
.dots-container {
  display: flex;
  gap: clamp(10px, 3vw, 16px);
  align-items: center;
  justify-content: center;
  height: clamp(20px, 4vw, 28px);
}

.dot {
  width: clamp(10px, 2.5vw, 16px);
  height: clamp(10px, 2.5vw, 16px);
  border-radius: 50%;
  background: linear-gradient(135deg, #06b6d4 0%, #0ea5e9 100%);
  animation: dotBounce 1.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
  box-shadow: 
    0 4px 15px rgba(6, 182, 212, 0.4),
    0 0 8px rgba(14, 165, 233, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  /* Optimize animations */
  will-change: transform, filter;
  position: relative;
  box-sizing: border-box;
}

.dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.3), transparent 70%);
  animation: dotRadiate 1.5s ease-out infinite;
  will-change: opacity;
  z-index: -1;
}

.dot:nth-child(1) { animation-delay: 0s; }
.dot:nth-child(2) { animation-delay: 0.15s; }
.dot:nth-child(3) { animation-delay: 0.3s; }

.dot:nth-child(1)::after { animation-delay: 0s; }
.dot:nth-child(2)::after { animation-delay: 0.15s; }
.dot:nth-child(3)::after { animation-delay: 0.3s; }

/* Typography - Modern and Professional */
.app-title {
  font-size: clamp(26px, 7vw, 48px);
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  text-shadow: 0 2px 8px rgba(30, 64, 175, 0.2);
  letter-spacing: clamp(0.5px, 0.3vw, 2px);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  word-spacing: 0.1em;
  line-height: 1.2;
}

.app-subtitle {
  font-size: clamp(13px, 3.5vw, 16px);
  color: rgba(255, 255, 255, 0.95);
  margin: 0;
  font-weight: 500;
  text-shadow: 0 1px 4px rgba(30, 64, 175, 0.15);
  letter-spacing: 0.3px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  /* PRIORITY 2: Smooth state transitions */
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform: translateY(0);
}

/* Enhanced animations - Modern smooth bouncing */
@keyframes logoFloat {
  0%, 100% { 
    transform: translateY(0px) scale(1);
  }
  50% { 
    transform: translateY(-8px) scale(1.01);
  }
}

@keyframes dotBounce {
  0%, 100% { 
    transform: translateY(0px) scale(1);
    opacity: 0.6;
    filter: blur(0px);
  }
  50% { 
    transform: translateY(-8px) scale(1.15);
    opacity: 1;
    filter: blur(0px);
  }
}

@keyframes dotRadiate {
  0% {
    opacity: 0.8;
    transform: scale(0.9);
  }
  100% {
    opacity: 0;
    transform: scale(1.6);
  }
}

@keyframes gradientShift {
  0%, 100% {
    background: 
      radial-gradient(circle at 20% 50%, rgba(59, 130, 246, 0.3) 0%, transparent 50%),
      radial-gradient(circle at 80% 80%, rgba(6, 182, 212, 0.2) 0%, transparent 50%);
  }
  50% {
    background: 
      radial-gradient(circle at 80% 80%, rgba(59, 130, 246, 0.3) 0%, transparent 50%),
      radial-gradient(circle at 20% 50%, rgba(6, 182, 212, 0.2) 0%, transparent 50%);
  }
}

/* Dark mode optimization - Modern theme */
@media (prefers-color-scheme: dark) {
  .loading {
    background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 25%, #f5fbff 50%, #ffffff 100%);
  }
}
  }
  
  .loading::before {
    background: 
      radial-gradient(circle at 20% 50%, rgba(59, 130, 246, 0.2) 0%, transparent 50%),
      radial-gradient(circle at 80% 80%, rgba(6, 182, 212, 0.15) 0%, transparent 50%);
  }
  
  .loading-content {
    background: transparent;
    border: none;
    box-shadow: none;
  }
  
  .logo {
    background: transparent;
    box-shadow: none;
    border: none;
  }
  
  .logo-container > img {
    filter: drop-shadow(0 2px 8px rgba(59, 130, 246, 0.25));
  }
  
  .dot {
    background: linear-gradient(135deg, #06b6d4 0%, #0ea5e9 100%);
    box-shadow: 
      0 4px 15px rgba(6, 182, 212, 0.5),
      0 0 8px rgba(14, 165, 233, 0.4),
      inset 0 1px 0 rgba(148, 163, 184, 0.2);
    border: 1.5px solid rgba(148, 163, 184, 0.4);
  }
  
  .app-title {
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(15, 23, 42, 0.3);
  }
  
  .app-subtitle {
    color: rgba(226, 232, 240, 0.95);
    text-shadow: 0 1px 4px rgba(15, 23, 42, 0.2);
  }
}

/* Mobile optimization - Professional responsive design */
@media (max-width: 480px) {
  .loading-content {
    gap: 32px;
    padding: 0;
    border-radius: 0;
    max-width: 100%;
  }
  
  .logo-container {
    width: clamp(90px, 24vw, 140px);
    height: clamp(90px, 24vw, 140px);
  }
  
  .logo {
    width: clamp(90px, 24vw, 140px);
    height: clamp(90px, 24vw, 140px);
  }
  
  .logo img {
    width: clamp(45px, 12vw, 70px);
    height: clamp(45px, 12vw, 70px);
  }
  
  .dots-container {
    gap: 12px;
  }
  
  .dot {
    width: clamp(11px, 2.8vw, 14px);
    height: clamp(11px, 2.8vw, 14px);
  }
  
  .app-title {
    font-size: clamp(24px, 6.5vw, 32px);
    margin: 8px 0 0 0;
  }
  
  .app-subtitle {
    font-size: clamp(12px, 3vw, 14px);
    margin-top: 4px;
  }
}

/* Tablet optimization (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
  .loading-content {
    gap: 36px;
    padding: 0;
    border-radius: 0;
    max-width: 100%;
  }
  
  .logo-container {
    width: clamp(110px, 20vw, 160px);
    height: clamp(110px, 20vw, 160px);
  }
  
  .logo {
    width: clamp(110px, 20vw, 160px);
    height: clamp(110px, 20vw, 160px);
  }
  
  .app-title {
    font-size: clamp(28px, 6.5vw, 40px);
  }
  
  .app-subtitle {
    font-size: clamp(14px, 3.5vw, 16px);
  }
}

/* Tablet Landscape (469px height or less) - PRIORITY 2 */
@media (max-height: 469px) {
  .loading-content {
    gap: 20px !important;
    padding: 0 !important;
    border-radius: 0 !important;
  }
  
  .logo-container {
    width: clamp(60px, 12vh, 90px) !important;
    height: clamp(60px, 12vh, 90px) !important;
  }
  
  .logo {
    width: clamp(60px, 12vh, 90px) !important;
    height: clamp(60px, 12vh, 90px) !important;
  }
  
  .logo img {
    width: clamp(30px, 8vh, 60px) !important;
    height: clamp(30px, 8vh, 60px) !important;
  }
  
  .app-title {
    font-size: clamp(20px, 5vh, 28px) !important;
    margin: 4px 0 0 0 !important;
  }
  
  .app-subtitle {
    font-size: clamp(11px, 2.5vh, 14px) !important;
    margin-top: 2px !important;
  }
  
  .dots-container {
    gap: 8px !important;
    margin: 8px 0 !important;
  }
  
  .dot {
    width: clamp(8px, 2vh, 12px) !important;
    height: clamp(8px, 2vh, 12px) !important;
  }
}

/* Very small phones (max-width: 375px) */
@media (max-width: 375px) {
  .loading-content {
    gap: 24px;
    padding: 0;
    border-radius: 0;
    max-width: 100%;
  }
  
  .logo-container {
    width: clamp(75px, 22vw, 110px);
    height: clamp(75px, 22vw, 110px);
  }
  
  .logo {
    width: clamp(75px, 22vw, 110px);
    height: clamp(75px, 22vw, 110px);
  }
  
  .logo img {
    width: clamp(38px, 10vw, 55px);
    height: clamp(38px, 10vw, 55px);
  }
  
  .dot {
    width: 10px;
    height: 10px;
  }
  
  .dots-container {
    gap: 8px;
  }
  
  .app-title {
    font-size: clamp(20px, 5.5vw, 26px);
    letter-spacing: 0px;
  }
  
  .app-subtitle {
    font-size: 11px;
  }
}

/* Large desktop (1024px+) */
@media (min-width: 1024px) {
  .loading-content {
    gap: 48px;
    padding: 0;
    border-radius: 0;
    max-width: 100%;
  }
  
  .logo-container {
    width: 180px;
    height: 180px;
  }
  
  .logo {
    width: 180px;
    height: 180px;
  }
  
  .app-title {
    font-size: 48px;
  }
  
  .app-subtitle {
    font-size: 16px;
  }
}

/* Performance optimizations for smooth animations */
@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;
  }
}

/* Low-end device detection - disable expensive animations */
@media (max-width: 480px) and (-webkit-max-device-pixel-ratio: 1) {
  .loading::before {
    animation: none !important;
    background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%) !important;
  }
  
  .dot {
    animation: simplePulse 1s ease-in-out infinite !important;
  }
  
  .dot::after {
    display: none !important;
  }
  
  .logo {
    animation: none !important;
  }
}

@keyframes simplePulse {
  0%, 100% {
    opacity: 0.7;
  }
  50% {
    opacity: 1;
  }
}

/* Version info - Modern styling */
.version-info {
  position: absolute;
  bottom: clamp(16px, 4vw, 32px);
  right: clamp(16px, 4vw, 32px);
  font-size: clamp(10px, 2.5vw, 12px);
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.08);
  padding: clamp(6px, 1.5vw, 10px) clamp(12px, 3vw, 16px);
  border-radius: clamp(20px, 4vw, 24px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-weight: 600;
  letter-spacing: 0.5px;
  font-family: 'Monaco', 'Menlo', monospace;
  box-shadow: 0 4px 12px rgba(30, 64, 175, 0.1);
}

@media (prefers-color-scheme: dark) {
  .version-info {
    color: rgba(203, 213, 225, 0.85);
    background: rgba(15, 23, 42, 0.3);
    border: 1px solid rgba(59, 130, 246, 0.25);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
  }
}

/* Accessibility improvements */
@media (prefers-color-scheme: dark) and (prefers-contrast: more) {
  .loading-content {
    border: none;
  }
  
  .dot {
    border: 2px solid rgba(255, 255, 255, 0.8);
  }
}