/* ============================================
   GTA-STYLE LOADER
   Smooth spinning with fading trail effect
   ============================================ */

/* Hide body content and scrollbar until loader is ready */
body {
    visibility: hidden;
    overflow: hidden !important;
}

body.loader-ready {
    visibility: visible;
    overflow: auto;
}

/* Hide scrollbar during loading */
body:not(.loader-ready)::-webkit-scrollbar {
    display: none;
}

body:not(.loader-ready) {
    scrollbar-width: none;
}

/* Full screen overlay */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 99999;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 50px;
    visibility: visible !important;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader-overlay.hidden {
    opacity: 0;
    visibility: hidden !important;
    pointer-events: none;
}

/* Mobile: Center the loader */
@media (max-width: 768px) {
    .loader-overlay {
        align-items: center;
        justify-content: center;
        padding: 0;
    }
}

/* Spinner with fading gradient trail */
.loader-spinner {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    position: relative;
    animation: loaderSpin 0.8s linear infinite;
}

/* The fading arc - uses conic gradient for smooth fade */
.loader-spinner::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(from 0deg,
            transparent 0deg,
            transparent 60deg,
            #FF2E63 360deg);
    mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 4px));
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 4px));
}

/* Spin animation - smooth and consistent */
@keyframes loaderSpin {
    to {
        transform: rotate(360deg);
    }
}