/* General container styling */
.leaderboard-container {
    margin: 20px 0;
    font-family: Arial, sans-serif;
}

/* Filter title styling */
.leaderboard-filter-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    color: #ff00ed;
    margin: 0 0 1vh 0;
    font-size: 1.3em;
    text-align: right !important;
}

/* Filter controls styling */
.leaderboard-controls {
    text-align: right !important;
    margin-bottom: 1.5vh;
    font-size: 1.0em;
}

/* Car filter dropdown styling */
.car-filter {
    background-color: #333 !important;
    color: #fff !important;
    border: 1px solid #ff00ed !important;
    padding: 5px !important;
    border-radius: 4px;
}

.car-filter:hover {
    background-color: #444 !important;
    border-color: #71ffd0 !important;
}

.car-filter:focus {
    outline: none !important;
    border-color: #ff00ed !important;
    box-shadow: 0 0 5px rgba(182, 47, 171, 0.5) !important;
}

/* Override any blue hover colors from theme */
.car-filter option {
    background-color: #333 !important;
    color: #fff !important;
}

.car-filter option:hover {
    background-color: #ff00ed !important;
    color: #000 !important;
}



/* Loading and error message styles */
.leaderboard-loading {
    color: #555;
    font-style: italic;
}

.leaderboard-error {
    color: red;
    font-weight: bold;
}

/* Table styling with added padding inside the table itself */
.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1.2em;
    padding: 10px;
    box-sizing: border-box;
    border: 1px solid #433841;
    background-color: rgba(30, 25, 29, 0.7);
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
}

/* Header styling with Montserrat font and bold weight */
.leaderboard-header,
.leaderboard-header-position,
.leaderboard-header-speed {
    background-color: #ff00ed;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    padding: 0.75em 1em;
    text-align: right;
    font-size: 1.2em;
    box-sizing: border-box;
}

.leaderboard-header-position {
    width: 4em;
    padding-left: 1.5em;
}

.leaderboard-header-speed {
    padding-right: 1.5em;
}

/* Row styling for even rows */
.leaderboard-row:nth-child(even) {
    background-color: rgba(34, 29, 33, 0.7);
}

/* Cell styling with Roboto font */
.leaderboard-cell,
.leaderboard-cell-speed {
    font-family: 'Roboto', sans-serif;
    padding: 0.5em 1em;
    text-align: right;
    font-size: 1.2em;
    color: #fff;
    box-sizing: border-box;
}

.leaderboard-cell-position {
    font-family: 'Roboto', sans-serif;
    width: 4em;
    padding-left: 1.5em !important;
    text-align: center;
}

/* Extra padding for speed column cells */
.leaderboard-cell-speed {
    padding-right: 1.5em !important;
}

.leaderboard-header-spacer,
.leaderboard-cell-spacer {
    width: 0.5em;
    padding: 0;
    border: none;
}

/* Personal leaderboard container styling */
.user-leaderboard-container {
    margin: 20px 0;
    font-family: Arial, sans-serif;
    border: 1px solid #71ffd0;
    background-color: rgba(23, 36, 32, 0.7);
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
}

.user-leaderboard-loading {
    color: #555;
    font-style: italic;
}

.user-leaderboard-error {
    color: red;
    font-weight: bold;
}

.user-leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1.2em;
    padding: 10px;
    box-sizing: border-box;
    border: 1px solid #303a38;
    background-color: rgba(23, 36, 32, 0.7);
}

.user-leaderboard-header,
.user-leaderboard-header-position,
.user-leaderboard-header-speed {
    background-color: #00ffaa;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    padding: 0.75em 1em;
    text-align: right;
    font-size: 1.2em;
    box-sizing: border-box;
}

.user-leaderboard-header-position {
    width: 4em;
    padding-left: 1.5em;
}

.user-leaderboard-header-speed {
    padding-right: 1.5em;
}

.user-leaderboard-row:nth-child(even) {
    background-color: rgba(25, 39, 34, 0.7);
}

.user-leaderboard-cell,
.user-leaderboard-cell-speed {
    font-family: 'Roboto', sans-serif;
    padding: 0.5em 1em;
    text-align: right;
    font-size: 1.2em;
    color: #fff;
    box-sizing: border-box;
}

.user-leaderboard-cell-position {
    font-family: 'Roboto', sans-serif;
    width: 4em;
    padding-left: 1.5em !important;
    text-align: center;
}

.user-leaderboard-cell-speed {
    padding-right: 1.5em !important;
}

.user-leaderboard-header-spacer,
.user-leaderboard-cell-spacer {
    width: 0.5em;
    padding: 0;
    border: none;
}

/* Personal records container styling */
.personal-records-container {
    margin: 20px 0;
    font-family: Arial, sans-serif;
}

.personal-records-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1.2em;
    padding: 10px;
    box-sizing: border-box;
    border: 1px solid #303a38;
    background-color: rgba(23, 36, 32, 0.7);
}

.personal-records-header {
    background-color: #00ffaa;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    padding: 0.75em 1em;
    text-align: center;
    font-size: 1.2em;
    box-sizing: border-box;
}

.personal-records-row:nth-child(even) {
    background-color: rgba(25, 39, 34, 0.7);
}

.personal-records-cell {
    font-family: 'Roboto', sans-serif;
    padding: 0.5em 1em;
    text-align: center;
    font-size: 1.2em;
    color: #fff;
    box-sizing: border-box;
}

/* Trophy showcase styling */
.trophy-showcase {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.trophy-item {
    position: relative;
    cursor: pointer;
}

.trophy-image {
    width: 12em;
    height: 12em;
    border-radius: 8px;
    transition: transform 0.2s;
}

.trophy-image:hover {
    transform: scale(1.1);
}

.trophy-tooltip {
    font-family: 'Roboto', sans-serif;
    position: absolute;
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 16px;
    pointer-events: none;
    z-index: 10;
}

.modal {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    z-index: 20;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
}

.modal-content {
    max-width: 80%;
    max-height: 80%;
    border-radius: 8px;
}

.close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
}

/* Responsive styling for mobile */
@media (max-width: 768px) {
    .leaderboard-container,
    .user-leaderboard-container,
    .personal-records-container {
        margin: 10px 5px;
    }

    .leaderboard-table,
    .user-leaderboard-table,
    .personal-records-table,
    .leaderboard-cell,
    .user-leaderboard-cell,
    .personal-records-cell,
    .leaderboard-header,
    .user-leaderboard-header,
    .personal-records-header {
        font-size: 1em;
        padding: 0.5em 0.75em;
    }

    .leaderboard-header,
    .user-leaderboard-header,
    .personal-records-header {
        padding: 0.5em;
    }

    .leaderboard-header-position,
    .leaderboard-header-speed,
    .user-leaderboard-header-position,
    .user-leaderboard-header-speed,
    .leaderboard-cell-position,
    .user-leaderboard-cell-position,
    .leaderboard-cell-speed,
    .user-leaderboard-cell-speed {
        padding: 0.5em;
    }

    .leaderboard-cell,
    .user-leaderboard-cell,
    .personal-records-cell {
        padding: 0.4em;
        font-size: 1em;
    }

    .trophy-showcase {
        gap: 5px;
    }

    .trophy-image {
        width: 8em;
        height: 8em;
    }

    .modal-content {
        max-width: 90%;
        max-height: 90%;
    }

    .close {
        top: 10px;
        right: 10px;
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .leaderboard-container,
    .user-leaderboard-container,
    .personal-records-container {
        margin: 5px;
    }

    .leaderboard-table,
    .user-leaderboard-table,
    .personal-records-table {
        font-size: 0.9em;
    }

    .trophy-image {
        width: 6em;
        height: 6em;
    }
}

/* Countdown timer styling - specific selector to avoid affecting other headings */
.challenge-countdown {
    font-weight: 400 !important;
}

.challenge-countdown span {
    font-weight: inherit;
}