/* =====================================================
   NW Page Transition — Public Styles
   ===================================================== */

/* Overlay — hidden by default, shown via .nwpt-visible class.
   Both rules use !important — in a tie, LAST rule wins (cascade order).
   So .nwpt-visible must come AFTER the base rule. */
#nwpt-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: opacity var(--nwpt-transition-duration, 400ms) ease,
                visibility var(--nwpt-transition-duration, 400ms) ease;
}

/* This MUST come after #nwpt-overlay to win the !important tie */
#nwpt-overlay.nwpt-visible {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto;
}

/* GIF / Logo image */
#nwpt-overlay img {
    max-width: 90vw;
    height: auto;
    display: block;
}

/* CSS loader wrapper */
#nwpt-loader {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---- Spinner ---- */
.nwpt-loader--spinner {
    width: 48px; height: 48px;
    border: 4px solid rgba(0,0,0,.12);
    border-top-color: var(--nwpt-loader-color, #333);
    border-radius: 50%;
    animation: nwpt-spin .8s linear infinite;
}

/* ---- Dots ---- */
.nwpt-loader--dots {
    display: flex; gap: 10px; align-items: center;
}
.nwpt-loader--dots span {
    display: block;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--nwpt-loader-color, #333);
    animation: nwpt-dot-bounce .8s ease-in-out infinite;
}
.nwpt-loader--dots span:nth-child(2) { animation-delay: .16s; }
.nwpt-loader--dots span:nth-child(3) { animation-delay: .32s; }

/* ---- Bars ---- */
.nwpt-loader--bars {
    display: flex; gap: 6px; align-items: flex-end; height: 48px;
}
.nwpt-loader--bars span {
    display: block;
    width: 8px; height: 28px;
    background: var(--nwpt-loader-color, #333);
    border-radius: 3px;
    animation: nwpt-bar-scale .8s ease-in-out infinite;
}
.nwpt-loader--bars span:nth-child(2) { animation-delay: .1s; }
.nwpt-loader--bars span:nth-child(3) { animation-delay: .2s; }
.nwpt-loader--bars span:nth-child(4) { animation-delay: .3s; }

/* ---- Pulse ---- */
.nwpt-loader--pulse {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: var(--nwpt-loader-color, #333);
    animation: nwpt-pulse 1s ease-in-out infinite;
}

/* ---- Keyframes ---- */
@keyframes nwpt-spin       { to { transform: rotate(360deg); } }
@keyframes nwpt-dot-bounce { 0%,80%,100% { transform: scale(0); } 40% { transform: scale(1); } }
@keyframes nwpt-bar-scale  { 0%,100% { transform: scaleY(0.4); } 50% { transform: scaleY(1); } }
@keyframes nwpt-pulse      { 0%,100% { transform: scale(0.6); opacity: .5; } 50% { transform: scale(1); opacity: 1; } }
