@import "../../../../assets/scss/abstracts/variables";
@import "../../../../assets/scss/abstracts/mixins";

.rdg-blocks .rdg-leader-board {
    width: calc(var(--vw, 1vw) * 100);
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    max-width: 99.55vw;

    .container.content {
        width: 100%;
        display: flex;
        flex-direction: column;
        padding-left: 20px;
        padding-right: 20px;

        #wait {
            display: none;
            position: fixed;
            z-index: 1000;
            top: 0;
            left: 0;
            height: 100%;
            width: 100%;
            background: rgba(255, 255, 255, 0.8)
                url("../../assets/images/spinner.gif") 50% 50% no-repeat;
        }

        @include title;

        .table {
            border-radius: 1rem;
            background-color: var(--color-white);

            .table-menu {
                display: flex;

                .menu {
                    padding: 1rem;
                    width: 100%;
                    margin: 0;
                    display: flex;
                    justify-content: space-between;

                    li {
                        text-align: center;
                        width: 100%;
                        list-style: none;
                        font-weight: 600;

                        i {
                            font-size: 0.8rem;
                            font-weight: 600;
                            color: var(--color-primary-dark-light);
                        }

                        .unactive {
                            color: var(--color-black);
                        }
                    }
                }
            }

            .table-filter {
                padding: 0.8rem;
                background-color: var(--color-primary-dark-light);
                min-height: 3.5rem;

                .filter {
                    width: 100%;
                    margin: 0;
                    display: flex;
                    justify-content: space-between;
                    color: var(--color-white);

                    @media screen and (max-width: 48em) {
                        display: flex;
                        flex-direction: column;
                        flex-flow: row wrap;
                        gap: 10px;
                    }

                    .filter-option {
                        width: 100%;
                        display: flex;
                        align-items: center;
                        list-style: none;
                        font-weight: 600;

                        @media screen and (max-width: 48em) {
                            display: flex;
                            flex-direction: column;
                            width: 45%;
                            align-items: flex-start;
                            flex: auto;
                        }

                        span {
                            width: 45%;
                            text-align: right;
                            padding-right: 0.5rem;

                            @media screen and (max-width: 48em) {
                                width: 100%;
                                text-align: left;
                            }
                        }

                        span.init {
                            text-align: left;
                        }

                        select {
                            width: 55%;
                            margin-right: 0.5rem;

                            @media screen and (max-width: 48em) {
                                width: 100%;
                            }
                        }
                    }
                }
            }

            .list-items {
                @include message;

                .table-wrapper {
                    border: 2px solid #cadae5;
                    border-bottom: none;
                    // border-top-left-radius: 10px;
                    // border-top-right-radius: 10px;
                    margin: auto;
                    max-width: 100%;
                    overflow-x: auto;
                    scrollbar-color: #dedede;
                    scrollbar-width: thin;

                    @media screen and (min-width: 48em) {
                        border: 2px solid #cadae5;
                    }

                    .static-column {
                        box-shadow: 0 0 13px #262626;
                        -webkit-clip-path: inset(0 -15px 0 0);
                        clip-path: inset(0 -15px 0 0);
                        left: 0;
                        padding-right: 10px;
                        position: sticky;

                        @media screen and (min-width: 48em) {
                            box-shadow: none;
                            padding-right: 10px;
                        }
                    }
                }

                .table-wrapper::-webkit-scrollbar {
                    width: 5px;
                }

                .table-wrapper::-webkit-scrollbar-thumb {
                    background: #dedede;
                    border-radius: 10px;
                }

                .table-wrapper::-webkit-scrollbar-track {
                    border-radius: 10px;
                    box-shadow: inset 0 0 5px #dedede;
                }
            }
        }

        .sortable {
            border-spacing: 0;
            border: none;

            .list-pagination {
                td {
                    border-bottom: 0;

                    ul {
                        padding-top: 0;
                        margin-bottom: 0;
                    }

                    .pagination {
                        @media screen and (max-width: 48em) {
                            justify-content: flex-start;
                        }
                    }
                }
            }

            th {
                cursor: pointer;
                border: none;

                &.no-sort {
                    pointer-events: none;
                }

                &::after,
                &::before {
                    transition: color 0.1s ease-in-out;
                    font-size: 1.2em;
                    color: transparent;
                }

                &::after {
                    margin-left: 3px;
                    content: "▸";
                    color: var(--color-primary-dark-light);
                }

                &:hover::after {
                    color: var(--color-primary-dark);
                }

                &.dir-d::after {
                    color: var(--color-primary-dark-light);
                    content: "▾";
                }

                &.dir-u::after {
                    color: var(--color-primary-dark-light);
                    content: "▴";
                }

                &.indicator-left::after {
                    content: "";
                }

                &.indicator-left::before {
                    margin-right: 3px;
                    content: "▸";
                }

                &.indicator-left:hover::before {
                    color: inherit;
                }

                &.indicator-left.dir-d::before {
                    color: var(--color-primary-dark-light);
                    content: "▾";
                }

                &.indicator-left.dir-u::before {
                    color: var(--color-primary-dark-light);
                    content: "▴";
                }
            }

            th {
                background: rgb(248, 248, 248);
                color: var(--color-black);
                font-weight: 600;
                text-align: center;
                text-transform: capitalize;
                vertical-align: baseline;
                white-space: nowrap;
            }
            td {
                background: white;
            }

            td,
            th {
                padding: 0.8rem 0.3rem;
                border-left: none;
                border-right: none;
                border-top: none;
                text-align: center;
            }

            .w-1 {
                width: 7%;
            }

            .w-2 {
                width: 25%;
            }

            .w-3 {
                width: 10%;
            }

            td.name {
                color: var(--color-rdg-leader-board-name);
            }
        }
    }
}

.acf-block-preview {
    .rdg-leader-board {
        width: 100%;
        left: 0;
        right: 0;
        margin-left: 0;
        margin-right: 0;

        .table {
            .table-menu {
                a {
                    text-decoration: none;
                }
            }
        }
    }
}
