/* =========================================================
   2026 WORKPILOT HIGH-FIDELITY LOADER
   Glassmorphism + Motion Blur + Motion Progress
   ========================================================= */

.wp-loader-wrap {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    background: rgba(248, 250, 252, 0.7); /* Adapted Light mode */
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    transition: opacity 0.5s ease, visibility 0.5s;
    transition-delay: 0.1s;
}

/* Hidden state: never block pointer events when invisible */
#wp-global-loader[style*="display: none"],
#wp-global-loader[style*="opacity: 0"] {
    pointer-events: none !important;
}

.dark .wp-loader-wrap {
    background: rgba(15, 23, 42, 0.7); /* Adapted Dark mode */
}

/* 🚀 Top Progress Bar (YouTube Style) */
.wp-top-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #4f46e5, #3b82f6, #4f46e5);
    background-size: 200% 100%;
    width: 100%;
    animation: wp-loading-progress 1.5s infinite linear;
    z-index: 1000000;
}

/* 💎 Branded Pulse Design */
.wp-loader-inner {
    text-align: center;
}

.wp-brand-mark {
    position: relative;
    width: 80px;
    height: 80px;
    background: #4F46E5;
    color: white;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 800;
    margin: 0 auto 24px;
    box-shadow: 0 10px 25px -5px rgba(79, 70, 229, 0.4);
    z-index: 2;
}

.wp-pulse-circle {
    position: absolute;
    width: 100%;
    height: 100%;
    background: #4F46E5;
    border-radius: 20px;
    z-index: -1;
    animation: wp-brand-pulse 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

.wp-loader-text {
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.dark .wp-loader-text {
    color: #94A3B8;
}

.wp-loader-text span {
    display: inline-block;
    animation: wp-text-bounce 1s infinite alternate;
}

/* Wave effect for processing letters */
.wp-loader-text span:nth-child(2)  { animation-delay: 0.1s; }
.wp-loader-text span:nth-child(3)  { animation-delay: 0.2s; }
.wp-loader-text span:nth-child(4)  { animation-delay: 0.3s; }
.wp-loader-text span:nth-child(5)  { animation-delay: 0.4s; }
.wp-loader-text span:nth-child(6)  { animation-delay: 0.5s; }
.wp-loader-text span:nth-child(7)  { animation-delay: 0.6s; }
.wp-loader-text span:nth-child(8)  { animation-delay: 0.7s; }
.wp-loader-text span:nth-child(9)  { animation-delay: 0.8s; }
.wp-loader-text span:nth-child(10) { animation-delay: 0.9s; }
.wp-loader-text span:nth-child(11) { animation-delay: 1.0s; }
.wp-loader-text span:nth-child(12) { animation-delay: 1.1s; }
.wp-loader-text span:nth-child(13) { animation-delay: 1.2s; }

/* 🎭 Animations */
@keyframes wp-loading-progress {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes wp-brand-pulse {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.4); opacity: 0; }
    100% { transform: scale(1); opacity: 0; }
}

@keyframes wp-text-bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-4px); color: #4F46E5; }
}
