@import "_SelectMixins.less";
@import "../../../ui/imports/jira-colours";

.check-list-select {
    width: 250px;
    .check-list-field-container {
        .border-box();
        position: relative;
        padding: 5px 10px 9px;
        overflow: hidden;
        .check-list-field {
            .border-box();
            border-radius: 3px;
            position: relative;
            z-index: 1;
            width: 100%;
            min-height: 28px;
            height: 0;
            padding: 0 24px 0 6px;
            box-shadow: var(--ds-shadow-raised, #bbb 0 7px 2px -7px inset);
            margin: 0;
            font-size: 14px;
            font-family: inherit;

            &::-ms-clear { //JRADEV-17689 IE10 trying to be clever. Adding a 'fix' to make it dumber.
                display: none;
            }
        }
        .icon-default {
            position: absolute;
            top: 12px;
            right: 15px;
            z-index: 2;
            &.clear-field {
                cursor: pointer;
                opacity: 0.7;
            }
        }

        input::-ms-clear {
            display: none;
        }
    }

    .aui-list-scroll {
        max-height: 270px;
        overflow-y: auto;
        overflow-x: hidden;
        clear: both;
        border-top: 1px solid var(--ds-border, @aui-color-N40);

        h5 {
            border-top: none;
            color: var(--ds-text-subtle, @aui-color-N200);
            font-size: 11px;
            font-weight: 600;
            line-height: 1.45454545;
            letter-spacing: 0;
            text-transform: uppercase;
            display: block;
            padding: 7px 10px;
        }

        ul + h5 {
            border-top: 1px solid var(--ds-border, @aui-color-N40);
        }

        @checkboxmultiselect-footer-bgcolor: var(--ds-surface, #f2f2f2);

        .no-suggestions {
            background-color: @checkboxmultiselect-footer-bgcolor;
        }

        .aui-list-section-footer {
            background-color: @checkboxmultiselect-footer-bgcolor;
            white-space: normal;
        }
    }

    .aui-list .aui-list-section + .aui-list-section {
        border-top: 1px solid var(--ds-border, @aui-color-N40);
    }

    .check-list-group-actions {
        padding: 5px 10px;
        .clear-all {
            color: var(--jira-color-textLinkColour, @jira-color-link);
            &:visited,
            &:hover {
                color: var(--jira-color-textLinkColour, @jira-color-link);
            }
            &:hover {
                text-decoration: underline;
            }
        }
    }

    .check-list-group-footer {
        padding: 2px 10px;
    }

    .clear-all.disabled {
        opacity: 0.5;
    }

    .check-list-buttons-container {
        border-top: 1px solid var(--ds-border, @aui-border-color);
        padding-top: 7px;
        padding-right: 10px;
        margin-bottom: 2px; /* Override form.aui .buttons-container */
        text-align: right;
        .disabled {
            display: inline-block;
            cursor: default;
            text-decoration: none;
            opacity: 0.5;
        }
    }
}

#order-by-options-multi-select,
#searcher-status-multi-select,
#assignee-multi-select {
    width: auto !important;
}

form#issue-filter .check-list-select.easter,
.check-list-select.easter {
    opacity: 1;
    transition: opacity 2s;

    &.enable-easter {
        .aui-list {
            height: 500px;
            opacity: 0;
        }
    }
}

form#issue-filter .check-list-item,
form.aui .check-list-item,
.check-list-item,
.check-list-group-footer {
    .border-box();
    padding: 6px 10px;
    position: relative;

    label {
        clear: none;
        color: inherit;
        display: block;
        left: 0;
        line-height: 1.4;
        margin: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        width: auto;
        font-weight: normal;

        input[type="checkbox"] {
            // Placing them absolutely within the container means the actual content can be 100% of the parent width.
            position: absolute;
            left: 10px;
        }
        img {
            margin-right: 5px;
            vertical-align: text-bottom;
            -moz-force-broken-image-icon: 1;
        }

        .icon {
            &.rounded {
                border-radius: 50%;
            }
        }

        em {
            font-weight: bold;
            font-style: normal;
        }
        .aui-lozenge {
            .border-box();
            margin-top: -1px;
            max-width: 100%;
            overflow: hidden;
            text-overflow: ellipsis;
            vertical-align: middle;
        }
    }

    &.disabled {
        color: var(--ds-text-disabled, #888);
        font-style: italic;

        em {
            font-style: italic;
        }
    }

    &.active {
        background-color: var(--jira-color-menuBackgroundColour);
        color: var(--jira-color-menuTxtColour);
    }
}

form#issue-filter .check-list-select {
    width: 250px;
}

.msie .check-list-select .check-list-item label {
    word-wrap: normal;
}

/* TODO - remove this after multi-select class has been stripped from the sparkler */
form#issue-filter .multi-select.check-list-select {
    width: 100%;
}
