/**
* DevExtreme (widgets/ios7/list.ios7.less)
* Version: 19.2.6
* Build date: Thu Jan 30 2020
*
* Copyright (c) 2012 - 2020 Developer Express Inc. ALL RIGHTS RESERVED
* Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
*/
@import (once) "./badge.ios7.less";
@import (once) "./button.ios7.less";
@import (once) "./scrollView.ios7.less";

@IOS7_DELETE_BUTTON_HORIZONTAL_PADDING: 5px;

.dx-list {
    background: @IOS7_LIST_BACKGROUND;

    &.dx-list-with-search .dx-scrollable-wrapper {
        height: calc(100% - 1.2em - round(2 * @TEXTEDITOR_INPUT_PADDING));
    }

    .dx-empty-message {
        padding: @IOS7_LIST_ITEM_VERTICAL_PADDING @IOS7_LIST_ITEM_HORIZONTAL_PADDING;
        color: @IOS7_LIST_DISABLE;
        text-align: center;
        .dx-overflow();
    }
}

.dx-list-group-header {
    padding: 10px 15px 9px;
    border-top: 1px solid @IOS7_LIST_ITEM_BORDER;
    background: @IOS7_LIST_GROUP_BACKGROUND;
    color: @IOS7_LIST_GROUP_TEXT;
    font-weight: bold;

    .dx-hairlines & {
        border-top-width: 0.5px;
    }

    &:before {
        border-top-color: @IOS7_LIST_GROUP_TEXT;
    }

    .dx-list-group-collapsed &:before {
        border-bottom-color: @IOS7_LIST_GROUP_TEXT;
    }
}

.dx-list-item {
    color: @IOS7_LIST_ITEM_TEXT;

    &.dx-state-focused,
    &.dx-state-active {
        background: @IOS7_LIST_ITEM_ACTIVE_BACKGROUND;
        color: @IOS7_LIST_ITEM_ACTIVE_TEXT;

        .dx-list-switchable-delete-button-container,
        .dx-list-slide-item-content {
            background: @IOS7_LIST_ITEM_ACTIVE_BACKGROUND;
            color: @IOS7_LIST_ITEM_ACTIVE_TEXT;
        }
    }
}

.dx-list-item-content {
    padding: @IOS7_LIST_ITEM_VERTICAL_PADDING @IOS7_LIST_ITEM_HORIZONTAL_PADDING 0;
}

.dx-list:not(.dx-list-select-decorator-enabled) .dx-list-item-selected {
    background-color: @IOS7_LIST_ITEM_SELECTED;
}

.dx-list-item-content:after {
    display: block;
    margin-top: @IOS7_LIST_ITEM_VERTICAL_PADDING;
    padding-left: @IOS7_LIST_ITEM_HORIZONTAL_PADDING;
    width: 200%;
    height: 1px;
    background: @IOS7_LIST_ITEM_BORDER;
    content: ' ';

    .dx-hairlines & {
        margin-top: @IOS7_LIST_ITEM_VERTICAL_PADDING - 0.5px;
        height: 0.5px;
        background: @IOS7_LIST_ITEM_BORDER;
    }

    .dx-list-item-separator-hidden & {
        background: none;
    }
}

.dx-list-item:last-child,
.dx-list-item:only-child {
    .dx-list-item-content:after {
        background: none;
        height: 0;
    }

    .dx-list-item-badge-container,
    .dx-list-item-chevron-container,
    .dx-list-item-after-bag.dx-list-reorder-handle-container,
    .dx-list-item-after-bag.dx-list-static-delete-button-container {
        border-bottom: none;
    }
}

.dx-list-item-badge-container,
.dx-list-item-chevron-container {
    border-bottom: 1px solid @IOS7_LIST_ITEM_BORDER;

    .dx-hairlines & {
        border-bottom-width: 0.5px;
    }
}

.dx-list-item-icon-container {
    width: @IOS7_LIST_ITEM_ICON_SIZE + @IOS7_LIST_ITEM_HORIZONTAL_PADDING;
}

.dx-list-item-icon {
    .dx-icon-sizing(@IOS7_LIST_ITEM_ICON_SIZE);
}

.dx-list-item-chevron {
    border-color: @IOS7_LIST_ITEM_TEXT;
    margin-left: -3px;
}

.dx-list-border-visible {
    border: 1px solid @IOS7_LIST_ITEM_BORDER;

    .dx-hairlines & {
        border-width: 0.5px;
    }
}

.dx-list-item-before-bag {
    &.dx-list-toggle-delete-switch-container {
        width: @IOS7_LIST_ITEM_HORIZONTAL_PADDING + 25px;
    }

    &.dx-list-select-checkbox-container,
    &.dx-list-select-radiobutton-container {
        width: @IOS7_LIST_ITEM_HORIZONTAL_PADDING + 25px;
    }

    .dx-list-toggle-delete-switch {
        .dx-button-content {
            padding: 0;
        }

        &.dx-state-active .dx-icon-toggle-delete {
            opacity: 1;
        }
    }

    .dx-icon-toggle-delete {
        margin: @IOS7_LIST_ITEM_VERTICAL_PADDING / 2 @IOS7_LIST_ITEM_HORIZONTAL_PADDING / 2 @IOS7_LIST_ITEM_VERTICAL_PADDING / 2 @IOS7_LIST_ITEM_HORIZONTAL_PADDING;
        width: 25px;
        height: 25px;
        background-image: @IOS7_LIST_DELETE_SWITCH_BACKGROUND;
        background-size: 100%;
    }

    .dx-list-select-checkbox,
    .dx-list-select-radiobutton {
        margin-top: -2px;
        margin-bottom: -3px;
        margin-left: @IOS7_LIST_ITEM_HORIZONTAL_PADDING;
    }

    .dx-list-select-radiobutton {
        margin-left: @IOS7_LIST_ITEM_HORIZONTAL_PADDING / 3 * 2;
    }
}

.dx-list-item:after {
    margin-top: 0;
}

.dx-list-select-all {
    padding: 12px 0 0;
    overflow: hidden;

    &:after {
        display: block;
        margin-left: 55px;
        margin-top: @IOS7_LIST_ITEM_VERTICAL_PADDING;
        padding-left: @IOS7_LIST_ITEM_HORIZONTAL_PADDING;
        width: 100%;
        height: 1px;
        background: @IOS7_LIST_ITEM_BORDER;
        content: ' ';
    }
}

.dx-list-select-all-checkbox {
    margin: -2px 1px -2px @IOS7_LIST_ITEM_HORIZONTAL_PADDING;
    float: left;
}

.dx-list-select-all-label {
    vertical-align: middle;
    padding: 0 @IOS7_LIST_ITEM_HORIZONTAL_PADDING 0 @IOS7_LIST_ITEM_HORIZONTAL_PADDING - 1px;
}

.dx-list-item-after-bag {
    &.dx-list-static-delete-button-container {
        border-bottom: 1px solid @IOS7_LIST_ITEM_BORDER;

        .dx-hairlines & {
            border-bottom-width: 0.5px;
        }
    }
}

// static delete button

.dx-list-static-delete-button-container {
    width: 28px;

    .dx-list-static-delete-button {
        padding: 0;

        .dx-icon {
            margin: 0;
        }
    }
}


.dx-list-item-after-bag { // stylelint-disable-line no-duplicate-selectors
    &.dx-list-reorder-handle-container {
        width: @IOS7_LIST_ITEM_HORIZONTAL_PADDING + 32px;
        border-bottom: 1px solid @IOS7_LIST_ITEM_BORDER;

        .dx-hairlines & {
            border-bottom-width: 0.5px;
        }
    }

    &.dx-list-static-delete-button-container { // stylelint-disable-line no-duplicate-selectors
        border-bottom: 1px solid @IOS7_LIST_ITEM_BORDER;

        .dx-hairlines & { // stylelint-disable-line no-duplicate-selectors
            border-bottom-width: 0.5px;
        }
    }

    .dx-list-reorder-handle {
        .dx-icon-dragvertical;
        .dx-icon-font-centered-sizing(25px);

        position: relative;
        width: 40px;
        height: 40px;
        color: @IOS7_LIST_ITEM_REORDER_HANDLE_COLOR;
    }
}

.dx-list-item-ghost-reordering {
    border-bottom: none;
    box-shadow: rgba(0, 0, 0, 0.5) 0 0 16px 0;
    opacity: 0.8;

    .dx-list & {
        background: none;
    }

    .dx-list-reorder-handle-container {
        border-bottom: none;
    }
}

.dx-list-reorder-handle-container:after {
    margin-top: 5px;
}

.dx-list-slide-menu-buttons {
    border-bottom: 1px solid @IOS7_LIST_ITEM_BORDER;

    .dx-hairlines & {
        border-bottom-width: 0.5px;
    }
}

.dx-list-slide-menu-button {
    bottom: 1px;
    color: white;
}

.dx-list-slide-menu-button-delete {
    background-color: @IOS7_LIST_ITEM_DELETE_BUTTON_BACKGROUND;
}

.dx-list-slide-menu-button-menu {
    background-color: @IOS7_LIST_ITEM_MENU_BUTTON_BACKGROUND;
}

.dx-list-switchable-delete-button-container {
    bottom: 1px;
    padding: 0 @IOS7_DELETE_BUTTON_HORIZONTAL_PADDING;
    background-color: @IOS7_LIST_BACKGROUND;
}

.dx-list-context-menucontent {
    box-shadow: @IOS7_HOLDMENU_SHADOW;
    border-radius: 0.5em;
    border: 1px solid @IOS7_HOLDMENU_BORDERCOLOR;
    background-color: @IOS7_HOLDMENU_BACKGROUND;

    .dx-hairlines & {
        border-width: 0.5px;
    }
}

.dx-state-disabled {
    &.dx-list-item,
    .dx-list-item {
        color: @IOS7_LIST_DISABLE;
    }
}

.dx-rtl .dx-list,
.dx-rtl.dx-list {
    .dx-list-item-before-bag {
        .dx-icon-toggle-delete {
            margin-right: @IOS7_LIST_ITEM_HORIZONTAL_PADDING;
            margin-left: @IOS7_LIST_ITEM_HORIZONTAL_PADDING / 2;
        }
    }

    .dx-list-select-checkbox {
        margin-right: @IOS7_LIST_ITEM_HORIZONTAL_PADDING;
        margin-left: 1px;
    }

    .dx-list-select-radiobutton {
        margin-right: @IOS7_LIST_ITEM_HORIZONTAL_PADDING / 3 * 2;
        margin-left: 1px;
    }

    .dx-list-select-all-checkbox {
        margin-right: @IOS7_LIST_ITEM_HORIZONTAL_PADDING;
        margin-left: 1px;
        float: right;
    }

    .dx-list-select-all:after {
        margin-left: 0;
        margin-right: 55px;
    }

    .dx-list-item-content:after {
        padding-right: @IOS7_LIST_ITEM_HORIZONTAL_PADDING;
        padding-left: 0;
    }
}
