/* 
 * Ultra-Optimized Loader CSS
 * - No unnecessary transitions
 * - Hardware-accelerated animations
 * - Efficient selectors
 * - No blocking animations
 */

/* Instant Content Visibility - Skip Fading */
.fade-effect,
.fade-effect.loaded {
  opacity: 1;
  visibility: visible;
}

/* Hidden Global Page Loader - For Performance */
.page-loader {
  display: none;
  z-index: -1;
  position: fixed;
  pointer-events: none;
}

.page-loader.active {
  display: none;
}

/* Button Loading State - Minimal and Fast */
.btn-loading .spinner-border {
  margin-right: 0.5rem;
  width: 1rem;
  height: 1rem;
  border-width: 0.15em;
  will-change: transform;
}

/* Efficient Disabled States */
input:disabled,
select:disabled,
textarea:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

/* In-page Loading Indicators - Hardware Accelerated */
.section-loader {
  position: relative;
  min-height: 120px;
}

.section-loader::before {
  content: '';
  position: absolute;
  inset: 0; /* Modern shorthand for top/right/bottom/left */
  background-color: rgba(255, 255, 255, 0.7);
  z-index: 1;
}

.section-loader::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border: 3px solid rgba(33, 150, 243, 0.2);
  border-radius: 50%;
  border-top-color: #2196F3;
  animation: spin 0.8s linear infinite;
  z-index: 2;
  will-change: transform;
}

/* Optimized Minimal Spinner Animation */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Efficient Loading Indicator */
.content-loading {
  position: relative;
  min-height: 100px;
}

/* Custom Lightweight Placeholders - For Fast Initial Render */
.placeholder-item {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: placeholderShimmer 1.5s infinite;
  height: 16px;
  margin-bottom: 8px;
  border-radius: 4px;
}

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

/* Efficient Form State Indicators */
.form-submitting input,
.form-submitting select,
.form-submitting textarea,
.form-submitting button:not(.spinner-button) {
  pointer-events: none;
  opacity: 0.7;
}

/* Spinner Button - Compact and Efficient */
.spinner-button {
  position: relative;
  padding-right: 2.5rem !important;
}

.spinner-button::after {
  content: '';
  position: absolute;
  right: 0.75rem;
  top: 50%;
  margin-top: -0.5rem;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
  will-change: transform;
}