/* --- PROPERTY OF ZABALA SOLUTIONS INC. - https://zabala.solutions
Provided "as is" without warranties. Unauthorized use, copying, or distribution is prohibited without written permission. Authors are not liable for any damages or claims arising from this software.
---
PROPIEDAD DE ZABALA SOLUTIONS INC. - https://zabala.solutions
Proporcionado "tal cual" sin garantías. Prohibido su uso, copia o distribución sin permiso por escrito. Los autores no son responsables por daños o reclamos derivados de este software.
--- */

/* ========================================
   LOADING SPINNERS - ESTILOS CENTRALIZADOS
   ======================================== */

/* ========================================
   OVERLAY DE LOADING PRINCIPAL
   ======================================== */
.loading-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background-color: rgba(0, 0, 0, 1) !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  z-index: 999999 !important;
  color: white !important;
  backdrop-filter: blur(5px) !important;
  -webkit-backdrop-filter: blur(5px) !important;
}

/* Asegurar que el contenido detrás esté completamente oculto */
body:has(.loading-overlay) {
  overflow: hidden !important;
}

/* Ocultar cualquier contenido que pueda estar visible */
.loading-overlay ~ * {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

/* ========================================
   BARRA DE PROGRESO PARA LOADING OVERLAY
   ======================================== */
.progress-container {
  width: 200px;
  margin: 0 auto;
  position: relative;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background-color: #ffffff;
  border-radius: 4px;
  transition: width 0.3s ease-in-out;
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.progress-text {
  margin-top: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #ffffff;
  text-align: center;
}

/* Responsive para la barra de progreso */
@media (max-width: 768px) {
  .progress-container {
    width: 250px;
  }
}

/* ========================================
   SPINNER PERSONALIZADO ANIMADO - ULTRA SIMPLE Y LIMPIO
   ======================================== */
.custom-spinner {
  width: 3rem;
  height: 3rem;
  border: 4px solid #e9ecef;
  border-top: 4px solid #000000;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
  display: block;
  position: relative;
  box-sizing: border-box;
}

/* Animación de rotación */
@keyframes spin {
  0% { 
    transform: rotate(0deg); 
  }
  100% { 
    transform: rotate(360deg); 
  }
}

/* Compatibilidad cross-browser */
.custom-spinner {
  -webkit-animation: spin 1s linear infinite;
  -moz-animation: spin 1s linear infinite;
  -o-animation: spin 1s linear infinite;
}
 

/* Versión limpia del spinner sin efectos complejos */
.custom-spinner {
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
  background: transparent;
  border-width: 4px;
  width: 3rem;
  height: 3rem;
}

/* ========================================
   OVERLAY DE LOADING PARA LOGOUT
   ======================================== */
.logout-loading-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background-color: rgba(0, 0, 0, 1) !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  z-index: 999999 !important;
  backdrop-filter: blur(5px) !important;
  -webkit-backdrop-filter: blur(5px) !important;
}

.logout-loading-content {
  text-align: center;
  color: white;
}

.logout-loading-content p {
  font-size: 1.1rem;
  font-weight: 500;
  margin: 0;
}

/* ========================================
   SPINNER INLINE PEQUEÑO
   ======================================== */
.loading-spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid #e9ecef;
  border-top: 2px solid #000000;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* ========================================
   SPINNER PARA INPUTS
   ======================================== */
.input-check-spinner {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid #e9ecef;
  border-top: 2px solid #2980b9;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* ========================================
   SPINNER PARA CAPTCHA
   ======================================== */
.captcha-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: #666;
  font-size: 0.9rem;
}

.captcha-spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid #e9ecef;
  border-top: 2px solid #000000;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* ========================================
   VARIANTES DE TAMAÑO
   ======================================== */
.custom-spinner.spinner-sm {
  width: 1.5rem;
  height: 1.5rem;
  border-width: 2px;
}

.custom-spinner.spinner-lg {
  width: 5rem;
  height: 5rem;
  border-width: 8px;
}

.custom-spinner.spinner-xl {
  width: 7rem;
  height: 7rem;
  border-width: 10px;
}

/* ========================================
   VARIANTES DE COLOR
   ======================================== */
.custom-spinner.spinner-primary {
  border-top-color: #000000;
}

.custom-spinner.spinner-secondary {
  border-top-color: #6c757d;
}

.custom-spinner.spinner-success {
  border-top-color: #28a745;
}

.custom-spinner.spinner-danger {
  border-top-color: #dc3545;
}

.custom-spinner.spinner-warning {
  border-top-color: #ffc107;
}

.custom-spinner.spinner-info {
  border-top-color: #17a2b8;
}

.custom-spinner.spinner-light {
  border-top-color: #f8f9fa;
}

.custom-spinner.spinner-dark {
  border-top-color: #343a40;
}

/* ========================================
   OVERLAY CON FONDO PERSONALIZADO
   ======================================== */
.loading-overlay.loading-overlay-light {
  background-color: rgba(255, 255, 255, 0.9);
  color: #333;
}

.loading-overlay.loading-overlay-primary {
  background-color: rgba(0, 123, 255, 0.9);
  color: white;
}

.loading-overlay.loading-overlay-success {
  background-color: rgba(40, 167, 69, 0.9);
  color: white;
}

/* ========================================
   ANIMACIONES ADICIONALES
   ======================================== */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.custom-spinner.pulse {
  animation: pulse 2s ease-in-out infinite !important;
}

@keyframes bounce {
  0%, 20%, 53%, 80%, 100% {
    transform: translate3d(0, 0, 0);
  }
  40%, 43% {
    transform: translate3d(0, -30px, 0);
  }
  70% {
    transform: translate3d(0, -15px, 0);
  }
  90% {
    transform: translate3d(0, -4px, 0);
  }
}

.custom-spinner.bounce {
  animation: bounce 2s ease-in-out infinite !important;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
  .custom-spinner {
    width: 3rem;
    height: 3rem;
    border-width: 4px;
  }
  
  .custom-spinner.spinner-lg {
    width: 4rem;
    height: 4rem;
    border-width: 6px;
  }
  
  .custom-spinner.spinner-xl {
    width: 5rem;
    height: 5rem;
    border-width: 8px;
  }
}

@media (max-width: 576px) {
  .custom-spinner {
    width: 2.5rem;
    height: 2.5rem;
    border-width: 3px;
  }
  
  .loading-overlay {
    padding: 1rem;
  }
}

/* ========================================
   UTILIDADES
   ======================================== */
.loading-hidden {
  display: none !important;
}

.loading-visible {
  display: block !important;
}

.loading-opacity-0 {
  opacity: 0;
}

.loading-opacity-1 {
  opacity: 1;
}

/* ========================================
   ESTADOS DE CARGA
   ======================================== */
.loading-state {
  position: relative;
  pointer-events: none;
}

.loading-state::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.loading-state::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2rem;
  height: 2rem;
  margin: -1rem 0 0 -1rem;
  border: 3px solid #e9ecef;
  border-top: 3px solid #000000;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 1001;
}
