//Table basic shared vars

$column-width: 300px;
$column-flex: 1;
$column-shrink: 0;
$column-margin: 0 5px 0 0;
$column-padding: .5rem 1rem;

@mixin fold {
    .card {
        align-self: flex-start;
        margin-top: .5rem;
        tg-card-slideshow,
        .card-unfold,
        .card-tag,
        .card-title,
        .card-owner-actions,
        .card-data,
        .card-statistics,
        .card-owner-name {
            display: none;
        }
        .card-owner {
            img {
                height: 1.3rem;
                margin-right: 0;
                width: 1.3rem;
            }
        }
    }
    &.task-column,
    .task-column {
        align-content: flex-start;
        display: flex;
        flex-direction: column;
        flex-flow: row wrap;
    }
    .avatar-task-link {
        display: block;
    }
    .avatar-assigned-to {
        display: none;
    }
}

.taskboard-table {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    width: 100%;
    &.zoom-0 {
        .task-colum-name span {
            padding-right: 1rem;
        }
    }
}

.taskboard-table-header {
    flex-basis: 2.4rem;
    flex-grow: 0;
    flex-shrink: 0;
    min-height: 2.4rem;
    position: relative;
    width: 100%;
    .taskboard-table-inner {
        display: flex;
        overflow: hidden;
        position: absolute;
    }
    .task-colum-name {
        @include font-size(medium);
        align-items: center;
        background: $mass-white;
        border-top: 3px solid $gray-light;
        color: $gray;
        display: flex;
        flex-basis: $column-width;
        flex-grow: $column-flex;
        flex-shrink: $column-shrink;
        justify-content: space-between;
        margin: $column-margin;
        max-width: $column-width;
        padding: $column-padding;
        position: relative;
        text-transform: uppercase;
        width: $column-width;
        &:last-child {
            margin-right: 0;
        }
        &.column-fold {
            align-items: center;
            justify-content: center;
            padding: .3rem 0;
            span {
                display: none;
            }
            .hfold,
            .hunfold {
                margin: 0;
            }
        }
        span {
            @include ellipsis(65%);
        }
    }
    tg-svg {
        display: block;
        margin-right: .3rem;
        &:hover {
            cursor: pointer;
        }
        &.hfold,
        &.hunfold {
            display: inline-block;
            transform: rotate(90deg);
        }
    }
}

.taskboard-table-body {
    flex: 1;
    margin-bottom: 5rem;
    overflow: auto;
    width: 100%;
    .task-column {
        flex-basis: $column-width;
        flex-grow: $column-flex;
        flex-shrink: $column-shrink;
        margin: $column-margin;
        max-width: $column-width;
        width: $column-width;
        &:last-child {
            margin-right: 0;
        }
    }
    .row-fold {
        @include fold;
    }
    .column-fold {
        @include fold;
    }
    .task-row {
        display: flex;
        margin-bottom: .25rem;
        min-height: 10rem;
        width: 100%;
        &.blocked {
            .taskboard-userstory-box {
                background: rgba($red, .6);

            }
            .taskboard-userstory-box svg,
            .taskboard-userstory-box svg:hover,
            .points-value,
            .points-value:hover {
                color: $white;
                fill: $white;
                transition: color .3s linear;
            }
            .taskboard-tasks-box {
                background: rgba($red, .1);
            }
        }
        &.row-fold {
            min-height: 0;
            .us-title {
                @include ellipsis(100%);
            }
            .points-value,
            .icon-add,
            .icon-bulk {
                display: none;
            }
        }
    }
    .taskboard-userstory-box {
        padding: .5rem .5rem .5rem 1.5rem;
    }

}

.taskboard-userstory-box {
    position: relative;
    .us-title {
        @include font-size(normal);
        @include font-type(text);
        margin-bottom: 0;
        margin-right: 3rem;
    }
    .points-value {
        @include font-size(small);
        color: $gray-light;
        span {
            margin-right: .1rem;
        }
    }
    tg-svg {
        cursor: pointer;
        display: block;
        position: absolute;
        right: .5rem;
        top: .7rem;
        &:hover {
            svg {
                fill: $primary;
            }
        }
        &.add-action {
            right: 2rem;
        }
        &.fold-action {
            left: 0;
            right: inherit;
            top: 1rem;
        }
    }
}
