/**
 * Otanyuu PWA Splash Screen
 * Premium native-like app launch experience
 * Inspired by Netflix, Apple, and top-tier apps
 */

/* Splash Screen Overlay */
.pwa-splash {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #0a0a0a;
  animation: splashFadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.pwa-splash.hide {
  animation: splashFadeOut 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes splashFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes splashFadeOut {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.1); }
}

/* Background Gradient Animation */
.pwa-splash::before {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(ellipse at 50% 0%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 100%, rgba(59, 130, 246, 0.1) 0%, transparent 50%);
  animation: bgPulse 3s ease-in-out infinite;
}

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

/* Logo Container */
.pwa-splash-logo {
  position: relative;
  width: 140px;
  height: 140px;
  margin-bottom: 32px;
  animation: logoContainerIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes logoContainerIn {
  0% { 
    opacity: 0; 
    transform: scale(0.5) translateY(15px); 
    filter: blur(8px);
  }
  100% { 
    opacity: 1; 
    transform: scale(1) translateY(0); 
    filter: blur(0);
  }
}

/* Logo Animation */
.pwa-splash-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  animation: logoFloat 3s ease-in-out infinite;
  filter: drop-shadow(0 25px 50px rgba(59, 130, 246, 0.5));
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-8px) scale(1.02); }
}

/* Shine Effect on Logo */
.pwa-splash-logo::after {
  content: '';
  position: absolute;
  inset: -50%;
  background: linear-gradient(
    45deg,
    transparent 40%,
    rgba(255, 255, 255, 0.1) 50%,
    transparent 60%
  );
  animation: logoShine 3s ease-in-out infinite;
  border-radius: 50%;
}

@keyframes logoShine {
  0%, 100% { transform: translateX(-100%) rotate(45deg); }
  50% { transform: translateX(100%) rotate(45deg); }
}

/* Glow Ring */
.pwa-splash-glow {
  position: absolute;
  inset: -30px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.4) 0%, transparent 70%);
  animation: glowPulse 2s ease-in-out infinite;
  filter: blur(20px);
}

@keyframes glowPulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.3); opacity: 1; }
}

/* App Name */
.pwa-splash-title {
  font-family: 'Cairo', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 36px;
  font-weight: 900;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffffff 0%, #94a3b8 50%, #ffffff 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: titleFade 0.6s ease-out 0.3s both, titleShine 4s linear infinite;
  margin-bottom: 8px;
}

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

@keyframes titleShine {
  to { background-position: 200% center; }
}

/* Tagline */
.pwa-splash-tagline {
  font-family: 'Cairo', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: #64748b;
  letter-spacing: 0.5px;
  animation: taglineFade 0.6s ease-out 0.5s both;
}

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

/* Loading Indicator */
.pwa-splash-loader {
  position: absolute;
  bottom: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  animation: loaderFade 0.5s ease-out 0.7s both;
}

@keyframes loaderFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Progress Bar */
.pwa-splash-progress {
  width: 160px;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
}

.pwa-splash-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  border-radius: 10px;
  animation: progressMove 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes progressMove {
  0% { width: 0%; }
  30% { width: 40%; }
  60% { width: 75%; }
  100% { width: 100%; }
}

/* Loading Dots */
.pwa-splash-dots {
  display: flex;
  gap: 10px;
}

.pwa-splash-dot {
  width: 6px;
  height: 6px;
  background: #3b82f6;
  border-radius: 50%;
  animation: dotPulse 1.4s ease-in-out infinite;
}

.pwa-splash-dot:nth-child(1) { animation-delay: 0s; }
.pwa-splash-dot:nth-child(2) { animation-delay: 0.2s; }
.pwa-splash-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotPulse {
  0%, 80%, 100% { transform: scale(0.8); opacity: 0.4; }
  40% { transform: scale(1.2); opacity: 1; }
}

/* Hide splash when content is ready */
.pwa-splash.hide .pwa-splash-logo {
  animation: logoOut 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes logoOut {
  to { 
    opacity: 0; 
    transform: scale(1.2) translateY(-20px); 
  }
}

.pwa-splash.hide .pwa-splash-title,
.pwa-splash.hide .pwa-splash-tagline {
  animation: textOut 0.4s ease-out forwards;
}

@keyframes textOut {
  to { opacity: 0; transform: translateY(-10px); }
}
