/*
 * heLoading styles — top-of-page progress bar + inline spinner.
 *
 * No image dependency: pure CSS. Works on dial-up; doesn't 404 if static
 * assets are misconfigured.
 */

/* ---------- Inline spinner ---------- */

.he-loading-inline {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    color: #666;
}

.he-loading-inline .he-loading-spinner {
    display: inline-block;
    border: 2px solid rgba(0, 0, 0, 0.12);
    border-top-color: #2a6ebb;
    border-radius: 50%;
    animation: he-loading-spin 700ms linear infinite;
}

.he-loading-sm .he-loading-spinner { width: 12px; height: 12px; border-width: 2px; }
.he-loading-md .he-loading-spinner { width: 18px; height: 18px; border-width: 2px; }
.he-loading-lg .he-loading-spinner { width: 28px; height: 28px; border-width: 3px; }

.he-loading-inline .he-loading-msg {
    margin-left: 8px;
    font-size: 13px;
}

@keyframes he-loading-spin {
    to { transform: rotate(360deg); }
}

/* sr-only matches Bootstrap 3's accessibility-only utility */
.he-loading-inline .sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0);
    white-space: nowrap; border: 0;
}

/* ---------- Top-of-page progress bar ---------- */

.he-loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 1090;          /* above ui-bootstrap modal (1050), navbar (1030), toasts (1080) */
    pointer-events: none;
    opacity: 0;
    transition: opacity 120ms ease-out;
}

.he-loading-bar-active {
    opacity: 1;
}

.he-loading-bar-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg,
        rgba(42, 110, 187, 0)   0%,
        rgba(42, 110, 187, 1)  35%,
        rgba(42, 110, 187, 1)  65%,
        rgba(42, 110, 187, 0) 100%);
    background-size: 200% 100%;
    animation: he-loading-bar-shift 1100ms linear infinite;
}

@keyframes he-loading-bar-shift {
    from { background-position: 200% 0; }
    to   { background-position: -200% 0; }
}

@media print {
    .he-loading-bar { display: none !important; }
    .he-loading-inline { display: none !important; }
}
