/* Preloader Styles - Optimized for performance */
/* Hide main content initially to prevent FOUC */
main {
  visibility: hidden !important;
  opacity: 0 !important;
  transform: translateY(10px) !important;
  transition: opacity 0.4s ease, transform 0.4s ease, visibility 0s !important;
}

/* Only show main content when preloader is hidden and body has content-loaded class */
body.content-loaded main {
  visibility: visible !important;
  opacity: 1 !important;
  transform: translateY(0) !important;
}

.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #f5f8ff 0%, #ffffff 100%);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  will-change: opacity;
}

.preloader-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.preloader-logo {
  width: 180px;
  height: 180px;
  margin-bottom: 20px;
  transform-origin: center;
  position: relative;
  z-index: 2;
}

.preloader-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.preloader-logo svg path {
  animation: pathGlow 2s ease-in-out infinite alternate;
}

.preloader-progress {
  width: 240px;
  height: 4px;
  background: rgba(44, 114, 194, 0.1);
  border-radius: 10px;
  margin-top: 20px;
  overflow: hidden;
  position: relative;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: #d2ab6e;
  border-radius: 10px;
  will-change: width;
  transform: translateZ(0);
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.03);
  }
}

@keyframes fadeInOut {
  0%, 100% {
    opacity: 0.7;
  }
  50% {
    opacity: 1;
  }
}

.preloader.fade-out {
  opacity: 0;
  transition: opacity 0.4s ease;
}

.preloader.hidden {
  display: none;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .preloader-logo {
    animation: none;
  }
  
  .progress-bar {
    transition: none;
  }
  
  .preloader.fade-out {
    transition: none;
  }
}

/* Mobile specific optimizations */
@media (max-width: 768px) {
  .preloader-logo {
    width: 150px;
    height: 150px;
  }
  
  .preloader-text {
    font-size: 12px;
  }
  
  .preloader-progress {
    width: 200px;
  }
}

/* Small mobile devices */
@media (max-width: 480px) {
  .preloader-logo {
    width: 150px;
    height: 150px;
    margin-bottom: 15px;
  }
  
  .preloader-text {
    font-size: 10px;
    letter-spacing: 2px;
  }
  
  .preloader-progress {
    width: 180px;
    height: 3px;
  }
}
