/*
Template Name: Material Ad Astra
Author: UnEspace
Email: rampeur@gmail.com
File: scss
*/
@use 'sass:color';

/*******************
Main sidebar
******************/

#snav mat-list-item.mat-mdc-list-item.selected:after {
    border-right: 18px solid color.scale($sidebar-light, $lightness: 50%);
    border-top: 18px solid $sidebar-text;
    border-bottom: 18px solid $sidebar-text;
    content: "";
    display: inline-block;
    position: absolute;
    right: -1px;
    top: 8px;
}

#snav {
    /*box-shadow: 1px 0px 20px rgba(0, 0, 0, 0.08);*/
    box-shadow: 0px 2px 4px -1px rgba(0, 0, 0, 0.2), 0px 4px 5px 0px rgba(0, 0, 0, 0.14), 0px 1px 10px 0px rgba(0, 0, 0, 0.12);
    &.mat-drawer{
        width: $sidenav-width;
        padding-top: 0px;
    }
    &.mat-drawer-side{
        border-right: 0px solid $sidebar;
    }
    mat-list-item {
        height: auto;
        padding: 0px 10px;
        &:hover{
            background: none;
            &::before {
                background-color: transparent;
                opacity: 1;
            }
        }
        .mdc-list-item__content{
            display: block;
            &:hover{
                background: none;
                span > a{
                    color:$white;
                    background: $sidebar-selected;
                    border-radius: $radius;
                    mat-icon{
                        color:$white;
                    }
                }
            }
        }
        a{
            height: 36px;
            padding: 0 10px;
            margin-top: 8px;
            margin-bottom: 8px;
            align-items: center;
            display: flex;
            font-size: 1rem;
            font-weight: 300;
            white-space: nowrap;
            mat-icon:not(.dd-icon){
                margin-right: 8px;
            }
            .dd-icon{
                font-size: 16px;
                width: 16px;
                transition: 0.2s ease-in;
                margin: 5px 0 5px 5px;
                height: 16px;
            }
        }
        &.selected:after {
            border-right: 18px solid color.scale($sidebar, $lightness: 4%);
            border-top: 18px solid $headingtext;
            border-bottom: 18px solid $headingtext;
            content: "";
            display: inline-block;
            position: absolute;
            right: -1px;
            top: 8px;
        }
        &.selected > .mdc-list-item__content span > a{
            background: $sidebar-selected;
            border-radius: $radius;
            .dd-icon{
                -webkit-transform: rotate(-180deg);
                transform: rotate(-180deg);
            }
            
        }
        &.selected .sub-item .mdc-list-item__content a.selected{
            background: transparent;
            font-weight: 500;
        }
    }
}

.light-theme #snav {
    &.mat-drawer{
        background-color: $sidebar-light;
    }
    mat-list-item {
        a{
            color:$sidebar-text;
            mat-icon{
                color:$sidebar-icons;
            }
        }
        &.selected > .mdc-list-item__content span > a{
            color:$white;
            mat-icon{
                color:$white;
            }
        }
        &.selected .sub-item .mdc-list-item__content a.selected{
            color: $white;
        }
    }
}
/*******************
use profile section
*******************/

.user-profile {
    position: relative;
    height: $sidenav-height;
    width: $sidenav-width;
    background-image: none;
    background-size: cover;
    background-repeat: no-repeat;
    .profile-img {
        width: 50px;
        margin-left: 30px;
        padding: 30px 0;
        border-radius: 100%;
        &::before {
            -webkit-animation: 2.5s blow 0s linear infinite;
            animation: 2.5s blow 0s linear infinite;
            position: absolute;
            content: '';
            width: 50px;
            height: 50px;
            top: 31px;
            margin: 0 auto;
            border-radius: 50%;
            z-index: 0;
        }
        @-webkit-keyframes blow {
            0% {
                box-shadow: 0 0 0 0px rgba(0, 0, 0, 0.1);
                opacity: 1;
                -webkit-transform: scale3d(1, 1, 0.5);
                transform: scale3d(1, 1, 0.5);
            }
            50% {
                box-shadow: 0 0 0 10px rgba(0, 0, 0, 0.1);
                opacity: 1;
                -webkit-transform: scale3d(1, 1, 0.5);
                transform: scale3d(1, 1, 0.5);
            }
            100% {
                box-shadow: 0 0 0 20px rgba(0, 0, 0, 0.1);
                opacity: 0;
                -webkit-transform: scale3d(1, 1, 0.5);
                transform: scale3d(1, 1, 0.5);
            }
        }
        @keyframes blow {
            0% {
                box-shadow: 0 0 0 0px rgba(0, 0, 0, 0.1);
                opacity: 1;
                -webkit-transform: scale3d(1, 1, 0.5);
                transform: scale3d(1, 1, 0.5);
            }
            50% {
                box-shadow: 0 0 0 10px rgba(0, 0, 0, 0.1);
                opacity: 1;
                -webkit-transform: scale3d(1, 1, 0.5);
                transform: scale3d(1, 1, 0.5);
            }
            100% {
                box-shadow: 0 0 0 20px rgba(0, 0, 0, 0.1);
                opacity: 0;
                -webkit-transform: scale3d(1, 1, 0.5);
                transform: scale3d(1, 1, 0.5);
            }
        }
        img {
            width: 100%;
            border-radius: 100%;
        }
    }
    .profile-text {
        position: absolute;
        cursor: pointer;
        white-space: nowrap;
        width: 100%;
        bottom: 0;
        > a {
            color: $sidebar !important;
            width: 100%;
            padding: 4px 10px 7px 22px;
            background-color: rgba(217, 202, 174, 0.5);
            display: block;
            white-space: nowrap;
            &:after{
                position: absolute;
                right: 20px;
                top:20px;
            }
        }
        .mat-icon {
            line-height: var(--bs-body-line-height);
        }
    }
}
.sidebar-closed #snav{
    &.mat-sidenav ~ .mat-drawer-content {
        margin-left: 0px!important;
    }
}