body {
    margin: 0;
    padding: 0;
    /* background-color: hsl(230 36% 9.2%); */
    background-color: hsl(0, 0%, 7%);
}

#navbar {
    user-select: none;
    list-style: none;
    margin: 0;
    padding: 0;
    overflow: visible;
    /* background-color: hsl(0, 0%, 20%); */
    /* background-color: hsl(226 20% 17%); */
    background-color: hsla(0, 0%, 100%, 0.16);
    position: relative;
    z-index: 1000;
}

#navbar::after {
    content: "";
    display: table;
    clear: both;
}

#rightNav {
    float: right;
    display: block;
    text-align: center;
    padding: 14px 16px;
    text-decoration: none;
}

#navbar #menu {
    float: right;
    display: block;
    color: hsla(0, 0%, 100%, 0.90);
    text-align: center;
    padding: 13px 16px;
    text-decoration: none;
}

#content {
    color: white;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
    min-height: calc(100vh - 50px); 
    box-sizing: border-box;
    width: 100%;
}

.page {
    display: none;
    animation: fadeIn 0.3s;
    width: 100%;
}

.page.active {
    display: flex; 
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#leftNav {
    float: left;
    display: block;
    color: hsla(0, 0%, 100%, 0.90);
    text-align: center;
    padding: 14px 16px;
    text-decoration: none;
}

#leftNav:hover{
    background-color: hsl(0, 0%, 15%);
}

#leftNav:active{
    background-color: hsl(0, 0%, 8%);
}

.navLink.active {
    background-color: hsl(0, 0%, 8%);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.theme-button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: inherit;
    color: hsla(0, 0%, 100%, 0.90);
}

.theme-button:hover {
    background-color: hsl(0, 0%, 15%);
}

.theme-button:active {
    background-color: hsl(0, 0%, 8%);
}

.dropdown {
    position: relative;
}

.menu-button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: inherit;
    color: hsla(0, 0%, 100%, 0.90);
    /* color: #06abfe; */
}

.menu-clip {
    position: absolute;
    right: 0;
    top: 100%;
    display: grid;
    grid-template-rows: 0fr;
    overflow: hidden;
    transition: grid-template-rows 0.3s ease;
    filter: drop-shadow(2px 8px 16px hsla(0, 0%, 0%, 0.5));
    clip-path: inset(0px -100px -100px -100px);
}

.menu-clip.show {
    grid-template-rows: 1fr;
}

.menu-content {
    display: block;
    font-size: 18px;
    font-family: Arial, Helvetica, sans-serif;
    /* background-color: hsl(226 20% 17%); */
    background-color: hsla(0, 0%, 100%, 0.16);
    min-width: 160px;
    list-style: none;
    padding: 0;
    margin: 0;
    border-bottom-left-radius: 8px;
    overflow: hidden;
    min-height: 0;
}

.menu-entry {
    padding: 0;
}

.menu-entry a{
    cursor: pointer;
    color: inherit;
    text-decoration: none;
    display: block;
    padding-top: 7px;
    padding-bottom: 7px;
}

.menu-entry:hover {
    background-color: hsl(0, 0%, 15%);
}

.menu-entry:active {
    background-color: hsl(0, 0%, 8%);
}

#navbar #menu:has(.menu-button:hover) {
    background-color: hsl(0, 0%, 15%);
}

#navbar #menu:has(.menu-button:active) {
    background-color: hsl(0, 0%, 8%);
}

.content-card {
    background-color: hsla(0, 0%, 100%, 0.09);
    border-radius: 20px;
    padding: 40px 50px;
    
    /* These 2 lines fix the width */
    width: fit-content; 
    max-width: 90%;
    
    box-shadow: 0 8px 32px 0 rgba(0,0,0,0.8);
    text-align: center;
    color: hsla(0, 0%, 100%, 0.95);
    font-family: Arial, Helvetica, sans-serif;
}
.strava-btn {
    background-color: #fc4c02; /* Official Strava Orange */
    color: white;
    padding: 14px 28px;
    text-decoration: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    display: inline-block;
    transition: background-color 0.2s, transform 0.1s;
}

.strava-btn:hover {
    background-color: #e34402;
}

.strava-btn:active {
    transform: scale(0.97);
}

/* Logout Button */
#logout-btn {
    background-color: hsla(0, 100%, 50%, 0.15); /* Faint Red */
    color: #ff6b6b;
    border: 1px solid hsla(0, 100%, 50%, 0.3);
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    margin-top: 10px;
}

#logout-btn:hover {
    background-color: hsla(0, 100%, 50%, 0.25);
    color: white;
}

/* Help section */
#email-phone-gap {
    margin-right: 50px;
}

#contact-us {
    margin-bottom: 50px;
}

/* --- Leaderboard Specifics --- */

/* Dropdown */
.dropdown-select {
    background-color: hsla(0, 0%, 100%, 0.1);
    color: white;
    border: 1px solid hsla(0, 0%, 100%, 0.2);
    padding: 10px;
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 25px;
    width: 100%;
    cursor: pointer;
    outline: none;
}
.dropdown-select option {
    background-color: hsl(0, 0%, 15%);
    color: white;
}

/* Podium */
.podium-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 15px;
    margin-bottom: 20px;
    min-height: 160px;
}

.podium-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 30%;
}

.podium-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-bottom: 5px;
    object-fit: cover;
    border: 2px solid hsla(0, 0%, 100%, 0.5);
}

.podium-name {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.podium-block {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 10px;
    font-size: 24px;
    font-weight: bold;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    color: rgba(0,0,0,0.6);
}

/* Podium Heights & Colors */
.step-1 .podium-block { height: 100px; background: linear-gradient(to bottom, #FFD700, #B8860B); } /* Gold */
.step-2 .podium-block { height: 75px; background: linear-gradient(to bottom, #C0C0C0, #808080); } /* Silver */
.step-3 .podium-block { height: 50px; background: linear-gradient(to bottom, #CD7F32, #8B4513); } /* Bronze */


/* Scrollable Table Area */
.table-container {
    flex-grow: 1; /* Takes up remaining space in the card */
    overflow-y: auto; /* Enables vertical scrolling inside the card */
    padding-right: 10px;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.leaderboard-table th {
    position: sticky;
    top: 0;
    background-color: hsl(0, 0%, 12%); /* Matches card background roughly so scrolling looks clean */
    padding: 10px 5px;
    z-index: 2;
    border-bottom: 1px solid hsla(0, 0%, 100%, 0.2);
}

.leaderboard-table td {
    padding: 12px 5px;
    border-bottom: 1px solid hsla(0, 0%, 100%, 0.05);
}

/* The separator line */
.separator-row td {
    padding: 0;
    border-bottom: 2px dashed hsla(0, 0%, 100%, 0.4);
    height: 10px;
}

.highlight-user {
    background-color: hsla(0, 100%, 100%, 0.1);
    font-weight: bold;
}

.leaderboard-card {
    height: 85vh; /* Locks the height to 85% of your screen */
    max-height: 800px;
    display: flex; 
    flex-direction: column; 
    width: 100%; 
    max-width: 700px; 
    padding: 30px;
    box-sizing: border-box;
    overflow: hidden; /* Prevents the card itself from scrolling */
}

/* Update the existing podium-container */
.podium-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 15px;
    margin-bottom: 20px;
    min-height: 200px;
    flex-shrink: 0;
}

/* --- Modern Global Scrollbar --- */
/* For Firefox */
.table-container {
    scrollbar-width: thin;
    scrollbar-color: hsla(0, 0%, 100%, 0.2) transparent;
}

/* For Chrome, Edge, and Safari */
.table-container::-webkit-scrollbar {
    width: 14px; /* A bit wider to accommodate the invisible border */
}

.table-container::-webkit-scrollbar-track {
    background: transparent; 
}

.table-container::-webkit-scrollbar-thumb {
    background-color: hsla(0, 0%, 100%, 0.3);
    border-radius: 10px;
    
    /* The trick: transparent solid border + padding-box clip */
    border: 4px solid transparent; 
    background-clip: padding-box; 
}

.table-container::-webkit-scrollbar-thumb:hover {
    background-color: hsla(0, 0%, 100%, 0.5);
}