/**
 * Loading & Skeleton Component Styles
 */

/* =============================================================================
   SPINNER
   Circular loading indicator
   ============================================================================= */

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-default);
  border-top-color: var(--accent-primary);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}

.spinnerSmall {
  width: 14px;
  height: 14px;
  border-width: 1.5px;
}

.spinnerLarge {
  width: 32px;
  height: 32px;
  border-width: 3px;
}

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

/* =============================================================================
   SKELETON
   Placeholder loading animation
   ============================================================================= */

.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-tertiary) 25%,
    var(--bg-hover) 50%,
    var(--bg-tertiary) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Skeleton variants */
.skeletonText {
  height: 12px;
  width: 100%;
}

.skeletonTextShort {
  width: 60%;
}

.skeletonTextMedium {
  width: 80%;
}

.skeletonTitle {
  height: 16px;
  width: 40%;
}

.skeletonAvatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
}

.skeletonButton {
  height: 28px;
  width: 80px;
  border-radius: var(--radius-default);
}

.skeletonCard {
  height: 120px;
  border-radius: var(--radius-default);
}

/* =============================================================================
   PROGRESS BAR
   Linear progress indicator
   ============================================================================= */

.progressBar {
  width: 100%;
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progressFill {
  height: 100%;
  background: var(--accent-primary);
  border-radius: var(--radius-full);
  transition: width var(--transition-default);
}

/* Indeterminate progress */
.progressIndeterminate .progressFill {
  width: 30%;
  animation: progress-indeterminate 1.5s ease-in-out infinite;
}

@keyframes progress-indeterminate {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(400%);
  }
}

/* Progress variants */
.progressSuccess .progressFill {
  background: var(--status-success);
}

.progressWarning .progressFill {
  background: var(--status-warning);
}

.progressError .progressFill {
  background: var(--status-error);
}

/* =============================================================================
   LOADING OVERLAY
   Full-area loading state
   ============================================================================= */

.loadingOverlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-overlay, rgba(0, 0, 0, 0.4));
  z-index: 10;
}

.loadingContent {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--bg-secondary);
  border-radius: var(--radius-default);
  box-shadow: var(--shadow-lg);
}

.loadingText {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

/* =============================================================================
   EMPTY STATE
   When there's no data to display
   ============================================================================= */

.emptyState {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
  text-align: center;
}

.emptyStateIcon {
  width: 48px;
  height: 48px;
  margin-bottom: var(--space-4);
  color: var(--text-tertiary);
}

.emptyStateTitle {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.emptyStateDescription {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  max-width: 280px;
  margin-bottom: var(--space-4);
}

/* =============================================================================
   PULSE DOT
   Animated status indicator
   ============================================================================= */

.pulseDot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--status-success);
}

.pulseDot::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-full);
  background: inherit;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.8);
    opacity: 0;
  }
}

.pulseDotWarning {
  background: var(--status-warning);
}

.pulseDotError {
  background: var(--status-error);
}

.pulseDotInfo {
  background: var(--status-info);
}
