/* Start table display styling */
/* START table games below */

table {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    border-collapse: separate; /* Ensure separate borders */
    border-spacing: 0; /* Set spacing between table cells */

    border-radius: var(--border-radius-big);
    border: none;
    color: var(--clr-white);

    background: var(--clr-green-1);

    --cell-font-size: 16px;
    --cell-padding: 1.5em 1em;
}
th, td {
    text-overflow: ellipsis;
    text-align: left;
    padding: 0.5em 1em;
    font-weight: 600;
    line-height: 1.3;
    font-size: var(--cell-font-size);
}
td:first-child,
th:first-child {
    border-left: 1px solid var(--clr-white);
}
td:last-child,
th:last-child {
    border-right: 1px solid var(--clr-white);
}
thead tr:first-child th {
    border-top: 1px solid var(--clr-white);
}
thead tr:first-child th:first-child {
    border-top-left-radius: var(--border-radius-small);
}
thead tr:first-child th:last-child {
    border-top-right-radius: var(--border-radius-small);
}
thead th {
    color: var(--clr-grey-1);
    border-bottom: 1px solid var(--clr-white);
}
thead th.is-sortable:hover {
    cursor: pointer;
    color: var(--clr-white);
}
thead th.active-sort {
    color: var(--clr-white);
}
thead th.active-sort > i {
    font-size: 0.8em;
    margin-left: .4em;
}
tbody tr:nth-of-type(odd) td {
    background: var(--clr-green-2);
}
tbody tr:nth-of-type(even) td {
    background: var(--clr-green-1);
}
tbody td.player-in-room {
    background: var(--clr-green-3);
}

table.no-footer-displayed tbody tr:last-child td {
    border-bottom: 1px solid var(--clr-white);
}
table.no-footer-displayed tbody tr:last-child td:first-child {
    border-bottom-left-radius: var(--border-radius-small);
}
table.no-footer-displayed tbody tr:last-child td:last-child {
    border-bottom-right-radius: var(--border-radius-small);
}

thead th.table-actions .fa-shuffle {
    font-size: 1em;
    margin-left: 0.65em;
}

tfoot td {
    border-top: 1px solid var(--clr-white);
}
tfoot tr:last-child td:first-child {
    border-bottom-left-radius: var(--border-radius-small);
}
tfoot tr:last-child td:last-child {
    border-bottom-right-radius: var(--border-radius-small);
}
tfoot tr:last-child td {
    border-bottom: 1px solid var(--clr-white);
}
tfoot .pagination-holder {
    display: flex;
    justify-content: center;
}
tfoot .pagination {
    display: flex;
    justify-content: center;
    gap: 3px;
    width: 41ch;
    max-width: 100%;
}
.pagination-holder {
    margin: 0 auto;
    text-align: center;
}
table:not(.games-table) .pagination-holder {
    display: table-cell;
}
table:not(.games-table) .pagination {
    text-align: left;
}
.pagination-data-wrapper {
    overflow-x: auto;
    position: relative;
}
.table-loading-wrapper {
    display: none;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}
.table-loading-wrapper {
    display: none;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 7px; /* account for padding on wrapper */
    left: 0;
    background: rgba(0,0,0,0.3);
    border-radius: var(--border-radius-small);
}
.table-loading-wrapper.show-loader {
    display: flex;
    justify-content: center;
    align-items: center;
}
.table-loading-wrapper.show-loader > i {
    font-size: 4em;
    font-weight: bold;
}

table tfoot > tr {
    /*display: flex;
    flex-wrap: nowrap;*/
}
table:not(.games-table) {
    --cell-font-size: 12px;
}
table:not(.games-table) th,
table:not(.games-table) td {
    max-width: 20ch;
    word-wrap: break-word;
}
table tr.red td {
    background: #8e4623;
}
table tr.gray td {
    background: #515151;
}
table tr.green td {
    /*background: var(--clr-green1);*/
}
table td .btn {
    min-width: max-content;
    font-size: 1em;
    padding: 0.1em 0.2em;
    margin-bottom: 0.1em;
    border-radius: var(--border-radius-tiny);
    line-height: 2em;
}
table td .btn:not(:last-child) {
    margin-right: 0.1em;
}

/* Regular table, but with bigger table/cell padding for more space */
table.bigger-padding {
    --cell-padding: 12px 12px;
}
table.bigger-padding thead th,
table.bigger-padding tbody td,
table.bigger-padding tfoot td {
    padding: var(--cell-padding);
}

/* Bigger font, from 12 -> 15 px) */
table.bigger-font {
    --cell-font-size: 15px;
}

/* .clean-table styling variant (for all sort of transactional logs etc.) */
table.clean-table {
    border-radius: var(--border-radius-small);
}
table.clean-table thead th,
table.clean-table tbody td,
table.clean-table tfoot td {
    padding: var(--cell-padding);
}
table.clean-table:not(.with-borders) thead th,
table.clean-table:not(.with-borders) tbody td,
table.clean-table:not(.with-borders) tfoot td {
    border: none;
    border-radius: 0;
}
table.clean-table.with-borders tbody td {
    border-top: none;
    border-bottom: none;
}
table.clean-table tbody td,
table.clean-table tfoot td {
    border-top: 1px solid var(--clr-white);
}
table.clean-table thead th {
    text-transform: uppercase;
    color: var(--clr-white);
}
table.clean-table tr th,
table.clean-table tr td {
    background: var(--clr-green-2);
}
table.clean-table tr th,
table.clean-table tr:nth-of-type(even) td {
    background: var(--clr-green-1);
}
table.clean-table .btn-pgn.active {
    background: var(--clr-green-1);
}
table.clean-table .btn-pgn:hover {
    background: var(--clr-green-1);
    filter: brightness(100%);
}
table.clean-table td .btn {
    padding: 0.1em 0.5em;
}

table a.highlighted-link {
    color: var(--clr-yellow);
}
/* TODO make it as dispaly flex, works better, but has edge cases, that need th & td ot have specific max widths set*/
/*table.clean-table tr {
    display: flex;
    flex-wrap: nowrap;
}
table.clean-table th,
table.clean-table td {
    flex-grow: 1;
    flex-basis: 0;
    display: flex;
    align-items: center;
    font-size: 14px;
}*/
table.clean-table th,
table.clean-table td {
    max-width: none;
}
table.clean-table.with-borders tbody td .small-date-text {
    font-size: 0.6em;
    line-height: 1;
}
table.clean-table .table-played {
    line-height: 1;
}
/* Table responsive handling BELOW */
@media (min-width: 1520px) {
}