﻿/* =========================================================
   ZENSLI PAGE LOADER
   Fullscreen loader used during page navigation.
   Prefix all classes to avoid conflicts with theme CSS.
   ========================================================= */

.zensli-page-loader {
    background: #fff;
    position: fixed;
    height: 100%;
    width: 100%;
    left: 0;
    top: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

    .zensli-page-loader.zensli-page-loader-initial {
        display: flex;
    }


/* =========================================================
   PAGE LOADER CONTENT
   ========================================================= */

.zensli-page-loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}


/* =========================================================
   PAGE LOADER - DATA STREAM
   ========================================================= */

.zensli-loader-data {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 42px;
}

    .zensli-loader-data span {
        width: 5px;
        height: 12px;
        background: #5577FF;
        border-radius: 2px;
        animation: zensli-loader-data-pulse 1.1s ease-in-out infinite;
    }

        .zensli-loader-data span:nth-child(1) {
            animation-delay: 0s;
        }

        .zensli-loader-data span:nth-child(2) {
            animation-delay: .1s;
        }

        .zensli-loader-data span:nth-child(3) {
            animation-delay: .2s;
        }

        .zensli-loader-data span:nth-child(4) {
            animation-delay: .3s;
        }

        .zensli-loader-data span:nth-child(5) {
            animation-delay: .4s;
        }


/* =========================================================
   PAGE LOADER - STATUS
   ========================================================= */

.zensli-loader-status {
    display: flex;
    align-items: center;
    gap: 7px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 1.5px;
    color: #6c757d;
}

.zensli-loader-status-dot {
    width: 6px;
    height: 6px;
    background: #5577FF;
    border-radius: 50%;
    animation: zensli-loader-status-pulse 1s ease-in-out infinite;
}


/* =========================================================
   PAGE LOADER - ANIMATIONS
   ========================================================= */

@keyframes zensli-loader-data-pulse {

    0%, 100% {
        height: 10px;
        opacity: .25;
    }

    50% {
        height: 38px;
        opacity: 1;
    }
}

@keyframes zensli-loader-status-pulse {

    0%, 100% {
        opacity: .25;
        transform: scale(.8);
    }

    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}


/* =========================================================
   GENERIC DATA LOADER
   Used by loadData() for AJAX-loaded sections.
   ========================================================= */

.loading {
    position: relative;
    min-height: 70px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}


    /* Data bars */

    .loading::before {
        content: "";
        width: 42px;
        height: 30px;
        background: linear-gradient(#5577FF 0 0) 0 50% / 4px 30%, linear-gradient(#5577FF 0 0) 9px 50% / 4px 55%, linear-gradient(#5577FF 0 0) 18px 50% / 4px 100%, linear-gradient(#5577FF 0 0) 27px 50% / 4px 55%, linear-gradient(#5577FF 0 0) 36px 50% / 4px 30%;
        background-repeat: no-repeat;
        animation: zensli-data-loader 1.1s ease-in-out infinite;
    }


    /* Loading text */

    .loading::after {
        content: "LOADING DATA";
        position: absolute;
        top: calc(50% + 24px);
        left: 50%;
        transform: translateX(-50%);
        white-space: nowrap;
        font-family: Consolas, "Courier New", monospace;
        font-size: 9px;
        font-weight: 500;
        letter-spacing: 1.3px;
        color: #6c757d;
    }


/* =========================================================
   GENERIC DATA LOADER - ANIMATION
   ========================================================= */

@keyframes zensli-data-loader {

    0%, 100% {
        transform: scaleY(.55);
        opacity: .35;
    }

    50% {
        transform: scaleY(1);
        opacity: 1;
    }
}
