/* Splash Screen CSS - A&L Home Solutions */
/* Enhanced Splash Screen with Performance Optimizations */

/* Critical CSS - Prevents Flash of Unstyled Content */
.splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: linear-gradient(135deg, #000000 0%, #0a0a0a 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  opacity: 1;
  visibility: visible;
  transition: all 0.8s cubic-bezier(0.645, 0.045, 0.355, 1);
  overflow: hidden;
  will-change: opacity, visibility, transform;
}

.splash-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.particle {
  position: absolute;
  background: rgba(255, 215, 0, 0.2);
  border-radius: 50%;
  animation: floatParticle 15s linear infinite;
  will-change: transform, opacity;
}

.particle:nth-child(1) {
  width: 10px;
  height: 10px;
  top: 20%;
  left: 10%;
  animation-delay: 0s;
  animation-duration: 18s;
}

.particle:nth-child(2) {
  width: 15px;
  height: 15px;
  top: 60%;
  left: 80%;
  animation-delay: 2s;
  animation-duration: 20s;
}

.particle:nth-child(3) {
  width: 8px;
  height: 8px;
  top: 80%;
  left: 30%;
  animation-delay: 4s;
  animation-duration: 15s;
}

.particle:nth-child(4) {
  width: 12px;
  height: 12px;
  top: 40%;
  left: 60%;
  animation-delay: 6s;
  animation-duration: 22s;
}

.particle:nth-child(5) {
  width: 5px;
  height: 5px;
  top: 70%;
  left: 20%;
  animation-delay: 8s;
  animation-duration: 17s;
}

.splash-logo {
  position: relative;
  width: 260px;
  height: 260px;
  margin-bottom: 2rem;
  z-index: 1;
  will-change: transform;
}

.splash-logo-custom {
  width: 350px;
  height: 350px;
}

.logo-circle {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-pulse {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(255, 215, 0, 0.1);
  animation: pulse 2s ease-out infinite;
  will-change: transform, opacity;
}

.splash-logo img {
  width: 92%;
  height: 92%;
  object-fit: contain;
  border-radius: 20px;
  z-index: 2;
  position: relative;
  animation: logoFloat 3s ease-in-out infinite;
  will-change: transform;
}

.logo-img-custom {
  width: 85%;
  height: 85%;
}

.splash-title {
  font-family: 'Poppins', sans-serif;
  font-size: 2.8rem;
  font-weight: 700;
  color: transparent;
  margin-bottom: 0.5rem;
  text-align: center;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  -webkit-background-clip: text;
  background-clip: text;
  position: relative;
  z-index: 1;
  min-height: 3.2rem;
  will-change: filter;
}

.splash-title::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  -webkit-background-clip: text;
  background-clip: text;
  filter: blur(10px);
  z-index: -1;
  opacity: 0.5;
}

.splash-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 1.4rem;
  color: #b3b3b3;
  margin-bottom: 3rem;
  text-align: center;
  font-weight: 400;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.5s ease-out 1.5s forwards;
  will-change: opacity, transform;
}

.loading-container {
  width: 300px;
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  margin-bottom: 1rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.loading-bar {
  height: 100%;
  background: linear-gradient(90deg, #FFD700, #FFA500, #FFD700);
  background-size: 200% 100%;
  border-radius: 4px;
  width: 0%;
  position: relative;
  transition: width 0.3s ease;
  will-change: width, background-position;
}

.progress-text {
  position: absolute;
  right: -40px;
  top: 50%;
  transform: translateY(-50%);
  color: #FFD700;
  font-size: 0.9rem;
  font-weight: 600;
}

.loading-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 215, 0, 0.3);
  animation: dotPulse 1.4s infinite ease-in-out;
  will-change: transform, opacity, background-color;
}

.dot:nth-child(1) {
  animation-delay: 0s;
}

.dot:nth-child(2) {
  animation-delay: 0.2s;
}

.dot:nth-child(3) {
  animation-delay: 0.4s;
}

.status-messages {
  position: relative;
  height: 20px;
  margin-top: 1.5rem;
  overflow: hidden;
}

.status-message {
  position: absolute;
  width: 100%;
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.5s ease;
  will-change: opacity, transform;
}

.status-message:nth-child(1) {
  animation: statusFade 3s 0.5s infinite;
}

.status-message:nth-child(2) {
  animation: statusFade 3s 3.5s infinite;
}

.status-message:nth-child(3) {
  animation: statusFade 3s 6.5s infinite;
}

.splash-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  transform: scale(1.05);
}

.splash-screen.loaded {
  opacity: 0;
  visibility: hidden;
  transform: scale(1.1);
}

/* Responsive splash screen */
@media (max-width: 768px) {
  .splash-logo {
    width: 200px;
    height: 200px;
  }

  .splash-title {
    font-size: 2rem;
  }

  .splash-subtitle {
    font-size: 1.1rem;
  }

  .loading-container {
    width: 250px;
  }
  
  .status-message {
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .splash-logo {
    width: 150px;
    height: 150px;
  }

  .splash-title {
    font-size: 1.8rem;
    min-height: 2.5rem;
  }

  .splash-subtitle {
    font-size: 1rem;
  }

  .loading-container {
    width: 200px;
  }
  
  .progress-text {
    right: -35px;
    font-size: 0.8rem;
  }
  
  .dot {
    width: 8px;
    height: 8px;
  }
}

/* Performance Optimizations for Mobile */
@media (max-width: 768px) {
  .particle {
    animation-duration: 20s;
  }
  
  .logo-pulse {
    animation-duration: 3s;
  }
  
  .splash-logo img {
    animation-duration: 4s;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .particle,
  .logo-pulse,
  .splash-logo img,
  .dot,
  .status-message {
    animation: none;
  }
  
  .splash-screen {
    transition: none;
  }
  
  .loading-bar {
    transition: none;
  }
}
