@use "variables" as *;

// DEPRECATED: This file is deprecated in favor of _table.scss.
// If a fix is needed in legacy tables, the update should happen here,
// but the potential fix also need to be implemented in _table.scss.

.p-datatable .p-paginator-top {
    border-width: 0 0 1px 0;
    border-radius: 0;
}

.p-datatable .p-paginator-bottom {
    border-width: 0 0 1px 0;
    border-radius: 0;
}

.p-datatable .p-datatable-header {
    background: $white;
    color: $black;
    border: 1px solid $color-palette-gray-300;
    border-width: 0 0 1px 0;
    padding: $spacing-2 $spacing-2;
    font-weight: $font-weight-semi-bold;
}

.p-datatable .p-datatable-footer {
    background: $white;
    color: $black;
    border: 1px solid $color-palette-gray-300;
    border-width: 0 0 1px 0;
    padding: $spacing-2 $spacing-2;
    font-weight: $font-weight-semi-bold;
}

.p-datatable .p-datatable-thead > tr > th {
    background: $white;
    border: 1px solid $color-palette-gray-300;
    border-width: 0 0 1px 0;
    color: $color-palette-gray-700;
    font-size: $font-size-sm;
    font-weight: $font-weight-semi-bold;
    padding: $spacing-2 $spacing-2;
    text-align: left;
    transition: none;
    text-wrap: nowrap;

    &:first-child {
        padding-left: $spacing-5;
    }

    &:last-child {
        padding-right: $spacing-5;
    }
}

.p-datatable .p-datatable-tfoot > tr > td {
    text-align: left;
    padding: $spacing-2 $spacing-2;
    border: 1px solid $color-palette-gray-300;
    border-width: 0 0 1px 0;
    font-weight: $font-weight-semi-bold;
    color: $black;
    background: $white;
}

.p-datatable .p-sortable-column {
    outline: 0 none;
}

.p-datatable .p-sortable-column .p-sortable-column-icon {
    display: inline-block;
    color: $color-palette-gray-700;
    margin-left: $spacing-1;
}

.p-datatable .p-sortable-column .p-sortable-column-badge {
    border-radius: 50%;
    height: 1.143rem;
    min-width: 1.143rem;
    line-height: 1.143rem;
    color: $color-palette-primary;
    background: $bg-highlight;
    margin-left: $spacing-1;
}

.p-datatable .p-sortable-column:not(.p-highlight):hover {
    color: $text-color-hover;
}

.p-datatable .p-sortable-column:not(.p-highlight):hover .p-sortable-column-icon {
    color: $black;
}

.p-datatable .p-sortable-column.p-highlight {
    background: $white;
    color: $black;
}

.p-datatable .p-sortable-column.p-highlight .p-sortable-column-icon {
    color: $black;
}

.p-datatable .p-datatable-tbody > tr {
    background: $white;
    color: $black;
    height: $field-height-md;
    transition: none;
    outline: 0 none;
    cursor: pointer;
    overflow-wrap: anywhere;
}

.p-datatable .p-datatable-tbody > tr > td {
    text-align: left;
    border: 1px solid $color-palette-gray-300;
    border-width: 0 0 1px 0;
    padding: 0.1875rem $spacing-2;

    &:first-child {
        padding-left: $spacing-5;
    }

    &:last-child {
        padding-right: $spacing-5;
    }
}

.p-datatable .p-datatable-tbody > tr > td .p-row-toggler,
.p-datatable .p-datatable-tbody > tr > td .p-row-editor-init,
.p-datatable .p-datatable-tbody > tr > td .p-row-editor-save,
.p-datatable .p-datatable-tbody > tr > td .p-row-editor-cancel {
    width: $spacing-5;
    height: $spacing-5;
    color: $black;
    border: 0 none;
    background: transparent;
    border-radius: 50%;
    transition:
        background-color 0.2s,
        color 0.2s,
        box-shadow 0.2s;
}

.p-datatable .p-datatable-tbody > tr > td .p-row-toggler:enabled:hover,
.p-datatable .p-datatable-tbody > tr > td .p-row-editor-init:enabled:hover,
.p-datatable .p-datatable-tbody > tr > td .p-row-editor-save:enabled:hover,
.p-datatable .p-datatable-tbody > tr > td .p-row-editor-cancel:enabled:hover {
    color: $text-color-hover;
    border-color: transparent;
    background: $color-palette-primary-100;
}

.p-datatable .p-datatable-tbody > tr > td .p-row-toggler:focus,
.p-datatable .p-datatable-tbody > tr > td .p-row-editor-init:focus,
.p-datatable .p-datatable-tbody > tr > td .p-row-editor-save:focus,
.p-datatable .p-datatable-tbody > tr > td .p-row-editor-cancel:focus {
    outline: 0 none;
    outline-offset: 0;
    box-shadow: none;
}

.p-datatable .p-datatable-tbody > tr > td .p-row-editor-save {
    margin-right: $spacing-1;
}

.p-datatable .p-datatable-tbody > tr.p-highlight {
    background: $bg-highlight;
    color: $text-color-highlight;
}

.p-datatable .p-datatable-tbody > tr.disabled-row {
    background: $color-palette-gray-200;
    color: $color-palette-gray-700;
    cursor: default;
}

.p-datatable .p-datatable-tbody > tr.p-datatable-dragpoint-top > td {
    box-shadow: inset 0 2px 0 0 $color-palette-primary-100;
}

.p-datatable .p-datatable-tbody > tr.p-datatable-dragpoint-bottom > td {
    box-shadow: inset 0 -2px 0 0 $color-palette-primary-100;
}

.p-datatable.p-datatable-hoverable-rows
    .p-datatable-tbody
    > tr:not(.p-highlight):not(.no-highlight):hover {
    background: $color-palette-primary-100;
    color: $text-color-hover;
    transition: background-color ease-in $basic-speed;
}

.p-datatable.p-datatable-hoverable-rows .p-datatable-tbody > tr.disabled-row:hover {
    background: $color-palette-gray-200;
    color: $color-palette-gray-700;
}

.p-datatable .p-column-resizer-helper {
    background: $color-palette-primary;
}

.p-datatable .p-datatable-scrollable-header,
.p-datatable .p-datatable-scrollable-footer {
    background: $white;
}

.p-datatable .p-datatable-loading-icon {
    width: $icon-xl;
    height: $icon-xl;
    color: $color-palette-secondary;
}

.p-datatable.p-datatable-gridlines .p-datatable-header {
    border-width: 1px 1px 0 1px;
}

.p-datatable.p-datatable-gridlines .p-datatable-footer {
    border-width: 0 1px 1px 1px;
}

.p-datatable.p-datatable-gridlines .p-paginator-top {
    border-width: 0 1px 0 1px;
}

.p-datatable.p-datatable-gridlines .p-paginator-bottom {
    border-width: 0 1px 1px 1px;
}

.p-datatable.p-datatable-gridlines .p-datatable-thead > tr > th {
    border-width: 1px 1px 1px 1px;
}

.p-datatable.p-datatable-gridlines .p-datatable-tbody > tr > td {
    border-width: 1px;
}

.p-datatable.p-datatable-gridlines .p-datatable-tfoot > tr > td {
    border-width: 1px;
}

.p-datatable.p-datatable-striped .p-datatable-tbody > tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.02);
}

.p-datatable.p-datatable-striped .p-datatable-tbody > tr:nth-child(even).p-highlight {
    background: $color-palette-primary-100;
    color: $text-color-highlight;
}

.p-datatable.p-datatable-striped
    .p-datatable-tbody
    > tr:nth-child(even).p-highlight
    .p-row-toggler {
    color: $text-color-highlight;
}

.p-datatable.p-datatable-striped
    .p-datatable-tbody
    > tr:nth-child(even).p-highlight
    .p-row-toggler:hover {
    color: $text-color-hover;
}

.p-datatable.p-datatable-sm .p-datatable-header {
    padding: 0.375rem 0.375rem;
}

.p-datatable.p-datatable-sm .p-datatable-thead > tr > th {
    padding: 0.375rem 0.375rem;
}

.p-datatable.p-datatable-sm .p-datatable-tbody > tr > td {
    padding: 0.375rem 0.375rem;
}

.p-datatable.p-datatable-sm .p-datatable-tfoot > tr > td {
    padding: 0.375rem 0.375rem;
}

.p-datatable.p-datatable-sm .p-datatable-footer {
    padding: 0.375rem 0.375rem;
}

.p-datatable.p-datatable-lg .p-datatable-header {
    padding: 0.9375rem 0.9375rem;
}

.p-datatable.p-datatable-lg .p-datatable-thead > tr > th {
    padding: 0.9375rem 0.9375rem;
}

.p-datatable.p-datatable-lg .p-datatable-tbody > tr > td {
    padding: 0.9375rem 0.9375rem;
}

.p-datatable.p-datatable-lg .p-datatable-tfoot > tr > td {
    padding: 0.9375rem 0.9375rem;
}

.p-datatable.p-datatable-lg .p-datatable-footer {
    padding: 0.9375rem 0.9375rem;
}

.p-datatable .p-sortable-column:focus {
    background-color: $color-palette-primary-100;
}

.p-datatable .p-datatable-tbody > tr:not(.p-highlight):focus {
    background-color: $color-palette-primary-100;
}
