#loader-overlay {
  position: fixed;
  z-index: 9999;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s;
}
#loader-overlay.hide {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.loader.modal-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  box-shadow: none;
  position: relative;
}

.img-spinner-loader {
  width: 48px;
  height: 48px;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,0.15));
  animation: img-modern-bounce-fade 1.2s cubic-bezier(.4,0,.2,1) infinite;
  will-change: transform, opacity;
  border-radius: 12px;
  background: rgba(255,255,255,0.7);
  padding: 6px;
}

@keyframes img-modern-bounce-fade {
  0% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
  20% {
    transform: scale(1.08) translateY(-6px);
    opacity: 0.92;
  }
  40% {
    transform: scale(0.96) translateY(0);
    opacity: 0.85;
  }
  60% {
    transform: scale(1.04) translateY(-3px);
    opacity: 0.95;
  }
  80% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

/* Color animation for the square */
.square-svg-spinner rect {
  stroke: #007bff;
  stroke-width: 4;
  fill: none;
  stroke-linecap: round;
  stroke-dasharray: 64;
  stroke-dashoffset: 0;
  animation: square-svg-color 1.2s linear infinite;
}
@keyframes square-svg-color {
  0% { stroke: #007bff; }
  25% { stroke: #00c3ff; }
  50% { stroke: #00ffae; }
  75% { stroke: #ffe066; }
  100% { stroke: #007bff; }
}

/* Bouncing Dots Loader */
.bouncing-dots-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
}

.bouncing-dots-loader .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #007bff;
  animation: bouncing-dot 0.8s infinite alternate;
}

.bouncing-dots-loader .dot:nth-child(2) {
  animation-delay: 0.2s;
}
.bouncing-dots-loader .dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes bouncing-dot {
  from {
    transform: translateY(0);
    opacity: 0.7;
  }
  to {
    transform: translateY(-16px);
    opacity: 1;
  }
}

/* Glowing pulse effect for loader */
.loader-glow {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle, #007bff55 0%, #007bff11 70%, transparent 100%);
  z-index: 0;
  animation: loader-glow-pulse 1.6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes loader-glow-pulse {
  0%, 100% { opacity: 0.7; transform: translate(-50%, -50%) scale(1);}
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.15);}
}

/* Rotating gradient border around loader */
.loader-gradient-border {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  z-index: 1;
  background: conic-gradient(from 0deg, #007bff, #00c3ff, #00ffae, #ffe066, #007bff);
  animation: loader-gradient-spin 1.8s linear infinite;
  pointer-events: none;
}

@keyframes loader-gradient-spin {
  100% { transform: translate(-50%, -50%) rotate(360deg);}
}

/* Blurred Colorful Aura Behind the Image */
.loader-aura {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: conic-gradient(
    #007bff 0deg, #00c3ff 90deg, #00ffae 180deg, #ffe066 270deg, #007bff 360deg
  );
  filter: blur(18px);
  opacity: 0.7;
  z-index: 0;
  animation: loader-aura-rotate 2.5s linear infinite;
  pointer-events: none;
}

@keyframes loader-aura-rotate {
  100% { transform: translate(-50%, -50%) rotate(360deg);}
}

/* Progress Bar for Loader */
.loader-progress-bar {
  position: absolute;
  left: 50%;
  bottom: -18px;
  transform: translateX(-50%);
  width: 48px;
  height: 5px;
  background: #e0e0e0;
  border-radius: 3px;
  overflow: hidden;
  z-index: 3;
}

.loader-progress-bar-inner {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #007bff, #00c3ff, #00ffae, #ffe066);
  border-radius: 3px;
}
