.loader {
  width: 50px;
  height: 50px;
  border: 3px solid hsl(var(--muted));
  border-radius: 50%;
  display: inline-block;
  position: relative;
  box-sizing: border-box;
  animation: rotation 1s linear infinite;
}

.loader::after {
  content: '';  
  box-sizing: border-box;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-bottom-color: hsl(var(--primary));
}

/* Pulse spinner */
.loader-pulse {
  width: 48px;
  height: 48px;
  display: inline-block;
  position: relative;
}

.loader-pulse::after,
.loader-pulse::before {
  content: '';  
  box-sizing: border-box;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  position: absolute;
  left: 0;
  top: 0;
  animation: animloader 2s linear infinite;
}

.loader-pulse::after {
  animation-delay: 1s;
}

/* Dots spinner */
.loader-dots {
  width: 70px;
  display: flex;
  justify-content: space-between;
}

.loader-dots > div {
  width: 12px;
  height: 12px;
  background-color: hsl(var(--primary));
  border-radius: 50%;
  animation: bounce 0.5s alternate infinite;
}

.loader-dots > div:nth-child(2) {
  animation-delay: 0.15s;
}

.loader-dots > div:nth-child(3) {
  animation-delay: 0.3s;
}

/* Loading container */
.loading-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: hsl(var(--background));
  z-index: 9999;
  gap: 1.5rem;
}

.loading-text {
  color: hsl(var(--muted-foreground));
  font-size: 1rem;
  margin-top: 1rem;
  font-weight: 500;
}

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

@keyframes animloader {
  0% {
    transform: scale(0);
    opacity: 1;
    border: 2px solid hsl(var(--primary));
  }
  100% {
    transform: scale(1);
    opacity: 0;
    border: 2px solid hsl(var(--primary));
  }
}

@keyframes bounce {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-8px);
  }
}
