/* PWA Splash Screen - Shown while app is loading */
.pwa-splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #4a90e2 0%, #357abd 50%, #2c6ba0 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  animation: fadeIn 0.3s ease-in;
}

.pwa-splash-screen.ai-learn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
}

/* Splash Icon Container */
.pwa-splash-icon {
  width: 180px;
  height: 180px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 40px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: iconBounce 1s ease-in-out infinite;
  position: relative;
  overflow: hidden;
}

.pwa-splash-icon::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  animation: shimmer 2s infinite;
}

/* App Logo/Text inside icon */
.pwa-splash-logo {
  font-size: 80px;
  font-weight: 900;
  color: white;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  letter-spacing: -2px;
  z-index: 1;
}

.ai-learn .pwa-splash-logo::before {
  content: '💡';
}

/* App Name */
.pwa-splash-title {
  color: white;
  font-size: 32px;
  font-weight: 900;
  margin-bottom: 12px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  animation: fadeInUp 0.6s ease-out 0.2s backwards;
}

/* App Tagline */
.pwa-splash-subtitle {
  color: rgba(255, 255, 255, 0.9);
  font-size: 16px;
  font-weight: 400;
  margin-bottom: 50px;
  animation: fadeInUp 0.6s ease-out 0.4s backwards;
}

/* Loading Spinner */
.pwa-splash-loader {
  display: flex;
  gap: 12px;
  animation: fadeInUp 0.6s ease-out 0.6s backwards;
}

.pwa-splash-dot {
  width: 12px;
  height: 12px;
  background: white;
  border-radius: 50%;
  animation: dotPulse 1.5s ease-in-out infinite;
}

.pwa-splash-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.pwa-splash-dot:nth-child(3) {
  animation-delay: 0.4s;
}

/* Decorative Background Elements */
.pwa-splash-bg-circle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  animation: floatCircle 8s ease-in-out infinite;
}

.pwa-splash-bg-circle:nth-child(1) {
  width: 300px;
  height: 300px;
  top: -150px;
  left: -150px;
}

.pwa-splash-bg-circle:nth-child(2) {
  width: 200px;
  height: 200px;
  bottom: -100px;
  right: -100px;
  animation-delay: 2s;
}

.pwa-splash-bg-circle:nth-child(3) {
  width: 150px;
  height: 150px;
  top: 50%;
  right: -75px;
  animation-delay: 4s;
}

/* Sparkle Effects */
.pwa-splash-sparkle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: white;
  border-radius: 50%;
  animation: sparkle 2s ease-in-out infinite;
}

.pwa-splash-sparkle:nth-child(1) {
  top: 20%;
  left: 15%;
  animation-delay: 0s;
}

.pwa-splash-sparkle:nth-child(2) {
  top: 30%;
  right: 20%;
  animation-delay: 0.5s;
}

.pwa-splash-sparkle:nth-child(3) {
  bottom: 25%;
  left: 10%;
  animation-delay: 1s;
}

.pwa-splash-sparkle:nth-child(4) {
  bottom: 20%;
  right: 15%;
  animation-delay: 1.5s;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes iconBounce {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-15px) scale(1.05);
  }
}

@keyframes dotPulse {
  0%, 100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

@keyframes floatCircle {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(30px, -30px) scale(1.1);
  }
  66% {
    transform: translate(-20px, 20px) scale(0.9);
  }
}

@keyframes sparkle {
  0%, 100% {
    opacity: 0;
    transform: scale(0);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%) translateY(-100%) rotate(45deg);
  }
  100% {
    transform: translateX(100%) translateY(100%) rotate(45deg);
  }
}

/* Hide splash after load */
.pwa-splash-screen.hidden {
  animation: fadeOut 0.5s ease-out forwards;
}

@keyframes fadeOut {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
  .pwa-splash-icon {
    width: 140px;
    height: 140px;
    border-radius: 30px;
    margin-bottom: 30px;
  }
  
  .pwa-splash-logo {
    font-size: 60px;
  }
  
  .pwa-splash-title {
    font-size: 24px;
  }
  
  .pwa-splash-subtitle {
    font-size: 14px;
    padding: 0 20px;
    text-align: center;
  }
}

/* Landscape Mode */
@media (orientation: landscape) and (max-height: 500px) {
  .pwa-splash-screen {
    flex-direction: row;
    padding: 20px;
  }
  
  .pwa-splash-icon {
    width: 100px;
    height: 100px;
    margin-bottom: 0;
    margin-right: 30px;
  }
  
  .pwa-splash-logo {
    font-size: 50px;
  }
  
  .pwa-splash-content {
    text-align: left;
  }
}
