//##############################################################################
// CHANGELIST

// resets form white background color #77
#changelist-form,
#changelist-search,
#changelist form,
#content-related form {
    margin-top: 0;
    margin-bottom: 0;
    padding: 0;
    background-color: transparent;
    box-shadow: none;
}
#image_container {
    margin-bottom: 5px;
}
#content-related {
    h3 {
        color: $gray-darker;
        font-size: $font-size-large !important;
        margin-top: 15px;
        margin-bottom: 10px;
    }
}
.change-list {
    min-height: inherit;
    background-image: none !important;
    .filtered {
        background: none !important;
    }
    .results,
    #toolbartable {
        box-shadow: $base-box-shadow;
        table {
            box-shadow: none;
        }
    }
    .results #result_list {
        box-shadow: none;
        .related-widget-wrapper a.change-related {
            margin-right: 0;
            margin-left: 5px;
        }
    }
    #toolbartable .paginator {
        box-shadow: none !important;
    }
    .paginator {
        color: $gray-light !important;
        // important is needed to make sure that paginator has correct font size #288
        font-size: $font-size-small !important;
        min-height: 20px;
        padding: 5px $paginator-padding !important;
        background-color: $white !important;
        .this-page {
            font-weight: normal;
            padding: 0;
        }
    }
    #changelist {
        display: block;
        width: auto !important;
        #action-toggle {
            vertical-align: middle;
        }
        .results {
            box-shadow: $base-box-shadow;
        }
        &.filtered {
            table {
                border: 0;
            }
            // adds max height on filter to make it more usable for very long filters #263
            #changelist-filter {
                overflow-y: auto;
                width: $filtered-filter-width !important;
                max-height: 585px;
                margin-left: $filtered-filter-margin;
                padding-right: $filtered-filter-padding;
                padding-left: 0;

                h2 {
                    letter-spacing: 0;
                }

                h3 {
                    font-weight: bold;
                }
            }
            .results,
            .paginator,
            .results + .paginator,
            #toolbartable .paginator {
                // removes box shadow top on paginator
                clip: rect(0, 99999px, 99999px, -2px);
            }
            .paginator {
                // calculates correct width because of margin right
                width: calc(100% - #{$filter-changelist-margin}) !important;
                border-right: 0;
                box-shadow: $base-box-shadow;
            }
            .actions {
                margin-right: $filtered-filter-width !important;
            }

            .changelist-form-container {
                position: relative;
                display: inline-block;
                width: calc(100% - #{$filter-changelist-margin}) !important;

                .results + .paginator {
                    box-sizing: border-box;
                    width: 100% !important;
                }
            }
        }
        table {
            tbody {
                th,
                td {
                    white-space: nowrap;
                    a,
                    a:link,
                    a:visited,
                    a:link:visited {
                        color: $color-primary;
                    }
                }
                .noItemsRow {
                    th,
                    td {
                        padding: 12px 0 12px 15px !important;
                    }
                }
                .drag {
                    max-width: 10px;
                    height: 36px;
                    margin: 0 21px;
                    cursor: move !important;
                    background: url("../img/drag.png");
                    background-size: 5px;
                }
                input[type="checkbox"],
                input[type="radio"] {
                    vertical-align: baseline;
                }
            }
        }
        #toolbar {
            overflow: hidden;
            height: auto;
            min-height: 30px;
            margin: 0 30px 10px 0 !important;
            padding: 3px 3px 3px 0;
            border: 0 !important;
            background: none !important;
            form label {
                display: inline-block;
                font-size: 100%;
                min-width: auto;
                padding: 0;
            }
            @at-root #toolbar #changelist-search form #searchbar,
                form #searchbar {
                font-size: $font-size-small;
                vertical-align: middle;
                box-sizing: border-box;
                width: auto !important;
                // makes sure that search doesn't jumps to new line #155
                max-width: 257px !important;
                // django 1.9
                height: 36px !important;
                padding: 9px 5px !important;
                border-radius: 3px !important;
            }
            // makes sure that if admin cations are visible that toolbar floats to position next to actions #275, #285
            &.actions-visible {
                float: left;
                margin-bottom: 5px !important;
            }
        }
        #changelist-filter {
            // resets position to float filter next to changelist
            position: static;
            float: right;
            min-height: 100%;
            margin-top: 8px;
            border-left: 0;
            border-top-right-radius: $border-radius-base;
            border-bottom-right-radius: $border-radius-base;
            background-color: $gray-lightest !important;
            h2,
            h3 {
                margin-bottom: 15px !important;
                padding-bottom: 10px !important;
                padding-left: 0 !important;
                border-bottom: solid 1px $gray-lighter;
            }
            h2 {
                color: $gray;
                font-size: $font-size-normal !important;
                font-weight: normal;
                text-transform: uppercase;
                padding: 2px 9px;
                background: none;
            }
            h3 {
                font-size: $font-size-normal;
                font-weight: bold;
                margin: 15px 0 10px !important;
                padding-bottom: 7px !important;
            }
            ul {
                font-size: $font-size-small;
                margin-bottom: 10px;
                margin-left: 0 !important;
                padding-left: 0;
                padding-bottom: 0;
                border-bottom: none;
            }
            li {
                font-size: $font-size-normal;
                margin-bottom: 15px;
                &.selected {
                    font-weight: bold;
                    margin-left: 0 !important;
                    padding-left: 0 !important;
                    border-left: 0 !important;
                    a {
                        color: $color-primary !important;
                    }
                }
            }
        }
        .actions {
            color: $gray-light;
            padding: 0 0 10px 0;
            border: none;
            background: none;
            select {
                white-space: nowrap;
                // makes sure that action select doesn't jumps to new line #155
                width: 257px !important;
                font-size: 12px;
                margin-top: 3px;
                margin-right: 10px;
                padding: 6px 40px 6px 20px;
                border: 1px solid $gray-lighter;
                border-radius: $border-radius-base;
            }
            label {
                display: inline-block;
                // make sure that only icon is displayed
                font: 0/0 a;
                margin-bottom: 0;
                margin-left: 0;
            }
            button {
                font-family: $base-font-family;
                font-size: $font-size-small;
                vertical-align: bottom;
                height: 36px;
                margin-top: 0;
                margin-right: 10px;
                margin-bottom: 0;
                padding: 10px 15px !important;
                box-shadow: none;
            }
            .action-counter {
                display: inline-block !important;
                font-size: $font-size-small;
                line-height: 36px;
                vertical-align: bottom;
            }
        }
        .toplinks {
            clear: both;
            overflow: hidden;
            margin-top: 20px !important;
            margin-bottom: 20px !important;
            border-top: 0;
            border-bottom: 0 !important;
            background: none;
            li {
                display: inline;
                float: left;
                color: $gray-darkest;
                font-size: $font-size-normal;
                font-weight: normal;
                text-transform: uppercase;
                margin-left: 25px;
                cursor: pointer;
                &:first-child {
                    margin-left: 0;
                }
            }
            a {
                display: block;
                position: relative;
                color: $color-primary;
                font-size: $font-size-normal;
                font-weight: normal;
                text-transform: uppercase;
            }
        }
        .results table {
            box-shadow: none !important;
        }
        .results + .paginator,
        #toolbartable .paginator,
        #has-filters ~ .paginator {
            // removes box shadow top on paginator
            clip: rect(0, 99999px, 99999px, -2px);
        }
        .paginator {
            // calculates correct width because of margin left and right
            width: calc(100% - 30px);
            border-top: none;
            background: none;
            box-shadow: $base-box-shadow !important;
        }
    }
    #changelist-search {
        #limit_search_to_folder {
            vertical-align: middle;
            margin-top: 2px;
            // adds space between search field and checkbox #216
            margin-left: 10px;
            + label {
                display: inline-block !important;
                color: $gray-light !important;
                font-size: $font-size-small !important;
                text-transform: none;
            }
        }
        .small {
            display: inline-block;
            margin-top: 5px;
        }
        input[type="checkbox"] {
            display: block;
        }
        input[type="submit"] {
            @include button-variant($btn-action-color, $btn-action-bgcolor, $btn-action-border, true);
            vertical-align: middle;
            text-indent: -9999px;
            box-sizing: border-box;
            margin-left: 10px !important;
            padding: 10px 16px !important;
            background-image: url("../img/icon_search_white@2x.png") !important;
            background-repeat: no-repeat !important;
            background-position: center !important;
            background-size: 20px !important;
            // django 1.9
            box-shadow: none !important;
            &:active {
                background-image: url("../img/icon_search_white@2x.png") !important;
            }
        }
        label {
            display: none !important;
            margin-bottom: 0;
            img {
                visibility: hidden;
            }
        }
    }
    #changelist-filter-button {
        color: $gray-light;
        font-size: $font-size-normal;
        text-transform: uppercase;
        width: 175px;
        margin-bottom: 5px;
        padding-left: 25px;
        border-left: 0;
        background: url("../img/icon_arrow_down.png") no-repeat left center;
        background-size: 25px;
        + #changelist-filter {
            position: absolute;
            top: 30px;
            margin-top: 1px;
            padding-left: 15px !important;
        }
    }
    // select field when multiple sites are available #201
    #site-selector {
        margin-top: -18px;
        margin-left: 0;
    }
}

#result_list {
    margin-bottom: 0 !important;
    tr[style*="background"] {
        background: $color-primary-light !important;
    }
    .drag {
        cursor: move !important;
    }
}
.djangocms-admin-style {
    table {
        margin-bottom: 0 !important;
    }
    thead {
        th {
            font-size: $font-size-normal;
            text-transform: uppercase;
            border-color: $gray-lighter;
            background-color: $white;
            border-top: none;
            &.sorted {
                background-color: $white;
            }
            &.action-checkbox-column {
                padding: 0 15px !important;
            }
            .text {
                float: none;
                padding-right: 0;
                a {
                    padding: 0 !important;
                }
            }
            .sortoptions {
                display: inline-block;
                float: right;
                padding-top: 0;
                a.sortremove {
                    &:after {
                        display: none;
                    }
                }
            }
        }
    }
}
#toolbartable {
    .paginator {
        background-color: transparent;
        box-shadow: none;
        .this-page {
            color: $gray-light;
            font-size: $font-size-small;
            font-weight: normal;
            padding: 0;
        }
    }
}

a.lang-code {
    color: $white !important;
    font-size: $font-size-small !important;
    font-weight: bold !important;
    text-transform: uppercase;
    margin-right: 10px !important;
    padding: 2px 8px !important;
    border: solid 1px $gray-lighter;
    border-radius: 10px !important;
    background-color: $gray-lighter;
    &:hover {
        color: $white !important;
    }
    &.current.active {
        color: $color-primary !important;
        border-color: $color-primary;
        background-color: $white !important;
        &:hover {
            color: $color-primary !important;
        }
    }
    &.active {
        color: $white !important;
        border-color: $color-primary;
        background-color: $color-primary !important;
        &:hover {
            color: $white !important;
        }
    }
}
.collapse {
    display: none;
}
