//
// Component: Tab
//
// ========================================================================


// Variables
// ========================================================================

//
// New
//

@tab-border-width:                              0;
@tab-border:                                    @global-border;

@tab-item-border-width:                         0;
@tab-item-font-size:                            @global-font-size;
@tab-item-text-transform:                       none;

@tab-margin-horizontal:                         5px;

@tab-item-active-border:                        @global-primary-background;
@tab-item-padding-horizontal:                   12px;
@tab-item-padding-vertical:                     7px;
@tab-item-color:                                @global-inverse-color;
@tab-item-hover-color:                          @global-color;
@tab-item-active-color:                         @global-emphasis-color;
@tab-item-disabled-color:                       @global-muted-color;

@tab-item-hover-background:                     #f5f5f5;
@tab-item-active-background:                    white;
@tab-item-background:                           @global-header-background;


// Component
// ========================================================================

.hook-tab() {

    background-color: @tab-item-background;
    position: relative;
    margin-left: 0;
    -webkit-box-shadow: inset 0px -1px 1px 0px rgba(0, 0, 0, 0.3);
    -moz-box-shadow: inset 0px -1px 1px 0px rgba(0, 0, 0, 0.3);
    box-shadow: inset 0px -1px 1px 0px rgba(0, 0, 0, 0.3);

    &::before {
        content: "";
        position: absolute;
        bottom: 0;
        left: @tab-margin-horizontal;
        right: 0;
        border-bottom: @tab-border-width solid @tab-border;
    }

}


// Items
// ========================================================================

.hook-tab-item() {
    border-bottom: @tab-item-border-width solid transparent;
    font-size: @tab-item-font-size;
    text-transform: @tab-item-text-transform;
    -webkit-transition: color 0.1s ease-in-out;
    transition: color 0.1s ease-in-out;
}

.hook-tab-item-hover() {
    background-color: @tab-item-hover-background;
}

.hook-tab-item-active() {
    background-color: @tab-item-active-background;
}

.hook-tab-item-disabled() {}


// Position modifiers
// ========================================================================

.hook-tab-bottom() {

    &::before {
        top: 0;
        bottom: auto;
    }

}

.hook-tab-bottom-item() {
    border-top: @tab-item-border-width solid transparent;
    border-bottom: none;
}

.hook-tab-left() {

    &::before {
        top: 0;
        bottom: 0;
        left: auto;
        right: 0;
        border-left: @tab-border-width solid @tab-border;
        border-bottom: none;
    }

}

.hook-tab-left-item() {
    border-right: @tab-item-border-width solid transparent;
    border-bottom: none;
}

.hook-tab-right() {

    &::before {
        top: 0;
        bottom: 0;
        left: 0;
        right: auto;
        border-left: @tab-border-width solid @tab-border;
        border-bottom: none;
    }

}

.hook-tab-right-item() {
    border-left: @tab-item-border-width solid transparent;
    border-bottom: none;
}


// Miscellaneous
// ========================================================================

.hook-tab-misc() {

    .uk-tab .uk-dropdown { margin-left: (@tab-margin-horizontal + @tab-item-padding-horizontal) }

    .uk-tab > *:first-of-type {
        padding-left: 0;
    }
}


// Inverse
// ========================================================================

@inverse-tab-border:                        @inverse-global-border;

.hook-inverse-tab() {

    &::before { border-color: @inverse-tab-border; }

}

.hook-inverse-tab-item() {}
.hook-inverse-tab-item-hover() {}
.hook-inverse-tab-item-active() { border-color: @inverse-global-primary-background; }
.hook-inverse-tab-item-disabled() {}
