/* Tabs General
----------------------------------------------------------------------- */
.tr-tab-section {
    width: 100%;
    display: none;
}

.tr-tab-section.active {
    display: block;
}

.tr-tabbed-sections {
    &.ui-tabs {
        padding: 0;
    }

    .tr-tabs li.hide {
        display: none;
    }

    .ui-tabs-hide {
        display: none !important;
    }

    .ui-widget-header {
        border: none;
    }
}

.tr-tabs {
    .tab-icon-i {
        height: auto;
        width: auto;
        font-size: inherit;
    }
}

/* Tabs Top
----------------------------------------------------------------------- */
.tr-tabbed-top {
    .tr-tabs {
        padding: 0 12px;
        margin: 0;
        overflow: hidden;
        zoom: 1;
        line-height: 1em;
        width: 100%;
        display: flex;
        box-sizing: border-box;
        box-shadow: inset 0 -1px 0 0 $gray_border;
        background: rgba(222, 222, 222, 0.49);
    }

    .tr-tabs > li {
        margin: 0 12px 0 0;
        font-weight: normal;
        font-size: 13px;
        line-height: 1em;
        position: relative;
        list-style: none;
        box-shadow: none;

        &.active a {
            color: #191e23;
            border-bottom-color: #444;
        }

        a {
            font-weight: bold;
            display: block;
            padding: 15px 9px 12px;
            text-decoration: none;
            color: #555;
            border-bottom: 4px solid transparent;
            box-shadow: none;

            em {
                color: #666;
                font-weight: normal;
                font-size: 11px;
                display: block;
                margin-top: 2px;
            }

            &:active, &:hover, &:focus {
                border-bottom-color: #00a0d2 !important;
                border-bottom-color: var(--tr-profile-color) !important;
                outline: none;
                box-shadow: none;
            }
        }
    }

    &.tr-tabs-layout-top-enclosed {
        background: #fff;
        border: 1px solid $gray_border;
        margin-top: 10px;

        > .tr-tabbed-sections {
            .tr-tabs {
                margin-bottom: 10px;

                .tr-tab-link {
                    font-size: 16px;

                    em {
                        font-size: 12px;
                        margin-top: 5px;
                    }
                }

                .tab-icon {
                    vertical-align: text-top;
                    display: inline-block;
                    margin-right: 3px;
                    color: #00a0d2;
                    color: var(--tr-profile-color);
                }
            }
        }
    }
}

/* Tabs Box
----------------------------------------------------------------------- */
.tr-tabbed-box {
    display: block;
    margin: 20px 0 -1px 0;
    position: relative;

    &.has-header {
        .tr-tab-layout-tabs {
            margin-top: 50px;
        }
    }

    label {
        line-height: inherit;
    }

    .tr-fieldset-group, .tr-table-container {
        padding: 20px;
        margin: 0;
        box-sizing: border-box;
    }

    .tr-tab-layout-tabs .active,
    .tr-tab-layout-tabs .active a,
    .tr-tab-layout-tabs .active a:hover {
        background: #fefefe;
        outline: none;
        box-shadow: none;
    }

    .tr-tab-layout-content {
        > .tr-control-section > .tr-control-row {
            padding-left: 20px;
            padding-right: 20px;
        }
    }

    .tr-tab-layout-tabs {
        margin: 0;
        position: relative;

        ul {
            margin: 1em 0;
        }

        li {
            list-style-type: none;
            border-style: solid;
            margin: 0 -1px 0 0;
            border-width: 0 0 0 3px;
            border-color: transparent;
            border-top: 1px solid $gray_border;
            border-bottom: 1px solid transparent;
            transition: all 0.2s;
            box-shadow: none;

            &:first-child {
                border-top: 1px solid transparent;
            }
        }

        .tab-text {
            max-width: 170px;
            min-width: 70px;
            box-sizing: border-box;
            padding-right: 10px;
        }

        .has-description {
            a {
                text-transform: uppercase;
            }
        }

        a {
            padding: 10px 10px 10px 12px;
            box-shadow: none;
            line-height: 18px;
            color: #00a0d2;
            color: var(--tr-profile-color);
            font-weight: bold;
            font-size: 13px;
            letter-spacing: 1px;
            text-decoration: none;
            border-right: none;
            border-left: none;
            display: flex;

            .tab-text {
                flex: 1;
            }
        }

        .tr-tab-link {
            > .tab-icon {
                width: 30px;
                text-align: center;
                color: #b4becb;
                display: flex;
                justify-items: center;
                align-items: center;
                font-size: 21px;

                > i {
                    flex: 1;
                }
            }

            em {
                letter-spacing: normal;
                display: block;
                font-weight: normal;
                font-style: normal;
                font-size: 12px;
                margin-top: 2px;
                color: #666;
                text-transform: none;
            }
        }

        li:focus-within.active {
            .tab-text {
                color: var(--tr-profile-color, #00a0d2);
            }
        }

        li:hover, li:active, li:focus-within,
        .active {
            padding: 0;
            border-left: 3px solid #00a0d2;
            border-left: 3px solid var(--tr-profile-color, #00a0d2);
            transition: all 0.2s;

            &:first-child {
                border-top: 1px solid $gray_border;
            }

            &:last-child {
                border-bottom: 1px solid $gray_border;
            }

            .tr-tab-link {
                border-color: $gray_border;
                color: #32373c;

                > .tab-icon {
                    color: var(--tr-profile-color, #00a0d2);
                }
            }
        }

        li.active {
            background: #fff;
        }
    }

    &.tr-tabs-layout-left-enclosed .tr-tab-layout-wrap {
        background: #fff;
        box-shadow: inset 0 0 0 1px $gray_border;
    }

    .tr-tab-layout-tabs-wrap {
        padding: 0;
        border: 1px solid $gray_border;
        background: #fefefe;
        flex: 1;
        overflow: visible;
        display: flex;
        flex-flow: column;
        min-width: 0;

        > .tr-tab-layout-content {
            flex: 1;
            box-sizing: border-box;
        }
    }

    .tr-tab-layout-sidebar {
        width: 150px;
        order: 2;
        padding: 0 8px 20px 12px;
    }

    @media screen and (max-width: 600px) {
        .tr-tab-layout-tabs {
            width: auto;
        }

        .tab-text {
            @include visually-hidden;
        }
    }

}

.tr-tab-layout-columns {
    position: relative;
    display: flex;
    align-items: stretch;
    flex-direction: row;
}

#post-body-content #screen-meta.tr-tabbed-box {
    margin: 0 0 20px 4px;
    -webkit-box-shadow: none;
    -moz-box-shadow: none;
    box-shadow: none;
}

.tr-builder-inputs > .tr-tabbed-box,
.tr-repeater-inputs > .tr-tabbed-box {
    margin: -1px 0;
}

#wpwrap .postbox {
    .tr-tabbed-box {
        display: block;
        margin: 0;

        .tr-tab-layout-tabs-wrap {
            border-color: transparent;
            border-left-color: $gray_border;
        }

        .tr-tab-layout-content {
            padding: 0;
        }
    }
}

/*
Fieldset
----------------------------------------------------------------------- */
.tr-repeater-inputs .tr-fieldset-group,
.tr-fieldset-group {
    padding: 10px 12px;

    .tr-fieldset-group-title {
        font-size: 21px;
        font-weight: 400;
        margin: 0 0 5px;
    }

    .tr-fieldset-group-description {
        margin: 0 0 10px;
    }

    .tr-fieldset-group-content {
        background: #f5f5f5;
        border: 1px solid $gray_border;
        border-radius: 3px;
        min-width: 0;
    }
}

.postbox, .tr-repeater-inputs {
    .tr-fieldset-group .tr-fieldset-group-title {
        font-size: 14px;
        line-height: 1.4;
        font-weight: bold;
    }
}

/*
Tab Extras
----------------------------------------------------------------------- */
.tr-tabbed-footer {
    background: #f5f5f5;
    border: 1px solid $gray_border;
    padding: 10px;
    position: relative;
    margin: 0 -1px -1px;
}

.tr-tabbed-header {
    padding: 10px;
    background: #f5f5f5;

    .tr-headline {
        margin: 10px;
    }
}