/* =====================================================
   JHAMXPRESS — CINEMATIC LOADING SCREEN
   Inspired by premium motion design: dark bg,
   glowing rings, speed streaks, floating logo,
   live progress bar & smooth page reveal.
   ===================================================== */

/* ---- Prevent scroll while loading ---- */
body.jx-loading {
    overflow: hidden;
}

/* ---- Root Loader Overlay ---- */
#jx-loader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: #06080F;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: opacity 0.9s cubic-bezier(0.77, 0, 0.175, 1),
                transform 0.9s cubic-bezier(0.77, 0, 0.175, 1);
}

#jx-loader.jx-done {
    opacity: 0;
    transform: scale(1.05);
    pointer-events: none;
}

/* ================================================
   SPEED STREAKS — horizontal light trails
   ================================================ */
.jx-streaks {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.jx-streaks span {
    position: absolute;
    left: -60%;
    height: 1px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, rgba(255,85,0,0.7), transparent);
    animation: jxStreak linear infinite;
    will-change: transform, opacity;
}

/* Give each streak a unique position + timing */
.jx-streaks span:nth-child(1)  { top: 8%;  width: 35%; animation-duration: 1.6s; animation-delay: 0s;    opacity: 0.8; }
.jx-streaks span:nth-child(2)  { top: 16%; width: 50%; animation-duration: 2.1s; animation-delay: 0.3s;  opacity: 0.5; height: 2px; background: linear-gradient(90deg, transparent, rgba(255,150,50,0.5), transparent); }
.jx-streaks span:nth-child(3)  { top: 25%; width: 28%; animation-duration: 1.3s; animation-delay: 0.7s;  opacity: 0.6; }
.jx-streaks span:nth-child(4)  { top: 35%; width: 60%; animation-duration: 2.5s; animation-delay: 0.1s;  opacity: 0.3; }
.jx-streaks span:nth-child(5)  { top: 45%; width: 40%; animation-duration: 1.8s; animation-delay: 0.9s;  opacity: 0.7; height: 2px; }
.jx-streaks span:nth-child(6)  { top: 55%; width: 55%; animation-duration: 2.2s; animation-delay: 0.4s;  opacity: 0.4; }
.jx-streaks span:nth-child(7)  { top: 63%; width: 32%; animation-duration: 1.5s; animation-delay: 1.1s;  opacity: 0.6; }
.jx-streaks span:nth-child(8)  { top: 72%; width: 45%; animation-duration: 1.9s; animation-delay: 0.2s;  opacity: 0.5; height: 2px; background: linear-gradient(90deg, transparent, rgba(255,85,0,0.8), transparent); }
.jx-streaks span:nth-child(9)  { top: 80%; width: 38%; animation-duration: 2.0s; animation-delay: 0.6s;  opacity: 0.7; }
.jx-streaks span:nth-child(10) { top: 88%; width: 52%; animation-duration: 1.7s; animation-delay: 0.8s;  opacity: 0.4; }
.jx-streaks span:nth-child(11) { top: 93%; width: 25%; animation-duration: 1.4s; animation-delay: 1.3s;  opacity: 0.5; }
.jx-streaks span:nth-child(12) { top: 20%; width: 70%; animation-duration: 3.0s; animation-delay: 0.0s;  opacity: 0.2; height: 3px; background: linear-gradient(90deg, transparent, rgba(255,120,0,0.3), transparent); }

@keyframes jxStreak {
    0%   { transform: translateX(0);    opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 1; }
    100% { transform: translateX(220vw); opacity: 0; }
}

/* ================================================
   ROTATING RINGS
   ================================================ */
.jx-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid transparent;
    pointer-events: none;
    animation: jxSpin linear infinite;
}

.ring-1 {
    width: 520px; height: 520px;
    border-top-color:  rgba(255, 85,  0, 0.45);
    border-right-color: rgba(255, 85, 0, 0.15);
    animation-duration: 6s;
    box-shadow: 0 0 30px rgba(255,85,0,0.08);
}

.ring-2 {
    width: 380px; height: 380px;
    border-bottom-color: rgba(255,130, 40, 0.5);
    border-left-color:   rgba(255,130, 40, 0.18);
    animation-duration: 4s;
    animation-direction: reverse;
    box-shadow: 0 0 20px rgba(255,100,0,0.1);
}

.ring-3 {
    width: 240px; height: 240px;
    border-top-color:   rgba(255,200,80, 0.4);
    border-right-color: rgba(255,200,80, 0.12);
    animation-duration: 2.8s;
    box-shadow: 0 0 12px rgba(255,180,0,0.08);
}

@keyframes jxSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ================================================
   GLOW BLOB — pulsing radial light behind logo
   ================================================ */
.jx-glow-blob {
    position: absolute;
    width: 320px; height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,85,0,0.28) 0%, transparent 70%);
    filter: blur(40px);
    animation: jxBlob 3s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes jxBlob {
    0%   { transform: scale(0.9); opacity: 0.7; }
    100% { transform: scale(1.3); opacity: 1;   }
}

/* ================================================
   CENTER CONTENT WRAPPER
   ================================================ */
.jx-center {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 10;
    text-align: center;
    animation: jxFadeUp 0.8s ease both;
}

@keyframes jxFadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ================================================
   LOGO
   ================================================ */
.jx-logo-wrap {
    width: 130px;
    height: 130px;
    border-radius: 28px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,85,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    box-shadow: 0 0 40px rgba(255,85,0,0.25),
                inset 0 0 20px rgba(255,85,0,0.05);
    animation: jxLogoFloat 3.5s ease-in-out infinite;
    margin-bottom: 4px;
}

.jx-logo {
    width: 100px;
    height: 100px;
    object-fit: contain;
    filter: drop-shadow(0 8px 20px rgba(255,85,0,0.5));
    animation: jxLogoPop 0.9s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.3s both;
}

@keyframes jxLogoFloat {
    0%, 100% { transform: translateY(0px)  rotate(-1deg); }
    50%       { transform: translateY(-10px) rotate(1deg); }
}

@keyframes jxLogoPop {
    from { opacity: 0; transform: scale(0.4) rotate(-15deg); }
    to   { opacity: 1; transform: scale(1)   rotate(0deg); }
}

/* ================================================
   BRAND NAME
   ================================================ */
.jx-brand {
    font-family: 'Outfit', sans-serif;
    font-size: 2.8rem;
    font-weight: 900;
    letter-spacing: 3px;
    line-height: 1;
    animation: jxFadeUp 0.8s 0.5s ease both;
}

.jx-brand-jh {
    color: #FFFFFF;
    text-shadow: 0 0 30px rgba(255,255,255,0.2);
}

.jx-brand-xp {
    color: #FF5500;
    text-shadow: 0 0 30px rgba(255,85,0,0.6);
}

.jx-tagline {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 3px;
    color: rgba(255,130,50,0.75);
    text-transform: uppercase;
    animation: jxFadeUp 0.8s 0.65s ease both;
    margin-bottom: 8px;
}

/* ================================================
   PROGRESS BAR
   ================================================ */
.jx-progress-wrap {
    width: 320px;
    animation: jxFadeUp 0.8s 0.8s ease both;
}

.jx-progress-track {
    position: relative;
    height: 5px;
    background: rgba(255,255,255,0.08);
    border-radius: 999px;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(255,85,0,0.15);
}

.jx-progress-bar {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: linear-gradient(90deg, #FF3300, #FF8800, #FFB347);
    transition: width 0.25s ease;
    position: relative;
}

.jx-progress-bar::after {
    content: '';
    position: absolute;
    right: 0; top: 50%;
    transform: translate(50%, -50%);
    width: 10px; height: 10px;
    border-radius: 50%;
    background: #FF8800;
    box-shadow: 0 0 12px 4px rgba(255,136,0,0.8);
}

.jx-progress-glow {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 60%, rgba(255,136,0,0.4));
    animation: jxShimmer 1.5s linear infinite;
    border-radius: 999px;
}

@keyframes jxShimmer {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.jx-progress-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}

.jx-loading-txt {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.45);
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.jx-pct {
    font-family: 'Outfit', sans-serif;
    font-size: 0.82rem;
    font-weight: 800;
    color: #FF6622;
    letter-spacing: 1px;
}

/* ================================================
   STATUS ICONS (motor / box / bus / map)
   ================================================ */
.jx-status-icons {
    display: flex;
    gap: 16px;
    margin-top: 6px;
    animation: jxFadeUp 0.8s 1s ease both;
}

.jx-status-icon {
    width: 42px; height: 42px;
    border-radius: 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,85,0,0.2);
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,130,50,0.6);
    font-size: 1rem;
    animation: jxIconPulse 2s var(--d, 0s) ease-in-out infinite alternate;
    transition: all 0.3s;
}

.jx-status-icon.active {
    background: rgba(255,85,0,0.15);
    border-color: rgba(255,85,0,0.6);
    color: #FF6622;
    box-shadow: 0 0 18px rgba(255,85,0,0.35);
    transform: scale(1.15);
}

@keyframes jxIconPulse {
    from { opacity: 0.4; }
    to   { opacity: 1; }
}

/* ================================================
   CORNER DECORATIONS — bracket corners
   ================================================ */
.jx-corner {
    position: absolute;
    width: 30px; height: 30px;
    border-color: rgba(255,85,0,0.45);
    border-style: solid;
    pointer-events: none;
    animation: jxCornerFade 2s ease-in-out infinite alternate;
}

.jx-tl { top: 24px; left: 24px;  border-width: 2px 0 0 2px; border-radius: 4px 0 0 0; }
.jx-tr { top: 24px; right: 24px; border-width: 2px 2px 0 0; border-radius: 0 4px 0 0; }
.jx-bl { bottom: 24px; left: 24px;  border-width: 0 0 2px 2px; border-radius: 0 0 0 4px; }
.jx-br { bottom: 24px; right: 24px; border-width: 0 2px 2px 0; border-radius: 0 0 4px 0; }

@keyframes jxCornerFade {
    from { opacity: 0.3; }
    to   { opacity: 1; }
}

/* ================================================
   PARTICLES (injected by JS)
   ================================================ */
.jx-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.jx-particle {
    position: absolute;
    border-radius: 50%;
    animation: jxParticleFloat linear infinite;
    will-change: transform, opacity;
}

@keyframes jxParticleFloat {
    0%   { transform: translateY(110vh) scale(0);   opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 0.6; }
    100% { transform: translateY(-10vh) scale(1.2); opacity: 0; }
}

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 480px) {
    .ring-1 { width: 320px; height: 320px; }
    .ring-2 { width: 240px; height: 240px; }
    .ring-3 { width: 160px; height: 160px; }
    .jx-brand { font-size: 2rem; }
    .jx-progress-wrap { width: 260px; }
    .jx-logo-wrap { width: 100px; height: 100px; }
    .jx-logo { width: 78px; height: 78px; }
}
