/* HECC Loading Indicator Styles */

/* Container */
.hecc-loader-container {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9995;
}

/* Loading Overlays */
.hecc-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    pointer-events: auto;
}

.hecc-loading-overlay.show {
    opacity: 1 !important;
}

/* Force visibility for page overlays */
.hecc-page-overlay {
    background-color: rgba(0, 0, 0, 0) !important;
    backdrop-filter: blur(2px);
}

/* Loading Content */
.hecc-loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: white;
    padding: 1.5rem 2rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    max-width: 400px;
    min-width: 280px;
    text-align: left;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Ensure page overlay content is visible - same as modal */
.hecc-page-overlay .hecc-loading-content {
    background: white !important;
    display: flex;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* Loading Spinner */
.hecc-loading-spinner {
    margin-bottom: 1rem;
}

.hecc-loading-spinner .spinner-border {
    width: 2.5rem;
    height: 2.5rem;
}

/* Inline spinner with text layout */
.hecc-loading-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.hecc-loading-inline .spinner-border {
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

/* Loading Message */
.hecc-loading-message {
    color: #212529 !important;
    font-size: 1rem;
    font-weight: 600;
    margin-top: 0;
    margin-left: 0.75rem;
}

/* Inline Loading */
.hecc-inline-loader {
    padding: 1rem;
    color: #6c757d;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin: 0.5rem 0;
}

.hecc-loading-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: #212529;
}

/* Small inline variant */
.hecc-inline-loader.small {
    padding: 0.5rem;
}

.hecc-inline-loader.small .hecc-loading-text {
    font-size: 0.8125rem;
}

/* Ensure spinners are visible in inline loaders */
.hecc-inline-loader .spinner-border-sm {
    width: 1rem !important;
    height: 1rem !important;
    border-width: 0.125rem !important;
    border-style: solid !important;
    border-color: currentColor !important;
    border-right-color: transparent !important;
    border-radius: 50% !important;
    display: inline-block !important;
    vertical-align: middle !important;
    animation: spinner-border 0.75s linear infinite !important;
}

.hecc-inline-loader .spinner-border {
    width: 1rem !important;
    height: 1rem !important;
    border-width: 0.125rem !important;
    border-style: solid !important;
    border-color: currentColor !important;
    border-right-color: transparent !important;
    border-radius: 50% !important;
    display: inline-block !important;
    vertical-align: middle !important;
    animation: spinner-border 0.75s linear infinite !important;
}

/* Bootstrap spinner animation in case it's missing */
@keyframes spinner-border {
    to { transform: rotate(360deg); }
}

/* Loading state for user list area */
#userListLoadingSpace .hecc-inline-loader {
    background: transparent;
    border: none;
    padding: 0.25rem 1rem;
}

#userListLoadingSpace .hecc-loading-text {
    color: #6c757d;
    font-weight: 500;
}

/* Pulse animation for enhanced visual feedback */
@keyframes heccPulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

.hecc-loading-pulse {
    animation: heccPulse 1.5s ease-in-out infinite;
}

/* Theme variations */
.hecc-loading-success .spinner-border {
    color: var(--bs-success, #198754) !important;
}

.hecc-loading-warning .spinner-border {
    color: var(--bs-warning, #ffc107) !important;
}

.hecc-loading-info .spinner-border {
    color: var(--bs-info, #0dcaf0) !important;
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
    .hecc-page-overlay {
        background-color: rgba(33, 37, 41, 0.95);
    }
    
    .hecc-page-overlay .hecc-loading-content {
        background: rgba(33, 37, 41, 0.9);
        color: #f8f9fa;
    }
    
    .hecc-page-overlay .hecc-loading-message {
        color: #adb5bd;
    }
    
    .hecc-inline-loader {
        background-color: #212529;
        border-color: #495057;
        color: #adb5bd;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .hecc-loading-overlay {
        transition: none;
    }
    
    .heccPulse {
        animation: none;
    }
    
    .spinner-border,
    .spinner-grow {
        animation-duration: 1s;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hecc-loading-content {
        margin: 1rem;
        padding: 1.5rem;
        max-width: calc(100vw - 2rem);
    }
    
    .hecc-loading-spinner .spinner-border {
        width: 2rem;
        height: 2rem;
    }
    
    .hecc-loading-message {
        font-size: 0.8rem;
    }
}

/* Integration with existing HECC styles */
.textGreen .spinner-border {
    color: var(--hecc-green, #28a745) !important;
}

.textGreen .spinner-grow {
    color: var(--hecc-green, #28a745) !important;
}

/* Professional styling for admin interface */
.admin-section .hecc-loading-content {
    border: 1px solid #dee2e6;
}

.admin-section .hecc-inline-loader {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}