/**
 * Unified Professional Loading Indicators
 * Use these classes for consistent loading UI across the application
 */

/* Main loading container */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  min-height: 200px;
}

/* Modern spinner */
.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #e2e8f0;
  border-top-color: #F59E0B;
  border-radius: 50%;
  animation: spinner-rotate 0.8s linear infinite;
}

/* Small spinner variant */
.loading-spinner-sm {
  width: 24px;
  height: 24px;
  border-width: 3px;
}

/* Large spinner variant */
.loading-spinner-lg {
  width: 64px;
  height: 64px;
  border-width: 5px;
}

/* Loading text - stays fixed, doesn't rotate */
.loading-text {
  margin-top: 16px;
  color: #718096;
  font-size: 15px;
  font-weight: 500;
  text-align: center;
  animation: loading-pulse 1.5s ease-in-out infinite;
}

/* Smaller loading text */
.loading-text-sm {
  font-size: 13px;
  margin-top: 12px;
}

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

@keyframes loading-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Inline loading (for buttons, inline elements) */
.inline-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.inline-loading .loading-spinner {
  width: 16px;
  height: 16px;
  border-width: 2px;
  margin: 0;
}

.inline-loading .loading-text {
  margin: 0;
  animation: none;
  font-size: 14px;
}

/* Overlay loading (covers entire section) */
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(2px);
}

.loading-overlay.dark {
  background: rgba(45, 55, 72, 0.95);
}

.loading-overlay.dark .loading-text {
  color: #e2e8f0;
}

.loading-overlay.dark .loading-spinner {
  border-color: rgba(255, 255, 255, 0.2);
  border-top-color: #F59E0B;
}

/* Skeleton loading (for content placeholders) */
.skeleton {
  background: linear-gradient(
    90deg,
    #f0f0f0 25%,
    #e0e0e0 50%,
    #f0f0f0 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 4px;
}

.skeleton-text {
  height: 16px;
  margin: 8px 0;
}

.skeleton-title {
  height: 24px;
  margin: 12px 0;
  width: 60%;
}

.skeleton-card {
  height: 120px;
  border-radius: 8px;
}

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

/* Progress bar loading */
.loading-progress {
  width: 100%;
  max-width: 400px;
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
  overflow: hidden;
  margin: 16px auto;
}

.loading-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #F59E0B, #F97316);
  animation: progress-indeterminate 1.5s ease-in-out infinite;
  border-radius: 2px;
}

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

/* Dots loading indicator */
.loading-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 16px 0;
}

.loading-dot {
  width: 10px;
  height: 10px;
  background: #F59E0B;
  border-radius: 50%;
  animation: dot-bounce 1.4s ease-in-out infinite;
}

.loading-dot:nth-child(1) { animation-delay: 0s; }
.loading-dot:nth-child(2) { animation-delay: 0.2s; }
.loading-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes dot-bounce {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

/* Utility classes */
.loading-hidden { display: none; }
.loading-visible { display: flex; }

/* Responsive adjustments */
@media (max-width: 768px) {
  .loading-container {
    padding: 30px 15px;
    min-height: 150px;
  }
  
  .loading-spinner {
    width: 40px;
    height: 40px;
  }
  
  .loading-text {
    font-size: 14px;
  }
}
