$variant: 'light';
@import "gnome-shell-sass/colors";
@import "gnome-shell-sass/drawing";
@import "gnome-shell-sass/common";

.svm-menu {
    $shell_margin: $base_padding + $base_margin * 2;

    @mixin no-spacing {
        padding-left: 0;
        padding-right: 0;
        margin-left: 0;
        margin-right: 0;
    }

    @mixin default-padding {
        /** @copypaste from gnome-shell .aggregate-menu .popup-sub-menu .popup-menu-item > :first-child **/
        &:ltr {
            padding-left: $shell_margin;
            margin-left: $base_icon_size;
        }

        &:rtl {
            padding-right: $shell_margin;
            margin-right: $base_icon_size;
        }
    }

    @mixin submenu-padding {
        &:ltr {
            padding-right: $shell_margin;
        }

        &:rtl {
            padding-left: $shell_margin;
        }
    }

    @mixin no-ornament-margin {
        // fix padding of ornament (selection) in submenu
        &:ltr {
            margin-left: 0;
            padding-left: 0;
        }

        &:rtl {
            margin-right: 0;
            padding-right: 0;
        }
    }


    /**
     * Common
     */
    .svm-slider-details {
        font-size: 0.9em;
        font-weight: 400;
    }

    .popup-menu-item {
        @include no-ornament-margin;
    }

    // sub menu items (of top level menu items)
    .popup-sub-menu {
        .popup-menu-item {
            @include submenu-padding;

            > .svm-menu-item-container {
                @include no-spacing;

                > .svm-container-line {
                    /* somewhere along all these paddings there's too much added
                     * here, offsetting sliders in submenus by a few pixels
                     */
                    &:ltr {
                        padding-right: $shell_margin - 2px;
                    }

                    &:rtl {
                        padding-left: $shell_margin - 2px;
                    }
                }
            }
        }
    }

    // top-level menu items
    > .popup-menu-item {
        > .svm-menu-item-container {
            @include no-spacing;

            > .svm-container-line {
                @include no-spacing;
            }
        }
    }


    /**
     * SVM integrated in status menu dropdown
     */
    &.svm-integrated-menu {
        // only sub menu items (of top level items)
        .popup-sub-menu {
            .popup-menu-item {
                > .svm-menu-item-container {
                    > .svm-container-line {
                        &.line-1 {
                            // align ornament to parent items
                            .popup-menu-ornament {
                                @include no-ornament-margin;
                            }
                        }
                    }
                }
            }
        }

        // top-level menu items
        > .popup-menu-item {
            > .svm-menu-item-container {
                // offset top level items to align with label instead of ornament icon
                .svm-master-slider-line,
                .svm-events-slider-line {
                    > .popup-menu-ornament {
                        @include default-padding;
                    }
                }
            }
        }
    }


    /**
     * Stand-alone menu via extra-button
     */
    &.svm-standalone-menu {
        width: 30em;
    }
}
