:root {
    --bg-color: #f4f4f4;
    --text-color: #333333;
    --header-bg: #61879f;
    --header-text: white;
    --header-subtitle: #aac7d9;
    --table-border: #cfcfcf;
    --hover-bg: #548895;
    --hover-text: white;
    --lagging-bg: #fde2d9;
    --lagging-hover: #e4866a;
    --offline-bg: #ddd;
    --offline-hover: #7c7c7c;
    --search-close: #4a4a4a;
    --link: #23638b;
    --link-hover: white;
}

[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #b3b3b3;
    --header-bg: #2c2c2c;
    --header-text: #c4c4c4;
    --header-subtitle: #707070;
    --table-border: #404040;
    --hover-bg: #404040;
    --hover-text: #e0e0e0;
    --lagging-bg: #3d2f2f;
    --lagging-hover: #4d3939;
    --offline-bg: #2c2c2c;
    --offline-hover: #404040;
    --search-close: #aaaaaa;
    --link: #496b8a;
    --link-hover: #72b5eb;
}

body {
    font-family: monospace, sans-serif;
    background-color: var(--bg-color);
    margin: 0;
    padding: 20px;
    font-size: 0.8em;
    color: var(--text-color);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    color: var(--text-color);
}

table {
  /* border-collapse: separate; */
  /* overflow: hidden; */
}


tbody tr:first-child td:first-child,
thead tr:first-child th:first-child { border-top-left-radius: 2px; }
tbody tr:first-child td:last-child,
thead tr:first-child th:last-child { border-top-right-radius: 2px; }

tbody tr:last-child td:first-child { border-bottom-left-radius: 2px; }
tbody tr:last-child td:last-child { border-bottom-right-radius: 2px; }

th,
td {
    padding: 10px;
    text-align: left;
    white-space: nowrap;
}

th.right-align,
td.right-align {
    text-align: right;
}

th.center-align,
td.center-align {
    text-align: center;
}

th {
    background-color: var(--header-bg);
    color: var(--header-text);
    cursor: pointer;
}

tr:hover {
    background-color: var(--hover-bg);
    color: var(--hover-text);
}

tr:hover td a {
    color: var(--link-hover);
}

.sort-icon {
    font-size: 1em;
    float: right;
}

.sticky-header {
    position: sticky;
    z-index: 1000;
    top: 0;
}

.sticky-header-table {
    top: 65px;
}

.post-header-box {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 20px;
    margin-bottom: 20px;
}

.moderation-main .post-header-box {
    justify-content: flex-end;
}

.moderation-main .post-header-box .search-box {
    margin-right: 10px;
    width: 500px;
}

.search-filter-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-bottom: 5px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: baseline;
    width: 20em;
    margin-bottom: 5px;
}

.search-field {
    padding: 5px;
    border: 1px solid var(--table-border);
    width: 100%;
    background-color: var(--bg-color);
    color: var(--text-color);
}

.search-field:focus {
    outline: none;
}

.search-close {
    position: absolute;
    right: 2px;
    top: 5px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1em;
    color: var(--search-close);
}

.version-table {
    margin-top: 10px;
    border-collapse: collapse;
    width: auto;
}

.version-table td {
    padding: 2px 10px;
    font-size: 0.9em;
}

.version-table tr:first-child td,
.version-table tr:last-child td {
    background-color: var(--header-bg);
    color: var(--header-text);
    font-weight: bold;
}

.lagging {
    background-color: var(--lagging-bg);
}

.lagging:hover {
    background-color: var(--lagging-hover);
}

.offline {
    background-color: var(--offline-bg);
}

.offline:hover {
    background-color: var(--offline-hover);
}

.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--header-bg);
    color: var(--header-text);
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    opacity: 0.9;
}

.head-box {
    display: flex;
    margin-bottom: 0.5em;
    color: var(--header-text);
    background-color: var(--header-bg);
    border-radius: 2px;
    padding: 10px 10px;
}

.head-box-item {
    padding: 5px 10px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    border-radius: 2px;
    font-size: 2em;
}

.head-box-item a {
    margin: 0;
    /* text-align: center; */
    color: var(--header-text);
    text-decoration: none;
    /* display: flex; */
    /* height: 100%; */
    /* flex-direction: column; */
    /* font-size: 2em; */
}

.head-box-title a {
    font-weight: bold;
}

.head-box-subtitle a {
    font-weight: normal;
    color: var(--header-subtitle);
}

.pagination {
    margin-top: 25px;
    text-align: center;
}

.pagination button {
    min-width: 50px;
    min-height: 35px;
    margin: 0px 2px 0px 0px;
    padding: 3px 5px;
    background-color: var(--header-bg);
    color: var(--header-text);
    border: 1px solid var(--header-bg);
    cursor: pointer;
    border-radius: 3px;
    font-weight: bold;
}

.pagination select {
    height: 35px;
    padding: 0px 10px;
    background-color: var(--header-bg);
    color: var(--header-text);
    border: 1px solid var(--header-bg);
    border-radius: 3px;
    border-right: 12px solid transparent;
}

.moderators-cell {
    text-align: center;
    cursor: pointer;
}

.moderators-cell button {
    cursor: pointer;
    background: none;
    border: none;
    padding-left: 5px;
    vertical-align: text-bottom;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1000;
}

.modal-content {
    background-color: var(--bg-color);
    margin: 100px auto;
    padding: 20px;
    border: 1px solid var(--border-color);
    width: 80%;
    max-width: 600px;
    border-radius: 5px;
    max-height: 70vh;
    overflow: hidden;
}

.modal .close {
    float: right;
    cursor: pointer;
    font-size: 20px;
}

#moderatorsList {
    max-height: calc(70vh - 100px);
    overflow-y: auto;
}

.moderators-vote {
    text-align: center;
    font-size: 25px;
    padding: 0px;
}

.vote-green {
    color: green;
}

.vote-red {
    color: red;
}

.vote-gray {
    color: gray;
}


.spinner {
    display: flex;
    justify-content: center;
    padding: 20px;
}
.spinner-inner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--text-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.link {
    color: var(--link);
    text-decoration: none;
}

.link:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

.filter-box {
    display: flex;
}

.filter-box label {
    display: inline-block;
    padding: 6px 5px;
    text-align: center;
    width: 90px;
    background-color: var(--header-bg);
    color: var(--header-text);
    cursor: pointer;
}

.filter-box label.checked {
    background-color: var(--link);
    color: var(--header-text);
}

.filter-box label input {
    display: none;
}