/**
 * Loading States
 * Subtle, minimal loading indicators
 */

/* Button loading state */
.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  top: 50%;
  left: 50%;
  margin: -7px 0 0 -7px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.5s linear infinite;
}

/* Dark button variant */
.btn-loading.btn-dark::after,
.btn-loading.bg-gray-900::after {
  border-color: rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
}

/* Light/outline button variant */
.btn-loading.btn-light::after,
.btn-loading.bg-white::after,
.btn-loading.border::after {
  border-color: rgba(0, 0, 0, 0.15);
  border-top-color: #374151;
}

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

/* Page overlay */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(2px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
}

.loading-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.loading-overlay-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #e5e7eb;
  border-top-color: #6b7280;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.loading-overlay-text {
  margin-top: 12px;
  font-size: 13px;
  color: #6b7280;
  font-weight: 450;
}
