/* Loader 1: Spinner */
.loader-spinner {
  border: 6px solid #eee;
  border-top: 6px solid var(--color-primary);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Loader 2: Dots Bounce */
.loader-dots {
  display: flex;
  gap: 6px;
}
.loader-dots span {
  width: 12px;
  height: 12px;
  background: linear-gradient(
    145deg,
    var(--color-primary),
    var(--color-secondary)
  );
  border-radius: 50%;
  animation: bounce 0.6s infinite ease-in-out;
}
.loader-dots span:nth-child(2) {
  animation-delay: 0.2s;
}
.loader-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}

/* Loader 3: Bar Slide */
.loader-bar {
  width: 80px;
  height: 8px;
  background: #ccc;
  overflow: hidden;
  position: relative;
  border-radius: 4px;
}
.loader-bar div {
  width: 40%;
  height: 100%;
  background: var(--color-primary);
  animation: slide 1.4s infinite;
}

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

/* Loader 4: Pulse */
.loader-pulse {
  width: 35px;
  height: 35px;
  background: var(--color-primary);
  border-radius: 50%;
  animation: pulse 1.2s infinite ease-in-out;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    background: var(--color-primary);
    opacity: 1;
  }
  100% {
    transform: scale(1.6);
    background: var(--color-secondary);
    opacity: 0;
  }
}

/* Loader 5: Dual Ring */
.loader-dual-ring {
  display: inline-block;
  width: 50px;
  height: 50px;
}
.loader-dual-ring:after {
  content: " ";
  display: block;
  width: 38px;
  height: 38px;
  margin: 1px;
  border-radius: 50%;
  border: 4px solid var(--color-primary);
  border-color: var(--color-primary) transparent var(--color-primary)
    transparent;
  animation: dual-ring 1.2s linear infinite;
}

@keyframes dual-ring {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Loader 6: Ripple */
.loader-ripple {
  position: relative;
  width: 60px;
  height: 60px;
}
.loader-ripple div {
  position: absolute;
  border: 4px solid var(--color-primary);
  border-radius: 50%;
  animation: ripple 1.2s infinite;
  opacity: 1;
}
.loader-ripple div:nth-child(2) {
  animation-delay: -0.6s;
}

@keyframes ripple {
  0% {
    top: 28px;
    left: 28px;
    width: 0;
    height: 0;
    opacity: 1;
  }
  100% {
    top: -1px;
    left: -1px;
    width: 58px;
    height: 58px;
    opacity: 0;
  }
}

/* Loader 7: Circle Dots */
.loader-circle-dots {
  position: relative;
  width: 50px;
  height: 50px;
}

.loader-circle-dots div {
  width: 8px;
  height: 8px;
  background: var(--color-primary);
  border-radius: 50%;
  position: absolute;
  animation: scale-dot 1.2s linear infinite;
}

.loader-circle-dots div:nth-child(1) {
  top: 21px;
  left: 0;
  animation-delay: 0s;
}
.loader-circle-dots div:nth-child(2) {
  top: 7px;
  left: 7px;
  animation-delay: 0.1s;
}
.loader-circle-dots div:nth-child(3) {
  top: 0;
  left: 21px;
  animation-delay: 0.2s;
}
.loader-circle-dots div:nth-child(4) {
  top: 7px;
  left: 35px;
  animation-delay: 0.3s;
}
.loader-circle-dots div:nth-child(5) {
  top: 21px;
  left: 42px;
  animation-delay: 0.4s;
}
.loader-circle-dots div:nth-child(6) {
  top: 35px;
  left: 35px;
  animation-delay: 0.5s;
}
.loader-circle-dots div:nth-child(7) {
  top: 42px;
  left: 21px;
  animation-delay: 0.6s;
}
.loader-circle-dots div:nth-child(8) {
  top: 35px;
  left: 7px;
  animation-delay: 0.7s;
}

@keyframes scale-dot {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.5);
    opacity: 0.3;
  }
}

/* Loader 8: Bars */
.loader-bars {
  display: flex;
  gap: 4px;
  align-items: end;
  height: 35px;
}

.loader-bars div {
  width: 5px;
  height: 10px;
  background: var(--color-primary);
  animation: grow 1s infinite ease-in-out;
}

.loader-bars div:nth-child(2) {
  animation-delay: 0.1s;
}
.loader-bars div:nth-child(3) {
  animation-delay: 0.2s;
}
.loader-bars div:nth-child(4) {
  animation-delay: 0.3s;
}
.loader-bars div:nth-child(5) {
  animation-delay: 0.4s;
}

@keyframes grow {
  0%,
  100% {
    height: 10px;
  }
  50% {
    height: 35px;
  }
}

/* Loader 9: Flip Box */
.loader-flip {
  width: 40px;
  height: 40px;
  background: var(--color-primary);
  animation: flip 1s infinite ease-in-out;
}

@keyframes flip {
  0% {
    transform: rotateY(0deg);
  }
  50% {
    transform: rotateY(180deg);
  }
  100% {
    transform: rotateY(360deg);
  }
}

/* Loader 10: Fade Circle */
.loader-fade-circle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--color-primary);
  animation: fade 1s infinite;
}

@keyframes fade {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

/* Loader 11: Rotate Square */
.loader-rotate-square {
  width: 40px;
  height: 40px;
  background: var(--color-primary);
  animation: rotate-square 1s infinite linear;
}

@keyframes rotate-square {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Loader 12: Moving Lines */
.loader-lines {
  display: flex;
  gap: 3px;
}

.loader-lines div {
  width: 4px;
  height: 20px;
  background: var(--color-primary);
  animation: lineMove 1s infinite ease-in-out;
}

.loader-lines div:nth-child(2) {
  animation-delay: 0.1s;
}
.loader-lines div:nth-child(3) {
  animation-delay: 0.2s;
}
.loader-lines div:nth-child(4) {
  animation-delay: 0.3s;
}

@keyframes lineMove {
  0%,
  100% {
    height: 10px;
  }
  50% {
    height: 30px;
  }
}

/* Animación opcional para el spinner */
.spinner-border {
  width: 2.5rem;
  height: 2.5rem;
  color: var(--color-secondary);
  margin-bottom: 1rem;
  /* Color primario Bootstrap */
}
.pulse {
  animation: pulse 1.5s infinite;
  text-shadow: 0 0.2rem 0.5rem rgba(0, 0, 0, 0.5);
}
@keyframes pulse {
  0% {
    transform: scale(0.9);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.7;
  }
  100% {
    transform: scale(0.9);
    opacity: 1;
  }
}
