/*************************************************
* ---- Sidebar ----
*/

.w2ui-sidebar {
    position: relative;
    cursor: default;
    overflow: hidden !important;
    background-color: @sidebar-background-color !important;
    .box-sizing(border-box);

    * {
        .box-sizing;
    }

    > div {
        position: absolute;
        overflow: hidden;
    }

    .w2ui-sidebar-top {
        position: absolute;
        z-index: 2;
        top: 0px;
        left: 0px;
        right: 0px;

        .w2ui-flat-left, .w2ui-flat-right {
            position: absolute;
            right: 2px;
            top: 2px;
            height: 24px;
            padding: 5px;
            border-radius: 2px;
            background-size: 16px 12px;
            background-position: center center;
            background-repeat: no-repeat;
            background-color: @sidebar-background-color;
            &:hover {
                background-color: @sidebar-node-hover-background-color-start;
            }
        }
        .w2ui-flat-left {
            left: auto;
            width: 25px;
            background-image: @image-less;
        }
        .w2ui-flat-right {
            left: 2px;
            width: auto;
            background-image: @image-more;
        }
    }

    .w2ui-sidebar-bottom {
        position: absolute;
        z-index: 2;
        bottom: 0px;
        left: 0px;
        right: 0px;
    }

    .w2ui-sidebar-div {
        position: absolute;
        z-index: 1;
        overflow: auto;
        top: 0px;
        bottom: 0px;
        left: 0px;
        right: 0px;
        padding: 2px 0px;
        .user-select;

        table {
            width: 100%;
        }

        .w2ui-node {
            .linear-gradient-vertical(@sidebar-node-linear-gradient-start, @sidebar-node-linear-gradient-end);
            border-top: @sidebar-node-border-top;
            border-bottom: @sidebar-node-border-bottom;
            margin: 0px;
            padding: 1px 0px;
            table {
                pointer-events: none; // all mouse events go to div
            }
            .w2ui-node-caption,
            .w2ui-node-image,
            .w2ui-node-image > span,
            td.w2ui-node-dots {
                color: @sidebar-node-color;
                text-shadow: @sidebar-node-text-shadow;
                pointer-events: none;
                &:hover {
                    color: @sidebar-node-hover-color;
                }
            }

            &:hover {
                border-top: 1px solid @sidebar-node-hover-border-color;
                border-bottom: 1px solid @sidebar-node-hover-border-color;
                .linear-gradient-vertical(@sidebar-node-hover-background-color-start, @sidebar-node-hover-background-color-end);
            }

            // font icon default
            .w2ui-node-image {
                width: 22px;
                text-align: center;
                pointer-events: none;
                > span {
                    color: @sidebar-node-image-color !important;
                }
            }

            // enable pointer events for all inputs inside node
            input, button {
                pointer-events: auto;
            }
        }

        .w2ui-selected,
        .w2ui-selected:hover {
            position: relative;
            .linear-gradient-vertical(@sidebar-node-selected-linear-gradient-start, @sidebar-node-selected-linear-gradient-end);
            border-top: @sidebar-node-selected-border-top;
            border-bottom: @sidebar-node-selected-border-bottom;

            .w2ui-node-caption,
            .w2ui-node-image,
            .w2ui-node-image > span,
            td.w2ui-node-dots {
                color: @sidebar-node-selected-color !important;
                text-shadow: @sidebar-node-selected-text-shadow !important;
            }
        }

        .w2ui-inactive {
        }

        .w2ui-selected:before {
            content: "";
            border: 1px dashed #eee;
            border-radius: 3px;
            position: absolute;
            top: 2px;
            bottom: 2px;
            left: 2px;
            right: 2px;
            pointer-events: none;
        }

        .w2ui-selected.w2ui-inactive:before {
            border: 1px dashed transparent !important;
        }

        .w2ui-disabled,
        .w2ui-disabled:hover {
            background: transparent !important;
            border-top: @sidebar-node-border-top;
            border-bottom: @sidebar-node-border-bottom;

            .w2ui-node-caption,
            .w2ui-node-image,
            .w2ui-node-image > span,
            td.w2ui-node-dots {
                .opacity(0.4);
                color: @sidebar-node-color !important;
                text-shadow: @sidebar-node-text-shadow !important;
            }
        }

        .w2ui-node-caption {
            white-space: nowrap;
            padding: 5px 0px 5px 3px;
            margin: 1px 0px 1px 22px;
            position: relative;
            z-index: 1;
            font-size: 12px;
        }

        .w2ui-node-group {
            white-space: nowrap;
            overflow: hidden;
            padding: 10px 0px 10px 10px;
            margin: 0px;
            cursor: default;
            color: @sidebar-group-color;
            background-color: @sidebar-group-background-color;

            :nth-child(1) {
                /* show / hide link */
                margin-right: 10px;
                float: right;
                color: transparent;
            }

            :nth-child(2) {
                /* title text */
                font-weight: normal;
                text-transform: uppercase;
            }
        }

        .w2ui-node-sub {
            overflow: hidden;
        }

        // for flat sidebar
        .w2ui-node-flat {
            padding: 6px 0px;
            text-align: center;
            .w2ui-node-image {
                text-align: center;
                width: auto;
                // for font-awesome icons
                & > span {
                    font-size: 16px;
                    color: @sidebar-node-color;
                    text-shadow: @sidebar-node-text-shadow;
                }
                &.w2ui-icon {
                    width: 21px;
                }
            }
        }

        td.w2ui-node-dots {
            width: 18px;
            padding: 0px 0px 1px 7px;
            text-align: center;

            .w2ui-expand {
                width: 16px;
                margin-top: -3px;
                pointer-events: auto;
            }
        }

        td.w2ui-node-data {
            padding: 1px 1px 3px 1px;

            .w2ui-node-image {
                padding: 3px 0px 0px 0px;
                float: left;
                // for font-awesome icons
                & > span {
                    font-size: 16px;
                    color: @sidebar-node-color;
                    text-shadow: @sidebar-node-text-shadow;
                }
                &.w2ui-icon {
                    margin-top: 3px;
                }
            }

            .w2ui-node-count {
                float: right;
                border: @sidebar-node-count-border;
                border-radius: 20px;
                width: auto;
                height: 18px;
                padding: 2px 7px;
                margin: 3px 4px -2px 0;
                background-color: @sidebar-node-count-background-color;
                color: @sidebar-node-count-color;
                box-shadow: @sidebar-node-count-shadow;
                text-shadow: @sidebar-node-count-text-shadow;
                position: relative;
                z-index: 2;
            }
         }
     }
}