/**
 * Page Transition Loading Spinner
 * 
 * Global loading spinner for HolyExplorer page transitions
 * - Shows on all internal navigation
 * - Blue theme matching WPUM menu (#3b82f6)
 * - Session-safe, no global state
 * - Hardware-accelerated animations
 * 
 * @since 1.14.0
 * @package HolyExplorer
 */

/* Loading Overlay */
#holyexplorer-page-spinner {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    z-index: 999999;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    pointer-events: none;
}

/* Active State */
#holyexplorer-page-spinner.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    pointer-events: all;
}

/* Spinner Container */
.holyexplorer-spinner-container {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

/* Spinner Animation - Blue Circle */
.holyexplorer-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(59, 130, 246, 0.2); /* Blue with transparency */
    border-top-color: #3b82f6; /* Solid blue - matches WPUM menu */
    border-radius: 50%;
    animation: holyexplorer-spin 0.8s linear infinite;
    will-change: transform; /* Hardware acceleration hint */
}

/* Spinner Animation Keyframes */
@keyframes holyexplorer-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Loading Text (Optional) */
.holyexplorer-spinner-text {
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Pulsing Animation for Text */
.holyexplorer-spinner-text {
    animation: holyexplorer-pulse 1.5s ease-in-out infinite;
}

@keyframes holyexplorer-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Dark Mode Support (if site uses dark mode) */
@media (prefers-color-scheme: dark) {
    #holyexplorer-page-spinner {
        background: rgba(17, 24, 39, 0.95);
    }
    
    .holyexplorer-spinner-text {
        color: #e5e7eb;
    }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .holyexplorer-spinner {
        width: 40px;
        height: 40px;
        border-width: 3px;
    }
    
    .holyexplorer-spinner-text {
        font-size: 13px;
    }
}

/* Performance: Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .holyexplorer-spinner {
        animation-duration: 1.5s;
    }
    
    .holyexplorer-spinner-text {
        animation: none;
    }
}

/* Prevent scrolling when spinner is active */
body.holyexplorer-loading {
    overflow: hidden;
}
