// archive-filtering.scss
// Styling for content archive filtering
// ----------------------------------------------------------------------------------------
@import '~mixins.scss';
@import '~variables.scss';
@import '~animation.scss';

.archive-sidebar {
    position:absolute;
    top:0px;
    bottom:0px;
    left:0;
    width:$archive-sidebar-width;
    @include box-sizing(border-box);
    background-color:$archive-sidebar-bg;
    @include  box-shadow(inset -1px 0px 6px 0px rgba(0,0,0,.1));
    @include transition(left 0.2s ease);
    border-right: 2px solid #bbb;

    .header {
        height: $nav-height;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(0, 0, 0, 0.06);
        background-color: #f4f4f4;
        position: relative;
        z-index: 4;
        .icon {
            width: 48px;
            height: $nav-height;
            float: left;
            text-align: center;
            line-height: 54px;
            cursor: pointer;
            @include opacity(80);
        }
        ul {
            float: left;
            padding-left: 5px;
            li {
                float: left;
                height: 48px;
                @include border-box();
                margin: 0 15px;
                line-height: 48px;
                font-size: 14px;
                @include opacity(70);
                &:hover {
                    cursor: pointer;
                    border-bottom: 3px solid #bbb;
                }
                &.active {
                    border-bottom: 3px solid $sd-blue;
                    @include opacity(100);
                }
            }
        }
        .doopen {
            position: absolute;
            top: 16px;
            right: 8px;
            padding-left: 10px;
            padding-right: 10px;
            @include opacity(40);
            &:hover {
                cursor: pointer;
                @include opacity(100);
            }
        }
    }
    z-index: 10;

    .content {
        position: absolute;
        top: $nav-height;
        left: 0px;
        bottom: 0px;
        right: 0px;
        padding: 20px;
        overflow: auto;
        padding-bottom: $bottom-view-padding + 3.2rem;
        &.pull { 
            bottom: 60px; 
        }
        &.pull-heigher { 
            bottom: 120px; 
        }
        .sd-check__wrapper {
            margin-left: 0;
        }
        .superdeskRepos {
            margin-bottom: 2rem;
        }
    }
    
    .tab-box {
        margin: 0 -20px 0 -20px;
        position: sticky;
        top: -20px;
        background-color: $archive-sidebar-bg;
        padding-bottom: 0.4rem;
        z-index: 3;
    }

    .edit-search {
        font-size: 15px;
        margin: 10px -20px 15px;
        fieldset {
            padding: 0 20px;
        }
    }
    .toggle-box {
            .toggle-box__label {
                font-size: 12px;
                font-weight: 500;
                color: $gray;
            }
        &.pane {
            margin: 0 -20px;
            > .toggle-content {
                padding: 20px 15px;
            }
        }
        .terms {
            @include user-select(none);
            clear: both;
            float: right;
            padding-top: 10px;
            margin-bottom: 15px;
            @include clearfix();
            li {
                background: rgba(0,0,0,0.06);
                line-height: 26px;
                height: 26px;
                padding: 0 6px;
                @include border-radius(3px);
                margin: 0 5px 5px 0;
                float: left;
                i {
                    vertical-align: sub;
                    margin-left: 5px;
                    @include opacity(40);
                }
                &:hover {
                    cursor: pointer;
                    background: rgba(0,0,0,0.1);
                    i {
                        @include opacity(70);
                    }
                }
            }
        }
    }

    .raw-search {
        height: 200px;
    }



    .search-within-filter {
        position: relative;
        margin: -19px -20px 20px -20px;
        height: $nav-height;
        input {
            height: $nav-height;
            border-width: 0 0 1px 0 !important;
            padding-left: 15px;
        }
        button {
            position: absolute;
            top: 0; right: 0;
            height: $nav-height;
            width: $nav-height - 15px;
            border: 0;
            background: none;
            i {
                width: 18px;
                  background-repeat: no-repeat;
                  margin-top: 5px;
            }
        }
    }

    .search-filters {
        position: relative;
        margin: 1px 0px 20px;
        height: $nav-height;
        input {
            height: $nav-height;
            border-width: 0 0 1px 0 !important;
            padding-left: 15px;
        }
        button {
            position: absolute;
            top: 0; right: 0;
            height: $nav-height;
            width: $nav-height - 15px;
            border: 0;
            background: none;
            i {
                width: 18px;
                  background-repeat: no-repeat;
                  margin-top: 5px;
            }
        }
    }

    .views {
        padding: 0;
        .header {
            padding: 10px;
        }
        .list {
            top: $nav-height;
            position: absolute;
            left: 0; right: 0;
            overflow: auto;
            ul {
                > li {
                    display: block;
                    box-sizing: border-box;
                    padding: 10px 15px 10px 20px;
                    border-bottom: 1px solid #ddd;
                    overflow: hidden;
                    position: relative;
                    .search-item {
                        width: 80%;
                        i {
                            color: $sd-gray-text;
                            font-weight: 400;
                        }
                        .search-name {
                            font-weight: 500;
                        }
                        .search-description {
                            font-size: 12px;
                            color: $sd-gray-text;
                        }
                    }
                    .search-button {
                        position: absolute;
                        right:6px;
                        top:8px;
                    }
                    .delete, .edit {
                        border: 0;
                        background: 0;
                        display: none;
                        opacity: 0.4;
                        &:hover {
                            opacity: 1;
                        }
                    }
                    &:hover {
                        cursor: pointer;
                        background: #f8f8f8;
                        .delete {
                            display: inline-block;
                        }
                    }
                    &.active {
                        background: $sd-hover;
                    }
                    &:first-child {
                        border-top: 1px solid #ddd;
                    }
                }

            }
        }
        .edit-saved-searches {
            position: absolute;
            margin-left: 0px;
            .content {
                position: static;
                padding: 0;
            }
        }
    }
}

.date-filter {
    .predefined-dates {
        display: flex;
        justify-content: space-between;
        margin-bottom: 15px;
        > div {
            flex: 1 1 auto;
            padding: 4px;
            button {
                display: block;
                width: 100%;
            }
        }
        .btn--mini, .toggle-button {
            min-height: 20px;
            height: auto;
            margin-right: 4px;
            flex-grow: 1;
            &:last-child {
                margin-right: 0;
            }
        }
        .toggle-button {
            padding: 5px;
            line-height: 130%;
            font-size: 11px;
            font-weight: 500;
        }
    }
    .datepicker-input {
        min-width: initial;
    }
    fieldset {
        .multiple {
            .field {
                padding-right: 10px;
                &:last-child {
                    padding: 0;
                }
            }
        }
    }
}

.filter-box {
    .filter-box__item {
        display: flex;
        margin-bottom: 2px;
        border-radius: 2px;
        padding: 4px 4px 4px 5px;
        line-height: 100%;
        background-color: transparent;
        transition: background-color ease-in-out 0.2s;
        button {
            border: 0;
            background: none;
            display: block;
            width: 100%;
            padding: 0;
            color: #666;
            text-align: left;
            height: 22px;
            line-height: 22px;
            font-size: 12px;
        }

        .filter-box__hover-box {
            height: 1.6rem;
            width: 1.6rem;
            flex-shrink: 0;
            flex-grow: 0;
            position: relative;
            margin-right: 0.8rem;
            &:hover {
                i[class*="filetype-icon-"] {
                    visibility: hidden;
                }
                .sd-checkbox {
                    visibility: visible;
                }
            }
            .sd-checkbox {
                position: absolute;
                left: 0;
                top: 0;
                visibility: hidden;
            }
        }
        &.checked {
            .sd-checkbox {
                visibility: visible;
            }
        }

        [class*="filetype-icon-"] {
            color: $gray;
        }

        &:hover {
            cursor: pointer;
            background-color: rgba(0, 0, 0, 0.1);
            .filter-box__negate-filter {
                opacity: 0.6;
                transition: all ease-in-out 0.2s;
                &:hover {
                    opacity: 1;
                }
                &:active {
                    color: $state-color-red;
                }
            }
        }
        &:active {
            background: #ccc;
        }
        .filter-box__negate-filter {
            opacity: 0;
            transition: all ease-in-out 0.1s;
        }
    }
    .filter-box__name {
        flex-grow: 1;
        display: flex;
        align-items: center;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
            i {
                margin-left: 10px;
                font-style: italic;
                color: $grayText;
                font-weight: 300;
            }
    }
    .filter-box__check {
        flex-grow: 0;
        margin-right: 8px;

    }
}

.backlink-toolbar {
    padding: 16px 20px 0;
    margin-bottom: 20px;
    @include border-box();
    height: $nav-height;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    position: relative;
    z-index: 2;
    animation: dropOut .2s cubic-bezier(0.695, 0.105, 0.285, 1.275) 1;
    .backlink {
        animation: appearFromRight 0.4s ease-out 1;
    }
}

.saved-searches__group-title {
    padding: 14px;
    font-weight: 500;
    line-height: 100%;
    text-align: center;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.1em;
    color: $sd-gray-text;
}

.sidebar-open {
    .archive-content {
        left: $archive-sidebar-width !important;
    }
}

.save-search,
.float-search-btn,
.save-search-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 3;
    background-color: #fff;
    box-sizing: border-box;
    padding: 16px 24px;
    text-align: right;
    box-shadow: 0 -1px 2px 0 rgba(0, 0, 0, 0.12);
    .search {
        margin-bottom: 5px;
    }
    .save-search__button-split {
        display: flex;
        align-items: center;
        .btn {
            flex-basis: auto;
            flex-grow: 1;
            & + .btn {
                margin-left: 5px;
            }
        }
    }
}
.save-search-panel {
    text-align: left;
    input {
        margin-bottom: 10px;
    }
}
.save-search-panel__title {
    text-transform: uppercase;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    margin-bottom: 20px;
}

.save-search__link {
    display: inline-block;
    margin-right: 32px;
    cursor: pointer;
    font-size: 14px;
    &:hover {
        text-decoration: underline;
    }
}
.float-search-btn {
    background-color: #f6f6f6;
    .search { margin-bottom: 0; }
}
.float-search-btn--shift {
    bottom: 60px;
}
