/* Preloader container styles */
#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #ffffff; /* Background color */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999; /* Ensure it's above other elements */
}

/* Paste your existing loader styles here */
.loader {
  display: flex;
  justify-content: center;
  align-items: center;
  --animation: 2s ease-in-out infinite;
}

.loader .circle {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 20px;
  height: 20px;
  border: solid 2px transparent;
  border-radius: 50%;
  margin: 0 10px;
  background-color: transparent;
  animation: circle-keys var(--animation);
}

/* General Loader Styles */
.loader {
  display: flex;
  justify-content: center;
  align-items: center;
  --animation: 2s ease-in-out infinite;
}

.loader .circle {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 20px;
  height: 20px;
  border: solid 2px transparent;
  border-radius: 50%;
  margin: 0 10px;
  background-color: transparent;
  animation: circle-keys var(--animation);
}

/* Dots with vibrant colors */
.loader .circle .dot {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  animation: dot-keys var(--animation);
}

/* Outlines with matching colors */
.loader .circle .outline {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  animation: outline-keys var(--animation);
}

/* Assign colors to each circle */
.circle:nth-child(1) .dot,
.circle:nth-child(1) .outline {
  background-color: #6198ff; /* Coral */
  border-color: #6198ff;
}

.circle:nth-child(2) .dot,
.circle:nth-child(2) .outline {
  background-color: #ffcc00; /* Gold */
  border-color: #ffcc00;
}

.circle:nth-child(3) .dot,
.circle:nth-child(3) .outline {
  background-color: #6fcf97; /* Mint */
  border-color: #6fcf97;
}

.circle:nth-child(4) .dot,
.circle:nth-child(4) .outline {
  background-color: #f25656; /* Sky Blue */
  border-color: #f25656;
}

/* Delayed animations */
.circle:nth-child(2) {
  animation-delay: 0.3s;
}
.circle:nth-child(3) {
  animation-delay: 0.6s;
}
.circle:nth-child(4) {
  animation-delay: 0.9s;
}
.circle:nth-child(5) {
  animation-delay: 1.2s;
}
.circle:nth-child(6) {
  animation-delay: 1.5s;
}

.circle:nth-child(2) .dot {
  animation-delay: 0.3s;
}
.circle:nth-child(3) .dot {
  animation-delay: 0.6s;
}
.circle:nth-child(4) .dot {
  animation-delay: 0.9s;
}
.circle:nth-child(5) .dot {
  animation-delay: 1.2s;
}
.circle:nth-child(6) .dot {
  animation-delay: 1.5s;
}

.circle:nth-child(1) .outline {
  animation-delay: 0.9s;
}
.circle:nth-child(2) .outline {
  animation-delay: 1.2s;
}
.circle:nth-child(3) .outline {
  animation-delay: 1.5s;
}
.circle:nth-child(4) .outline {
  animation-delay: 1.8s;
}
.circle:nth-child(5) .outline {
  animation-delay: 2.1s;
}
.circle:nth-child(6) .outline {
  animation-delay: 2.4s;
}

/* Animations */
@keyframes circle-keys {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.5);
    opacity: 0.5;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes dot-keys {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(0);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes outline-keys {
  0% {
    transform: scale(0);
    outline: solid 20px currentColor;
    outline-offset: 0;
    opacity: 1;
  }
  100% {
    transform: scale(1);
    outline: solid 0 transparent;
    outline-offset: 20px;
    opacity: 0;
  }
}



/* Hide the preloader when it's not needed */
#preloader.hidden {
  display: none;
}
