$nav-item-width: 4rem;
$nav-item-height: 3.5rem;
$nav-label-width: 8rem;
$nav-wide: 12rem;

nav {
    z-index:60;
    width: $nav-item-width;
    position: fixed;
    left: 0;
    top: 0;
    height: 100%;
    background-color: $darkgray;
    color: $white;
    @include transition(0.2s);

    a, a:hover {
        color: $white;
        text-decoration: none;
    }
}
.toggle {
    position: absolute;
    overflow: hidden;
    width: $nav-item-width;
    height: $nav-item-height;
    right: (-$nav-item-width);
    top: 0;
    z-index: 61;
    display: none;
    background-color: $darkgray;
    .ham, .close {
        vertical-align: middle;
        text-align: center;
        line-height: $nav-item-width;
        display: none;
    }
}

.nav-item {
    overflow: hidden;
    width: $nav-item-width;
    background-color: $darkgray;
    height: $nav-item-height;
    line-height: $nav-item-height;
    display: block;
    -webkit-transition: .3s ease all;
    transition: .3s ease all;
    position: relative;

    &.selected {
        background-color: $blue;
    }

    .nav-icon {
        text-align: center;
        width: $nav-item-width;
        height: $nav-item-height;
        line-height: $nav-item-height;
        display: inline-block;
        float:left;
    }
    .nav-label {
        position: absolute;
        padding-left: 1rem;
        font-weight: 300;
        left: $nav-item-width;
        right: 0;
        display: inline-block;
        float:right;
        font-size: 1.5rem;
        height: $nav-item-height;
        line-height: $nav-item-height;

    }
}

$profile-picture-size: 2.5rem;
.bottom {
    position: absolute;
    bottom: 0;
    .me {
        height: $nav-item-height;
        i {
            width: $nav-item-width;
            height: $nav-item-height;
            background-position: center center;
            background-repeat: no-repeat;
            background-size: $profile-picture-size $profile-picture-size;
            text-align: center;
            position: relative;
            margin: 0 auto;
            display: block;
        }

        p {
            display: none;
        }
    }
}

$home: 5.5rem;
$w-5: 5.5rem;
$w-6: 6rem;
$w-6-5: 6.5rem;
$w-7: 7rem;
$w-8: 8rem;
$w-9: 9rem;

.open, nav {
    left: 0;
}
.home {
    &:hover { width: $nav-item-width + $home; }
    background-color: $darkgray !important;
    .nav-label { width: $home; } }
.w-5 {
    &:hover { width: $nav-item-width + $w-5; }
    .nav-label { width: $w-5; } }
.w-6 {
    &:hover { width: $nav-item-width + $w-6; }
    .nav-label { width: $w-6; } }
.w-6-5 {
    &:hover { width: $nav-item-width + $w-6-5; }
    .nav-label { width: $w-6-5; } }
.w-7 {
    &:hover { width: $nav-item-width + $w-7; }
    .nav-label { width: $w-7; } }
.w-8 {
    &:hover { width: $nav-item-width + $w-8; }
    .nav-label { width: $w-8; } }
.w-9 {
    &:hover { width: $nav-item-width + $w-9; }
    .nav-label { width: $w-9; } }

.fa-2-5x {
    font-size: 2.5em;
}

@media screen and (max-width: $phone-max) {
    nav {
        left: (-1 * $nav-wide) !important;
        width: $nav-wide;

        .nav-item {
            width: $nav-wide !important;
        }

        &.open {
            left: 0 !important;
            .toggle {
                .ham {
                    display: none;
                }

                .close {
                    display: block;
                }
            }
        }
    }

    .main {
        margin-left: 0 !important;
    }

    .content {
        width: 100%;
        margin: 0;
    }

    .toggle {
        display: block;

        .ham {
            display: block;
        }

        .close {
            display: none;
        }
    }
}


@media screen and (min-width: $xl-desktop-min) {
    nav {
        width: $nav-wide;
    }

    .main > .inner {
        width: 100%;

        .content {
            width: 90%;
            margin: 0 auto;
            box-sizing: border-box;
        }
    }
    .me {
        min-width: $profile-picture-size;
        height: $profile-picture-size;
        position: relative;
        margin: 0 auto;

        i {
            position: absolute;
            width: $profile-picture-size;
            height: $profile-picture-size;
            display: block;
            left: 0;
            top: 0;
        }

        p {
            display: inline-block;
            padding-left: $profile-picture-size;
        }
    }

    .main {
        margin-left: $nav-wide;
        background-color: $white;
    }

    .nav-item {
        -webkit-transition: none;
        transition: none;
        width: $nav-wide !important;

        .nav-label {
            padding-left: 0;
        }

        &:not(.selected):hover { background-color: $gray; }
        &.selected:hover { background-color: $fadedblue; }
    }
}
