/* Leaderboard Container */
.leaderboard-container {
    display: none;
    position: fixed;
    top: 0; /* Adjust if you have a fixed navbar */
    left: 0;
    right: 0;
    bottom: 35px;
    z-index: 10;
    overflow: hidden; /* Prevent scrolling of the entire page */
}

/* Leaderboard Background */
.leaderboard-background {
    width: 95%;
    height: calc(100% - 60px); /* Adjust if you have a fixed navbar */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px 2.5%;
}

/* Leaderboard Card */
.leaderboard-card {
    background-color: var(--card-color);
    border-radius: 15px;
    width: 100%;
    height: 100%; /* Take full height */
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
    text-align: center;
    overflow: hidden; /* Hide overflow */
    display: flex;
    flex-direction: column;
    font-family: Luckiest;
    color: #333;
    margin: 0 auto; /* Center the card */
}

/* Add banner styling */
.leaderboard-banner {
    background-color: var(--secondary-color);
    padding: 12px;
    text-align: center;
    font-size: 1.8em;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
}

.your-rank-title {
    font-size: 0.9em;
    color: var(--primary-color);
    text-align: left;
    font-weight: 300;
    position: absolute;
    top: -12px;
    left: 14px;
}

.current-user-container {
    padding: 8px 15px;
    margin: 15px auto;
    width: 90%;
    text-align: left;
    border-radius: 8px;
    position: relative;
    padding-top: 5px;
}

.current-user-container table {
    width: 99%;
    border-collapse: collapse;
}

.current-user-container td {
    padding: 8px;
    text-align: left;
    font-weight: 300;
    font-size: 1em;
    color: #333;
}

/* Style for rank and username columns */
.current-user-container td:nth-child(1),
.current-user-container td:nth-child(2) {
    background-color: white;
    color: #333;
}

/* Style for score columns */
.current-user-container td:nth-child(3),
.current-user-container td:nth-child(4) {
    background-color: var(--primary-color);
    color: white;
}

.current-user-container tr {
    border: 2px solid var(--primary-color);
}

/* Last Updated Time */
.leaderboard-updated {
    font-size: 0.9em;
    color: #555;
    margin-bottom: 15px;
}

/* Leaderboard Search */
.leaderboard-search {
    display: flex;
    font-family: Luckiest;
    justify-content: center;
    align-items: center;
    margin: 10px 10px 10px 10px;
}

.leaderboard-search input {
    width: 60%;
    padding: 8px;
    font-size: 1em;
    border: 1px solid #ccc;
    border-radius: 5px 0 0 5px;
    outline: none;
    font-family: Luckiest;
}

.leaderboard-search button {
    padding: 8px 12px;
    font-size: 1em;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
    font-family: Luckiest;
}


.leaderboard-search button:hover {
    background-color: var(--primary-color);
}

/* Leaderboard Table Container */
.leaderboard-table-container {
    flex: 1; /* Take up remaining space */
    overflow-y: auto; /* Enable vertical scrolling */
    padding: 0px 0;
}

/* Leaderboard Table */
#leaderboard-table {
    width: 90%;
    margin: 0 auto;
    border-collapse: separate;
    border-spacing: 0 3px;
}

#leaderboard-table th {
    background-color: white;
    color: black;
    position: sticky;
    top: 0;
    font-size: 0.9em;
    font-weight: 300;
    text-align: center;
    padding: 15px 10px;
}

#leaderboard-table td {
    padding: 8px;
    text-align: center;
    font-weight: 300;
    font-size: 1em;
}

#leaderboard-table td:nth-child(1),
#leaderboard-table td:nth-child(2) {
    background-color: white;
    color: #333;
    border: 2px solid grey;
    border-right: none;
}

#leaderboard-table td:nth-child(1) {
    border-right: none;
}

#leaderboard-table td:nth-child(2) {
    border-left: none;
}

#leaderboard-table td:nth-child(3),
#leaderboard-table td:nth-child(4) {
    background-color: grey;
    color: white;
}

#leaderboard-table td:nth-child(1) {
    border-right: none;
}

#leaderboard-table tr {
    border: 2px solid var(--secondary-color);
    margin-bottom: 8px;
    display: table-row;
}

#leaderboard-table tr:nth-child(even) {
    background-color: transparent;
    border: 2px solid var(--secondary-color);
}

/* Scrollbar Styling */
.leaderboard-table-container::-webkit-scrollbar {
    width: 8px;
}

.leaderboard-table-container::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.leaderboard-table-container {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

.current-user {
    background-color: var(--secondary-color) !important;
    color: var(--secondary-color);
}

.leaderboard-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
    width: 100%;
    bottom: 0;
    padding: 10px 0;
    z-index: 10;
}

.leaderboard-pagination button {
    padding: 0.5rem 0.7rem;
    font-family: Luckiest;
    cursor: pointer;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    min-width: 35px;
}

.leaderboard-pagination button:disabled {
    cursor: not-allowed;
    opacity: 0.7;
    background-color: #ccc;
}

.leaderboard-pagination span {
    font-size: 0.9rem;
    color: #666;
    min-width: 35px;
    text-align: center;
}

.leaderboard-pagination input {
    width: 50px;
    padding: 0.5rem;
    font-family: Luckiest;
    text-align: center;
    border: 1px solid var(--primary-color);
    border-radius: 4px;
    font-size: 0.9rem;
}

.leaderboard-pagination .page-input-container {
    display: flex;
    align-items: center;
}

.leaderboard-pagination .page-label {
    font-size: 0.9rem;
    color: #666;
}

/* Remove old title styling */
.leaderboard-title {
    display: none;
}

.leaderboard-refresh-text {
    font-size: 0.8em;
    color: #666;
    text-align: center;
    padding: 5px 0;
    font-family: Luckiest;
}