@use '../abstracts/cds-vars' as vars;
@use '../abstracts/cds-mixins' as mixins;

table.cds-table {
    border-collapse: collapse;
    display: inline-table;
    width: 100%;

    &--alternate {
        tbody tr:nth-child(even) {
            background-color: var(--cds-color-background-soft);
            &:hover {
                background-color: var(--cds-color-background-soft--hover);
            }
        }
    }
}

table.cds-table thead tr {
    @include mixins.cds-paragraph-m(bold);
    color: var(--cds-color-text-default);
    border-bottom: 2px solid var(--cds-color-border-default);
    text-align: left;

}

/*table.cds-table thead th [class^="cds-ico-"],
table.cds-table thead th [class*=" cds-ico-"] {
    opacity: 0;
    position: absolute;
    display: inline-block;
}

table.cds-table thead th:hover.is-sortable {
    cursor: pointer;

    & [class^="cds-ico-"],
    [class*=" cds-ico-"] {
        opacity: 1;
    }
}*/


table.cds-table th,
table.cds-table td {
    padding: vars.$cds-spacing-50;
    height: 3rem;
}

table.cds-table tbody tr {
    border-top: 1px solid var(--cds-color-border-default);

    &:hover {
        background-color: var(--cds-color-background-default--hover);
    }

    &:disabled,
    &.is-disabled {
        @include mixins.cds-disabled;
    }

    &.is-selected {
        background-color: var(--cds-color-accent-primary-main);
        color: var(--cds-color-text-inverse);
        border-color: var(--cds-color-text-inverse);

        &:hover {
            background-color: var(--cds-color-accent-primary-main--hover);
        }
    }

    &.is-loading {
        color: var(--cds-color-text-muted);
        background: linear-gradient(to right, var(--cds-color-background-deep), var(--cds-color-background-default), var(--cds-color-background-deep));
        //background: repeating-linear-gradient(45deg, var(--cds-color-background-deep), var(--cds-color-background-deep) 10px, var(--cds-color-background-soft) 10px, var(--cds-color-background-soft) 20px);
        background-size: 200% 100%;
        animation: moveGradient 1s linear infinite;
    }
}

table.cds-table tbody tr:first-of-type {
    border: 0;
}

table.cds-table tfoot tr {
    border-top: 1px solid var(--cds-color-accent-primary-main);
    color: var(--cds-color-accent-primary-main);
}