/* Mobile Loading Spinner Fix - Prevents "Loading page..." from staying visible */

/* Hide all loading spinners on mobile devices */
@media (max-width: 768px) {
    /* Main global loading spinner */
    #globalLoadingSpinner,
    .loading-overlay,
    .loading-container,
    .loading-spinner,
    .loading-text {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
        position: fixed !important;
        top: -9999px !important;
        left: -9999px !important;
        z-index: -1 !important;
    }
    
    /* Any other loading indicators */
    .schools-loading,
    #schoolsLoading,
    .tab-loading,
    .spinner,
    [class*="loading-"],
    [class*="spinner"],
    [id*="loading"],
    [id*="spinner"] {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
    
    /* Disable all loading animations */
    @keyframes spin {
        from { transform: none !important; }
        to { transform: none !important; }
    }
    
    @keyframes rotate {
        from { transform: none !important; }
        to { transform: none !important; }
    }
    
    @keyframes loading {
        from { transform: none !important; }
        to { transform: none !important; }
    }
    
    /* Ensure body is not affected by loading states */
    body.loading,
    body.spinner-active,
    body.page-loading {
        overflow: auto !important;
        position: static !important;
        height: auto !important;
    }
    
    /* Override any inline styles */
    #globalLoadingSpinner[style] {
        display: none !important;
    }
}

/* Also hide on small desktop windows that might be touch devices */
@media (max-width: 1024px) and (pointer: coarse) {
    #globalLoadingSpinner,
    .loading-overlay {
        display: none !important;
    }
}

/* Hide loading spinner for all touch devices */
@media (hover: none) and (pointer: coarse) {
    #globalLoadingSpinner,
    .loading-overlay,
    .loading-container,
    .loading-spinner,
    .loading-text {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
}

/* Ensure spinner is removed after page loads */
body.loaded #globalLoadingSpinner,
body.loaded .loading-overlay {
    display: none !important;
    animation: none !important;
    transition: none !important;
}