@use 'src/styles/components/visualization';

$menu-item-height: var(--menu-item-height);

.menu {
    height: 100%;
    width: auto;
    
    display: flex;
    flex-direction: column;
    align-items: center;
    
    background: var(--nota-menu-background);

    &:focus {
        outline: none;
    }

    & > .base-item:first-child { margin-top: 4px; }
    & > .base-item:last-child { margin-bottom: 4px; }
    & > .base-item {
        @include visualization.text(none, 10pt, center);

        position: relative;
        cursor: pointer;
        
        height: $menu-item-height;
        width: 100%;
        box-sizing: border-box;

        &:focus {
            outline: none;
        }

        display: grid;
        grid-template-columns: $menu-item-height auto $menu-item-height;
        
        & > .left-part, .content, .right-part {
            display: flex;
            align-items: center;
            justify-content: center;
            white-space: nowrap;
            box-sizing: border-box;
        }
    }

    & > .separator {
        height: 1.5px;
        width: 95%;
        margin-top: 4px;
        margin-bottom: 4px;
        border-radius: 10px;
        background-color: var(--nota-menu-separator-background);
        pointer-events: none;
    }

    & > .menu-item {
        position: relative;

        // hover effect
        &.focused::before {
            content: "";
            position: absolute;
            
            height: 100%;
            width: 95%;
            left: 50%;
            transform: translateX(-50%);

            border-radius: 4px;
            background-color: var(--nota-menu-item-focus-background);
        }

        // when the item is disabled
        &.disabled {
            & > .content {
                color: var(--nota-menu-item-disabled);
            }
            cursor: default;
        }

        // content styles
        & > .left-part, .content, .right-part {
            position: relative;
        }

        & > .left-part {
            & > .menu-item-check {
                font-size: 10px;
                margin-left: 4px;
                color: var(--nota-menu-item-check-color);
            }
        }

        & > .content {
            justify-content: space-between;
            color: var(--nota-menu-item-content-color);

            // the ones after the name
            & > .menu-item-name ~ * {
                margin-left: 30px;
                color: var(--nota-menu-item-disabled);
            }
        }

        & > .right-part {
            & > .submenu-item-arrow {
                font-size: 14px;
            }
        }
    }
}