/* Prevent FOUC: Hide core layout containers by default until fully loaded */
body:not(.loaded) header,
body:not(.loaded) main,
body:not(.loaded) footer,
body:not(.loaded) .mobile-bottom-nav {
    display: none !important;
}

/* Prevent FOUC on modals */
.modal, .tracking-modal {
    display: none !important;
}
.modal.active, .tracking-modal.active {
    display: flex !important;
}

/* Prevent background dark peeking through */
html:has(#app-preloader),
body:has(#app-preloader) {
    background-color: #ffffff !important;
    overflow: hidden;
}

.app-preloader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    min-height: -webkit-fill-available;
    background-color: #ffffff;
    background: #ffffff;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin: 0;
    padding: 0;
    border: none;
    outline: none;
    box-shadow: none;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.5s ease;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #0f172a;
    user-select: none;
    -webkit-font-smoothing: antialiased;
}

/* --------------------------------------------------------------------------
   Background Watermark Layer (Spread Seamlessly Across All Viewports)
   -------------------------------------------------------------------------- */
.tb-preloader-bg-patterns {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    opacity: 0.35;
    z-index: 1;
}

.tb-pattern-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

/* Main Preloader Content Container */
.tb-orbital-preloader-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 440px;
    padding: 15px;
    box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   1. Brand Header: Logo, Typography & Tagline
   -------------------------------------------------------------------------- */
.tb-preloader-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1.5rem;
    text-align: center;
}

.tb-preloader-logo-top {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-bottom: 0.55rem;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.08));
    animation: tb-brand-float 3s ease-in-out infinite;
}

.tb-preloader-brand-title {
    font-size: 2.45rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin: 0;
    line-height: 1.1;
    color: #0f172a;
    text-shadow: none;
    display: flex;
    align-items: baseline;
    justify-content: center;
}

.tb-preloader-brand-title .text-blue,
.tb-preloader-brand-title .text-white {
    color: #053E99;
}

.tb-preloader-brand-title .text-red {
    color: #ef233c;
    text-shadow: 0 0 16px rgba(239, 35, 60, 0.25);
}

.tb-preloader-brand-title .text-domain {
    font-size: 1.6rem;
    font-weight: 700;
    color: #64748b;
    opacity: 0.95;
}

.tb-preloader-tagline-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 0.55rem;
}

.tb-tagline-line {
    width: 42px;
    height: 2px;
    border-radius: 2px;
}

.tb-tagline-line.blue-line {
    background: linear-gradient(90deg, transparent, #0284c7);
}

.tb-tagline-line.red-line {
    background: linear-gradient(90deg, #ef233c, transparent);
}

.tb-preloader-tagline {
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.4px;
    color: #475569;
}

/* --------------------------------------------------------------------------
   2. Central Circular Orbit System
   -------------------------------------------------------------------------- */
.tb-orbit-system {
    position: relative;
    width: 360px;
    height: 360px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Outer Orbit Ring */
.tb-orbit-ring {
    position: absolute;
    width: 266px;
    height: 266px;
    border-radius: 50%;
    border: 2px solid rgba(2, 132, 199, 0.25);
    box-shadow: 0 0 24px rgba(2, 132, 199, 0.12), inset 0 0 16px rgba(2, 132, 199, 0.06);
    pointer-events: none;
}

/* Orbit Light Comet / Beam Tracer */
.tb-orbit-tracer-svg {
    position: absolute;
    width: 270px;
    height: 270px;
    top: calc(50% - 135px);
    left: calc(50% - 135px);
    animation: tb-orbit-rotate 4.5s linear infinite;
    pointer-events: none;
}

/* Center Spool Core Orb */
.tb-orbit-center {
    position: relative;
    width: 108px;
    height: 108px;
    border-radius: 50%;
    background: #ffffff;
    border: 1.5px solid rgba(2, 132, 199, 0.4);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08), 0 0 20px rgba(56, 189, 248, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    animation: tb-center-breathe 3s ease-in-out infinite alternate;
}

/* Center Dashed Rotating Track & Pulse Particles */
.tb-center-dashed-ring {
    position: absolute;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    border: 1.5px dashed rgba(2, 132, 199, 0.45);
    animation: tb-orbit-rotate-reverse 8s linear infinite;
    pointer-events: none;
}

.tb-center-sparkle-dot {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ef233c;
    box-shadow: 0 0 8px #ef233c, 0 0 14px #ef233c;
    top: 50%;
    left: -3px;
    transform: translateY(-50%);
}

.tb-center-spool-icon {
    width: 56px;
    height: 56px;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.1));
}

/* --------------------------------------------------------------------------
   3. Service Node Badges (Top, Right, Bottom, Left)
   -------------------------------------------------------------------------- */
.tb-orbit-node {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    width: 90px;
    transform: translate(-50%, -50%);
}

/* Positioning */
.tb-node-top {
    top: 48px;
    left: 50%;
}

.tb-node-right {
    top: 50%;
    left: calc(100% - 48px);
}

.tb-node-bottom {
    top: calc(100% - 48px);
    left: 50%;
}

.tb-node-left {
    top: 50%;
    left: 48px;
}

/* Node Circular White Badge */
.tb-node-badge {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid rgba(2, 132, 199, 0.35);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 5px;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    position: relative;
}

.tb-node-badge::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 16px;
    width: 40px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
}

.tb-node-icon {
    width: 48px;
    height: 48px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.08));
}

.tb-node-label {
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.6px;
    color: #0f172a;
    text-transform: uppercase;
    text-shadow: none;
    white-space: nowrap;
}

/* Synchronized Node Glow Pulse Animations (matching 4.5s orbit cycle) */
.tb-node-top .tb-node-badge {
    animation: tb-node-pulse 4.5s infinite ease-in-out;
    animation-delay: 0s;
}

.tb-node-right .tb-node-badge {
    animation: tb-node-pulse 4.5s infinite ease-in-out;
    animation-delay: 1.125s;
}

.tb-node-bottom .tb-node-badge {
    animation: tb-node-pulse 4.5s infinite ease-in-out;
    animation-delay: 2.25s;
}

.tb-node-left .tb-node-badge {
    animation: tb-node-pulse 4.5s infinite ease-in-out;
    animation-delay: 3.375s;
}

/* --------------------------------------------------------------------------
   4. CSS Keyframe Animations (60 FPS GPU Accelerated)
   -------------------------------------------------------------------------- */
@keyframes tb-brand-float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px);
    }
}

@keyframes tb-orbit-rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes tb-orbit-rotate-reverse {
    0% {
        transform: rotate(360deg);
    }
    100% {
        transform: rotate(0deg);
    }
}

@keyframes tb-center-breathe {
    0% {
        transform: scale(0.96);
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06), 0 0 14px rgba(2, 132, 199, 0.15);
    }
    100% {
        transform: scale(1.03);
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1), 0 0 24px rgba(2, 132, 199, 0.35);
    }
}

@keyframes tb-node-pulse {
    0%, 100% {
        transform: scale(1);
        border-color: rgba(2, 132, 199, 0.35);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
    }
    12% {
        transform: scale(1.1);
        border-color: #0284c7;
        box-shadow: 0 12px 28px rgba(2, 132, 199, 0.3), 0 0 14px rgba(2, 132, 199, 0.4);
    }
    24% {
        transform: scale(1);
        border-color: rgba(2, 132, 199, 0.35);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
    }
}

/* --------------------------------------------------------------------------
   5. Responsive Adjustments
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
    .tb-preloader-logo-top {
        width: 52px;
        height: 52px;
        margin-bottom: 0.4rem;
    }
    .tb-preloader-brand-title {
        font-size: 2.15rem;
    }
    .tb-preloader-brand-title .text-domain {
        font-size: 1.45rem;
    }
    .tb-preloader-tagline {
        font-size: 0.88rem;
    }
    .tb-orbit-system {
        width: 340px;
        height: 340px;
    }
    .tb-orbit-ring {
        width: 250px;
        height: 250px;
    }
    .tb-orbit-tracer-svg {
        width: 254px;
        height: 254px;
        top: calc(50% - 127px);
        left: calc(50% - 127px);
    }
    .tb-orbit-center {
        width: 102px;
        height: 102px;
    }
    .tb-center-dashed-ring {
        width: 122px;
        height: 122px;
    }
    .tb-center-spool-icon {
        width: 52px;
        height: 52px;
    }
    .tb-node-badge {
        width: 68px;
        height: 68px;
    }
    .tb-node-icon {
        width: 46px;
        height: 46px;
    }
    .tb-node-label {
        font-size: 0.8rem;
    }
    .tb-node-top {
        top: 45px;
    }
    .tb-node-right {
        left: calc(100% - 45px);
    }
    .tb-node-bottom {
        top: calc(100% - 45px);
    }
    .tb-node-left {
        left: 45px;
    }
}

