@import "../../../style/variables.less";

.cityFieldSpace() {

    @cmName: ~"@{prefix}-city-field";

    .city-names {
        display: flex;
        flex-wrap: wrap;
        min-height: 18px;

        .fm-huaban1 {
            color: #e1e1e1;
            font-size: 14px;
            margin-left: 4px;
            margin-right: 16px;
            cursor: pointer;
        }
    }

    .@{cmName}-wrapper{
        position: relative;
        .anticon{
            width: 16px;
            height: 16px;
            display: flex;
            justify-content: center;
            align-items: center;
            color: #fff;
            border-radius: 50%;
            font-size: 10px;
            background: @maycur-color;
            opacity: 0;
            position: absolute;
            top: 50%;
            right: 0;
            margin-top: -8px;
            cursor: pointer;
        }
        &:hover{
            .anticon{
                opacity: 1;
            }
        }
    }    

    .@{cmName}-display-value.@{cmName}-cell {
        padding: 4px 11px;
        border: 1px solid @form-field-border;
        line-height: unset;
    }

    .@{cmName}-list {
        list-style: none;
        padding: 0;
        margin: 0;
        // padding-left: 15px;

        &-wrap {
            flex: 1;
            overflow-y: auto;
        }

        &-item {
            box-sizing: border-box;
            display: flex;
            justify-content: space-between;
            padding: 11px 15px 11px 15px;
            border-bottom: 1px solid #eee;
            cursor: pointer;

            &:hover {
                background: #f7f7f7;
            }

            &_desc {
                opacity: 0.45;
            }

            .fm-checking {
                margin-right: 5px;
                color: @maycur-color;
                font-size: 14px;
            }
        }

        &-empty-text {
            width: 100%;
            display: flex;
            justify-content: center;
            align-items: center;
            color: @form-input-placeholder;
            min-height: 100px;
            height: 100%;
        }

        &-display-value-clone {
            height: auto;
            padding: 4px 0;
            line-height: 18px;
            border-bottom: 1px solid #eee;
            margin: 5px 10px;
        }
    }

    .has-err .@{cmName}-display-value {
        border-color: @alert-color;
    }

    .@{cmName}-display-value {
        min-height: @fieldHeight;
        position: relative;
        height: auto;
        padding: 0 0;
        line-height: @fieldHeight;
        background-color: #fff;
        border-bottom: 1px solid @form-field-border;
        cursor: pointer;

        &:hover {
            border-color: @maycur-color;
        }

        .placeholder {
            color: @form-input-placeholder;
        }

        .ant-select-arrow {
            transition: transform .3s;

            &.up {

                transform: rotate(180deg);
            }

            &.down {
                transform: rotate(-180deg);
            }
        }

        &.readonly {
            border-bottom: 1px dashed @border-color;
            cursor: not-allowed;

            &:hover {
                border-bottom-color: @border-color;
            }

            .ant-select-arrow {
                display: none;
            }
        }
    }

    .@{cmName} {
        @height: 27px;
        @color: #e6f7ff;
        position: relative;
        min-width: 400px;

        .dropdown {
            position: absolute;
            top: @height;
            width: 100%;
            max-height: 400px;
            min-height: 200px;
            min-width: 200px;
            overflow: auto;
            z-index: 1;
            box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
            background-color: #fff;
            border-radius: 4px;
            z-index: 99;

            &.in {
                display: flex;
                flex-direction: column;

                &.up {
                    bottom: 0;
                    top: unset;
                    // flex-direction: column-reverse;

                    // .@{cmName}-list-display-value-clone {
                    //     border-top: 1px solid @form-field-border;
                    //     border-bottom: none;
                    // }
                }
            }

            .search {
                flex-shrink: 0;
                padding: 10px 15px 5px;
                background-color: #fff;

                input {
                    background-color: #f7f7f7;
                    padding: 5px !important;
                    border: none;
                }
            }

            .search-pane {
                .ant-list {
                    .ant-list-item-meta {
                        &:hover {
                            background-color: @color;
                        }
                    }

                    .ant-list-item-meta-content {
                        margin-left: 15px;
                        padding: 3px 0;
                        border-bottom: 1px solid #e1e1e1;

                        .ant-list-item-meta-title {
                            margin-bottom: 0;
                            color: #333;
                        }

                        .ant-list-item-meta-description {
                            font-size: 12px;
                        }
                    }
                }
            }

            .hot-city-pane,
            .nav {
                width: 100%;
                padding: 0 15px;
                background: #fff;
            }

            .hot-city-pane {
                .sub-title {
                    line-height: 26px;
                    font-size: 12px;
                    color: #959595;
                }

                .hot-city-list {
                    line-height: 33px;

                    .ant-btn {
                        height: 24px;
                        padding: 0 7px;
                        line-height: 24px;
                        border-radius: 2px;
                        font-size: 12px;
                        color: #555;
                        border-color: #e1e1e1;
                        margin-right: 8px;
                    }
                }
            }

            .nav {
                display: flex;
                flex-wrap: wrap;
                line-height: 40px;

                .ant-radio-group {
                    margin-right: 10px;

                    .ant-radio-button-wrapper {
                        height: 24px;
                        line-height: 24px;
                        padding: 0 10px;
                        font-size: 12px;

                        &:first-child {
                            border-radius: 2px 0 0 2px;
                        }

                        &:last-child {
                            border-radius: 0 2px 2px 0;
                        }
                    }
                }

                .crumb {
                    .crumb-item {
                        display: inline-block;
                        position: relative;
                        line-height: 27px;
                        font-size: 14px;
                        padding: 0 14px 0 12px;
                        color: @maycur-color;
                        cursor: pointer;

                        &:first-child {
                            padding-left: 0;
                        }

                        &:after {
                            content: '/';
                            position: absolute;
                            right: 0;
                            font-size: 14px;
                            line-height: 27px;
                            color: #e1e1e1;
                        }

                        &:last-child {
                            color: #757575;

                            &:after {
                                content: none;
                            }
                        }
                    }
                }
            }

            .ant-list-item {
                padding: 0;
                border: none;
                cursor: pointer;

                &:hover {
                    background-color: @color;
                }

                .ant-list-item-extra-wrap,
                .ant-list-item-no-flex {
                    width: 100%;
                    display: flex;
                    justify-content: space-between;
                    margin-left: 15px;
                    padding: 11px 15px 11px 0;
                    border-bottom: 1px solid #eee;

                    .ant-list-item-extra {
                        .fm {
                            font-size: 12px;
                        }
                    }
                }
            }

            .action-bar {
                display: flex;
                width: 100%;
                padding: 12px 16px;
                flex: none;
                justify-content: flex-end;
            }
        }
    }

    .has-error {
        .city-picker {
            .display-value {
                border-bottom-color: @icon-fee-red;
            }
        }
    }
}

.cityFieldSpace();

:global {
    .fm-revised {
        position: absolute;
        font-size: 32px;
        color: #FF7100;
        opacity: 0.4;
        right: 48px;
        bottom: 0;
        transform: rotate(-15deg);
    }
}