/* Preloader Styles - Inspired by Hero Animation */

.preloader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(
    135deg,
    #f8fafc 0%,
    #e0f2fe 25%,
    #fef3c7 50%,
    #fce7f3 75%,
    #f8fafc 100%
  );
  background-size: 400% 400%;
  animation: gradientShift 8s ease-in-out infinite;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.8s ease, transform 0.8s ease;
  overflow: hidden;
}

.preloader-overlay::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 20% 75%, rgba(99, 102, 241, 0.15) 0%, transparent 55%),
                radial-gradient(circle at 75% 25%, rgba(16, 185, 129, 0.12) 0%, transparent 55%),
                radial-gradient(circle at 50% 50%, rgba(251, 113, 133, 0.1) 0%, transparent 75%);
  animation: backgroundPulse 6s ease-in-out infinite;
  mix-blend-mode: screen;
  pointer-events: none;
}

.preloader-content {
  text-align: center;
  position: relative;
  z-index: 2;
}

.preloader-logo-wrapper {
  margin-bottom: 2rem;
  position: relative;
}

.preloader-logo {
  position: relative;
  display: inline-block;
  perspective: 1000px;
  transform-style: preserve-3d;
}

.preloader-text-line-1 {
  display: block;
  font-size: 4rem;
  font-weight: 900;
  letter-spacing: -2px;
  color: #1e293b;
  text-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.1),
    0 4px 8px rgba(0, 0, 0, 0.05),
    0 8px 16px rgba(0, 0, 0, 0.025);
  animation: slideInLeft 1.2s ease-out 0.2s forwards;
  transform: translateX(-100px);
  opacity: 0;
  line-height: 0.9;
  transform-origin: center;
}

.preloader-text-line-2 {
  display: block;
  font-size: 4rem;
  font-weight: 900;
  letter-spacing: -2px;
  background: linear-gradient(135deg, #ff6b9d 0%, #ffa726 50%, #4ecdc4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 
    0 2px 4px rgba(255, 107, 157, 0.2),
    0 4px 8px rgba(255, 167, 38, 0.15),
    0 8px 16px rgba(78, 205, 196, 0.1);
  animation: slideInRight 1.2s ease-out 0.6s forwards;
  transform: translateX(100px);
  opacity: 0;
  line-height: 0.9;
  transform-origin: center;
}

.preloader-underline {
  width: 0;
  height: 4px;
  background: linear-gradient(90deg, #ff6b9d, #ffa726, #4ecdc4);
  margin: 1rem auto 0;
  border-radius: 2px;
  animation: expandLine 1s ease-out 1.2s forwards;
  box-shadow: 0 2px 8px rgba(255, 107, 157, 0.3);
}

.preloader-subtitle {
  margin-bottom: 3rem;
  overflow: hidden;
}

.preloader-subtitle-text {
  display: inline-block;
  font-size: 1.2rem;
  color: #64748b;
  font-weight: 500;
  animation: fadeInUp 1s ease-out 1.8s forwards;
  opacity: 0;
  transform: translateY(20px);
}

/* Spinner Animation */
.preloader-spinner {
  width: 60px;
  height: 60px;
  margin: 0 auto 2rem;
  position: relative;
}

.preloader-spinner-inner {
  width: 100%;
  height: 100%;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top: 3px solid #ff6b9d;
  border-right: 3px solid #ffa726;
  border-bottom: 3px solid #4ecdc4;
  border-radius: 50%;
  animation: spin 1.5s linear infinite;
  position: relative;
}

.preloader-spinner-inner::before {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  border: 2px solid transparent;
  border-top: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  animation: spinReverse 2s linear infinite;
}

/* Loading Dots */
.preloader-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2rem;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff6b9d, #ffa726);
  animation: dotPulse 1.4s ease-in-out infinite both;
}

.dot-1 { animation-delay: -0.32s; }
.dot-2 { animation-delay: -0.16s; }
.dot-3 { animation-delay: 0s; }

/* Animations */
@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes backgroundPulse {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 0.5; }
}

@keyframes slideInLeft {
  0% {
    transform: translateX(-100px) rotateY(-15deg);
    opacity: 0;
  }
  100% {
    transform: translateX(0) rotateY(0deg);
    opacity: 1;
  }
}

@keyframes slideInRight {
  0% {
    transform: translateX(100px) rotateY(15deg);
    opacity: 0;
  }
  100% {
    transform: translateX(0) rotateY(0deg);
    opacity: 1;
  }
}

@keyframes expandLine {
  0% { width: 0; }
  100% { width: 200px; }
}

@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes spinReverse {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(-360deg); }
}

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

/* Responsive Design */
@media (max-width: 768px) {
  .preloader-text-line-1,
  .preloader-text-line-2 {
    font-size: 2.5rem;
  }
  
  .preloader-subtitle-text {
    font-size: 1rem;
  }
  
  .preloader-spinner {
    width: 40px;
    height: 40px;
  }
  
  @keyframes expandLine {
    0% { width: 0; }
    100% { width: 150px; }
  }
}

/* Hide preloader */
.preloader-overlay.hidden {
  opacity: 0;
  transform: scale(1.1);
  pointer-events: none;
}

/* Content transitions */
.content-hidden {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.content-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.8s ease, transform 0.8s ease;
}