/* Full-screen loader */
#loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.9); /* Light overlay */
  z-index: 9999;
  transition: opacity 0.5s ease-in-out, visibility 0.5s;
}

/* Hide loader after animation */
#loader.hidden {
  opacity: 0;
  visibility: hidden;
}

/* Positioning the container */
#container {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  width: 190px;
  height: 190px;
}

/* Text inside loader */
/* Colorful Animated Text */
h3 {
  position: absolute;
  font-size: 15px;
  font-weight: bold;
  text-align: center;
  background: linear-gradient(45deg, #ff00ff, #ff4500, #00ffff, #ff1493);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientAnimation 3s infinite linear;
  text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
}

/* Gradient Animation */
@keyframes gradientAnimation {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Loader rings */
.ring {
  width: 190px;
  height: 190px;
  border-radius: 50%;
  position: absolute;
  border: 8px solid transparent;
}

.ring:nth-child(1) {
  border-bottom-color: rgb(240, 42, 230);
  animation: rotate1 2s linear infinite;
}

@keyframes rotate1 {
  from {
    transform: rotateX(50deg) rotateZ(110deg);
  }
  to {
    transform: rotateX(50deg) rotateZ(470deg);
  }
}

.ring:nth-child(2) {
  border-bottom-color: rgb(240, 19, 67);
  animation: rotate2 2s linear infinite;
}

@keyframes rotate2 {
  from {
    transform: rotateX(20deg) rotateY(50deg) rotateZ(20deg);
  }
  to {
    transform: rotateX(20deg) rotateY(50deg) rotateZ(380deg);
  }
}

.ring:nth-child(3) {
  border-bottom-color: rgb(3, 170, 170);
  animation: rotate3 2s linear infinite;
}

@keyframes rotate3 {
  from {
    transform: rotateX(40deg) rotateY(130deg) rotateZ(450deg);
  }
  to {
    transform: rotateX(40deg) rotateY(130deg) rotateZ(90deg);
  }
}

.ring:nth-child(4) {
  border-bottom-color: rgb(207, 135, 1);
  animation: rotate4 2s linear infinite;
}

@keyframes rotate4 {
  from {
    transform: rotateX(70deg) rotateZ(270deg);
  }
  to {
    transform: rotateX(70deg) rotateZ(630deg);
  }
}
