@import "../imports/aui-colours";
@import "../imports/mixins/border-box";

// Functional style
.tabwrap.tabs2 {
    font-size: 14px;
    line-height: (20 / 14);
    /* JIRA's tabwrap expects that the active panel's state and styles to be managed by something else. */
}

// Common styles
.tabwrap > ul.tabs > li {
    a,
    a:link,
    a:visited {
        background: var(--ds-surface-sunken, #eee);
        color: var(--ds-link-visited, #333);
    }

    a:focus,
    a:hover {
        background: var(--ds-background-discovery-hovered, #e6e6e6);
        color: var(--ds-link-pressed, #333);
    }

    > a strong {
        background: transparent;
        font-weight: normal;
        text-overflow: ellipsis;
        white-space: nowrap;
        cursor: pointer; /* set explicitly to avoid ie bug */
    }

    &.active-tab {
        a,
        a:link,
        a:visited,
        a:focus,
        a:hover,
        a:active {
            background: var(--ds-surface, #fff);
            color: var(--ds-link-pressed, #333);
        }

        a,
        strong {
            font-weight: bold;
        }
    }
}

.tabwrap > ul.tabs#filter_type_table > li {
    a,
    a:link,
    a:visited {
        color: var(--ds-text, #333);
    }
}

// Horizontal Tabs
.tabwrap > .tabs.horizontal {
    .border-box();
    border-bottom: 1px solid var(--ds-border, #ccc);
    display: inline-block;
    margin: 0;
    padding: 0 0 0 20px;
    width: 100%;

    > li {
        display: block;
        float: left;
        margin: 5px 0 0 -1px;
        background: var(--ds-surface, #eee);
        > a,
        > strong {
            display: block;
            border: 1px solid var(--ds-border, #ccc);
            margin-bottom: -1px;
            padding: 4px 10px 3px;
        }

        a,
        strong {
            text-decoration: none;
        }

        &.active {
            > a,
            > strong {
                background: var(--ds-surface-pressed, #fff);
                border-bottom-color: var(--ds-surface-pressed, #fff);
                position: relative;
            }
        }
        &:first-child {
            > a,
            > strong {
                border-radius: 3px 0 0;
            }
        }
        /* last-child ok because IE8 doesn't do border radius anyway */
        &:last-child {
            > a,
            > strong {
                border-radius: 0 3px 0 0;
            }
        }
    }
}

/* An extension for bulk operations */
.aui-tabs .menu-item.has-errors {
    border-color: var(--ds-border-danger, @aui-color-status-error-border-subtle);
    background-color: var(--ds-surface, @aui-color-status-error-background-subtle);

    a {
        color: var(--ds-text-danger, @aui-color-status-error-foreground-subtle);
        font-weight: bold;
    }
}
