/* =========================================================
   LOADER OVERLAY
   ========================================================= */

.loader-overlay {
    position: fixed;

    inset: 0;

    width: 100%;
    height: 100%;

    margin: 0;
    padding: 0;

    box-sizing: border-box;

    display: flex;

    align-items: center;
    justify-content: center;

    background:
        rgba(0, 0, 0, 0.18);

    backdrop-filter:
        blur(4px);

    -webkit-backdrop-filter:
        blur(4px);

    /*
     * Loader nằm trên:
     * - Header
     * - Nav
     * - Chat
     *
     * Nhưng nằm dưới:
     * - Payment popup
     * - MessageBox
     * - Toast
     */
    z-index: var(--z-loader);

    opacity: 0;

    visibility: hidden;

    pointer-events: none;

    transition:
        opacity .2s ease,
        visibility .2s ease;

    isolation: isolate;
}


/* =========================================================
   ACTIVE
   JS:
   element.classList.add("is-active")
   ========================================================= */

.loader-overlay.is-active {
    opacity: 1;

    visibility: visible;

    pointer-events: auto;
}


/* =========================================================
   SPINNER
   ========================================================= */

.loader-overlay .neural-spinner {
    position: relative;

    top: auto;
    left: auto;

    width: 120px;
    height: 80px;

    margin: 0;

    transform: none;

    z-index: 1;

    flex: 0 0 auto;

    pointer-events: none;
}


/* =========================================================
   SVG
   ========================================================= */

.loader-overlay
.neural-spinner
svg {
    display: block;

    width: 100%;
    height: 100%;

    margin: 0;
    padding: 0;

    overflow: visible;
}


/* =========================================================
   NETWORK LINES
   ========================================================= */

.neural-spinner
.lines {
    pointer-events: none;
}


.neural-spinner
.lines line {
    stroke:
        rgba(236, 72, 153, .20);

    stroke-width: 1;

    stroke-linecap: round;

    vector-effect:
        non-scaling-stroke;
}


/* =========================================================
   NETWORK NODES
   ========================================================= */

.neural-spinner
.nodes {
    pointer-events: none;
}


.neural-spinner
.nodes circle {
    stroke:
        #ec4899;

    stroke-width: 1;

    vector-effect:
        non-scaling-stroke;
}


/* =========================================================
   NODE 1
   ========================================================= */

.neural-spinner
.nodes circle:nth-child(1) {
    fill:
        #fce7f3;
}


/* =========================================================
   NODE 2
   ========================================================= */

.neural-spinner
.nodes circle:nth-child(2) {
    fill:
        #fbcfe8;
}


/* =========================================================
   NODE 3
   ========================================================= */

.neural-spinner
.nodes circle:nth-child(3) {
    fill:
        #f9a8d4;
}


/* =========================================================
   HUB
   ========================================================= */

.neural-spinner
.nodes
.hub {
    fill:
        #ec4899;

    stroke:
        #ec4899;

    filter:
        drop-shadow(
            0 0 5px
            rgba(236, 72, 153, .50)
        )
        drop-shadow(
            0 0 12px
            rgba(236, 72, 153, .20)
        );
}


/* =========================================================
   NODE 5
   ========================================================= */

.neural-spinner
.nodes circle:nth-child(5) {
    fill:
        #f9a8d4;
}


/* =========================================================
   NODE 6
   ========================================================= */

.neural-spinner
.nodes circle:nth-child(6) {
    fill:
        #fbcfe8;
}


/* =========================================================
   NODE 7
   ========================================================= */

.neural-spinner
.nodes circle:nth-child(7) {
    fill:
        #f472b6;
}


/* =========================================================
   NODE 8
   ========================================================= */

.neural-spinner
.nodes circle:nth-child(8) {
    fill:
        #f9a8d4;
}


/* =========================================================
   NODE 9
   ========================================================= */

.neural-spinner
.nodes circle:nth-child(9) {
    fill:
        #fbcfe8;
}


/* =========================================================
   NODE 10
   ========================================================= */

.neural-spinner
.nodes circle:nth-child(10) {
    fill:
        #fce7f3;
}


/* =========================================================
   SIGNAL
   ========================================================= */

.neural-spinner
.signal {
    fill:
        #ec4899;

    filter:
        drop-shadow(
            0 0 4px
            #ec4899
        )
        drop-shadow(
            0 0 8px
            rgba(236, 72, 153, .50)
        );

    pointer-events: none;
}


/* =========================================================
   LOADER ACTIVE - BODY
   ========================================================= */

body.loader-active {
    overflow: hidden;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 768px) {

    .loader-overlay {
        background:
            rgba(0, 0, 0, .16);

        backdrop-filter:
            blur(3px);

        -webkit-backdrop-filter:
            blur(3px);
    }


    .loader-overlay
    .neural-spinner {
        width: 100px;
        height: 68px;
    }

}


/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media (max-width: 480px) {

    .loader-overlay
    .neural-spinner {
        width: 90px;
        height: 62px;
    }

}


/* =========================================================
   VERY SMALL MOBILE
   ========================================================= */

@media (max-width: 360px) {

    .loader-overlay
    .neural-spinner {
        width: 82px;
        height: 56px;
    }

}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .loader-overlay {
        transition: none !important;
    }

}