/* assets/css/preloader.css */

/* ==========================================================================
   1. GLOBAL ENGINE INITIALIZATION PRELOADER LAYOUT
   ========================================================================== */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Powered natively by theme variables matching index.php and about.php */
    background-color: var(--bg-void);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 999999; /* Absolute top stack hierarchy above sticky headers or action docks */
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.4s ease, background-color 0.4s ease, color 0.4s ease;
}

/* Preloader Hidden State Utility (Triggered smoothly via asynchronous platform bootstrap scripts) */
#preloader.hidden,
#preloader.preloader-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* -----------------------------------------
   PREMIUM PLATFORM INNER LOADER SHELL COMPONENTS
----------------------------------------- */
.loader-wrapper {
    text-align: center;
    padding: 20px;
    z-index: 10;
}

/* Graphic Logo Icon Keyframe Pulse Engine */
.loader-logo {
    font-size: 3.5rem;
    color: var(--accent-gold);
    margin-bottom: 15px;
    display: inline-block;
    animation: pulseGlowEngine 1.5s infinite alternate cubic-bezier(0.45, 0, 0.55, 1);
}

/* Horizontal Progress Track Architecture Bar */
.loader-bar {
    width: 240px;
    height: 4px;
    background: rgba(148, 163, 184, 0.15);
    margin: 20px auto 0 auto;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.03);
}
body.light-theme .loader-bar {
    background: rgba(15, 23, 42, 0.08);
    border-color: rgba(0, 0, 0, 0.02);
}

/* Infinite Kinetic Loader Sweep Animation Loop */
.loader-progress {
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary-blue) 0%, #38BDF8 100%);
    position: absolute;
    left: 0;
    top: 0;
    border-radius: 20px;
    animation: loadingTrackSweep 1.4s infinite cubic-bezier(0.65, 0, 0.35, 1);
    box-shadow: 0 0 10px rgba(37, 99, 235, 0.4);
}

/* -----------------------------------------
   HIGH-PERFORMANCE COGNITIVE LOADING SPINNER
   (Maintained safely for legacy/sub-panel game engine states support)
----------------------------------------- */
.spinner {
    width: 55px;
    height: 55px;
    border: 4px solid rgba(37, 99, 235, 0.1); /* Subtle base trace circle */
    border-top: 4px solid var(--primary-blue); /* Premium focus track */
    border-right: 4px solid #38BDF8; /* Secondary cyan sweep path */
    border-radius: 50%;
    animation: spinEngineLoop 0.8s linear infinite, glowPulseBreath 2s infinite alternate ease-in-out;
    margin: 0 auto 20px auto;
    box-shadow: 0 0 15px rgba(37, 99, 235, 0.15);
}

/* -----------------------------------------
   BRANDING ELEMENT INJECTORS TYPOGRAPHY
----------------------------------------- */
.preloader-brand-text {
    font-family: 'Poppins', sans-serif;
    font-size: 1.35rem;
    font-weight: 900;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-main);
    margin: 0 0 6px 0;
    animation: textFlickerPulse 2s infinite alternate ease-in-out;
}

.preloader-brand-text span {
    color: var(--primary-blue);
}

.preloader-sub-status {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
    opacity: 0.85;
}

/* ==========================================================================
   2. UNIVERSAL POPUP CONTENT OVERLAY FRAMEWORK (MODALS)
   ========================================================================== */
.modal-overlay,
.global-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 6, 23, 0.85); /* Shading backdrop veil boundary */
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: none; /* Controlled atomatically via platform interactive engine layers scripts */
    justify-content: center;
    align-items: center;
    z-index: 99998;
    padding: 15px; /* Symmetrical mobile margin gap padding tightened */
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}
body.light-theme .modal-overlay,
body.light-theme .global-modal-overlay {
    background: rgba(15, 23, 42, 0.45); /* Enhanced daytime high-contrast overlay shading shadow profile */
}

/* Active overlay runtime visibility state configurations mapping triggers */
.modal-overlay.active,
.global-modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content,
.global-modal-content {
    background: var(--bg-card); /*matte slate box surfaces or white box surfaces dynamically */
    border: 1px solid var(--border-slate);
    padding: 35px 25px; /* Spaces layouts gap padding compressed tightly for optimal scanning yield metrics */
    border-radius: 14px;
    width: 100%;
    max-width: 460px;
    text-align: center;
    box-shadow: var(--shadow-preset), 0 20px 45px rgba(0, 0, 0, 0.3);
    font-family: 'Inter', sans-serif;
    box-sizing: border-box;
    transform: translateY(24px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.3s ease, border-color 0.3s ease;
    position: relative;
}

.modal-overlay.active .modal-content,
.global-modal-overlay.active .global-modal-content {
    transform: translateY(0);
}

/* Content Element Internal Typography Trees Rules */
.modal-content h2,
.global-modal-content h3 {
    color: var(--text-main);
    margin: 0 0 12px 0;
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.25;
    font-family: 'Poppins', sans-serif;
}

.modal-content h2 span,
.global-modal-content h3 span {
    color: var(--primary-blue);
}

.modal-content p,
.global-modal-content p {
    color: var(--text-muted);
    line-height: 1.55;
    font-size: 0.92rem;
    margin: 0 0 24px 0;
    text-align: center;
}

/* ==========================================================================
   3. ANIMATION TIMELINE VECTOR DEFINITIONS KEYS
   ========================================================================== */
@keyframes spinEngineLoop {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes glowPulseBreath {
    from { box-shadow: 0 0 12px rgba(37, 99, 235, 0.15); transform: scale(1); }
    to { box-shadow: 0 0 24px rgba(56, 189, 248, 0.35); transform: scale(1.02); }
}

@keyframes pulseGlowEngine {
    from { transform: scale(1); filter: drop-shadow(0 0 2px rgba(255, 193, 7, 0.2)); }
    to { transform: scale(1.06); filter: drop-shadow(0 0 15px rgba(255, 193, 7, 0.6)); }
}

@keyframes loadingTrackSweep {
    0% { left: -40%; }
    50% { left: 100%; }
    100% { left: -40%; }
}

@keyframes textFlickerPulse {
    0% { opacity: 0.88; transform: scale(0.99); }
    100% { opacity: 1; transform: scale(1); }
}

/* ==========================================================================
   4. STRUCTURAL LAYOUT MEDIA INTERFACE BREAKPOINTS
   ========================================================================== */
@media (max-width: 768px) {
    .modal-content,
    .global-modal-content {
        padding: 30px 20px;
        max-width: 90%;
    }
}

/* Alignment rules targeting 520px and 480px responsive smartphone format envelopes thresholds */
@media (max-width: 520px) {
    .modal-content,
    .global-modal-content {
        padding: 24px 18px; /* Internal content cell boundaries compressed */
        border-radius: 12px;
    }
    .modal-content h2,
    .global-modal-content h3 {
        font-size: 1.28rem;
        margin-bottom: 10px;
    }
    .modal-content p,
    .global-modal-content p {
        font-size: 0.88rem;
        margin-bottom: 20px;
        line-height: 1.5;
    }
    .spinner {
        width: 46px;
        height: 46px;
    }
    .loader-bar {
        width: 190px;
        margin-top: 15px;
    }
    .loader-logo {
        font-size: 2.8rem;
        margin-bottom: 10px;
    }
}

@media (max-width: 480px) {
    .modal-content,
    .global-modal-content {
        padding: 22px 15px;
        border-radius: 10px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    }
    body.light-theme .modal-content,
    body.light-theme .global-modal-content {
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.16); /* Deep cast black shadow profile mapped for Light Mode */
    }
    .modal-content h2,
    .global-modal-content h3 {
        font-size: 1.18rem;
    }
    .preloader-brand-text {
        font-size: 1.1rem;
        letter-spacing: 1px;
    }
    .preloader-sub-status {
        font-size: 0.76rem;
    }
}