@use '../Frontend/Parts/mixin';

@import url("./checkbox.min.css");
@import url("./card.min.css");

.gswpts_create_table_container {
    margin: 80px 0;

    .gswpts_table_loader {
        min-height: 450px;
        width: 100% !important;
    }

    table {
        th,
        td {
            border: 1px solid #76767647;
        }
        .expanded_style {
            max-width: unset !important;
            overflow-wrap: unset !important;
            white-space: nowrap !important;
            overflow-x: unset !important;
        }
        .wrap_style {
            max-width: 200px;
            overflow-wrap: break-word;
            white-space: normal;
            overflow-x: unset;
        }

        th:focus {
            outline: none;
        }

        th:focus {
            outline: none;
        }
    }

    #gswpts_tables_container .ui.stackable.grid {
        margin: 0;

        .row {
            width: 105% !important;
        }
    }

    #manage_tables_paginate > div {
        padding-top: 0 !important;
    }

    #spreadsheet_container .ui.stackable.grid {
        margin: 0;

        .row {
            width: 105% !important;
        }

        #create_tables th,
        #create_tables td {
            vertical-align: middle;
        }
    }

    #spreadsheet_container {
        #create_tables_wrapper {
            width: 100% !important;
        }

        #create_tables_paginate > div {
            padding-top: 0 !important;
        }

        .dt-buttons {
            display: flex;
            justify-content: flex-end;
            margin-top: 5px;

            button {
                font-size: 13px;
                margin: 0 5px;
            }
        }

        .filtering_input {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin: 15px 0 5px 0;

            #create_tables_length {
                margin-right: auto;
            }

            #create_tables_filter {
                margin-left: auto;
            }
        }

        .bottom_options {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-top: 10px;
            .dataTables_info {
                padding-top: 0 !important;
                margin-right: auto;
            }
            #create_tables_paginate {
                margin-left: auto;
                padding: 0 5px;
            }
            .pagination.menu {
                padding: 0 !important;
                font-size: 14px;
                background: transparent !important;
                display: flex;
                justify-content: center;
                align-items: center;
                flex-wrap: wrap;
                border: none;
                margin: 0 5px;

                & > * {
                    padding: 9px 16px;
                    border: 1px solid #a9a1a13d;
                    -webkit-box-shadow: 1px 1px 0px 0px rgba(145, 145, 145, 0.48);
                    box-shadow: 1px 1px 0px 0px rgba(145, 145, 145, 0.48);
                    &:first-child {
                        border-radius: 0.28571429rem 0px 0px 0.28571429rem;
                    }
                    &:last-child {
                        border-radius: 0px 0.28571429rem 0.28571429rem 0px 0px;
                    }
                    font-weight: bold;
                    color: rgba(56, 13, 13, 0.787);

                    &:hover {
                        background-color: rgba(0, 0, 0, 0.03);
                    }
                }
                a {
                    text-decoration: none;
                }
                .active {
                    background-color: #b3b3b35c;
                }
            }
        }
    }
}

.gswpts_create_table_container,
.gswpts_tables_container {
    @include mixin.datatable_semantic;
    @include mixin.loader_style;

    .gswpts_table_title {
        display: none;

        &.active {
            display: block;
        }
    }

    // Design the hidden popup
    .modal_wrapper {
        position: absolute;
        width: 100%;
        height: 100%;
        top: 0;
        left: 0;
        background: none;
        display: flex;
        justify-content: center;
        align-items: center;
        transition: 0.3s ease-in-out;
        z-index: 5;
        pointer-events: none;
        background: #0000004a;
        opacity: 0;
    }
    .modal_wrapper.active {
        pointer-events: all;
        opacity: 1;
    }
    .modal_container {
        background: white;
        border-radius: 8px;
        width: 90%;
    }
    .settings_container {
        width: 100%;
        z-index: 99;
        position: relative;
        .large_promo_close {
            position: absolute;
            right: 0px;
            top: -60px;
            cursor: pointer;
        }
    }

    .settings_container {
        /* colors */
        $link-color: #2ecc40;
        $blue: $link-color;
        $background-color: #fff;
        $red: #ff4a53;
        $dark: #333;
        $accent: $blue;
        $accent-inactive: desaturate($accent, 85%);
        $secondary: $accent-inactive;
        /* tab setting */
        $tab-count: 3;
        $indicator-width: 50px;
        $indicator-height: 4px;
        /* breakpoints */
        $breakpoints: (
            medium: #{$tab-count * 250px},
            small: #{$tab-count * 150px},
        );
        /* selectors relative to radio inputs */
        $label-selector: "~ ul > li";
        $slider-selector: "~ .slider";
        $content-selector: "~ .content > section";
        @mixin tabs($label-selector: $label-selector, $slider-selector: $slider-selector, $content-selector: $content-selector) {
            @for $i from 1 through $tab-count {
                &:nth-of-type(#{$i}):checked {
                    #{$label-selector}:nth-child(#{$i}) {
                        @content;
                    }
                    #{$slider-selector} {
                        transform: translateX(#{100% * ($i - 1)});
                    }
                    #{$content-selector}:nth-child(#{$i}) {
                        display: block;
                    }
                }
            }
        }
        .tabs {
            padding: 20px;
            width: 100%;
            background-color: #fff;
            border-radius: 5px;
            min-width: #{$tab-count * 60px};
            input[name="tab-control"] {
                display: none;
            }
            .content section h2,
            ul li label {
                font-weight: bold;
                font-size: 18px;
                color: $accent;
            }
            ul {
                list-style-type: none;
                padding-left: 0;
                display: flex;
                flex-direction: row;
                margin-bottom: 10px;
                justify-content: space-between;
                align-items: center;
                flex-wrap: wrap;
                li {
                    box-sizing: border-box;
                    flex: 1;
                    width: #{100% / $tab-count};
                    padding: 0 10px;
                    text-align: center;
                    label {
                        transition: all 0.3s ease-in-out;
                        color: $secondary;
                        padding: 5px auto;
                        overflow: hidden;
                        text-overflow: ellipsis;
                        display: block;
                        cursor: pointer;
                        transition: all 0.2s ease-in-out;
                        white-space: nowrap;
                        -webkit-touch-callout: none;
                        br {
                            display: none;
                        }
                        svg {
                            fill: $secondary;
                            height: 1.2em;
                            vertical-align: bottom;
                            margin-right: 0.2em;
                            transition: all 0.2s ease-in-out;
                        }
                        &:hover,
                        &:focus,
                        &:active {
                            outline: 0;
                            color: lighten($secondary, 15%);
                            svg {
                                fill: lighten($secondary, 15%);
                            }
                        }
                    }
                }
            }
            .slider {
                position: relative;
                width: #{100% / $tab-count};
                transition: all 0.33s cubic-bezier(0.38, 0.8, 0.32, 1.07);
                .indicator {
                    position: relative;
                    width: $indicator-width;
                    max-width: 100%;
                    margin: 0 auto;
                    height: $indicator-height;
                    background: $accent;
                    border-radius: 1px;
                }
            }
            .content {
                margin-top: 25px;
                section {
                    display: none;
                    animation: {
                        name: content;
                        direction: normal;
                        duration: 0.3s;
                        timing-function: ease-in-out;
                        iteration-count: 1;
                    }
                    line-height: 1.4;
                    h2 {
                        color: $accent;
                        display: none;
                        &::after {
                            content: "";
                            position: relative;
                            display: block;
                            width: 30px;
                            height: 3px;
                            background: $accent;
                            margin-top: 5px;
                            left: 1px;
                        }
                    }
                }
            }
            input[name="tab-control"] {
                @include tabs {
                    > label {
                        cursor: default;
                        color: $accent;
                        svg {
                            fill: $accent;
                        }
                        @media (max-width: map-get($breakpoints, small)) {
                            background: rgba(0, 0, 0, 0.08);
                        }
                    }
                }
            }
            @keyframes content {
                from {
                    opacity: 0;
                    transform: translateY(5%);
                }
                to {
                    opacity: 1;
                    transform: translateY(0%);
                }
            }
            @media (max-width: map-get($breakpoints, medium)) {
                ul li label {
                    white-space: initial;
                    br {
                        display: initial;
                    }
                    svg {
                        height: 1.5em;
                    }
                }
            }
            @media (max-width: map-get($breakpoints, small)) {
                ul li label {
                    padding: 5px;
                    border-radius: 5px;
                }
                ul {
                    flex-direction: column;
                    justify-content: center;
                    align-items: center;
                    li {
                        width: 90%;
                    }
                }
                .slider {
                    display: none;
                }
                .content {
                    margin-top: 20px;
                    section h2 {
                        display: block;
                    }
                }
            }
            .display_settings,
            .sort_filter,
            .table_tools {
                .feature-container {
                    display: grid;
                    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
                    grid-gap: 20px;

                    @media screen and (max-width: 512px) {
                        grid-template-columns: repeat(auto-fill, minmax(100%, 1fr));
                    }
                }
                .card {
                    position: relative;
                    width: 100%;
                    height: 60px;
                    display: flex;
                    justify-content: center;
                    align-items: center;
                }
                .content {
                    position: relative;
                    display: flex;
                    justify-content: center;
                    align-items: center;
                    margin: 0;
                    width: 100%;
                    .ui.dropdown {
                        width: 250px !important;
                        .ui.label {
                            background-color: $link-color;
                            color: #fff;
                        }
                    }
                    .pro_feature {
                        float: right;
                        margin-top: -10px;
                        font-size: 20px;
                        color: $link-color;
                    }
                    .selectbox_overlay {
                        position: absolute;
                        width: 90%;
                        margin: 0 auto;
                        height: 40px;
                        bottom: 15px;
                        z-index: 20;
                    }
                    .card-top-header {
                        text-transform: capitalize;
                        display: flex;
                        justify-content: space-between;
                        align-items: center;
                        width: 100%;

                        & > span {
                            font-size: 1.2rem;
                            font-weight: bolder;
                            margin-right: 5px;
                            display: flex;
                            justify-content: center;
                            align-items: center;

                            div {
                                background: none;
                                margin-left: 5px !important;
                            }
                        }
                        .input-tooltip {
                            position: relative;
                            margin-right: 10px;
                            svg {
                                cursor: pointer;
                            }
                            .tooltiptext {
                                opacity: 0;
                                pointer-events: none;
                                background-color: #000;
                                color: #fff;
                                text-align: center;
                                border-radius: 6px;
                                padding: 5px;
                                position: absolute;
                                z-index: 50;
                                top: 130%;
                                left: 0%;
                                transform: translateX(-30%);
                                min-height: 200px;
                                transition: opacity 500ms ease-in-out;
                                &::after {
                                    content: "";
                                    position: absolute;
                                    top: -15px;
                                    right: 65%;
                                    border-width: 8px;
                                    border-style: solid;
                                    border-color: transparent transparent #000 transparent;
                                }

                                span {
                                    display: block;
                                    margin-bottom: 8px;
                                    font-style: italic;
                                    padding: 2px;
                                }

                                img {
                                    max-width: 500px;
                                    min-width: 350px;
                                    width: 100%;
                                }
                                @media screen and (max-width: 600px) {
                                    left: -48px;
                                    top: 100%;
                                    margin-top: 15px;

                                    &::after {
                                        display: none;
                                    }
                                }
                            }
                            &:hover .tooltiptext {
                                opacity: 1;
                                pointer-events: all;
                            }
                        }
                    }
                    .tableStyle {
                        display: flex;
                        justify-content: center;
                        flex-wrap: wrap;
                        align-items: center;
                        .label {
                            margin-left: 20px;
                        }
                        .chooseStyle {
                            cursor: pointer;
                        }
                    }
                }

                .ui.toggle.checkbox {
                    display: flex;
                    justify-content: center;
                    flex-direction: column;
                    align-items: center;
                    margin-right: -10px;
                    input {
                        visibility: hidden;
                    }
                    label {
                        cursor: pointer;
                        margin: 0 !important;
                    }
                    input:checked ~ .box:before,
                    input:checked ~ label:before {
                        background-color: $link-color !important;
                    }
                }
                .pro_feature_promo {
                    position: absolute;
                    width: 0;
                    height: 0;
                    z-index: 20;
                    background: #0000007d;
                    overflow: hidden;
                    transition: all 0.1s ease-in-out;

                    a {
                        margin: 0;
                        position: absolute;
                        top: 65%;
                        left: 50%;
                        transform: translateX(-50%);
                    }
                    .promo_close_btn {
                        position: absolute;
                        top: 0;
                        left: 0;
                        margin-left: 8px;
                        margin: 8px 0 0 8px;
                        color: white;
                        font-size: 17px;
                        cursor: pointer;
                    }
                    strong {
                        position: absolute;
                        top: 45%;
                        left: 50%;
                        transform: translate(-50%, -50%);
                        white-space: nowrap;
                        color: white;
                        font-size: 15px;
                    }
                    &.active {
                        width: 100%;
                        height: 100%;
                    }
                }
            }
        }
        .disabled_checkbox *,
        .disabled_checkbox > label {
            visibility: hidden;
            pointer-events: all;
        }
    }
}
