#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7); /* Полупрозрачный чёрный */
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.5s ease;
}

#preloader.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loader-img {
  width: 80px;
  height: 80px;
  filter: brightness(0) invert(1); /* Делаем белую иконку */
  animation: pulse 1.5s infinite;
}

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

/* Контейнер для прогресс-бара */
.preloader-progress {
  width: 250px;
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  margin: 20px auto;
  overflow: hidden;
  position: relative;
}

/* Линия прогресса */
#preloader-line2 {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
  border-radius: 3px;
  transition: width 0.3s ease;
  position: relative;
}

/* Эффект свечения для линии */
#preloader-line2::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 100%
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* Контейнер для процентов */
#preloader-percentage {
  color: white;
  font-size: 28px;
  font-weight: 600;
  text-align: center;
  margin-top: 15px;
  font-family: "Roboto", sans-serif;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Анимация появления процентов */
#preloader-percentage {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    opacity: 0.8;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.8;
  }
}

/* Дополнительные эффекты при завершении */
#preloader-line2.complete {
  background: #4caf50;
  animation: completePulse 1s infinite;
}

@keyframes completePulse {
  0% {
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
  }
  50% {
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.8);
  }
  100% {
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
  }
}

.preloader-percentage.complete {
  color: #4caf50;
  animation: none;
}

/* Принудительно переопределяем inline стили */
.preloader-line2 {
  width: var(--progress-width, 0%) !important;
  height: 100% !important;
  background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%) !important;
  transition: width 0.3s ease !important;
  display: block !important;
}
/* Линия прогресса с классом preloader-line2 */
.preloader-line2 {
  width: 0% !important; /* Важно: начальное значение */
  height: 100%;
  background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
  border-radius: 3px;
  transition: width 0.3s ease;
  display: block;
}

/* Контейнер для процентов */
.preloader-percentage {
  color: white;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  margin-top: 15px;
  font-family: "Arial", sans-serif;
}
