/*
 * loading-overlay.css — UX loading feedback global (added 2026-05-21).
 *
 * Dipakai di:
 *   - protected/views/layouts/main.php (logged-in pages)
 *   - protected/views/apiconnection/select_branch.php  (_blank layout)
 *   - protected/views/apiconnection/manage.php         (_blank layout)
 *   - protected/views/apiconnection/select_sales(_).php (_blank layout)
 *   - protected/views/login/index.php + login2.php + reset-password.php
 *
 * Komponen:
 *   1. Full-screen overlay #ld-loading-overlay (default hidden, dishow saat
 *      klik link / form submit / navigasi back-forward).
 *   2. Pace.js progress bar custom theme di atas halaman.
 */

/* ============== FULL-SCREEN OVERLAY ============== */

#ld-loading-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.45);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.18s ease-in-out;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

#ld-loading-overlay.is-visible {
    display: flex;
    opacity: 1;
}

/* Spinner di dalam "card" putih kecil supaya tetap kebaca walau backdrop tipis */
#ld-loading-overlay .ld-spinner-wrap {
    background: rgba(255, 255, 255, 0.92);
    border-radius: 14px;
    padding: 26px 36px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12),
                0 2px 6px  rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
}

#ld-loading-overlay .ld-spinner {
    width: 52px;
    height: 52px;
    border: 4px solid #e5e6e7;
    border-top-color: #1f78b4;   /* warna LD blue */
    border-radius: 50%;
    animation: ld-spin 0.9s linear infinite;
}

#ld-loading-overlay .ld-spinner-text {
    margin-top: 14px;
    font-size: 13px;
    color: #555;
    font-weight: 600;
    letter-spacing: 0.5px;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

#ld-loading-overlay .ld-spinner-dots::after {
    content: '';
    animation: ld-dots 1.5s steps(4, end) infinite;
}

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

@keyframes ld-dots {
    0%   { content: ''; }
    25%  { content: '.'; }
    50%  { content: '..'; }
    75%  { content: '...'; }
    100% { content: ''; }
}

/* ============== PACE.JS PROGRESS BAR (top) ============== */

.pace {
    -webkit-pointer-events: none;
    pointer-events: none;
    -webkit-user-select: none;
    user-select: none;
}

.pace-inactive {
    display: none;
}

.pace .pace-progress {
    background: #1f78b4;
    position: fixed;
    z-index: 100000;
    top: 0;
    right: 100%;
    width: 100%;
    height: 3px;
    box-shadow: 0 0 8px rgba(31, 120, 180, 0.6);
    transition: transform 0.18s ease, opacity 0.18s ease;
}

.pace .pace-progress-inner {
    display: block;
    position: absolute;
    right: 0;
    width: 100px;
    height: 100%;
    box-shadow: 0 0 10px #1f78b4, 0 0 5px #1f78b4;
    opacity: 1;
    transform: rotate(3deg) translate(0px, -4px);
}

.pace .pace-activity {
    display: none;
}
