body {
    /* background-color: #000d1a; */
    color: #aeb4c7;
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 25px 10px;
    /* background: linear-gradient(180deg, #001428 0%, #000a14 100%) fixed; */
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000;
    box-sizing: border-box;
    filter: brightness(1.3) !important;
}

h1 {
    color: #c0c8df;
    font-size: 28px;
    margin-bottom: 30px;
    text-transform: uppercase;
    text-shadow: 0 0 15px rgba(160, 168, 191, 0.4);
    letter-spacing: 2px;
    text-align: left;
    font-weight: 600;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: linear-gradient(180deg, #0a1a2a 0%, #061525 100%);
    border-radius: 10px;
    box-shadow: 
        0 0 20px rgba(0, 128, 255, 0.1),
        0 0 40px rgba(0, 0, 0, 0.5);
    position: relative;
    border: 1px solid rgba(160, 168, 191, 0.1);
    transform: translateZ(0);
    will-change: transform;
    table-layout: fixed;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    overflow: hidden;
}

th {
    background: linear-gradient(180deg, #1a2a3a 0%, #152535 100%);
    color: #c0c8df;
    padding: 15px 20px;
    text-align: left;
    font-weight: 500;
    border-bottom: 1px solid #1a3040;
    letter-spacing: 1px;
    font-size: 14px;
    text-shadow: 0 0 10px rgba(160, 168, 191, 0.2);
    transition: all 0.2s ease;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

td {
    padding: 12px 20px;
    border-bottom: 1px solid rgba(26, 48, 64, 0.5);
    font-size: 14px;
    transition: background-color 0.2s ease, color 0.2s ease;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

tr {
    transition: background 0.2s ease-in-out, transform 0.1s ease-in-out;
}

tr:hover {
    background: linear-gradient(180deg, #1a2a3a 0%, #152535 100%) !important;
    text-shadow: 0 0 10px rgba(160, 168, 191, 0.3);
    transform: translateX(2px);
}

thead tr:hover {
    transform: none;
}

/* Style for the player count column */
td:nth-child(8) {
    color: #80c0ff;
    text-shadow: 0 0 10px rgba(128, 192, 255, 0.3);
}

/* Style for empty slots (0 players) */
td:nth-child(8)[data-players^="0/"] {
    color: #8090a5;
    text-shadow: none;
}

/* Alternating row colors with improved contrast */
tr:nth-child(even) {
    background: linear-gradient(180deg, #0c1c2c 0%, #081627 100%);
}

tr:nth-child(odd) {
    background: linear-gradient(180deg, #0a1a2a 0%, #061525 100%);
}

/* Header row styling with improved visibility */
thead tr {
    height: 45px;
    background: linear-gradient(180deg, #1a2a3a 0%, #152535 100%);
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Hide the XUID column */
td:first-child, th:first-child {
    display: none;
}

/* Add some spacing between columns */
th, td {
    padding-right: 25px;
}

/* Make the table headers clickable */
th {
    cursor: pointer;
    user-select: none;
    position: relative;
}

th:after {
    content: '';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid rgba(160, 168, 191, 0.3);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

th:hover {
    background: linear-gradient(180deg, #1f3045, #1a2a3a);
}

th:hover:after {
    opacity: 1;
    border-top-color: rgba(160, 168, 191, 0.5);
}

/* Add subtle separator between columns */
td:not(:last-child), 
th:not(:last-child) {
    border-right: 1px solid rgba(26, 48, 64, 0.2);
}

/* Improved active server highlighting with better color */
td:nth-child(8):not([data-players^="0/"]) {
    color: #80c0ff;
    text-shadow: 0 0 10px rgba(128, 192, 255, 0.3);
    position: relative;
    font-weight: 500;
}

/* Refined pulse animation for servers with players */
@keyframes pulse {
    0% { text-shadow: 0 0 10px rgba(128, 192, 255, 0.3); }
    50% { text-shadow: 0 0 15px rgba(128, 192, 255, 0.5); }
    100% { text-shadow: 0 0 10px rgba(128, 192, 255, 0.3); }
}

td:nth-child(8)[data-players^="0/"] {
    color: #8090a5;
    text-shadow: none;
    transition: color 0.3s ease;
}

td:nth-child(8):not([data-players^="0/"]) {
    animation: pulse 2.5s infinite;
}

/* Optimize scrolling performance */
@media screen and (min-width: 768px) {
    .table-container {
        overflow: auto;
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
}

/* Prevent white flash during loading */
html {
    background: #000d1a;
}

/* Add focus styles for accessibility */
th:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 128, 255, 0.3);
}

/* Add box-sizing to all elements */
*, *:before, *:after {
    box-sizing: inherit;
}

/* Column widths */
th, td {
    padding: 12px 15px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Adjust column widths */
th:nth-child(2), td:nth-child(2) { /* Server Type */
    width: 4%;
}
th:nth-child(3), td:nth-child(3) { /* Server Name */
    width: 20%;
}

th:nth-child(4), td:nth-child(4) { /* Map */
    width: 15%;
}

th:nth-child(5), td:nth-child(5) { /* Download */
    width: 4%;
}

th:nth-child(6), td:nth-child(6) { /* Gametype */
    width: 15%;
}

th:nth-child(7), td:nth-child(7) { /* Variant */
    width: 15%;
}

th:nth-child(8), td:nth-child(8) { /* Players */
    width: 10%;
}

td:nth-child(8) { /* Players */
    text-overflow: clip;
}

th:last-child, td:last-child { /* Description */
    width: 17%;
}

/* Responsive adjustments */
@media screen and (max-width: 1024px) {
    th, td {
        padding: 12px 10px;
    }
    
    .table-container:before,
    .table-container:after {
        display: none;
    }
}

@media screen and (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    h1 {
        font-size: 24px;
        margin-bottom: 20px;
    }
}

/* Add subtle border radius to table */
table {
    border-radius: 10px;
    overflow: hidden;
}

/* Improved table container with subtle shadow */
.table-container {
    position: relative;
    margin: 20px auto;
    padding-top: 10px;
    transform: translateZ(0);
    will-change: transform;
    width: 95%;
    max-width: 1400px;
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
}

/* Column specific styles */
td:nth-child(3) { /* Server Name */
    font-weight: 500;
    color: #8090a5;
    transition: none;
}

.server-name-column {
    color: #aeb4c7 !important;
    font-weight: 500;
    transition: none;
}

td:nth-child(4), /* Map */
td:nth-child(6), /* Gametype */
td:nth-child(7) { /* Variant */
    color: #8090a5;
}

/* Description column */
td:last-child {
    color: #708090;
    font-style: italic;
}

/* Add subtle transition to all elements */
* {
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

/* Improve scrollbar appearance */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #0a1a2a;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: #1a2a3a;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2a3a4a;
}

/* Header container for title, logo, and search */
.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    position: relative;
    padding: 0 10px;
    width: 95%;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

/* Title styling - moved to left */
h1 {
    color: #c0c8df;
    font-size: 28px;
    text-transform: uppercase;
    text-shadow: 0 0 15px rgba(160, 168, 191, 0.4);
    letter-spacing: 2px;
    font-weight: 600;
    margin: 0;
    text-align: left;
    flex: 1;
}

/* Logo styling - centered and clickable */
.logo-container {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo-container a {
    display: inline-block;
    transition: transform 0.2s ease;
}

.logo-container a:hover {
    transform: scale(1.05);
}

.logo {
    height: auto;
    max-height: 60px;
    width: auto;
    filter: drop-shadow(0 0 10px rgba(128, 192, 255, 0.4));
}

/* Search container styling - right aligned */
.search-container {
    position: relative;
    flex: 1;
    max-width: 250px;
    display: flex;
    justify-content: flex-end;
}

.search-input {
    background: linear-gradient(180deg, #0a1a2a 0%, #061525 100%) !important;
    border: 1px solid rgba(160, 168, 191, 0.2) !important;
    border-radius: 8px;
    color: #c0c8df;
    padding: 8px 35px 8px 40px;
    width: 100%;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

.search-input:focus {
    outline: none;
    border-color: rgba(128, 192, 255, 0.5);
    box-shadow: 0 0 15px rgba(0, 128, 255, 0.2);
}

.search-input::placeholder {
    color: #505865;
}

.search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #505865;
    pointer-events: none;
}

.search-input:focus + .search-icon {
    color: #80c0ff;
}

/* Hide rows that don't match search */
tr.hidden {
    display: none;
}

/* Responsive adjustments for header */
@media screen and (max-width: 900px) {
    .header-container {
        flex-wrap: wrap;
        gap: 15px;
    }
    
    h1 {
        font-size: 22px;
        flex-basis: 100%;
        text-align: center;
        order: 1;
    }
    
    .logo-container {
        position: relative;
        left: 0;
        transform: none;
        flex-basis: 100%;
        order: 2;
    }
    
    .search-container {
        flex-basis: 100%;
        max-width: 100%;
        order: 3;
    }
}

.clear-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #c0c8df;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.clear-icon:hover {
    color: #80c0ff;
}

@media screen and (max-width: 750px) {
    .description-column {
        display: none !important;
    }
}

@media screen and (max-width: 500px) {
    .gametype-column {
        display: none !important;
    }
}

/* Stats container styling */
.stats-container {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 10px 20px;
    background: linear-gradient(180deg, #0a1a2a 0%, #061525 100%);
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(160, 168, 191, 0.1);
    width: 95%;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

.stat-item {
    display: flex;
    align-items: center;
    padding: 5px 15px;
}

/* Position the middle stat to align with the logo */
.stat-item:nth-child(2) {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

/* Adjust the container to account for the absolute positioning */
.stats-container {
    position: relative;
}

/* Keep the first and last items at the edges */
.stat-item:first-child {
    margin-right: auto;
}

.stat-item:last-child {
    margin-left: auto;
}

.stat-label {
    color: #8090a5;
    margin-right: 8px;
    font-size: 14px;
    font-weight: 500;
}

.stat-value {
    color: #80c0ff;
    font-weight: normal;
    text-shadow: 0 0 10px rgba(128, 192, 255, 0.3);
    font-size: 14px;
}

/* Responsive adjustments for stats container */
@media screen and (max-width: 768px) {
    .stats-container {
        flex-direction: column;
        align-items: center;
        gap: 5px;
        padding: 15px 10px;
    }
    
    .stat-item {
        padding: 3px 10px;
    }
    
    .stat-item:nth-child(2) {
        position: static;
        transform: none;
        margin: 5px 0;
    }
    
    .stat-item:first-child,
    .stat-item:last-child {
        margin: 0;
    }
}

/* Download icon styling */
.download-icon {
    height: 20px;
    width: auto;
    vertical-align: middle;
    transition: filter 0.2s ease;
}

.download-column {
    width: 4;
    text-align: center;
}

/* Media query for smaller screens */
@media screen and (max-width: 600px) {
    .download-column {
        display: none !important;
    }
}

/* Remove dropdown arrow from download column header */
th.download-column:after {
    display: none;
}

/* Center the download icon in the header */
th.download-column {
    text-align: center;
    padding-right: 15px; /* Reduce right padding since we don't have the arrow */
}

/* Make sure the download icon is properly centered in both header and cells */
th.download-column img,
td.download-column img {
    display: inline-block;
    margin: 0 auto;
}

/* Download column specific styling */
th.download-column, td.download-column {
    width: 4%;
    text-align: center;
    padding-left: 0;
    padding-right: 0;
    white-space: nowrap;
    overflow: visible; /* Prevent ellipsis */
    text-overflow: clip; /* Prevent ellipsis */
}

/* Make sure the download icon is properly centered and maintains its size */
th.download-column img,
td.download-column img {
    display: inline-block;
    height: 20px; /* Fixed height */
    width: auto;
    margin: 0 auto;
    vertical-align: middle;
    min-width: 20px; /* Ensure minimum width */
}

/* Remove dropdown arrow from download column header */
th.download-column:after {
    display: none;
}

/* Ensure the column doesn't shrink too much */
th:nth-child(5), td:nth-child(5) { /* Download */
    width: 4%;
    min-width: 30px; /* Minimum width to display the icon properly */
}

/* Server type icon styling */
.server-type-icon {
    height: 20px;
    width: auto;
    vertical-align: middle;
    transition: filter 0.2s ease;
}

.server-type-column {
    width: 4%;
    text-align: center;
}

/* Media query for smaller screens */
@media screen and (max-width: 600px) {
    .server-type-column {
        display: none !important;
    }
}

/* Remove dropdown arrow from server type column header */
th.server-type-column:after {
    display: none;
}

/* Center the server type icon in the header */
th.server-type-column {
    text-align: center;
    padding-right: 15px; /* Reduce right padding since we don't have the arrow */
}

/* Make sure the server type icon is properly centered in both header and cells */
th.server-type-column img,
td.server-type-column img {
    display: inline-block;
    margin: 0 auto;
}

/* Server type column specific styling */
th.server-type-column, td.server-type-column {
    width: 4%;
    text-align: center;
    padding-left: 0;
    padding-right: 0;
    white-space: nowrap;
    overflow: visible; /* Prevent ellipsis */
    text-overflow: clip; /* Prevent ellipsis */
}

/* Make sure the server type icon is properly centered and maintains its size */
th.server-type-column img,
td.server-type-column img {
    display: inline-block;
    height: 20px; /* Fixed height */
    width: auto;
    margin: 0 auto;
    vertical-align: middle;
    min-width: 20px; /* Ensure minimum width */
}

/* Ensure the column doesn't shrink too much */
th:nth-child(2), td:nth-child(2) { /* Server Type */
    width: 4%;
    min-width: 30px; /* Minimum width to display the icon properly */
}
