@charset 'UTF-8';

.sidebar--left {
    border-right: $border-gray;
    height: 100%;
    left: 0;
    position: fixed;
    width: 220px;
    z-index: 5;

    .error-bar--fixed & {
        height: calc(100% - 22px);
    }

    &.sidebar--padded {
        padding-top: 44px;
    }

    .sidebar-item {
        .icon {
            display: inline-block;
            margin: 0 7px 0 1px;
            position: relative;
            text-align: left;
            vertical-align: top;
            width: 15px;
        }

        .icon__lock {
            top: 2px;
        }

        .icon__globe {
            top: 1px;
        }
    }

    .sidebar-item__name {
        display: inline-block;
        max-width: 160px;
        overflow: hidden;
        text-overflow: ellipsis;
        vertical-align: top;
    }

    .sidebar__divider {
        color: $white;
        font-size: .9em;
        height: 20px;
        line-height: 20px;
        margin: 5px 0 6px;
        position: relative;
        z-index: 0;

        &:before {
            background: $light-gray;
            content: '';
            height: 1px;
            position: absolute;
            top: 10px;
            width: 100%;
        }

        .sidebar__divider__text {
            background: $primary-color;
            float: right;
            padding: 0 10px;
            position: relative;
            z-index: 1;
        }
    }

    .sidebar__switcher {
        bottom: 0;
        display: block;
        padding-bottom: 0;
        position: absolute;
        width: 100%;

        button {
            @include single-transition(all, .15s, ease-in);
            display: block;
            font-weight: 600;
            height: 45px;
            line-height: 40px;
            padding: 0;
            text-decoration: none;
            width: 100%;

            > span {
                display: inline-block;
                position: relative;
                vertical-align: middle;
                z-index: 5;
            }

            .icon {
                display: none;
                margin-right: 15px;

                svg {
                    position: relative;
                    top: 7px;
                }
            }

            &:hover {
                span {
                    @include opacity(1);
                }
            }
        }

        .switch__shortcut {
            margin-left: 4px;
        }
    }

    .dropdown-menu {
        max-height: 80vh;
        max-width: 200px;
        overflow-x: hidden;
        overflow-y: auto;
        width: 200px;
    }

    .search__form {
        display: none;
        margin: 0;
        padding: 1em 1em 0;
    }

    .badge {
        @include border-radius(100px);
        font-size: 11px;
        height: 16px;
        line-height: 16px;
        min-width: 18px;
        padding: 0 5px;
        position: absolute;
        right: 15px;
        top: 8px;
    }

    .nav-pills__container {
        -webkit-overflow-scrolling: touch;
        height: calc(100% - 115px);
        overflow: auto;
        position: relative;
    }

    .nav-pills__unread-indicator {
        @include border-radius(50px);
        font-size: 13.5px;
        left: 15px;
        margin: 0 auto;
        padding: 4px 0 3px;
        position: fixed;
        text-align: center;
        width: 190px;
        z-index: 1;

        .icon {
            margin-left: 5px;
        }
    }

    .nav-pills__unread-indicator-top {
        top: 80px;

        .icon {
            svg {
                @include transform(rotate(180deg));
            }
        }
    }

    .nav-pills__unread-indicator-bottom {
        bottom: 60px;
    }

    .nav {
        &.nav-stacked {
            > li + li {
                margin: 0;
            }
        }

        li {
            > h4 {
                font-size: 1em;
                font-weight: 600;
                margin: 1.5em 0 .7em;
                padding: 0 12px 0 17px;
                text-transform: uppercase;
            }

            .divider {
                & + .divider {
                    display: none;
                }
            }

            > a {
                border-radius: 0;
                line-height: 1.5;
                outline: none;
                overflow: hidden;
                padding: 5px 0 5px 17px;
                text-overflow: ellipsis;
                white-space: nowrap;

                .icon {
                    &.icon__globe,
                    &.icon__lock {
                        @include opacity(.5);
                    }
                }

                &.has-badge {
                    .sidebar-item__name {
                        max-width: 142px;
                    }
                }

                &.has-close {
                    &:hover {
                        .sidebar-item__name {
                            max-width: 152px;
                        }

                        .btn-close {
                            @include opacity(.8);
                            display: block;
                        }
                    }

                    .btn-close {
                        @include opacity(0);
                        display: none;
                        font-family: 'Open Sans', sans-serif;
                        font-size: 21px;
                        font-weight: 600;
                        position: absolute;
                        right: 15px;
                        top: 0px;

                        &:hover {
                            @include opacity(1);
                        }
                    }
                }

                &.unread-title {
                    font-weight: 600;
                }

            }

            &.active {
                a {
                    &:before {
                        background: $black;
                        content: '';
                        height: 100%;
                        left: 0;
                        position: absolute;
                        top: 0;
                        width: 3px;
                    }
                }

                .icon {
                    &.icon__globe,
                    &.icon__lock {
                        @include opacity(.7);
                    }
                }

                a,
                a:hover,
                a:focus {
                    @include alpha-property(background-color, $black, .1);
                    border-radius: 0;
                    font-weight: 400;
                    position: relative;

                    &.unread-title {
                        font-weight: 600;
                    }
                }
            }
        }
    }

    .modal-title {
        line-height: 2em;
    }

    .add-channel-btn {
        float: right;
        font-size: 1.9em;
        font-weight: 700;
        line-height: 18px;
        margin: -2px 0 0 0;
        outline: none;
        padding: 0 5px;
        text-decoration: none;

        &:hover {
            color: #666666;
        }
    }

    .status-wrapper {
        height: 36px;
        width: 36px;

        .status {
            bottom: -4px;
            height: 18px;
            right: -5px;
            width: 18px;

            &.status-edit {
                .fa {
                    top: 4px;
                }
            }

            .fa {
                position: relative;
                top: 2px;
            }

            .icon__container {
                &:after {
                    border-radius: 20px;
                    content: '';
                    height: 10px;
                    left: 4px;
                    position: absolute;
                    top: 4px;
                    width: 10px;
                }
            }

            svg {
                height: 13px;
                left: 3px;
                max-height: initial;
                position: relative;
                top: 3px;
                width: 13px;
                z-index: 1;
            }
        }
    }
}

.channel-loading-gif {
    height: 15px;
    margin-top: 2px;
    width: 15px;
}

.join-channel-loading-gif {
    height: 25px;
    margin-left: 10px;
    margin-top: 5px;
    width: 25px;
}
