/*
 * Spinner Component
 * Loading indicators
 */

.spinner {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--theme-border);
  border-right-color: var(--theme-accent);
  border-radius: 50%;
  animation: spinner-rotate 0.75s linear infinite;
}

@keyframes spinner-rotate {
  to {
    transform: rotate(360deg);
  }
}

/* Spinner Sizes */
.spinner-xs {
  width: 0.75rem;
  height: 0.75rem;
  border-width: 1px;
}

.spinner-sm {
  width: 1rem;
  height: 1rem;
  border-width: 2px;
}

.spinner-md {
  width: 1.25rem;
  height: 1.25rem;
  border-width: 2px;
}

.spinner-lg {
  width: 1.75rem;
  height: 1.75rem;
  border-width: 3px;
}

.spinner-xl {
  width: 2.5rem;
  height: 2.5rem;
  border-width: 3px;
}

/* Spinner Colors */
.spinner-primary {
  border-color: var(--theme-border);
  border-right-color: var(--theme-accent);
}

.spinner-white {
  border-color: rgba(255, 255, 255, 0.3);
  border-right-color: white;
}

.spinner-dark {
  border-color: rgba(0, 0, 0, 0.1);
  border-right-color: var(--theme-text-primary);
}

/* Pulse Spinner */
.spinner-pulse {
  width: 1.25rem;
  height: 1.25rem;
  background-color: var(--theme-accent);
  border-radius: 50%;
  animation: spinner-pulse 1.5s ease-in-out infinite;
}

@keyframes spinner-pulse {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 0;
  }
}

/* Dots Spinner */
.spinner-dots {
  display: inline-flex;
  gap: 0.25rem;
}

.spinner-dots span {
  width: 0.5rem;
  height: 0.5rem;
  background-color: var(--theme-accent);
  border-radius: 50%;
  animation: spinner-dots 1.4s ease-in-out infinite both;
}

.spinner-dots span:nth-child(1) {
  animation-delay: -0.32s;
}

.spinner-dots span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes spinner-dots {
  0%, 80%, 100% {
    transform: scale(0);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}