/* General Styles */
body {
    font-family: 'Play', Arial, sans-serif;
    margin: 0;
    padding: 0;
}

/* Leaderboard General Styles */
.main-content {
    display: grid;
    justify-items: center;
    font-family: 'Play', Arial, sans-serif;
    background-size: cover;
    background-position: center;
    margin: 0;
    padding: 0;
}

.leaderboard-container {
    width: 80%;
    margin: 0 auto;
    padding: 20px;
    background-color: #293045;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

/* Add margin below the leaderboard dropdown */
.leaderboard-select {
    margin-bottom: 20px; /* Adds 20px spacing below */
}

/* Scrollable leaderboard container */
.leaderboard-wrapper {
    width: 100%;
    overflow-x: auto; /* Enables horizontal scrolling */
    overflow-y: scroll;
    display: block;
    position: relative;
    border-radius: 5px;
    white-space: nowrap; /* Prevents columns from breaking onto new lines */
    height: 67vh;
}

.leaderboard-wrapper a {
    text-decoration: none;
    color: inherit;
}

.leaderboard-wrapper a:hover { 
    text-decoration: none;
    color: red; 
}

/* Ensure the table fits within the scrollable area */
.leaderboard-table {
    width: max-content; /* Prevents the table from shrinking too much */
    min-width: 100%;
    border-collapse: collapse;
    background-color: rgba(0, 0, 0, 0.5); /* Black with 50% transparency */
    border-radius: 5px;
}

.leaderboard-table th, .leaderboard-table td {
    padding: 10px;
    font-size: 14px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-right: 2px solid #6C00FF; /* Neon purple border */
    box-shadow: 0 0 8px rgba(108, 0, 255, 0.5); /* Softer glow */
}

.leaderboard-table th {
    background-color: rgba(108, 0, 255, 0.1);
    color: #FFFFFF;
    font-family: 'Play', Arial, sans-serif;
    text-transform: uppercase;
    border-right: 1px solid #8254FF;
    box-shadow: 0 0 8px rgba(108, 0, 255, 0.5); /* Softer glow */
}

.leaderboard-table td {
    color: white;
    font-family: 'Play', Arial, sans-serif;
    font-weight: bold;
    border: 1px solid #4B4B63; /* Subtle gray border */
    border-right: 1px solid #8254FF;
}

/* Transparent headers with a solid background behind */
.leaderboard-table thead::before {
    content: ""; /* Creates an invisible layer */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8); /* Adjust for better visibility */
    backdrop-filter: blur(5px); /* Optional: Adds a blur effect */
    z-index: -1; /* Places it behind the text */
}

/* Fix: Ensure headers cover the gap */
.leaderboard-table thead th {
    padding: 12px; /* Adjust padding for proper alignment */
    border-bottom: 2px solid #6C00FF; /* Ensures a clear division */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5); /* Adds a shadow effect for better separation */
}

/* Keep headers sticky and fix the small gap issue */
.leaderboard-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.leaderboard-table .highlight {
    font-weight: bold;
    color: gold;
}

.leaderboard-table .win {
    background-color: green;
    color: white;
}

.leaderboard-table .loss {
    background-color: red;
    color: white;
}

/* Ensure the first row does not overlap */
.leaderboard-table tbody tr:first-child td {
    padding-top: 14px; /* Pushes first row down to prevent overlap */
}

.leaderboard-table td:nth-child(-n+1) {
    background-color: rgba(108, 0, 255, 0.1); /* Softer light purple */
    border-right: 2px solid #6C00FF; /* Neon purple border */
    box-shadow: 0 0 8px rgba(108, 0, 255, 0.5); /* Softer glow */
    border-left: none;
}

.leaderboard-table th:nth-child(-n+1) {
    background-color: rgba(108, 0, 255, 0.1); /* Softer light purple */
    border-right: 2px solid #6C00FF; /* Neon purple border */
    box-shadow: 0 0 8px rgba(108, 0, 255, 0.5); /* Softer glow */
}

.leaderboard-legend {
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    text-align: center;
    font-size: 14px;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 8px;
    box-shadow: 0 0 8px rgba(108, 0, 255, 0.8);
}
.leaderboard-legend p {
    margin: 5px 0;
}
.leaderboard-legend strong {
    color: #A855FF;

}

/* Responsive adjustments */
@media (max-width: 768px) {
    .leaderboard-table {
        font-size: 12px;
    }
    .leaderboard-table th, .leaderboard-table td {
        padding: 8px;
    }
}

.section-header {
    color: white;
}





/* Small Display */
@media (max-width: 992px) {
    .main-content {
        display: grid;
        justify-items: center;
        font-family: 'Play', Arial, sans-serif;
        background-size: cover;
        background-position: center;
        margin: 0;
        padding: 0;
        margin-left: 0px;
    }

}


/* Small Display */
@media (max-width: 768px) {
    .leaderboard-table {
        font-size: 12px;
        min-width: 700px; /* Ensures content fits within scrollable area */
    }
    .leaderboard-table th, .leaderboard-table td {
        padding: 6px;
    }

    /* Ensure headers stay readable */
    .leaderboard-table thead {
        font-size: 13px;
    }

    /* Reduce unnecessary spacing */
    .leaderboard-container {
        width: 95%;
        padding: 10px;
    }
}

@media (max-width: 768px) {
    .leaderboard-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling for iOS */
    }
}

@media (max-width: 576px) {

    .main-content {
        display: grid;
        justify-items: center;
        font-family: 'Play', Arial, sans-serif;
        background-size: cover;
        background-position: center;
        margin: 0;
        padding: 0;
        margin-left: 0px;
    }

    .leaderboard-legend {
        background-color: rgba(0, 0, 0, 0.5);
        color: white;
        text-align: center;
        font-size: 14px;
        padding: 10px;
        margin-bottom: 10px;
        border-radius: 8px;
        box-shadow: 0 0 8px rgba(108, 0, 255, 0.8);
        width: 90%;
    }

    .leaderboard-table th, .leaderboard-table td {
        padding: 4px;
        font-size: 12px;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        border-right: 2px solid #6C00FF;
        box-shadow: 0 0 8px rgba(108, 0, 255, 0.5);
    }

    .leaderboard-table thead th {
        padding: 6px;
        border-bottom: 2px solid #6C00FF;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    }

    .leaderboard-table tbody tr:first-child td {
        padding-top: 4px;
    }

}
