/* Loading Button Component Styles */

/* Base loading state */
.loading {
  position: relative;
  overflow: hidden;
}

/* Loading overlay with white background and opacity */
.loading::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.8);
  z-index: 10;
  transition: opacity 200ms ease-out;
}

/* Loading spinner icon */
.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #e5e7eb;
  border-top: 2px solid rgb(255, 111, 97);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 11;
}

/* Spinner animation */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Loading state with custom icon (when data attribute is present) */
.loading[data-loading-icon]::after {
  background-image: var(--loading-icon);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  border: none;
  animation: spin 1s linear infinite;
}

/* Variants for different loading overlay opacities */
.loading-light::before {
  background-color: rgba(255, 255, 255, 0.6);
}

.loading-medium::before {
  background-color: rgba(255, 255, 255, 0.8);
}

.loading-heavy::before {
  background-color: rgba(255, 255, 255, 0.95);
}

/* Loading state for buttons themselves */
button.loading,
a.loading {
  pointer-events: none;
  opacity: 0.7;
  cursor: not-allowed;
}

/* Smooth transitions for loading states */
.loading-transition {
  transition: all 200ms ease-out;
}

/* Loading button content fade effect */
.loading .loading-fade {
  opacity: 0.5;
  transition: opacity 200ms ease-out;
}

/* Hide content when loading for buttons */
button.loading .loading-hide,
a.loading .loading-hide {
  opacity: 0;
  transition: opacity 200ms ease-out;
}