/* ============================================
   LTF WEBSCORER FRONTEND STYLES v1.6
   Comprehensive styling with full customization
   ============================================ */

/* CSS VARIABLES - Customize these to match your theme */
:root {
    /* Brand Colors */
    --ltf-primary-color: #e31e24;
    --ltf-secondary-color: #000000;
    --ltf-text-color: #333333;
    --ltf-text-light: #666666;
    --ltf-background: transparent;
    --ltf-background-alt: #f9f9f9;

    /* Table Colors */
    --ltf-table-header-bg: #000000;
    --ltf-table-header-text: #ffffff;
    --ltf-table-border: #e0e0e0;
    --ltf-table-hover: #f5f5f5;

    /* Row Colors */
    --ltf-row-bg: #ffffff;
    --ltf-row-bg-alt: #f9f9f9;
    --ltf-row-text-color: #333333;

    /* Link Colors */
    --ltf-link-color: #e31e24;
    --ltf-link-hover-color: #000000;

    /* Border Color */
    --ltf-border-color: #e0e0e0;

    /* Filter Button Colors */
    --ltf-filter-bg: #ffffff;
    --ltf-filter-text: #333333;
    --ltf-filter-border: #e0e0e0;
    --ltf-filter-active-bg: #e31e24;
    --ltf-filter-active-text: #ffffff;
    --ltf-filter-active-border: #e31e24;
    --ltf-filter-container-bg: #f9f9f9;
    --ltf-filter-container-border: #e0e0e0;

    /* Podium Colors */
    --ltf-gold-start: #9a8500;
    --ltf-gold-end: #b89f00;
    --ltf-silver-start: #6a6a6a;
    --ltf-silver-end: #8a8a8a;
    --ltf-bronze-start: #8a5a2a;
    --ltf-bronze-end: #a06830;
    --ltf-fourth-start: transparent;
    --ltf-fourth-end: transparent;
    --ltf-fifth-start: transparent;
    --ltf-fifth-end: transparent;

    /* Typography */
    --ltf-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    --ltf-title-size: 32px;
    --ltf-subtitle-size: 22px;
    --ltf-text-size: 16px;

    /* Spacing */
    --ltf-spacing-xs: 8px;
    --ltf-spacing-sm: 12px;
    --ltf-spacing-md: 20px;
    --ltf-spacing-lg: 30px;
    --ltf-spacing-xl: 40px;

    /* Borders & Shadows */
    --ltf-border-radius: 8px;
    --ltf-box-shadow: none;
    --ltf-box-shadow-lg: none;
    --ltf-table-shadow: none;
}

/* ============================================
   CONTAINER STYLES
   ============================================ */

.ltf-ws-standings,
.ltf-ws-race-results,
.ltf-ws-athlete-card {
    margin: var(--ltf-spacing-lg) 0;
    padding: var(--ltf-spacing-md);
    font-family: var(--ltf-font-family);
    background: var(--ltf-background);
    border-radius: var(--ltf-border-radius);
    box-shadow: var(--ltf-box-shadow);
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

.ltf-ws-title {
    font-size: var(--ltf-title-size);
    font-weight: 400;
    margin: 0 0 var(--ltf-spacing-md) 0;
    color: var(--ltf-primary-color);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ltf-ws-group-title {
    font-size: var(--ltf-subtitle-size);
    font-weight: 400;
    margin: var(--ltf-spacing-xl) 0 var(--ltf-spacing-md) 0;
    color: var(--ltf-text-color);
    padding-bottom: var(--ltf-spacing-xs);
    border-bottom: 3px solid var(--ltf-primary-color);
}

/* Section title - like group title but without the underline */
.ltf-ws-section-title {
    font-size: var(--ltf-subtitle-size);
    font-weight: 400;
    margin: var(--ltf-spacing-xl) 0 var(--ltf-spacing-md) 0;
    color: var(--ltf-primary-color);
}

.ltf-ws-date {
    text-align: center;
    color: var(--ltf-text-light);
    font-size: var(--ltf-subtitle-size);
    font-family: var(--ltf-font-family);
    margin-bottom: var(--ltf-spacing-md);
}

/* ============================================
   TABLE STYLES
   ============================================ */

.ltf-ws-table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--ltf-spacing-lg) 0;
    background: var(--ltf-background);
    box-shadow: var(--ltf-table-shadow, var(--ltf-box-shadow));
    border-radius: var(--ltf-border-radius);
    border: 1px solid var(--ltf-border-color);
    overflow: hidden;
}

/* Table Header */
.ltf-ws-table thead {
    background: var(--ltf-table-header-bg);
    color: var(--ltf-table-header-text);
}

.ltf-ws-table th {
    padding: var(--ltf-spacing-md) var(--ltf-spacing-sm);
    text-align: left;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none !important;
    border-bottom: 1px solid var(--ltf-border-color) !important;
    border-left: 1px solid var(--ltf-border-color) !important;
    color: var(--ltf-table-header-text);
}

.ltf-ws-table th:first-child {
    border-left: none !important;
    padding-left: var(--ltf-spacing-sm);
    text-align: center;
}

.ltf-ws-table th:last-child {
    padding-right: var(--ltf-spacing-md);
}

/* Table Body */
.ltf-ws-table td {
    padding: var(--ltf-spacing-sm) var(--ltf-spacing-sm);
    border: none !important;
    border-bottom: 1px solid var(--ltf-border-color) !important;
    border-left: 1px solid var(--ltf-border-color) !important;
    font-size: var(--ltf-text-size);
    color: var(--ltf-row-text-color);
}

.ltf-ws-table td:first-child {
    padding-left: var(--ltf-spacing-sm);
    border-left: none !important;
    text-align: center;
}

.ltf-ws-table td:last-child {
    padding-right: var(--ltf-spacing-md);
}

.ltf-ws-table tbody tr {
    transition: background-color 0.2s ease;
    background-color: var(--ltf-row-bg);
}

/* Zebra striping - alternating row colors */
.ltf-ws-table tbody tr:nth-child(even) {
    background-color: var(--ltf-row-bg-alt);
}

.ltf-ws-table tbody tr:hover {
    background: var(--ltf-table-hover);
}

.ltf-ws-table tbody tr:last-child td {
    border-bottom: none;
}

/* ============================================
   COLUMN WIDTHS — consistent across all group tables
   ============================================ */

/* Race results table: # | Name | Category | Time | Gap */
.ltf-ws-table--race-results {
    table-layout: fixed;
}

.ltf-ws-table--race-results .ltf-ws-col-place {
    width: 6%;
}

.ltf-ws-table--race-results .ltf-ws-col-name {
    width: 32%;
}

.ltf-ws-table--race-results .ltf-ws-col-category {
    width: 18%;
}

.ltf-ws-table--race-results .ltf-ws-col-time {
    width: 22%;
}

.ltf-ws-table--race-results .ltf-ws-col-diff {
    width: 22%;
}

/* Standings table: # | Name | Category | Points | Races */
.ltf-ws-table--standings {
    table-layout: fixed;
}

.ltf-ws-table--standings .ltf-ws-col-place {
    width: 6%;
}

.ltf-ws-table--standings .ltf-ws-col-name {
    width: 32%;
}

.ltf-ws-table--standings .ltf-ws-col-category {
    width: 20%;
}

.ltf-ws-table--standings .ltf-ws-col-points {
    width: 16%;
}

.ltf-ws-table--standings .ltf-ws-col-races {
    width: 26%;
}

/* Handle text overflow in fixed-width columns */
.ltf-ws-table td,
.ltf-ws-table th {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Name column can wrap if needed */
.ltf-ws-table .ltf-ws-col-name {
    white-space: normal;
    word-break: break-word;
}

/* ============================================
   PODIUM HIGHLIGHTING
   ============================================ */

.ltf-ws-gold {
    background: linear-gradient(135deg, var(--ltf-gold-start) 0%, var(--ltf-gold-end) 100%) !important;
}

.ltf-ws-silver {
    background: linear-gradient(135deg, var(--ltf-silver-start) 0%, var(--ltf-silver-end) 100%) !important;
}

.ltf-ws-bronze {
    background: linear-gradient(135deg, var(--ltf-bronze-start) 0%, var(--ltf-bronze-end) 100%) !important;
}

.ltf-ws-fourth {
    background: linear-gradient(135deg, var(--ltf-fourth-start) 0%, var(--ltf-fourth-end) 100%) !important;
}

.ltf-ws-fifth {
    background: linear-gradient(135deg, var(--ltf-fifth-start) 0%, var(--ltf-fifth-end) 100%) !important;
}

/* Podium emojis — medals style (default) */
.ltf-ws-podium-emojis-medals .ltf-ws-gold td:first-child::before { content: "🥇 "; }
.ltf-ws-podium-emojis-medals .ltf-ws-silver td:first-child::before { content: "🥈 "; }
.ltf-ws-podium-emojis-medals .ltf-ws-bronze td:first-child::before { content: "🥉 "; }
.ltf-ws-podium-emojis-medals .ltf-ws-fourth td:first-child::before { content: "⭐ "; }
.ltf-ws-podium-emojis-medals .ltf-ws-fifth td:first-child::before { content: "⭐ "; }

/* Podium emojis — stars style */
.ltf-ws-podium-emojis-stars .ltf-ws-gold td:first-child::before { content: "⭐ "; }
.ltf-ws-podium-emojis-stars .ltf-ws-silver td:first-child::before { content: "⭐ "; }
.ltf-ws-podium-emojis-stars .ltf-ws-bronze td:first-child::before { content: "⭐ "; }
.ltf-ws-podium-emojis-stars .ltf-ws-fourth td:first-child::before { content: "⭐ "; }
.ltf-ws-podium-emojis-stars .ltf-ws-fifth td:first-child::before { content: "⭐ "; }

/* ============================================
   ATHLETE CARD
   ============================================ */

.ltf-ws-athlete-card {
    padding: var(--ltf-spacing-lg);
    background: var(--ltf-background);
    border-radius: var(--ltf-border-radius);
    box-shadow: var(--ltf-box-shadow-lg);
}

.athlete-name {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 var(--ltf-spacing-md) 0;
    color: var(--ltf-link-color, var(--ltf-primary-color));
    text-align: center;
}

.athlete-category {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ltf-text-light, var(--ltf-primary-color));
    margin: 0 0 var(--ltf-spacing-md) 0;
}

.athlete-place,
.athlete-points {
    font-size: 18px;
    margin: var(--ltf-spacing-xs) 0;
    text-align: center;
    color: var(--ltf-text-color);
}

.athlete-place strong,
.athlete-points strong {
    color: var(--ltf-text-color);
    font-weight: 700;
}

.athlete-races {
    list-style: none;
    padding: 0;
    margin-top: var(--ltf-spacing-lg);
}

.athlete-races li {
    padding: var(--ltf-spacing-sm) 0;
    border-bottom: 1px solid var(--ltf-border-color);
    font-size: var(--ltf-text-size);
}

.athlete-races li:last-child {
    border-bottom: none;
}

/* ============================================
   ERROR MESSAGES
   ============================================ */

.ltf-ws-error {
    padding: var(--ltf-spacing-md);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--ltf-border-radius);
    color: rgba(255, 255, 255, 0.5);
    font-weight: 400;
    text-align: center;
    font-style: italic;
}

.ltf-ws-no-results {
    padding: var(--ltf-spacing-lg, 24px) var(--ltf-spacing-md, 16px);
    text-align: center;
}

.ltf-ws-upcoming-message {
    color: rgba(255, 255, 255, 0.6);
    font-size: var(--ltf-font-size-base, 1rem);
    font-style: italic;
    margin: 0;
    line-height: 1.6;
}

.ltf-ws-upcoming-message strong {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 600;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media screen and (max-width: 768px) {
    .ltf-ws-standings,
    .ltf-ws-race-results {
        padding: 0;
    }

    .ltf-ws-athlete-card {
        padding: var(--ltf-spacing-md);
        box-shadow: none;
    }

    .ltf-ws-table {
        font-size: 14px;
    }

    .ltf-ws-table th,
    .ltf-ws-table td {
        padding: var(--ltf-spacing-xs);
    }

    .ltf-ws-title {
        font-size: 24px;
    }

    .ltf-ws-group-title {
        font-size: 18px;
    }

    /* Hide columns marked for mobile hiding */
    .ltf-ws-hide-mobile {
        display: none !important;
    }

    /* Mobile column widths — Category/Gap/Races hidden, redistribute space */
    /* Shared: # column is 15% for both tables */
    .ltf-ws-table--race-results .ltf-ws-col-place,
    .ltf-ws-table--standings .ltf-ws-col-place {
        width: 15%;
    }

    /* Race results: Name 55% + Time 30% (times are 7 chars like "2:22:31") */
    .ltf-ws-table--race-results .ltf-ws-col-name {
        width: 55%;
    }
    .ltf-ws-table--race-results .ltf-ws-col-time {
        width: 30%;
    }

    /* Standings: Name 62% + Points 23% (points are short like "146") */
    .ltf-ws-table--standings .ltf-ws-col-name {
        width: 62%;
    }
    .ltf-ws-table--standings .ltf-ws-col-points {
        width: 23%;
    }

    /* Athlete profile races: Show all 4 columns in scrollable container */
    /* Override the global hide-mobile for athlete race tables */
    .ltf-ws-table--athlete-races .ltf-ws-hide-mobile {
        display: table-cell !important;
    }
    .ltf-ws-athlete-card {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .ltf-ws-table--athlete-races {
        min-width: 480px;
    }
    .ltf-ws-table--athlete-races .ltf-ws-col-event {
        white-space: nowrap;
    }

    /* Athlete card text sizing on mobile */
    .athlete-name {
        font-size: 22px;
    }
    .athlete-place,
    .athlete-points {
        font-size: 16px;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .ltf-ws-standings,
    .ltf-ws-race-results {
        box-shadow: none;
        page-break-inside: avoid;
    }
    
    .ltf-ws-table {
        box-shadow: none;
    }
    
    .ltf-ws-table tbody tr:hover {
        background: transparent;
    }
}

/* ============================================
   CLICKABLE LINKS
   ============================================ */

.ltf-ws-standings a.ltf-ws-athlete-link,
.ltf-ws-standings a.ltf-ws-race-link,
.ltf-ws-race-results a.ltf-ws-athlete-link,
.ltf-ws-race-results a.ltf-ws-race-link,
.ltf-ws-athlete-card a.ltf-ws-athlete-link,
.ltf-ws-athlete-card a.ltf-ws-race-link {
    color: var(--ltf-link-color) !important;
    text-decoration: none;
    transition: color 0.2s ease, text-decoration 0.2s ease;
}

.ltf-ws-standings a.ltf-ws-athlete-link:hover,
.ltf-ws-standings a.ltf-ws-race-link:hover,
.ltf-ws-race-results a.ltf-ws-athlete-link:hover,
.ltf-ws-race-results a.ltf-ws-race-link:hover,
.ltf-ws-athlete-profile a.ltf-ws-athlete-link:hover,
.ltf-ws-athlete-profile a.ltf-ws-race-link:hover {
    color: var(--ltf-link-hover-color) !important;
    text-decoration: underline;
}

/* Podium row text and link color — controlled by Podium Text setting */
.ltf-ws-gold,
.ltf-ws-silver,
.ltf-ws-bronze,
.ltf-ws-fourth,
.ltf-ws-fifth {
    color: var(--ltf-podium-text-color, var(--ltf-table-header-bg, #000000)) !important;
}

.ltf-ws-gold a.ltf-ws-athlete-link,
.ltf-ws-gold a.ltf-ws-race-link,
.ltf-ws-silver a.ltf-ws-athlete-link,
.ltf-ws-silver a.ltf-ws-race-link,
.ltf-ws-bronze a.ltf-ws-athlete-link,
.ltf-ws-bronze a.ltf-ws-race-link,
.ltf-ws-fourth a.ltf-ws-athlete-link,
.ltf-ws-fourth a.ltf-ws-race-link,
.ltf-ws-fifth a.ltf-ws-athlete-link,
.ltf-ws-fifth a.ltf-ws-race-link {
    color: #ffffff !important;
    text-decoration: none;
}

.ltf-ws-gold a.ltf-ws-athlete-link:hover,
.ltf-ws-gold a.ltf-ws-race-link:hover,
.ltf-ws-silver a.ltf-ws-athlete-link:hover,
.ltf-ws-silver a.ltf-ws-race-link:hover,
.ltf-ws-bronze a.ltf-ws-athlete-link:hover,
.ltf-ws-bronze a.ltf-ws-race-link:hover,
.ltf-ws-fourth a.ltf-ws-athlete-link:hover,
.ltf-ws-fourth a.ltf-ws-race-link:hover,
.ltf-ws-fifth a.ltf-ws-athlete-link:hover,
.ltf-ws-fifth a.ltf-ws-race-link:hover {
    color: var(--ltf-link-hover-color) !important;
}

/* ============================================
   BACK LINK
   ============================================ */

.ltf-ws-back-link {
    margin-bottom: var(--ltf-spacing-md);
}

.ltf-ws-back-link a {
    display: inline-flex;
    align-items: center;
    gap: var(--ltf-spacing-xs);
    color: var(--ltf-text-light);
    text-decoration: none;
    font-size: 14px;
    padding: var(--ltf-spacing-xs) var(--ltf-spacing-sm);
    border: 1px solid var(--ltf-border-color);
    border-radius: var(--ltf-border-radius);
    transition: all 0.2s ease;
}

.ltf-ws-back-link a:hover {
    color: var(--ltf-primary-color);
    border-color: var(--ltf-primary-color);
    background: var(--ltf-background-alt);
}

/* ============================================
   FILTER UI
   ============================================ */

/* Filter container */
.ltf-ws-filters {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--ltf-spacing-sm);
    margin-bottom: var(--ltf-spacing-lg);
    padding: var(--ltf-spacing-lg);
    background: var(--ltf-filter-container-bg);
    border-radius: var(--ltf-border-radius);
    border: 1px solid var(--ltf-filter-container-border);
}

/* Filter row */
.ltf-ws-filter-row {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Filter buttons container */
.ltf-ws-filter-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--ltf-spacing-sm);
}

/* Filter button base styles — specificity boosted with button[type] to beat theme resets */
.ltf-ws-filter-buttons .ltf-ws-filter-btn,
button.ltf-ws-filter-btn[type="button"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--ltf-font-family);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ltf-filter-text);
    background: var(--ltf-filter-bg);
    border: 2px solid var(--ltf-filter-border);
    border-radius: var(--ltf-border-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
}

.ltf-ws-filter-buttons .ltf-ws-filter-btn:hover,
button.ltf-ws-filter-btn[type="button"]:hover {
    border-color: var(--ltf-filter-active-border);
    color: var(--ltf-filter-active-border);
}

/* Active filter button */
.ltf-ws-filter-buttons .ltf-ws-filter-btn.active,
button.ltf-ws-filter-btn.active[type="button"] {
    background: var(--ltf-filter-active-bg);
    border-color: var(--ltf-filter-active-border);
    color: var(--ltf-filter-active-text);
}

.ltf-ws-filter-buttons .ltf-ws-filter-btn.active:hover,
button.ltf-ws-filter-btn.active[type="button"]:hover {
    background: var(--ltf-filter-active-bg);
    border-color: var(--ltf-filter-active-border);
    color: var(--ltf-filter-active-text);
    opacity: 0.9;
}

/* Hidden result groups */
.ltf-ws-result-group.ltf-ws-hidden {
    display: none;
}

/* No results message (PHP-rendered and JS-generated) */
.ltf-ws-no-results,
.ltf-ws-no-results-msg {
    text-align: center;
    padding: var(--ltf-spacing-xl);
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
}

/* Filter responsive styles */
@media screen and (max-width: 768px) {
    .ltf-ws-filters {
        padding: var(--ltf-spacing-md);
        max-width: 100%;
        box-sizing: border-box;
    }

    .ltf-ws-filter-row {
        flex-wrap: wrap;
        max-width: 100%;
    }

    .ltf-ws-filter-buttons {
        gap: var(--ltf-spacing-xs);
        max-width: 100%;
        justify-content: center;
    }

    .ltf-ws-filter-buttons .ltf-ws-filter-btn,
    button.ltf-ws-filter-btn[type="button"] {
        padding: 6px 10px;
        font-size: 12px;
        min-width: auto;
        letter-spacing: 0.03em;
    }
}

/* ============================================
   ATHLETES ARCHIVE GRID
   ============================================ */

/* Archive container */
.ltgp-athletes-archive {
    font-family: var(--ltf-font-family);
}

/* Filter Bar */
.ltgp-filter-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--ltf-spacing-sm);
    margin-bottom: var(--ltf-spacing-xl);
}

.ltgp-filter-bar__search-wrap {
    width: 100%;
    max-width: 400px;
    margin-bottom: var(--ltf-spacing-sm);
}

.ltgp-filter-bar__search {
    width: 100%;
    padding: var(--ltf-spacing-sm) var(--ltf-spacing-md);
    font-size: 15px;
    font-family: var(--ltf-font-family);
    color: var(--ltf-text-color);
    background: var(--ltf-background);
    border: 2px solid var(--ltf-border-color);
    border-radius: var(--ltf-border-radius);
    outline: none;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.ltgp-filter-bar__search:focus {
    border-color: var(--ltf-primary-color);
}

.ltgp-filter-bar__search::placeholder {
    color: var(--ltf-text-light);
}

/* Filter tab row */
.ltgp-filter-bar__tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--ltf-spacing-sm);
}

/* Tab buttons — unified with all other filter buttons */
.ltgp-filter-bar .ltgp-tabs__btn,
button.ltgp-tabs__btn[type="button"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--ltf-font-family);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ltf-filter-text);
    background: var(--ltf-filter-bg);
    border: 2px solid var(--ltf-filter-border);
    border-radius: var(--ltf-border-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
}

.ltgp-filter-bar .ltgp-tabs__btn:hover,
button.ltgp-tabs__btn[type="button"]:hover {
    border-color: var(--ltf-filter-active-border);
    color: var(--ltf-filter-active-border);
}

.ltgp-filter-bar .ltgp-tabs__btn--active,
button.ltgp-tabs__btn--active[type="button"] {
    background: var(--ltf-filter-active-bg);
    border-color: var(--ltf-filter-active-border);
    color: var(--ltf-filter-active-text);
}

.ltgp-filter-bar .ltgp-tabs__btn--active:hover,
button.ltgp-tabs__btn--active[type="button"]:hover {
    background: var(--ltf-filter-active-bg);
    border-color: var(--ltf-filter-active-border);
    color: var(--ltf-filter-active-text);
    opacity: 0.9;
}

/* Athletes Grid */
.ltgp-athletes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--ltf-spacing-md);
}

.ltgp-athletes-grid--cols-3 {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.ltgp-athletes-grid--cols-4 {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* Athlete Card */
.athlete-card {
    position: relative;
    border-radius: var(--ltf-border-radius);
    overflow: hidden;
    border: 2px solid transparent;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.4s ease;
    /* Animation: start hidden, JS adds visible class */
    opacity: 0;
}

/* ---- Animation Variants (initial state) ---- */
.ltgp-athletes-grid--anim-fade-up .athlete-card {
    transform: translateY(20px);
}
.ltgp-athletes-grid--anim-fade-in .athlete-card {
    transform: none;
}
.ltgp-athletes-grid--anim-slide-left .athlete-card {
    transform: translateX(-40px);
}
.ltgp-athletes-grid--anim-slide-right .athlete-card {
    transform: translateX(40px);
}
.ltgp-athletes-grid--anim-scale-up .athlete-card {
    transform: scale(0.85);
}

/* ---- Visible state (applied by JS) ---- */
.athlete-card--visible {
    opacity: 1;
    transform: translateY(0) translateX(0) scale(1);
    transition: opacity 0.5s ease, transform 0.5s ease, border-color 0.4s ease;
}

/* ---- No animation fallback ---- */
.ltgp-athletes-grid--anim-none .athlete-card {
    opacity: 1;
    transform: none;
}

.athlete-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px #00000040;
    border-color: #ffffff80;
}

.athlete-card__link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.athlete-card__image-wrapper {
    position: relative;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: var(--ltf-secondary-color, #1a1a28);
}

.athlete-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.athlete-card:hover .athlete-card__image {
    transform: scale(1.05);
}

.athlete-card__placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--ltf-secondary-color, #1a1a28) 0%, #1e1e2acc 100%);
}

.athlete-card__gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70%;
    background: linear-gradient(to top, #000000d9 0%, #00000066 40%, transparent 100%);
    pointer-events: none;
    z-index: 1;
}

.athlete-card__content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--ltf-spacing-md);
    z-index: 2;
}

.athlete-card__flag {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 4px;
}

.athlete-card__name {
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #ffffff;
    margin: 0;
    text-shadow: 0 1px 3px #00000080;
}

/* No results */
.ltgp-no-results {
    text-align: center;
    padding: var(--ltf-spacing-xl) var(--ltf-spacing-md);
    color: var(--ltf-text-light);
    font-size: var(--ltf-text-size);
    font-style: italic;
}

/* Athletes Grid Responsive */
@media screen and (max-width: 768px) {
    .ltgp-athletes-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: var(--ltf-spacing-sm);
    }

    .ltgp-filter-bar__tabs {
        gap: var(--ltf-spacing-xs);
    }

    .ltgp-filter-bar .ltgp-tabs__btn,
    button.ltgp-tabs__btn[type="button"] {
        padding: 6px 10px;
        font-size: 12px;
        min-width: auto;
        letter-spacing: 0.03em;
    }

    .athlete-card__name {
        font-size: 14px;
    }
}

@media screen and (max-width: 480px) {
    .ltgp-athletes-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   YEAR TABS (multi-year results)
   ============================================ */

/* Year tabs container */
.ltf-ws-year-tabs {
    margin-bottom: var(--ltf-spacing-lg);
}

/* Tab button row — inside the filter container as the last row, horizontally scrollable on mobile */
.ltf-ws-year-tab-buttons {
    display: flex;
    justify-content: center;
    gap: var(--ltf-spacing-sm);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 2px 0;
}

.ltf-ws-year-tab-buttons::-webkit-scrollbar {
    display: none;
}

/* Year tab button — unified with all other filter buttons */
.ltf-ws-year-tab-buttons .ltf-ws-year-tab-btn,
button.ltf-ws-year-tab-btn[type="button"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--ltf-font-family);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ltf-filter-text);
    background: var(--ltf-filter-bg);
    border: 2px solid var(--ltf-filter-border);
    border-radius: var(--ltf-border-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-width: 70px;
}

.ltf-ws-year-tab-buttons .ltf-ws-year-tab-btn:hover,
button.ltf-ws-year-tab-btn[type="button"]:hover {
    border-color: var(--ltf-filter-active-border);
    color: var(--ltf-filter-active-border);
}

/* Active year tab */
.ltf-ws-year-tab-buttons .ltf-ws-year-tab-btn.active,
button.ltf-ws-year-tab-btn.active[type="button"] {
    background: var(--ltf-filter-active-bg);
    border-color: var(--ltf-filter-active-border);
    color: var(--ltf-filter-active-text);
}

.ltf-ws-year-tab-buttons .ltf-ws-year-tab-btn.active:hover,
button.ltf-ws-year-tab-btn.active[type="button"]:hover {
    background: var(--ltf-filter-active-bg);
    border-color: var(--ltf-filter-active-border);
    color: var(--ltf-filter-active-text);
    opacity: 0.9;
}

/* Year tab panels */
.ltf-ws-year-panel {
    display: none;
}

.ltf-ws-year-panel.active {
    display: block;
}

/* Responsive year tabs */
@media screen and (max-width: 768px) {
    .ltf-ws-year-tab-buttons {
        justify-content: center;
        flex-wrap: nowrap;
        gap: 6px;
        padding: 0;
    }

    .ltf-ws-year-tab-buttons .ltf-ws-year-tab-btn,
    button.ltf-ws-year-tab-btn[type="button"] {
        padding: 6px 10px;
        font-size: 12px;
        min-width: auto;
        letter-spacing: 0.03em;
    }
}

/* ============================================
   SERIES TABS (GP / Wild Card / U23)
   ============================================ */

.ltf-ws-series-tabs {
    margin-bottom: var(--ltf-spacing-lg);
}

/* Series button row */
.ltf-ws-series-tab-buttons {
    display: flex;
    justify-content: center;
    gap: var(--ltf-spacing-sm);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 2px 0;
}

/* When outside filters container, add spacing */
.ltf-ws-series-tabs > .ltf-ws-series-tab-buttons {
    margin-bottom: var(--ltf-spacing-lg);
}

.ltf-ws-series-tab-buttons::-webkit-scrollbar {
    display: none;
}

/* Series tab button — unified with all other filter buttons */
.ltf-ws-series-tab-buttons .ltf-ws-series-tab-btn,
button.ltf-ws-series-tab-btn[type="button"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--ltf-font-family);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ltf-filter-text);
    background: var(--ltf-filter-bg);
    border: 2px solid var(--ltf-filter-border);
    border-radius: var(--ltf-border-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-width: 80px;
}

.ltf-ws-series-tab-buttons .ltf-ws-series-tab-btn:hover,
button.ltf-ws-series-tab-btn[type="button"]:hover {
    border-color: var(--ltf-filter-active-border);
    color: var(--ltf-filter-active-border);
}

/* Active series tab */
.ltf-ws-series-tab-buttons .ltf-ws-series-tab-btn.active,
button.ltf-ws-series-tab-btn.active[type="button"] {
    background: var(--ltf-filter-active-bg);
    border-color: var(--ltf-filter-active-border);
    color: var(--ltf-filter-active-text);
}

.ltf-ws-series-tab-buttons .ltf-ws-series-tab-btn.active:hover,
button.ltf-ws-series-tab-btn.active[type="button"]:hover {
    background: var(--ltf-filter-active-bg);
    border-color: var(--ltf-filter-active-border);
    color: var(--ltf-filter-active-text);
    opacity: 0.9;
}

/* Series panels */
.ltf-ws-series-panel {
    display: none;
}

.ltf-ws-series-panel.active {
    display: block;
}

/* Responsive series tabs */
@media screen and (max-width: 768px) {
    .ltf-ws-series-tab-buttons {
        justify-content: center;
        flex-wrap: nowrap;
        gap: 6px;
        padding: 0;
    }

    .ltf-ws-series-tab-buttons .ltf-ws-series-tab-btn,
    button.ltf-ws-series-tab-btn[type="button"] {
        padding: 6px 10px;
        font-size: 12px;
        min-width: auto;
        letter-spacing: 0.03em;
    }
}

/* ============================================
   NEXT EVENT COUNTDOWN
   [ltgp_next_event] shortcode
   ============================================ */

.ltgp-next-event {
    text-align: center;
    padding: 48px 24px;
}

.ltgp-next-event__label {
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--event-color, rgba(255, 255, 255, 0.5));
    margin-bottom: 12px;
}

.ltgp-next-event__name {
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 32px;
    line-height: 1.1;
}

.ltgp-next-event__countdown {
    display: flex;
    justify-content: center;
    gap: clamp(24px, 4vw, 48px);
    margin-bottom: 32px;
}

.ltgp-next-event__unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
}

.ltgp-next-event__number {
    font-size: clamp(36px, 6vw, 64px);
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

.ltgp-next-event__unit-label {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--event-color, rgba(255, 255, 255, 0.45));
    margin-top: 8px;
}

.ltgp-next-event__today {
    margin-bottom: 32px;
}

.ltgp-next-event__today-text {
    display: inline-block;
    font-size: clamp(28px, 5vw, 48px);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--event-color, #e31e24);
    animation: ltgp-pulse 2s ease-in-out infinite;
}

@keyframes ltgp-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.ltgp-next-event__cta {
    margin-top: 8px;
}

.ltgp-next-event__button {
    display: inline-block;
    padding: 12px 32px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.06em;
    transition: all 0.2s ease;
}

.ltgp-next-event__button:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    color: #ffffff;
}

.ltgp-next-event--complete .ltgp-next-event__label {
    font-size: clamp(24px, 4vw, 40px);
    font-weight: 700;
    color: rgba(255, 255, 255, 0.7);
}

@media (max-width: 480px) {
    .ltgp-next-event {
        padding: 32px 16px;
    }
    .ltgp-next-event__countdown {
        gap: 16px;
    }
    .ltgp-next-event__unit {
        min-width: 50px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ltgp-next-event__today-text {
        animation: none;
    }
}

/* ============================================
   STANDALONE COUNTDOWN SHORTCODE
   [ltgp_next_event_countdown] — styleable via
   CSS custom properties set as shortcode attributes
   ============================================ */

.ltgp-countdown {
    display: flex;
    justify-content: center;
    gap: var(--cd-gap, clamp(24px, 4vw, 48px));
}

.ltgp-countdown__unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
}

.ltgp-countdown__number {
    font-size: var(--cd-number-size, clamp(36px, 6vw, 64px));
    font-weight: 700;
    color: var(--cd-number-color, rgba(255, 255, 255, 0.85));
    line-height: 1;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

.ltgp-countdown__label {
    font-size: var(--cd-label-size, 12px);
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--cd-label-color, rgba(255, 255, 255, 0.45));
    margin-top: 8px;
}

@media (max-width: 480px) {
    .ltgp-countdown {
        gap: var(--cd-gap, 16px);
    }
    .ltgp-countdown__unit {
        min-width: 50px;
    }
}

/* ============================================
   CUSTOM THEME OVERRIDES
   Add your custom styles below this line
   ============================================ */
