body {
  margin: 0;
}

html {
  overflow: hidden scroll;
}

#loading-bg {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--initial-loader-bg, #fff);
  z-index: 9999;
  overflow: hidden;
}

/* Animated gradient background (subtle) */
#loading-bg::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle at center,
    var(--initial-loader-color, #157BBF) 0%,
    transparent 70%
  );
  opacity: 0.03;
  animation: rotate-bg 20s linear infinite;
}

/* Logo container with smooth pulse */
.loading-logo {
  position: relative;
  width: 200px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse-logo 3s ease-in-out infinite;
  z-index: 1;
}

.loading-logo svg {
  width: 130px;
  height: 130px;
}

/* Loading spinner container */
.loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 200px;
  pointer-events: none;
}


/* Single clean rotating circle */
.loading .effect-1 {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--initial-loader-color, #157BBF);
  box-sizing: border-box;
  animation: rotate-smooth 1.2s linear infinite;
}

/* Hide effect-2 and effect-3 */
.loading .effect-2,
.loading .effect-3 {
  display: none;
}

/* Smooth rotation animation */
@keyframes rotate-smooth {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}


/* Background rotation */
@keyframes rotate-bg {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Pulse animation for the logo */
@keyframes pulse-logo {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}


/* Fade in animation */
@keyframes fade-in {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Apply fade-in to the whole loading screen */
#loading-bg {
  animation: fade-in 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Loading text (optional) */
.loading-text {
  position: absolute;
  bottom: 30%;
  font-size: 14px;
  color: var(--initial-loader-color, #157BBF);
  opacity: 0.6;
  animation: fade-in-out 2s ease-in-out infinite;
}

@keyframes fade-in-out {
  0%, 100% {
    opacity: 0.3;
  }
  50% {
    opacity: 0.7;
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .loading-logo {
    width: 160px;
    height: 160px;
  }

  .loading-logo svg {
    width: 100px;
    height: 100px;
  }

  .loading {
    width: 160px;
    height: 160px;
  }
}
