/* ==================== LOADING INDICATORS ==================== */

/* Global Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  backdrop-filter: blur(3px);
}

.loading-overlay.active {
  display: flex;
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid #d1a056;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-text {
  color: white;
  margin-top: 1rem;
  font-size: 1rem;
  font-weight: 500;
}

/* Button Loading State */
.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid white;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* Card Loading Skeleton */
.card-loading {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 12px;
}

.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

.skeleton-text {
  height: 16px;
  margin: 8px 0;
}

.skeleton-title {
  height: 24px;
  width: 60%;
  margin-bottom: 12px;
}

.skeleton-image {
  width: 100%;
  height: 200px;
  border-radius: 12px;
}

.skeleton-button {
  width: 100px;
  height: 40px;
  border-radius: 20px;
}

/* Image Loading State */
.image-loading {
  position: relative;
  background: #f5f5f5;
}

.image-loading::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  margin-left: -15px;
  margin-top: -15px;
  border: 3px solid #eee;
  border-top-color: #d1a056;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Table Loading State */
.table-loading {
  position: relative;
  min-height: 200px;
}

.table-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin-left: -20px;
  margin-top: -20px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #d1a056;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Animations */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Dark Mode */
body.dark-mode .skeleton,
body.dark-mode .card-loading {
  background: linear-gradient(90deg, #2d2d2d 25%, #3d3d3d 50%, #2d2d2d 75%);
  background-size: 200% 100%;
}

body.dark-mode .image-loading {
  background: #2d2d2d;
}

/* Responsive */
@media (max-width: 768px) {
  .loading-spinner {
    width: 50px;
    height: 50px;
    border-width: 3px;
  }
  
  .loading-text {
    font-size: 0.9rem;
    margin-top: 0.8rem;
  }
  
  .skeleton-image {
    height: 180px;
  }
}

@media (max-width: 480px) {
  .loading-spinner {
    width: 40px;
    height: 40px;
  }
  
  .loading-text {
    font-size: 0.85rem;
  }
  
  .skeleton-image {
    height: 150px;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .loading-spinner,
  .btn-loading::after,
  .card-loading,
  .skeleton,
  .image-loading::before,
  .table-loading::after {
    animation: none !important;
  }
}