@font-face {
    font-family: 'Formula1Black';
    src: local('Formula1Black'),
         url("../fonts/Formula1-Black.f817b827ea06.ttf") format("truetype");
}
  
@font-face {
    font-family: 'Formula1Wide';
    src: local('Formula1Wide'),
        url("../fonts/Formula1-Wide.5d49e39d7227.ttf") format("truetype");
}
  
@font-face {
    font-family: 'Formula1Bold';
    src: local('Formula1Bold'),
        url("../fonts/Formula1-Bold.0819be9f7b49.ttf") format("truetype");
}
  
@font-face {
    font-family: 'Formula1Regular';
    src: local('Formula1Regular'),
        url("../fonts/Formula1-Regular.ea4e4ee44601.ttf") format("truetype");
}

.main-standings{
    background-color: hsl(240, 2%, 91%);
    height:auto;
    width: 100%;
    padding: 2% 1% 2% 1%;
}

/* Top filters */
.top-filters{
    background-color: hsl(240, 2%, 64%);
    margin: 0% 1% 2% 1%;
    padding: 1%;
    border-radius: 10px;
}

.gray-line-top{
    border: none;
    height: 1px;
    background-color: hsl(240, 5%, 28%);
    margin-top: 0;
    margin-bottom: 0;
}




/* User Standings */
.user-standings{
    background-color: hsl(240, 2%, 64%);
    margin: 1%;
    padding: 3%;
    border-radius: 10px;
    display: grid;
}

.gray-line{
    border: none;
    height: 1px;
    background-color: hsl(240, 5%, 28%);
    margin-top: 0;
    margin-bottom: 30px;
}

.standings-table{
    table-layout: fixed;
    width: 90%;
    border-collapse: separate;
    border-spacing: 0;
    background-color: white;
    font-size: clamp(0.65rem, 1vw, 1rem);
    border: 2px solid #ffffff; /* Border color for the table */
    border-radius: 20px;
    overflow: hidden; /* Ensures the rounded corners are applied correctly */
    justify-self: center;
    background-clip: padding-box;
}

.standings-table thead{
    font-family: "Formula1Regular";
    font-size: 1.05em;
}

.standings-table tbody{
    font-family: "Formula1Bold";
    font-size: 01.1em;
}

.standings-table th {
    background-color: #E10600; /* Title row background color */
    color: white; /* Title row text color */
    padding: 10px; /* Padding for table headers */
}

.standings-table td {
    padding: 0.5%; /* Padding for normal table cells */
    border-bottom: 1px solid #ccc; /* Gray line separating rows */
}

.standings-table tr:hover {
    background-color: #f1f1f1; /* Highlight row on hover */
}

.standings-table tr:nth-child(even) {
    background-color: #f9f9f9; /* Alternating row colors */
}

.standings-table thead {
    overflow: hidden;
}

.standings-table thead tr th:first-child {
    border-top-left-radius: 18px;
}

.standings-table thead tr th:last-child {
    border-top-right-radius: 18px;
}

.standings-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 18px;
}

.standings-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 18px;
}

/* Variable width styles */
.user-name{
    width: 30%; /* Wider for user and team names */
    text-align: left; /* Left align user and team names */
}

.team-name {
    width: 25%; /* Wider for user and team names */
    text-align: left; /* Left align user and team names */
}

.points, .wins, .podiums, .last-2{
    width: 8%; /* Narrower for numeric columns */
    text-align: center; /* Center align all data in table cells */
}

.chips{
    width: 10%;
    text-align: center;
}

.view-team{
    width: 9%; /* Narrower for numeric columns */
    text-align: center; /* Center align all data in table cells */
}

.view-team a{
    color: #E10600;

}

.rank{
    width: 6%; /* Narrower for numeric columns */
    text-align: center; /* Center align all data in table cells */
}

.profile-photo {
    width: clamp(1.4rem, 2.5em, 2.5em);
    height: clamp(1.4rem, 2.5em, 2.5em);
    border-radius: 50%;
    object-fit: cover;
}

.standings-table img {
    max-width: 25%; /* Adjust size as needed */
    max-height: 85%; /* Adjust size as needed */
    margin-right: 5px; /* Space between image and text */
}

.chip-icons{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.chip-icon{
    width: clamp(24px, 3.2vw, 46px);
    height: clamp(24px, 3.2vw, 46px);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #9a9a9a;
    border: 1px solid rgba(0, 0, 0, 0.15);
}

.chip-icon img{
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transform: scale(2.1);
}

.chip-icon.available{
    background-color: #E10600;
}

.chip-icon.chip-drs.available{
    background-color: #8d1598;
}

.chip-icon.chip-pit.available{
    background-color: #1d7c32;
}

.chip-icon.used{
    background-color: #9a9a9a;
}

.chip-icon.used img{
    filter: grayscale(1) brightness(0.7);
    opacity: 0.85;
}



/* Team Standings */
.teams-standings{
    background-color: hsl(240, 2%, 64%);
    margin: 1%;
    padding: 3%;
    border-radius: 10px;
    display: grid;
}

.standings-table-team{
    table-layout: fixed;
    width: 80%;
    border-collapse: separate;
    border-spacing: 0;
    background-color: white;
    font-size: clamp(0.65rem, 1vw, 1rem);
    border: 2px solid #ffffff; /* Border color for the table */
    border-radius: 20px;
    overflow: hidden; /* Ensures the rounded corners are applied correctly */
    justify-self: center;
    background-clip: padding-box;
}

.standings-table-team thead{
    font-family: "Formula1Regular";
    font-size: 1.05em;
}

.standings-table-team tbody{
    font-family: "Formula1Bold";
    font-size: 01.1em;
}

.standings-table-team th {
    background-color: #E10600; /* Title row background color */
    color: white; /* Title row text color */
    padding: 10px; /* Padding for table headers */
}

.standings-table-team td {
    padding: 0.5%; /* Padding for normal table cells */
    border-bottom: 1px solid #ccc; /* Gray line separating rows */
}

.standings-table-team tr:hover {
    background-color: #f1f1f1; /* Highlight row on hover */
}

.standings-table-team tr:nth-child(even) {
    background-color: #f9f9f9; /* Alternating row colors */
}

.standings-table-team thead {
    overflow: hidden;
}

.standings-table-team thead tr th:first-child {
    border-top-left-radius: 18px;
}

.standings-table-team thead tr th:last-child {
    border-top-right-radius: 18px;
}

.standings-table-team tbody tr:last-child td:first-child {
    border-bottom-left-radius: 18px;
}

.standings-table-team tbody tr:last-child td:last-child {
    border-bottom-right-radius: 18px;
}

/* =========================================
   RESPONSIVE — Standings
========================================= */

/* Tablet / medium screens */
@media (max-width: 1100px) {
    .standings-table,
    .standings-table-team {
        width: 100%;
        font-size: clamp(0.6rem, 1.6vw, 0.9rem);
    }

    .standings-table th,
    .standings-table td,
    .standings-table-team th,
    .standings-table-team td {
        padding: 0.4rem 0.3rem;
    }

    .chip-icons {
        gap: 0.2rem;
    }

    .user-standings,
    .teams-standings {
        padding: 2% 1.5%;
    }
}

/* Small tablets / large phones */
@media (max-width: 768px) {
    .main-standings {
        padding: 1% 0;
    }

    .user-standings,
    .teams-standings {
        margin: 0.5%;
        padding: 2% 1%;
    }

    .user-standings h1,
    .teams-standings h1 {
        font-size: 1.3rem !important;
    }

    .standings-table,
    .standings-table-team {
        width: 100%;
        table-layout: auto;
        font-size: clamp(0.55rem, 2.2vw, 0.8rem);
        border-radius: 12px;
    }

    .standings-table thead tr th:first-child,
    .standings-table-team thead tr th:first-child {
        border-top-left-radius: 10px;
    }
    .standings-table thead tr th:last-child,
    .standings-table-team thead tr th:last-child {
        border-top-right-radius: 10px;
    }
    .standings-table tbody tr:last-child td:first-child,
    .standings-table-team tbody tr:last-child td:first-child {
        border-bottom-left-radius: 10px;
    }
    .standings-table tbody tr:last-child td:last-child,
    .standings-table-team tbody tr:last-child td:last-child {
        border-bottom-right-radius: 10px;
    }

    .standings-table th,
    .standings-table td,
    .standings-table-team th,
    .standings-table-team td {
        padding: 0.35rem 0.2rem;
    }

    /* Column widths — let table auto-size but give hints */
    .rank { width: auto; }
    .user-name { width: auto; }
    .team-name { width: auto; }
    .points, .wins, .podiums, .last-2 { width: auto; }
    .chips { width: auto; }
    .view-team { width: auto; }

    .chip-icon {
        width: clamp(20px, 5vw, 34px);
        height: clamp(20px, 5vw, 34px);
    }

    .chip-icon img {
        transform: scale(1.7);
    }

    .chip-icons {
        gap: 0.15rem;
    }

    .profile-photo {
        width: 1.6em;
        height: 1.6em;
    }

    .standings-table img {
        max-width: 20%;
        margin-right: 3px;
    }

    .achievement-badge {
        width: 20px;
        height: 20px;
        font-size: 0.6rem;
        margin-left: 0.25rem;
    }

    .achievement-badge.icon-number {
        font-size: 0.35rem;
    }

    .achievement-tooltip {
        min-width: 180px;
        max-width: 260px;
        font-size: 0.6rem;
    }

    .achievement-tooltip-icon {
        width: 22px;
        height: 22px;
        font-size: 0.7rem;
    }

    .achievement-tooltip-name {
        font-size: 0.58rem;
    }

    .view-team a {
        font-size: 0.7em;
    }

    .gray-line {
        margin-bottom: 15px;
    }
}

/* Mobile phones */
@media (max-width: 576px) {
    .main-standings {
        padding: 0;
    }

    .user-standings,
    .teams-standings {
        margin: 0.3%;
        padding: 3% 1%;
        border-radius: 6px;
    }

    .user-standings h1,
    .teams-standings h1 {
        font-size: 1.1rem !important;
        margin-bottom: 1% !important;
    }

    .standings-table,
    .standings-table-team {
        width: 100%;
        table-layout: auto;
        font-size: clamp(0.5rem, 2.8vw, 0.72rem);
        border-radius: 8px;
    }

    .standings-table th,
    .standings-table td {
        padding: 0.3rem 0.15rem;
        word-break: break-word;
    }

    .standings-table-team th,
    .standings-table-team td {
        padding: 0.3rem 0.2rem;
    }

    /* Hide less important columns on very small screens */
    .standings-table .podiums,
    .standings-table .last-2 {
        display: none;
    }

    .chip-icon {
        width: 20px;
        height: 20px;
    }

    .chip-icon img {
        transform: scale(1.5);
    }

    .chip-icons {
        gap: 0.1rem;
    }

    .profile-photo {
        width: 1.3em;
        height: 1.3em;
    }

    .standings-table img {
        max-width: 18%;
        margin-right: 2px;
    }

    .achievement-badge {
        width: 16px;
        height: 16px;
        font-size: 0.5rem;
        margin-left: 0.15rem;
    }

    .achievement-badge.icon-number {
        font-size: 0.3rem;
    }

    .achievement-badge.icon-symbol {
        font-size: 0.55rem;
    }

    .achievement-tooltip {
        min-width: 150px;
        max-width: 220px;
        font-size: 0.55rem;
        left: 0;
        transform: translateX(-30%);
    }

    .achievement-tooltip-icon {
        width: 18px;
        height: 18px;
        font-size: 0.6rem;
    }

    .achievement-tooltip-item {
        gap: 0.25rem;
    }

    .achievement-tooltip-name {
        font-size: 0.5rem;
    }

    .achievement-tooltip-tag {
        font-size: 0.45rem;
        padding: 0.05rem 0.25rem;
    }

    .view-team a {
        font-size: 0.65em;
    }

    .gray-line {
        margin-bottom: 10px;
    }

    .top-filters {
        margin: 0 0.5% 1% 0.5%;
        padding: 0.5%;
    }

    /* Stack filter grid on mobile */
    .main-standings .stats-filter-grid {
        flex-wrap: wrap;
    }

    .main-standings .stats-filter-grid .section-std {
        flex: 1 1 45%;
        min-width: 100px;
    }

    .main-standings .stats-filter-grid .stats-actions-cell {
        flex: 1 1 100%;
    }

    .main-standings .stats-title {
        font-size: 1.2rem;
    }
}

/* Extra small phones */
@media (max-width: 400px) {
    .standings-table,
    .standings-table-team {
        font-size: clamp(0.45rem, 3vw, 0.62rem);
        border-radius: 6px;
    }

    .standings-table th,
    .standings-table td {
        padding: 0.25rem 0.1rem;
    }

    /* Also hide wins on very tiny screens */
    .standings-table .wins {
        display: none;
    }

    .chip-icon {
        width: 16px;
        height: 16px;
    }

    .chip-icon img {
        transform: scale(1.3);
    }

    .profile-photo {
        width: 1.1em;
        height: 1.1em;
    }

    .achievement-badge {
        width: 14px;
        height: 14px;
        font-size: 0.42rem;
        margin-left: 0.1rem;
    }

    .user-standings h1,
    .teams-standings h1 {
        font-size: 0.9rem !important;
    }
}