/**=====================
    Select2 css start
==========================**/

.select2-container {
    .select2-dropdown {
        transition: none !important;

        .select2-results {
            .select2-results__options {
                .select2-results__option {
                    display: block;
                }
            }
        }
    }

    &.select2-container--disabled {
        .selection {
            .select2-selection {
                opacity: 0.6;
                background-color: rgba($dark-color, 0.15) !important;
            }
        }
    }
}

.select2-container--default {
    .select2-results__option[aria-selected=true] {
        background-color: rgba($dark-color, 0.08);
    }
}

.select2-container--open {

    .select2-dropdown--below,
    .select2-dropdown--above {
        border: 1px solid rgba($primary-color, 0.10);
        border-radius: $border-radius;
        box-shadow: 0 6px 10px 4px rgba($dark-color, 0.10);
        top: 0;
        left: 0;
        right: 0;
        z-index: 13;

        .select2-search--dropdown {
            padding: 6px;

            .select2-search__field {
                background-color: $transparent-color;
                border: 1px solid rgba($primary-color, 0.10);
                border-radius: 4px;
                padding: 9px 11px;
                font-size: 14px;
                font-weight: 400;
                color: $dark-color;

                .selected-item {
                    gap: 12px;
                }
            }
        }

        .select2-results {
            .select2-results__options {
                .select2-results__option {
                    font-size: calc(14px + (15 - 14) * ((100vw - 320px) / (1920 - 320)));
                    padding: calc(8px + (11 - 8) * ((100vw - 320px) / (1920 - 320))) calc(8px + (11 - 8) * ((100vw - 320px) / (1920 - 320))) calc(8px + (11 - 8) * ((100vw - 320px) / (1920 - 320))) calc(10px + (15 - 10) * ((100vw - 320px) / (1920 - 320)));
                    border-bottom: 1px solid rgba($primary-color, 0.10);
                    border-left: 3px solid transparent;
                    color: rgba($dark-color, 0.6);

                    &.select2-results__option--highlighted {
                        background-color: rgba($input-bg, 0.4);
                        color: $dark-color;
                        border-left: 3px solid var(--primary-color);
                    }

                    .flag-img {
                        width: 22px;
                    }

                    .selected-item {
                        gap: 12px;

                        .initial-letterP .detail {
                            &:has(p:empty) {
                                h6 {
                                    margin-bottom: 0;
                                }
                            }

                            h6 {
                                font-size: 15px;
                                color: #00162e;
                                line-height: 1.3;
                            }

                            p {
                                margin: 0;

                                &:empty {
                                    display: none;
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}

.phone-detail {
    >div {
        &.col-sm-11 {
            >.form-control {
                border-top-left-radius: 0;
                border-bottom-left-radius: 0;

                &.error {
                    @media (max-width: 420px) {
                        margin-left: unset;
                    }
                }
            }
        }
    }

    >.col-sm-3 {
        width: 25%;
    }

    >.col-sm-9 {
        width: 75%;
    }
}

.profile-detail {
    .phone-detail {
        .select2 {
            &.select2-container {
                .select2-selection {
                    &.select2-selection--single {
                        border-top-right-radius: 0;
                        border-bottom-right-radius: 0;
                        background-color: $input-grp-bg;

                        .select2-selection__rendered {
                            color: $dark-color;
                        }
                    }
                }
            }
        }

        .form-control {
            border-top-left-radius: 0;
            border-bottom-left-radius: 0;
        }
    }
}

.select2 {
    &.select2-container {
        width: 100% !important;
        height: 100%;

        .select2-selection {
            height: 100%;

            &.select2-selection--multiple,
            &.select2-selection--single {
                background-color: rgba($input-bg, 0.4);
                border: 1px solid $input-bg;
                border-radius: 6px;
                min-height: auto;
                height: 47px;
                position: relative;

                @media (max-width: 768px) {
                    height: 43px;
                }

                .select2-selection__rendered {
                    color: #7A8591;
                    display: flex;
                    align-items: center;
                    gap: 8px;
                    padding: 12px 16px;
                    flex-wrap: wrap;
                    font-size: calc(13px + (14 - 13)*((100vw - 320px) /(1920 - 320)));
                    line-height: 1.5 !important;
                    height: 100%;

                    @media (max-width: 767.98px) {
                        padding: 10px 12px !important;
                    }

                    .selected-item {
                        gap: 12px;

                        .detail {
                            h6 {
                                font-size: 14px;
                                color: var(--primary-color);
                                line-height: 1.3;
                            }

                            .small {
                                margin: 0;
                                font-weight: 400;
                                font-size: 14px;

                                &:empty {
                                    display: none;
                                }
                            }
                        }
                    }

                    .select2-selection__choice {
                        border: none;
                        background-color: transparent;
                        color: var(--primary-color);
                        border-radius: 5px;
                        font-size: 14px;
                        margin: 0;
                        margin-top: 0px;
                        line-height: 1;
                        padding: 6px 13px;
                        display: flex;
                        align-items: center;
                        gap: 5px;
                        font-weight: 500;
                        position: relative;
                        z-index: 0;

                        img {
                            width: 35px;
                            height: 35px;
                            object-fit: cover;
                        }

                        &::before {
                            @extend %bg-theme-color;
                            opacity: 0.1;
                        }

                        .select2-selection__choice__remove {
                            color: var(--primary-color);
                            border: none;
                            height: auto;
                            padding: 0;
                            margin: 0;
                            line-height: 1;
                            position: relative;
                            inset: unset;
                            font-size: 18px;
                            font-weight: 500;

                            &:hover {
                                background-color: $transparent-color;
                            }
                        }
                    }

                    .select2-search--inline {
                        .select2-search__field {
                            margin-top: 0;
                            height: unset;
                            margin-left: 0;
                            line-height: 1;
                            font-family: var(--font-family);
                            width: max-content !important;
                        }
                    }

                    .select2-selection__clear {
                        margin: 0;
                        right: 10px;
                        top: 8px;
                        font-size: 18px;
                        font-weight: 500;
                    }
                }

                .select2-selection__placeholder {
                    color: $tab-border;
                    font-size: 14px;
                }

                .select2-selection__arrow {
                    top: 50%;
                    transform: translateY(-50%);
                    height: 12px;
                    right: 17px;
                    width: 12px;

                    b {
                        border: 2px solid rgba($dark-color, 0.6);
                        width: 8px;
                        height: 8px;
                        transform: rotate(45deg) scale(-1);
                        border-bottom: 0;
                        border-right: 0;
                        margin-top: -6px;
                    }
                }
            }

            &.select2-selection--multiple {
                padding: 0 16px;
                height: auto;

                @media (max-width:768px) {
                    padding: 0 12px !important;
                }

                .select2-selection__rendered {
                    margin: 0 !important;
                    padding: 12px 0 !important;

                    @media (max-width:768px) {
                        padding: 9px 0 !important;
                    }
                }
            }

            &.select2-selection--single {
                .select2-selection__rendered {
                    color: $dark-color !important;
                    padding: 12px 16px;
                    line-height: 1.15 !important;
                }
            }
        }

        &.select2-container--open {
            .select2-selection--single {
                .select2-selection__arrow {
                    b {
                        transform: rotate(45deg);
                        margin-top: -4px;
                    }
                }
            }
        }
    }
}

.select-dropdown {
    .select2 {
        &.select2-container {
            .select2-selection {

                &.select2-selection--multiple,
                &.select2-selection--single {
                    height: 100%;
                }
            }
        }
    }
}

.service-user-dropdown {
    .select2.select2-container {
        .select2-selection {
            &.select2-selection--single {
                height: auto;
            }
        }
    }
}

.phone-detail {
    .select2-selection {
        &.select2-selection--single {
            background-color: $input-bg !important;
        }
    }
}

.select-2 {
    &.language {
        ~.select2 {
            &.select2-container {
                &.select2-container--default {
                    .select2-selection--multiple {
                        .select2-selection__rendered {
                            .select2-search--inline {
                                padding-left: 16px;
                            }
                        }
                    }
                }

                .select2-selection {
                    &.select2-selection--multiple {
                        .select2-selection__rendered {
                            padding-top: 13px;
                            padding-left: 0px;
                            margin-left: 16px;

                            .select2-search--inline {
                                padding-left: 0;
                            }
                        }
                    }
                }
            }
        }
    }
}

.phone-detail {
    .phone-fill-input {
        background-color: rgba(237, 239, 241, 0.4);
        border: 1px solid $input-bg;
        padding: 12px 16px;
        font-size: 14px;
        font-weight: 400;
        color: $dark-color;
        border-radius: 0 6px 6px 0;
        border-left: unset;
        font-family: var(--font-family);
        width: 100%;
    }
}