/* ==========================================================================
   components/spinner.css — Loading Spinner & Skeleton
   ========================================================================== */

.spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-green-main);
  border-radius: var(--radius-full);
  animation: spin .6s linear infinite;
}

.spinner-sm {
  width: 16px;
  height: 16px;
  border-width: 2px;
}
.spinner-md {
  width: 24px;
  height: 24px;
  border-width: 3px;
}
.spinner-lg {
  width: 40px;
  height: 40px;
  border-width: 4px;
}

/* On dark surface */
.spinner-light {
  border-color: rgba(255,255,255,.25);
  border-top-color: #fff;
}

/* Centered overlay */
.spinner-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.6);
  z-index: var(--z-overlay);
}

/* ---------- Skeleton ---------- */
.skeleton {
  display: block;
  background: linear-gradient(
    90deg,
    var(--color-border) 25%,
    var(--color-surface-2) 50%,
    var(--color-border) 75%
  );
  background-size: 200% 100%;
  border-radius: var(--radius-sm);
  animation: skeleton 1.4s ease infinite;
}

.skeleton-text {
  height: 12px;
  margin-bottom: var(--space-2);
}
.skeleton-text.short { width: 60%; }
.skeleton-text.long  { width: 90%; }

.skeleton-title {
  height: 18px;
  width: 45%;
  margin-bottom: var(--space-3);
}

.skeleton-circle {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-full);
}

.skeleton-card {
  height: 180px;
  border-radius: var(--radius-lg);
}

/* ---------- Dots loader ---------- */
.dots-loader {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}
.dots-loader span {
  width: 7px;
  height: 7px;
  border-radius: var(--radius-full);
  background: var(--color-green-main);
  animation: dot-bounce 1.2s ease-in-out infinite;
}
.dots-loader span:nth-child(2) { animation-delay: .15s; }
.dots-loader span:nth-child(3) { animation-delay: .3s; }
@keyframes dot-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .5; }
  30%           { transform: translateY(-6px); opacity: 1; }
}
