/* Loading khas VREOKA — dipakai di semua halaman (situs utama, undangan, tema, contoh). */

.vr-loader {
    position: fixed; inset: 0; z-index: 2147483600;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
    background: #0e0d10;
    opacity: 0; visibility: hidden;
    transition: opacity .4s ease, visibility 0s linear .4s;
    pointer-events: none;
}
.vr-loader.is-active {
    opacity: 1; visibility: visible;
    transition: opacity .18s ease;
    pointer-events: auto;
}

/* Logo: "VRE" terisi, "OKA" garis tepi yang terisi pink dari kiri ke kanan */
.vr-loader .vr-loader-logo { display: flex; align-items: flex-start; width: min(56vw, 260px); margin: 0; padding: 0; }
.vr-loader .vl-vre { display: block; width: 46.675%; height: auto; margin: 0; }
.vr-loader .vl-oka { position: relative; display: block; width: 53.325%; margin: 0; }
.vr-loader .vl-oka img { display: block; width: 100%; height: auto; margin: 0; }
.vr-loader .vl-fill {
    position: absolute; inset: 0;
    clip-path: inset(0 100% 0 0);
    animation: vl-fill 1.3s cubic-bezier(.65, 0, .35, 1) infinite;
}
@keyframes vl-fill {
    0%   { clip-path: inset(0 100% 0 0); }
    50%  { clip-path: inset(0 0 0 0); }
    100% { clip-path: inset(0 0 0 100%); }
}
.vr-loader.is-active .vr-loader-logo { animation: vl-in .5s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes vl-in { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }

/* Garis pink yang bergerak */
.vr-loader .vr-loader-bar {
    position: relative; display: block; overflow: hidden;
    width: min(56vw, 260px); height: 2px; border-radius: 2px;
    background: rgba(254, 84, 131, .16);
}
.vr-loader .vr-loader-bar::after {
    content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 40%;
    background: #fe5483;
    animation: vl-bar 1.3s cubic-bezier(.65, 0, .35, 1) infinite;
}
@keyframes vl-bar { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

.vr-loader .vl-sr {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
}

/* Cadangan: kalau JavaScript gagal dimuat, loading pembuka tetap hilang sendiri */
.vr-loader.is-boot { animation: vl-autohide 0s linear 4s forwards; }
@keyframes vl-autohide { to { opacity: 0; visibility: hidden; pointer-events: none; } }

@media (prefers-reduced-motion: reduce) {
    .vr-loader .vl-fill { animation: none; clip-path: none; }
    .vr-loader .vr-loader-bar::after { animation: none; width: 100%; }
    .vr-loader.is-active .vr-loader-logo { animation: none; }
}
