/* Preloader Overlay */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* background: #49bcea; */
    background: linear-gradient(145deg, #49bcea 0%, #496fea 100%);

    /* same bg-color */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Loader */
.loader {
    position: relative;
    width: 75px;
    height: 100px;
}

.loader__bar {
    position: absolute;
    bottom: 0;
    width: 10px;
    height: 50%;
    background: #fff;
    transform-origin: center bottom;
    box-shadow: 1px 1px 0 rgba(0, 0, 0, .2);
}

.loader__bar:nth-child(1) {
    left: 0;
    transform: scale(1, .2);
    animation: barUp1 4s infinite;
}

.loader__bar:nth-child(2) {
    left: 15px;
    transform: scale(1, .4);
    animation: barUp2 4s infinite;
}

.loader__bar:nth-child(3) {
    left: 30px;
    transform: scale(1, .6);
    animation: barUp3 4s infinite;
}

.loader__bar:nth-child(4) {
    left: 45px;
    transform: scale(1, .8);
    animation: barUp4 4s infinite;
}

.loader__bar:nth-child(5) {
    left: 60px;
    transform: scale(1, 1);
    animation: barUp5 4s infinite;
}

.loader__ball {
    position: absolute;
    bottom: 10px;
    left: 0;
    width: 10px;
    height: 10px;
    background: #fff;
    border-radius: 50%;
    animation: ball 4s infinite;
}

/* Animations (same as before) */
@keyframes ball {
    0% {
        transform: translate(0, 0);
    }

    5% {
        transform: translate(8px, -14px);
    }

    10% {
        transform: translate(15px, -10px)
    }

    17% {
        transform: translate(23px, -24px)
    }

    20% {
        transform: translate(30px, -20px)
    }

    27% {
        transform: translate(38px, -34px)
    }

    30% {
        transform: translate(45px, -30px)
    }

    37% {
        transform: translate(53px, -44px)
    }

    40% {
        transform: translate(60px, -40px)
    }

    50% {
        transform: translate(60px, 0)
    }

    57% {
        transform: translate(53px, -14px)
    }

    60% {
        transform: translate(45px, -10px)
    }

    67% {
        transform: translate(37px, -24px)
    }

    70% {
        transform: translate(30px, -20px)
    }

    77% {
        transform: translate(22px, -34px)
    }

    80% {
        transform: translate(15px, -30px)
    }

    87% {
        transform: translate(7px, -44px)
    }

    90% {
        transform: translate(0, -40px)
    }

    100% {
        transform: translate(0, 0);
    }
}

@keyframes barUp1 {

    0%,
    40%,
    100% {
        transform: scale(1, .2);
    }

    50%,
    90% {
        transform: scale(1, 1);
    }
}

@keyframes barUp2 {

    0%,
    40%,
    100% {
        transform: scale(1, .4);
    }

    50%,
    90% {
        transform: scale(1, .8);
    }
}

@keyframes barUp3 {

    0%,
    100% {
        transform: scale(1, .6);
    }
}

@keyframes barUp4 {

    0%,
    40%,
    100% {
        transform: scale(1, .8);
    }

    50%,
    90% {
        transform: scale(1, .4);
    }
}

@keyframes barUp5 {

    0%,
    40%,
    100% {
        transform: scale(1, 1);
    }

    50%,
    90% {
        transform: scale(1, .2);
    }
}

/* Hide preloader when loaded */
body.loaded #preloader {
    display: none;
}


/* ====================Scroll to top=================== */
/* Scroll To Top Button */
#scrollTopBtn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    background: linear-gradient(135deg, #4a6cf7, #00c2ff);
    color: #fff;
    border: none;
    outline: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 22px;
    display: flex;
    /* flex for centering */
    justify-content: center;
    align-items: center;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);

    opacity: 0;
    /* hidden initially */
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.3s ease;
}

/* Visible state */
#scrollTopBtn.show {
    opacity: 0.6;
    pointer-events: auto;
}

/* Hover or click state */
#scrollTopBtn:hover,
#scrollTopBtn:active {
    opacity: 1;
    transform: translateY(-4px);
}

/* ========================
   RESPONSIVE ADJUSTMENTS
   ======================== */

/* Tablets */
@media (max-width: 1024px) {
    #scrollTopBtn {
        width: 45px;
        height: 45px;
        font-size: 20px;
        bottom: 25px;
        right: 25px;
    }
}

/* Phones */
@media (max-width: 600px) {
    #scrollTopBtn {
        width: 40px;
        height: 40px;
        font-size: 18px;
        bottom: 20px;
        right: 20px;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
    }
}