/**
 * Componente Loader - Sistema Taco Loco
 * Loader modular y reutilizable para toda la aplicación
 * 
 * - Estilo visual inspirado en iOS
 * - Se muestra al cargar la página o durante operaciones asíncronas
 * - Incluye animaciones fluidas
 * - Adaptable a diferentes temas
 */

/* -----------------
   1. CONTENEDOR PRINCIPAL
   ----------------- */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.85);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading.active {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

/* -----------------
   2. SPINNER ANIMADO
   ----------------- */
.spinner-border {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--primary-color, #007aff);
    animation: spin 1s infinite linear;
    margin-bottom: 15px;
}

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

/* -----------------
   3. TEXTO Y MENSAJES
   ----------------- */
.loading-text {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-secondary, #8e8e93);
    font-size: 16px;
    text-align: center;
    max-width: 80%;
    margin-top: 15px;
    font-weight: 500;
    letter-spacing: -0.2px;
}

/* -----------------
   4. ADAPTACIONES RESPONSIVAS
   ----------------- */
@media (min-width: 768px) {
    .spinner-border {
        width: 60px;
        height: 60px;
        border-width: 4px;
    }
    
    .loading-text {
        font-size: 18px;
    }
} 