.table-menu {
    display: flex;
    flex-direction: row;
    gap: 1em;
    padding: 0.75em 2em;
    align-self: center;
    width: 100%;
    justify-content: space-between;
}

.table-menu .table-utilities {
    display: flex;
    flex-direction: row;
    gap: 1em;
}

/*.table-menu .searchbar-input {*/
/*    background-color: var(--deep-background-color);*/
/*}*/

.table-menu-wrapper {
    display: flex;
    flex-direction: column;
    /*border: 1px solid var(--light-gray, #c8ced7);*/
    background-color: var(--plain-white);
    border-radius: 1em;
    flex: 1;
}

table-container {
    display: flex;
    flex-direction: column;
    background-color: var(--blue-gray);
    border-radius: 1em;
    flex: 1;
    width: 100%;
    box-shadow: var(--soft-continer-outer-shadow);
    position: relative;
}
table-container sl-spinner {
    align-self: center;
    margin-top: 1rem;
}
data-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
}

.table-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
}

.table-container {
    display: flex;
    overflow-x: auto;
    padding-bottom: 1rem;
}

table {
    width: 100%;
    border-spacing: 0;
    font-size: var(--font-size-normal);
}

table td,
table th {
    height: 46.16px;
    padding: 1rem 1.5rem;
}

table th {
    text-align: left;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    color: var(--light-global-font-color)
}
table td[action-cell] {
    width: 1%;
    padding: 0 2rem 0 0;
    white-space: nowrap;
    font-size: 1.25rem;
}
table td[action-cell] > div {
    align-items: flex-end;
}
table td[action-cell] button {
    border: none;
    background-color: transparent;
    color: var(--black);
    aspect-ratio: 1;
    padding: 0;
}

table td[action-cell] span,
table td[action-cell] button{
    transition: transform 0.1s ease-out;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
    table td[action-cell] span:hover,
    table td[action-cell] button:hover {
        transform: scale(1.2);
    }
    table td[action-cell] span:active,
    table td[action-cell] button:active {
        transform: scale(0.9);
    }
table th[action-header] {
    text-align: right;
    padding-right: 2rem;
}
table th > button {
    background: transparent;
    border: none;
    padding: 0;
    transition: transform 0.1s ease-out;
}
table th > button:hover {
    transform: scale(1.2);
}
table th[top-left-cell] {
    border-top-left-radius: 1rem;
}

table th[top-right-cell] {
    border-top-right-radius: 1rem;
}
table th > button:active {
    transform: scale(0.9);
}

table thead tr {
    cursor: pointer;
    /*background-color: var(--light-gray);*/
}

table thead tr th {
    font-weight: 600;
    cursor: pointer !important;
    user-select: none; /* So that the text is not selectable when clicked to sort. */
}
table thead tr th[static],
table[static-table] thead tr th{
    cursor: default !important;
}

table:not([static-table]) tr th:not([static]){
    transition: 0.1s ease-out;
}
table:not([static-table]) tr th:not([static]):hover {
    background-color: var(--hover-gray);
}

table thead tr th svg {
    vertical-align: middle;
    width: 1.1rem;
    height: 1.1rem;
    margin-left: 0.5rem;
    color: var(--black);
}

table thead tr th[action-header] svg {
    width: 1.4rem;
    height: 1.4rem;
}

table-container table tbody tr:not(:last-child) td {
    border-bottom: 1px solid var(--soft-border-color);
}

table tbody tr[simple-row] td {
    padding: 1rem 1.5rem;
}

table tbody tr[parent-row] td {
    padding-bottom: 0.25rem;
}
table tbody tr[child-row] td {
    padding: 0.25rem 1.5rem;
}
table tbody tr[last-child] td {
    padding-bottom: 1rem !important;
}
table tbody tr[parent-row]:not(:first-child) td,
table tbody tr[simple-row]:not(:first-child) td {
    border-top: 1px solid var(--soft-border-color);
}
table:not([static-table]) tbody tr {
    cursor: default;
    transition: 0.1s ease-out;
}
/* Target all table rows on hover when the table is not a static table and when 
a child td with an action-cell attribute does not have a hover effect applied as well. */
table:not([static-table]) tbody tr:not([static-row]):not([role="presentation"]):hover:not(:has(td[action-cell]:hover)) {
    background-color: var(--hover-gray);
}

table:not([static-table]) tbody tr:not([static-row]):active:not(:has(td[action-cell]:active)) {
    background-color: var(--background-white);
}

.table-footer {
    display: flex;
    flex-direction: row;
    padding: 1rem 2rem;
    justify-content: flex-end;
    font-size: var(--font-size-normal);
    align-items: center;
    width: 100%;
}

.table-footer .results-status {
    margin-right: auto;
}

.table-pages {
    display: flex;
    flex-direction: row;
    /*gap: 0.5em;*/
}

.table-pages span {
    width: 2em;
    height: 2em;
    padding: 0.25em;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease-in-out;
    user-select: none;
}

.table-pages .current-page {
    background-color: var(--primary-green);
    color: var(--plain-white);
}

.current-page {
    border: 1px solid var(--primary-green);
}

.inactive-pagination {
    background-color: var(--blue-gray);
}
.inactive-pagination:not(:last-child) {
    border-right: 1px solid #4e535e;
}
.inactive-pagination svg {
    color: var(--gray);
    width: 1em;
    height: 1em;
}

.inactive-pagination:hover {
    background-color: var(--hover-gray);
}

/**
 * Styles for the first and last child span elements of a table pagination component.
 * The first child span element has a border radius on the top left and bottom left corners, and no right border.
 * The last child span element has a border radius on the bottom right and top right corners, and no left border.
 * This is to give the pagination component a rounded appearance while maintaining a border around the entire component.
 */
.table-pages span:first-child {
    border-top-left-radius: 0.3rem;
    border-bottom-left-radius: 0.3rem;
}

.table-pages span:last-child {
    border-bottom-right-radius: 0.3rem;
    border-top-right-radius: 0.3rem;
    border-left: none;
}

/* This class makes a td element take up only as much space as it needs */
td.fit-width {
    width: 1px;
    white-space: nowrap;
}

#table-settings-popup {
    --arrow-color: var(--border-color);
}
#table-settings-popup options-popup{
    display: none;
    width: fit-content;
    height: fit-content;
    padding: 0.5em 0.75em;
    border-radius: 0.5em;
    background-color: var(--background-white);
    box-shadow: var(--continer-outer-shadow);
    gap: 0.75em;
    border: 1px solid var(--border-color);
}
#table-settings-popup[active] options-popup {
    display: flex;
}

#table-settings-popup options-popup span[icon] {
    align-items: center;
    display: flex;
}
/*Has attribute icon and aria-disabled="true"*/
#table-settings-popup options-popup span[icon][aria-disabled="true"] {
    cursor: not-allowed;
    opacity: 0.5;
    pointer-events: none;
}

#table-settings-popup options-popup span[icon] svg {
    font-size: 2rem;
    color: var(--global-font-color);
    cursor: pointer;
}

#table-settings-popup options-popup span[icon] svg:hover {
    transition: scale 0.15s ease-in-out;
    scale: 1.1;
}

#table-settings-popup options-popup span[icon] svg:active {
    transition: scale 0.05s ease-in-out;
    scale: 0.9;
}