/* =========================
           RESET
========================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


/* =========================
           BODY
========================= */

body {

    font-family: Arial, sans-serif;

    background: var(--background);

    color: var(--text);

    min-height: 100vh;

    /* Space for mobile navbar */

    padding-bottom: 80px;

}


/* =========================
       BOTTOM NAVIGATION
========================= */

.bottom-nav {

    position: fixed;

    bottom: 0;
    left: 0;

    width: 100%;
    height: 70px;

    background: var(--surface);

    border-top:
        1px solid var(--border);

    display: flex;

    align-items: center;

    justify-content: space-around;

    z-index: 9999;

    box-shadow:
        0 -5px 20px
        rgba(0, 0, 0, 0.06);

}


/* =========================
       NAVIGATION ITEM
========================= */

.nav-item {

    text-decoration: none;

    color: var(--muted);

    width: 100%;
    height: 100%;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    gap: 5px;

    font-size: 12px;

    font-weight: 500;

    border-radius: 12px;

    transition:
        background 0.25s ease,
        color 0.25s ease,
        transform 0.25s ease;

}


/* =========================
           ICON
========================= */

.nav-item i {

    font-size: 20px;

    transition:
        transform 0.25s ease;

}


/* =========================
        ACTIVE ITEM
========================= */

.nav-item.active {

    color: var(--primary);

}


.nav-item.active i {

    transform:
        translateY(-2px);

}


/* =========================
           HOVER
========================= */

.nav-item:hover {

    color: var(--primary);

    background:
        var(--nav-hover);

}


/* =========================
     DESKTOP FLOATING NAV
========================= */

@media (min-width: 768px) {

    body {

        /* Space for floating navbar */

        padding-bottom: 120px;

    }


    .bottom-nav {

        /* Floating */

        bottom: 25px;

        left: 50%;

        transform:
            translateX(-50%);


        /* Width */

        width:
            min(650px, 90%);

        height: 72px;


        /* Modern look */

        border:
            1px solid var(--border);

        border-radius: 20px;

        padding: 8px;

        /*
           Uses the theme surface.

           Slight transparency keeps
           the glass effect.
        */

        background:
            var(--nav-background);

        backdrop-filter:
            blur(15px);

        -webkit-backdrop-filter:
            blur(15px);


        box-shadow:
            0 15px 40px
            rgba(0, 0, 0, 0.12);

    }


    /* Desktop navigation */

    .nav-item {

        flex-direction: row;

        gap: 10px;

        font-size: 14px;

        padding:
            12px 18px;

    }


    .nav-item i {

        font-size: 19px;

    }


    /* Active desktop item */

    .nav-item.active {

        background: var(--primary);

        color: #ffffff;

        box-shadow:
            0 5px 15px
            rgba(37, 99, 235, 0.25);

    }


    .nav-item:hover {

        background:
            var(--nav-hover);

        color:
            var(--primary);

    }


    /* Keep active item blue */

    .nav-item.active:hover {

        background:
            var(--primary);

        color: #ffffff;

    }

}


/* =========================
    SMALL MOBILE SCREENS
========================= */

@media (max-width: 380px) {

    .nav-item {

        font-size: 11px;

    }


    .nav-item i {

        font-size: 18px;

    }

}


/* =========================
       PAGE ANIMATION
========================= */

body {

    animation:
        pageEnter 0.2s ease;

}


@keyframes pageEnter {

    from {

        opacity: 0;

        transform:
            translateY(8px);

    }


    to {

        opacity: 1;

        transform:
            translateY(0);

    }

}


body.page-exit {

    animation:
        pageExit 0.25s ease forwards;

}

 
@keyframes pageExit {

    from {

        opacity: 1;

        transform:
            translateY(0);

    }


    to {

        opacity: 0;

        transform:
            translateY(-8px);

    }

}

/* =====================================
   SMART SCROLL BUTTON
===================================== */

.smart-scroll-btn {
    position: fixed;

    right: 20px;
    bottom: 85px;

    z-index: 1000;

    width: 48px;
    height: 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: var(--surface);
    color: var(--heading);

    border: 1px solid var(--border);
    border-radius: 50%;

    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);

    font-size: 18px;
    cursor: pointer;

    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
}

.smart-scroll-btn:hover {
    transform: translateY(-3px);
}

.smart-scroll-btn[hidden] {
    display: none !important;
}

@media (max-width: 600px) {
    .smart-scroll-btn {
        right: 16px;
        bottom: 90px;

        width: 44px;
        height: 44px;
    }
}