/* P2P loaders: Orbit boot + Pulse/Dots body busy */

:root {
    --krom-purple: #623cea;
    --p2p-muted: #5a6b7d;
}

/* ---------- Orbit boot (WASM first paint) ---------- */
.p2p-boot {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.loader-orbit {
    position: relative;
    width: 88px;
    height: 88px;
}

.loader-orbit img {
    position: absolute;
    inset: 50%;
    width: 48px;
    height: 48px;
    margin: -24px 0 0 -24px;
    border-radius: 11px;
    z-index: 1;
}

.loader-orbit::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid rgba(98, 60, 234, 0.15);
    border-top-color: var(--krom-purple);
    border-right-color: rgba(98, 60, 234, 0.55);
    animation: p2p-orbit-spin 0.9s linear infinite;
}

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

/* Stack % + tip — gap 7px (setengah dari gap boot 14px) */
.p2p-boot-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
}

/* Blazor WASM masih isi % ke .loading-progress-text */
.p2p-boot .loading-progress-text {
    position: static;
    width: auto;
    top: auto;
    left: auto;
    inset: auto;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--p2p-muted);
    text-align: center;
}

.p2p-boot .loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}

/* Tip setelah ~selesai download — nunggu WASM start / Program.cs */
.p2p-boot-tip {
    max-width: 16rem;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--p2p-muted);
    text-align: center;
    line-height: 1.35;
    opacity: 0;
    transform: translateY(10px) scale(0.94);
}

.p2p-boot-tip.is-visible {
    animation: p2p-boot-tip-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards,
        p2p-boot-tip-breathe 1.6s ease-in-out 0.45s infinite;
}

@keyframes p2p-boot-tip-in {
    0% {
        opacity: 0;
        transform: translateY(10px) scale(0.94);
    }

    60% {
        opacity: 1;
        transform: translateY(-2px) scale(1.03);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes p2p-boot-tip-breathe {
    0%,
    100% {
        opacity: 0.72;
    }

    50% {
        opacity: 1;
    }
}

/* ---------- Body busy host (tengah content area) ---------- */
.p2p-body-busy {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 40vh;
    margin: 0.5rem auto;
}

/* Compact buat card/dialog/inline biar ga maksa 40vh */
.p2p-body-busy--compact {
    min-height: 0;
    margin: 0.25rem auto;
    padding: 0.75rem 0;
}

.p2p-body-busy-caption {
    font-size: 0.75rem;
    color: var(--p2p-muted);
    letter-spacing: 0.02em;
    text-align: center;
}

/* ---------- #1 PNG pulse (Authorizing) ---------- */
.loader-pulse {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    animation: p2p-pulse-scale 1.15s ease-in-out infinite;
}

@keyframes p2p-pulse-scale {
    0%,
    100% {
        transform: scale(0.92);
        opacity: 0.85;
        filter: drop-shadow(0 0 0 transparent);
    }

    50% {
        transform: scale(1.05);
        opacity: 1;
        filter: drop-shadow(0 6px 14px rgba(98, 60, 234, 0.35));
    }
}

/* ---------- #5 Icon + dots (page/dialog busy) ---------- */
.loader-dots {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.loader-dots img {
    width: 48px;
    height: 48px;
    border-radius: 11px;
}

.loader-dots .dots {
    display: flex;
    gap: 6px;
}

.loader-dots .dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--krom-purple);
    animation: p2p-dot-bounce 0.9s ease-in-out infinite;
}

.loader-dots .dots span:nth-child(2) {
    animation-delay: 0.12s;
}

.loader-dots .dots span:nth-child(3) {
    animation-delay: 0.24s;
}

@keyframes p2p-dot-bounce {
    0%,
    80%,
    100% {
        transform: translateY(0);
        opacity: 0.45;
    }

    40% {
        transform: translateY(-7px);
        opacity: 1;
    }
}
