
/*--------------------------------------------------------------
# Preloader with Loading Percentage
--------------------------------------------------------------*/
#preloader {
  position: fixed;
  inset: 0;
  z-index: 999999;
  overflow: hidden;
  background: #3B3B3B; 
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  transition: opacity 0.6s ease-out;
}

.preloader__image {
  animation-fill-mode: both;
  animation-duration: 1s;
  animation-iteration-count: infinite;
  animation-timing-function: ease-in-out;
  margin-bottom: 60px; /* Space between logo and percentage */
}

.preloader__image img {
  max-width: 100vw !important;
  max-height: 100vh !important;
  /* width: auto;
  height: auto; */
  filter: drop-shadow(0 4px 8px rgba(137, 11, 12, 0.2));
}

/* Loading Percentage Styling */
.loading-percentage {
  position: absolute;
  bottom: 20px;
  left: 10%;
  transform: translateX(-50%);
  font-size: 4rem;
  font-weight: 700;
  color: #89670b; /* Red color matching your logo */
   font-family: 'Trajan Pro', serif;
  letter-spacing: 2px;
  text-shadow: 0 2px 4px rgba(137, 11, 12, 0.3);
  animation: pulsePercentage 3s ease-in-out infinite;
}

#percentage-counter {
  display: inline-block;
  min-width: 3ch; /* Ensures consistent width for single/double/triple digits */
  text-align: right;
}

/* Responsive adjustments */
@media (max-width: 991px) {
  .preloader__image {
    animation-name: logoFadeInOut;
    margin-bottom: 40px;
  }
  
  .preloader__image img {
    max-width: 80px;
    max-height: 80px;
  }
  
  .loading-percentage {
    font-size: 3rem;
    bottom: 60px;
     left: 20%;
  }
}

@media (min-width: 992px) {
  .preloader__image {
    animation-name: logoFlipInY;
  }
}

@media (max-width: 480px) {
  .loading-percentage {
    font-size: 2.5rem;
    bottom: 40px;
     left: 20%;
  }
}

/* Logo Animation keyframes */
@keyframes logoFadeInOut {
  0%, 100% { 
    opacity: 0.4;
    transform: scale(0.9);
  }
  50% { 
    opacity: 1;
    transform: scale(1.05);
  }
}

@keyframes logoFlipInY {
  0% {
    transform: perspective(400px) rotate3d(0, 1, 0, 90deg) scale(0.8);
    animation-timing-function: ease-in;
    opacity: 0;
  }
  40% {
    transform: perspective(400px) rotate3d(0, 1, 0, -20deg) scale(0.95);
    animation-timing-function: ease-in;
    opacity: 0.8;
  }
  60% {
    transform: perspective(400px) rotate3d(0, 1, 0, 10deg) scale(1.02);
    opacity: 1;
  }
  80% {
    transform: perspective(400px) rotate3d(0, 1, 0, -5deg) scale(1);
  }
  100% {
    transform: perspective(400px) rotate3d(0, 1, 0, 0deg) scale(1);
    opacity: 1;
  }
}

/* Percentage animation */
@keyframes pulsePercentage {
  0%, 100% {
    transform: translateX(-50%) scale(1);
    opacity: 0.9;
  }
  50% {
    transform: translateX(-50%) scale(1.05);
    opacity: 1;
  }
}

/* Hide main content initially */
.main-content {
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.main-content.loaded {
  opacity: 1;
}

/* Fade out effect for preloader */
#preloader.fade-out {
  opacity: 0;
  visibility: hidden;
}