@use "../utils/variables";

/**=====================
      Dropdown CSS Start
==========================**/

.dropdown {
    .dropdown-menu {
        top: 0 !important;
        margin: 0;
        padding: 0;
        width: max-content !important;
        min-width: 13rem;
        left: 0;
        z-index: 2;
        border: 1px solid transparent;
        border-radius: variables.$border-radius;
        box-shadow: 0 6px 10px 4px rgba(variables.$dark-color, 0.10);
        position: relative;
        z-index: 0;
        overflow: hidden;

        &::before {
            content: "";
            position: absolute;
            top: 0;
            border-radius: variables.$border-radius;
            left: 0;
            width: 100%;
            height: 100%;
            border: 1px solid var(--primary-color);
            opacity: 0.1;
        }

        .form-check-label {
            margin-bottom: 0;
            font-size: 14px;
        }

        .form-check {
            margin-bottom: 4px;
        }

        li {
            .dropdown-item {
                line-height: 1;
                font-size: 14.5px;
                font-weight: 500;
                padding: 9px;
                border-bottom: 1px solid rgba(variables.$primary-color, 0.1);
                color: rgba(variables.$dark-color2, 0.9);

                &:hover {
                    background: unset;
                }
            }
        }

        &.show {
            display: flex;
            flex-direction: column;
        }

        &.p-right {
            right: 0 !important;
            left: unset !important;
        }
    }

    &.tag-dropdown {
        .dropdown-toggle {
            border: none;
            padding: 0;
            box-shadow: none;
            width: 100%;

            &::after {
                display: none;
            }
        }

        .dropdown-menu {
            width: 100% !important;
            height: max-content;

            li {
                .dropdown-item {
                    label {
                        display: flex;
                        align-items: center;
                        gap: 8px;
                        margin: 0;

                        .form-check {
                            padding-left: 4px;
                            min-height: auto;

                            .form-check-input {
                                margin-right: 0;
                            }
                        }
                    }

                    &:hover {
                        label {
                            color: var(--primary-color) !important;
                        }
                    }
                }
            }
        }
    }

    .dropdown-toggle {
        background-repeat: no-repeat;
        background-position: right 0.75rem center;
        background-size: 16px 16px;
        padding-right: 35px;

        &:after {
            display: none;
        }
    }
}

.btn-group {
    .dropdown-menu {
        top: 55px;
        margin: 0;
        padding: 10px;
        width: max-content !important;
        min-width: 13rem;

        #table-filter-status-wrapper,
        #coupons-filter-status-wrapper {
            padding: 0 !important;

            label {
                font-size: 14px;
                font-weight: 500;
            }

            .form-select {
                width: 100%;

                option:hover {
                    background-color: yellow;
                }
            }
        }

        button {
            &.dropdown-item {
                font-size: 14px;
                font-weight: 500;
                background-color: var(--primary-color);
                border-radius: variables.$border-radius;
                padding: 12px;
                color: variables.$white;
                margin-top: 10px;

                &:hover {
                    color: var(--primary-color) !important;
                    background-color: rgba(variables.$primary-color, 0.10);
                }
            }
        }

        .dropdown-divider {
            display: none;
        }
    }
}

.dropdown-item {
    position: relative;
    z-index: 0;
    overflow: hidden;

    &::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        transition: 0.5s ease;
        height: 100%;
        background-color: var(--primary-color);
        opacity: 0;
    }

    &:hover {
        color: var(--primary-color) !important;
        background-color: transparent;

        &::before {
            opacity: 0.1;
        }
    }
}

.chart-dropdown {
    .dropdown-toggle {
        border: 1px solid #eee;
        margin-left: auto;
        font-size: 15px !important;
        background-color: #eeeeee26;

        &::before {
            content: "\ea4e";
            font-family: remixicon;
            font-style: normal;
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            right: 10px;
            line-height: 1;
            font-size: 20px;
        }
    }
}

.user-dropdown {
    ~.select2 {
        .select2-selection--multiple {
            .select2-selection__rendered {
                li {
                    padding: 0 10px;
                }
            }
        }

        .select2-selection {
            .select2-selection__choice {
                padding: 11px 13px !important;
                background-color: #ffffff !important;
                border: 1px solid #eeeeee !important;

                .select2-selection__choice__remove {
                    position: absolute;
                    top: 2px !important;
                    right: 5px;
                    color: #777 !important;
                    left: unset !important;
                    line-height: 1;
                    margin: 0;
                }
            }
        }
    }
}

/**=====================
      Dropdown CSS End
==========================**/