/**
 * resultats3/assets/css/style.css
 * Same design as resultats/resultat_clax.php
 */

/* === CSS Variables === */
:root {
    /* Colors */
    --text-color: #1a202c;
    --text-muted: #6b7280;
    --bg-white: rgba(255, 255, 255, 0.52);
    --bg-white-heavy: rgba(255, 255, 255, 0.45);
    --bg-card: rgba(255, 255, 255, 0.45);
    --bg-input: rgba(249, 250, 251, 0.75);
    --bg-hover: rgba(243, 244, 246, 0.7);
    --border-color: rgba(229, 231, 235, 0.4);
    --border-strong: rgba(229, 231, 235, 0.6);
    --accent: #ec4899;
    --accent-hover: #db2777;
    --accent-light: rgba(236, 72, 153, 0.1);
    --podium-gold: #fbbf24;
    --podium-silver: #9ca3af;
    --podium-bronze: #d97706;
    --sexe-m-bg: rgba(219, 234, 254, 0.8);
    --sexe-m-color: #1d4ed8;
    --sexe-f-bg: rgba(252, 231, 243, 0.8);
    --sexe-f-color: #be185d;
    --footer-bg: rgba(26, 32, 44, 0.88);
    --footer-text: rgba(255, 255, 255, 0.7);
    --footer-link: rgba(255, 255, 255, 0.9);
    --header-gradient-start: rgba(26, 32, 44, 0.78);
    --header-gradient-end: rgba(26, 32, 44, 0.62);
    --live-badge: #dc2626;
    --new-arrival: #22c55e;
    --btn-diploma: #fbbf24;
    --btn-diploma-hover: #f59e0b;
    --btn-fb: #4a6ea9;
    --btn-fb-hover: #3b5998;
    --btn-tw: #1da1f2;
    --btn-tw-hover: #0d8ddb;
    --btn-wa: #25d366;
    --btn-wa-hover: #1fb855;
    --btn-copy: #6b7280;
    --btn-copy-hover: #4b5563;
    --btn-tracking: #2563eb;
    --btn-tracking-hover: #1d4ed8;
    --dossard-color: #ec4899;
    --club-color: #6b7280;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-color);
    line-height: 1.5;
    margin: 0;
    min-height: 100vh;
}

.bg-fixed {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image: var(--bg-small);
    background-size: cover;
    background-position: top center;
    background-repeat: no-repeat;
}

@media (min-width: 768px) {
    .bg-fixed { background-image: var(--bg-medium); }
}

@media (min-width: 1200px) {
    .bg-fixed { background-image: var(--bg-large); }
}

/* Constrain content to 1280px */
#app {
    max-width: 1280px;
    margin: 0 auto;
    position: relative;
}

/* === Loading Overlay === */
.loading-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay p {
    margin-top: 20px;
    font-size: 1.1em;
    color: var(--text-muted);
}

.spinner > div {
    width: 18px;
    height: 18px;
    background-color: #ADADAD;
    border-radius: 100%;
    display: inline-block;
    animation: bounceDelay 1.4s infinite ease-in-out;
    animation-fill-mode: both;
}
.spinner .bounce-1 { animation-delay: -0.32s; }
.spinner .bounce-2 { animation-delay: -0.16s; }

@keyframes bounceDelay {
    0%, 80%, 100% { transform: scale(0.0); }
    40% { transform: scale(1.0); }
}

/* === Event Header === */
.event-header {
    background: linear-gradient(135deg, var(--header-gradient-start), var(--header-gradient-end));
    padding: 30px 20px;
    color: white;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.lang-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
}

.lang-icon {
    font-size: 1.2em;
    line-height: 1;
}

.lang-selector {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.85em;
    cursor: pointer;
}

.lang-selector option {
    background: #1a202c;
    color: white;
}

/* Timepulse logo */
.timepulse-logo-link {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
}

.timepulse-logo {
    height: 74px;
    width: auto;
}


.back-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    margin-bottom: 15px;
    font-size: 0.9em;
}

.back-link:hover {
    color: white;
}

/* === Event Header Main Grid === */
.event-header-main {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 20px;
    align-items: center;
    margin-top: 15px;
}

/* === Event Logo === */
.event-logo {
    flex-shrink: 0;
    max-width: 120px;
    max-height: 80px;
}

.event-logo-img {
    max-width: 100%;
    max-height: 80px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* Event Info Container */
.event-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.event-title {
    font-size: 2em;
    font-weight: 700;
    margin-bottom: 10px;
}

.event-timepulse-logo {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .event-header-main {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
   
    .event-timepulse-logo {
        order: -1;
    }
    .timepulse-logo {
            height: 50px;
    }
}
.event-details {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
    font-size: 0.95em;
    opacity: 0.9;
    align-items: center;
}

.event-details span {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* === LIVE Badge === */
.live-badge {
    background: var(--live-badge);
    color: white;
    padding: 4px 12px;
    border-radius: 16px;
    font-weight: 700;
    font-size: 0.85em;
    animation: livePulse 1.5s ease-in-out infinite;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* === Provisional Ranking Notice === */
.prov-notice {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #664d03;
    padding: 8px 16px;
    margin: 8px 16px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9em;
    text-align: center;
}

/* === Epreuve Tabs === */
.epreuve-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 12px 16px;
    background: var(--bg-white);
    border-radius: 0;
    border: none;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.epreuve-tabs::-webkit-scrollbar { display: none; }

.epreuve-tabs .tab-btn {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    padding: 6px 14px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
    background: var(--bg-input);
    font: 600 0.82em / 1.4 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-color);
    cursor: pointer;
    user-select: none;
}

.epreuve-tabs .tab-btn:hover {
    background: var(--accent-light);
    color: var(--accent);
    border-color: var(--accent);
}

.epreuve-tabs .tab-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    font-weight: 700;
    box-shadow: 0 1px 4px rgba(236, 72, 153, 0.35);
}

/* === Statistics Section === */
.stats-section {
    background: var(--bg-white);
    backdrop-filter: blur(2px);
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
    border-radius: 0;
}

.stat-card {
    background: var(--bg-white);
    border: none;
    border-radius: 0;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-icon {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
   /* color: var(--accent);*/
}

.stat-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.stat-info {
    flex: 1;
}

.stat-label {
    font-size: 0.65em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 1px;
}

.stat-value {
    font-size: 1.05em;
    font-weight: 700;
    color: #1a202c;
}

.stat-unit {
    font-size: 0.75em;
    color: var(--text-muted);
    margin-left: 4px;
}

/* === Podium Section === */
.podium-section {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 16px;
    padding: 40px 20px 30px;
    background: var(--bg-white);
    backdrop-filter: blur(2px);
    border-radius: 0;
}

/* --- Modern podium (default) --- */
.podium-modern {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 16px;
    width: 100%;
    max-width: 900px;
}

.podium-step {
    flex: 1;
    max-width: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
}

.podium-step.r1 { order: 2; }
.podium-step.r2 { order: 1; }
.podium-step.r3 { order: 3; }

.podium-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8em;
    font-weight: 800;
    color: white;
    margin-bottom: 12px;
    position: relative;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.podium-step.r1 .podium-avatar {
    width: 88px;
    height: 88px;
    font-size: 2.2em;
    background: var(--podium-gold);
    box-shadow: 0 4px 20px rgba(251, 191, 36, 0.4);
}

.podium-step.r2 .podium-avatar {
    background: var(--podium-silver);
    box-shadow: 0 4px 15px rgba(156, 163, 175, 0.3);
}

.podium-step.r3 .podium-avatar {
    background: var(--podium-bronze);
    box-shadow: 0 4px 15px rgba(217, 119, 6, 0.3);
}

.podium-medal {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.5em;
    font-weight: 800;
    color: white;
    background: rgba(0,0,0,0.2);
}

.podium-flag {
    width: 36px;
    height: 24px;
    border-radius: 4px;
    margin-bottom: 8px;
    display: block;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.podium-name {
    font-size: 1.05em;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 4px;
    line-height: 1.3;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.podium-time {
    font-size: 1.2em;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 2px;
}

.podium-speed {
    font-size: 0.8em;
    color: var(--text-muted);
}

.podium-exaequo {
    font-size: 0.7em;
    color: var(--accent);
    font-weight: 600;
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.podium-bar {
    width: 100%;
    border-radius: 4px 4px 0 0;
    margin-top: 16px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    font-weight: 800;
    color: rgba(255,255,255,0.9);
}

.podium-step.r1 .podium-bar {
    min-height: 100px;
    background: linear-gradient(180deg, var(--podium-gold), rgba(245, 158, 11, 0.7));
}

.podium-step.r2 .podium-bar {
    min-height: 70px;
    background: linear-gradient(180deg, var(--podium-silver), rgba(107, 114, 128, 0.7));
}

.podium-step.r3 .podium-bar {
    min-height: 50px;
    background: linear-gradient(180deg, var(--podium-bronze), rgba(180, 83, 9, 0.7));
}

/* --- Legacy podium (fallback) --- */
.podium-legacy {
    display: flex;
    justify-content: center;
    gap: 15px;
    width: 100%;
}

.podium-legacy .podium-card {
    flex: 1;
    max-width: 280px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    padding: 25px;
    text-align: center;
    color: white;
    position: relative;
}

.podium-legacy .podium-card.r1 {
    max-width: 300px;
    transform: scale(1.05);
    z-index: 1;
    background: linear-gradient(135deg, var(--podium-gold) 0%, var(--podium-bronze) 100%);
}

.podium-legacy .podium-card.r2 {
    background: linear-gradient(135deg, var(--podium-silver) 0%, #6b7280 100%);
}

.podium-legacy .podium-card.r3 {
    background: linear-gradient(135deg, var(--podium-bronze) 0%, #b45309 100%);
}

.podium-legacy .podium-rank {
    font-size: 2.5em;
    font-weight: 800;
    opacity: 0.3;
    position: absolute;
    top: 8px;
    right: 15px;
}

.podium-legacy .podium-flag {
    width: 45px;
    height: 30px;
    border-radius: 4px;
    margin: 12px auto;
    display: block;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.podium-legacy .podium-name {
    font-size: 1.2em;
    font-weight: 700;
    margin-bottom: 4px;
    color: white;
}

.podium-legacy .podium-time {
    font-size: 1.3em;
    font-weight: 700;
    margin-bottom: 4px;
    color: white;
}

.podium-legacy .podium-speed {
    font-size: 0.85em;
    opacity: 0.9;
    color: white;
}

/* === Filters Section === */
.filters-section {
    background: var(--bg-white);
    backdrop-filter: blur(2px);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border-color);
    border-radius: 0;
}

.search-box {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9em;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9em;
    min-width: 130px;
}

.results-count {
    background: var(--accent);
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 600;
}

/* === Results Table === */
.table-section {
    background: var(--bg-white);
    backdrop-filter: blur(2px);
    overflow-x: auto;
    border-radius: 0;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85em;
}

.results-table th {
    background: var(--bg-input);
    backdrop-filter: blur(2px);
    padding: 10px 8px;
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.7em;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-strong);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    border-radius: 0;
}

/* Header column widths matching cell widths */
.results-table th.moy-header {
    width: 70px;
    min-width: 70px;
    max-width: 70px;
    text-align: right;
}
.results-table th.clt-sexe-header,
.results-table th.clt-cat-header {
    width: 60px;
    min-width: 60px;
    max-width: 60px;
    text-align: center;
}

.results-table th:hover {
    color: var(--text-color);
    background: var(--bg-hover);
}

.results-table td {
    padding: 10px 8px;
    border-bottom: 1px solid rgba(243, 244, 246, 0.4);
}

.results-table tr:hover {
    background: rgba(250, 250, 250, 0.5);
    cursor: pointer;
}


/* Live animation for new arrivals */
.results-table tr.new-arrival {
    animation: newPassage 2s ease-out;
}

@keyframes newPassage {
    0% {     background: var(--new-arrival); }
    100% { background: transparent; }
}

.clt-cell {
    width: 45px;
    text-align: center;
}

.clt-badge {
    display: inline-block;
    width: 22px;
    height: 22px;
    line-height: 22px;
    border-radius: 4px;
    font-weight: 700;
    text-align: center;
    font-size: 0.85em;
}

.clt-1 { background: var(--podium-gold); color: white; }
.clt-2 { background: var(--podium-silver); color: white; }
.clt-3 { background: var(--podium-bronze); color: white; }

.dossard-cell {
    width: 60px;
    text-align: center;
    font-weight: 600;
    color: var(--dossard-color);
}

.segment-cell {
    text-align: center;
    font-size: 0.9em;
    color: var(--text-primary);
    border-radius: 0;
}

.segment-cell.ptg-active {
    color: var(--accent);
    font-weight: 600;
}

.athlete-cell {
    font-weight: 600;

}
.athlete-cell-ctn {
    display: flex;
    align-items: center;  
    gap:.5rem;
    line-height: 1.05;
}

.club-cell {
    color: var(--text-muted);
    font-size: 0.9em;
}



.nat-flag {
    width: 26px;
    height: 18px;
    border-radius: 4px;
    display: inline-block;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* === Table Cell Base Styles === */

/* Fixed-width columns (SEXE, CAT) */
.sexe-cell,
.cat-cell {
    width: 55px;
    min-width: 55px;
    max-width: 55px;
    text-align: center;
    font-size: 0.8em;
    padding: 8px 4px;
    border-radius: 0;
}

/* Gender badges */
.sexe-m,
.sexe-f {
    width: 1.2rem;
    height: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-weight: 600;
}
.sexe-m {
    background: var(--sexe-m-bg);
    color: var(--sexe-m-color);
}
.sexe-f {
    background: var(--sexe-f-bg);
    color: var(--sexe-f-color);
}

/* Time columns */
.temps-cell {
    font-weight: 600;
}
.temps-reel-cell {
    font-weight: 500;
    color: var(--primary-color);
}

/* Average column */
.moy-cell {
    width: 70px;
    min-width: 70px;
    max-width: 70px;
    text-align: right;
    padding: 8px 4px;
    border-radius: 0;
}

/* Classification columns (CLT/SEXE, CLT/CAT) */
.clt-sexe-cell,
.clt-cat-cell {
    width: 60px;
    min-width: 60px;
    max-width: 60px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85em;
    padding: 8px 4px;
    border-radius: 0;
}

/* Pointage cells */
.pointage-cell {
    width: 45px;
    min-width: 45px;
    max-width: 45px;
    white-space: nowrap;
    text-align: center;
    font-size: 0.9em;
    color: var(--text-muted);
    padding: 8px 4px;
    border-radius: 0;
}

/* Athlete name formatting */
.athlete-name {
    font-weight: 600;
}



.athlete-firstname {
    font-weight: 400;
}

.athlete-club {
    font-size: 0.8em;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Active (selected) pointage column highlight */
.pointage-cell.ptg-active {
    color: var(--primary, #2563eb);
    font-weight: 600;
    background: rgba(37, 99, 235, 0.06);
}

/* Pointage header styling */
.pointage-header-th {
    white-space: nowrap;
    padding: 10px 4px;
    text-align: center;
    font-size: 0.7em;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-strong);
}

/* Responsive : nom sur une ligne pour petits écrans */
@media (max-width: 767px) {
       
    /* Masquer les pointages sur petit écran */
    .pointage-cell, .pointage-header-th {
        display: none;
    }
    
    body.show-pointages .pointage-cell, 
    body.show-pointages .pointage-header-th {
        display: table-cell;
    }
}

/* === Pagination === */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 20px;
    background: var(--bg-white-heavy);
    backdrop-filter: blur(2px);
    border-top: 1px solid var(--border-color);
}

.pagination button {
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-card);
    backdrop-filter: blur(2px);
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.2s;
}

.pagination button:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--border-strong);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination button.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.pagination .page-info {
    font-size: 0.85em;
    color: var(--text-muted);
}

.pagination .per-page-select {
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.85em;
}

/* === Modal / Popup === */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
}

.modal-content {
    position: relative;
    background: var(--bg-white-heavy);
    backdrop-filter: blur(2px);
    border-radius: 4px;
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
    z-index: 1;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.8em;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #1a202c;
}

/* Popup sections */
.popup-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-strong);
}

.popup-dossard {
    font-size: 2em;
    font-weight: 800;
    color: var(--accent);
    min-width: 60px;
    text-align: center;
}

.popup-name {
    font-size: 1.4em;
    font-weight: 700;
}

.popup-course {
    font-size: 0.9em;
    color: var(--text-muted);
}

.popup-section {
    margin-bottom: 20px;
}

.popup-section-title {
    font-size: 1em;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.popup-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.popup-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
    border-radius: 4px;
    background: var(--bg-input);
    font-size: 0.85em;
    gap: 8px;
}

.popup-list-item-segment {
    background: var(--bg-hover);
}

.popup-list-name {
    font-weight: 600;
    color: var(--text-color);
    flex-shrink: 0;
}

.popup-list-time {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text-color);
    text-align: right;
}

.popup-list-brut {
    font-size: 0.8em;
    color: var(--text-muted);
    text-align: right;
    margin-left: 8px;
}

.popup-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.popup-stat {
    background: var(--bg-input);
    backdrop-filter: blur(2px);
    padding: 10px 14px;
    border-radius: 4px;
}

.popup-stat-label {
    font-size: 0.75em;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.popup-stat-value {
    font-size: 1.1em;
    font-weight: 700;
    color: #1a202c;
}

/* Splits table in popup */
.popup-splits-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.popup-splits-table th {
    background: var(--bg-input);
    backdrop-filter: blur(2px);
    padding: 8px;
    text-align: left;
    font-size: 0.8em;
    color: var(--text-muted);
    text-transform: uppercase;
}

.popup-splits-table td {
    padding: 8px;
    border-bottom: 1px solid #f3f4f6;
}

/* Pointage times in popup */
.popup-pointage-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.popup-pointage-item {
    background: var(--bg-input);
    backdrop-filter: blur(2px);
    padding: 10px 14px;
    border-radius: 4px;
}

.popup-pointage-name {
    font-size: 0.75em;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.popup-pointage-time {
    font-size: 1.1em;
    font-weight: 700;
    color: #1a202c;
}

.popup-pointage-brut {
    font-size: 0.7em;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Video iframe */
.popup-video iframe {
    width: 100%;
    max-width: 560px;
    height: 315px;
    border: 0;
    border-radius: 4px;
}

/* Action buttons */
.popup-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
    padding-top: 0;
    border-top: none;
}

.btn {
    padding: 10px 18px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.btn-diploma {
    background: var(--btn-diploma);
    color: white;
}

.btn-diploma:hover {
    background: var(--btn-diploma-hover);
}

.btn-share-fb {
    background: var(--btn-fb);
    color: white;
}

.btn-share-fb:hover {
    background: var(--btn-fb-hover);
}

.btn-share-tw {
    background: var(--btn-tw);
    color: white;
}

.btn-share-tw:hover {
    background: var(--btn-tw-hover);
}

.btn-share-wa {
    background: var(--btn-wa);
    color: white;
}

.btn-share-wa:hover {
    background: var(--btn-wa-hover);
}

.btn-copy {
    background: var(--btn-copy);
    color: white;
}

.btn-copy:hover {
    background: var(--btn-copy-hover);
}

.btn-tracking {
    background: var(--btn-tracking);
    color: white;
}

.btn-tracking:hover {
    background: var(--btn-tracking-hover);
}

/* Diploma loading */
.diploma-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.85em;
}

.diploma-loading .mini-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e5e7eb;
    border-top-color: #ec4899;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === Footer === */
.site-footer {
    background: var(--footer-bg);
    backdrop-filter: blur(2px);
    padding: 16px 20px;
    color: var(--footer-text);
    font-size: 0.85em;
}

.footer-content {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.footer-links {
    display: flex;
    gap: 16px;
}

.footer-links a {
    color: var(--footer-link);
    text-decoration: none;
    transition: opacity 0.2s;
}

.footer-links a:hover {
    opacity: 0.8;
}

/* === Responsive === */
@media (max-width: 768px) {
    .event-title { font-size: 1.5em; }
    .event-details { gap: 10px; font-size: 0.85em; }
    .event-header { padding: 20px 15px; }
    .back-link { font-size: 0.85em; }
    .stats-section { grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 12px; }
    .stat-card { padding: 8px 10px; }
    .stat-icon { width: 28px; height: 28px; }
    .stat-value { font-size: 0.95em; }
    .stat-label { font-size: 0.6em; }

    /* Podium responsive */
    .podium-section { padding: 20px 10px; }
    .podium-modern { flex-direction: column; align-items: center; gap: 20px; }
    .podium-step { max-width: 260px; width: 100%; }
    .podium-step.r1 { order: 1; }
    .podium-step.r2 { order: 2; }
    .podium-step.r3 { order: 3; }
    .podium-bar { min-height: 30px !important; }
    .podium-avatar { width: 64px; height: 64px; font-size: 1.6em; }
    .podium-step.r1 .podium-avatar { width: 72px; height: 72px; font-size: 1.8em; }

    .filters-section { flex-direction: column; align-items: stretch; padding: 12px 15px; gap: 10px; }
    .search-box { min-width: 100%; }
    .filter-select { width: 100%; }
    .results-count { text-align: center; }
    .popup-stats-grid { grid-template-columns: 1fr; }
    .modal-content { padding: 20px; width: 95%; max-height: 95vh; }
    .popup-actions { flex-direction: column; }
    .popup-actions .btn { justify-content: center; }
    .popup-header { flex-direction: column; align-items: flex-start; gap: 8px; }
    .popup-dossard { font-size: 1.5em; }
    .popup-name { font-size: 1.2em; }
    .popup-video iframe { height: 200px; }
    .epreuve-tabs { padding: 10px 15px; }
    .epreuve-tabs .tab-btn { padding: 6px 12px; font-size: 0.85em; }
    
}

@media (max-width: 500px) {
    .event-header { padding: 12px 10px; }
    .event-title { font-size: 1.15em; }
    .event-details { font-size: 0.75em; gap: 6px; }
    .header-top { flex-wrap: wrap; gap: 8px; }
    
    /* Logo responsive for small screens */
    .lang-icon { font-size: 1em; }
    .lang-selector { padding: 4px 6px; font-size: 0.8em; }
    .stats-section { grid-template-columns: 1fr 1fr; gap: 6px; padding: 10px; }
    .stat-card { padding: 8px 10px; gap: 8px; }
    .stat-icon { width: 28px; height: 28px; }
    .stat-value { font-size: 0.95em; }
    .stat-label { font-size: 0.6em; }
    .stat-unit { font-size: 0.7em; }

    /* Podium small screens */
    .podium-section { padding: 15px 8px; }
    .podium-modern { gap: 16px; }
    .podium-step { max-width: 90%; }
    .podium-avatar { width: 56px; height: 56px; font-size: 1.4em; }
    .podium-step.r1 .podium-avatar { width: 64px; height: 64px; font-size: 1.6em; }
    .podium-name { font-size: 0.95em; }
    .podium-time { font-size: 1.05em; }
    .podium-speed { font-size: 0.75em; }
    .podium-flag { width: 30px; height: 20px; }
    .podium-bar { min-height: 24px !important; font-size: 1.5em; }
    .podium-medal { width: 22px; height: 22px; font-size: 0.45em; }

    .filters-section { padding: 10px 12px; gap: 8px; }
    .search-box input { padding: 8px 10px; font-size: 0.85em; }
    .filter-select { padding: 8px 10px; font-size: 0.85em; }
    .results-count { font-size: 0.75em; padding: 4px 10px; }
    .results-table { font-size: 0.72em; }
    .results-table th, .results-table td { padding: 6px 4px; }
    .results-table th { font-size: 0.65em; }
    /* Hide less important columns on small screens */
    .nat-cell, .clt-sexe-cell, .clt-cat-cell, .moy-cell { display: none; }
    .club-cell { display: none; }
    .dossard-cell { width: 45px; }
    .clt-cell { width: 35px; }
    .clt-badge { width: 18px; height: 18px; line-height: 18px; font-size: 0.75em; }
    .modal-content { padding: 15px; width: 98%; }
    .popup-header { padding-bottom: 10px; margin-bottom: 12px; }
    .popup-dossard { font-size: 1.3em; min-width: 45px; }
    .popup-name { font-size: 1.1em; }
    .popup-course { font-size: 0.8em; }
    .popup-section { margin-bottom: 15px; }
    .popup-section-title { font-size: 0.9em; }
    .popup-stat { padding: 8px 10px; }
    .popup-stat-label { font-size: 0.7em; }
    .popup-stat-value { font-size: 1em; }
    .popup-pointage-grid { grid-template-columns: 1fr; }
    .popup-pointage-item { padding: 8px 10px; }
    .popup-pointage-name { font-size: 0.7em; }
    .popup-pointage-time { font-size: 1em; }
    .popup-list-item { padding: 3px 6px; font-size: 0.8em; }
    .popup-list-name { font-size: 0.85em; }
    .popup-list-time { font-size: 0.85em; }
    .popup-list-brut { font-size: 0.75em; }
    .popup-pointage-brut { font-size: 0.65em; }
    .popup-video iframe { height: 180px; max-width: 100%; }
    .btn { padding: 8px 14px; font-size: 0.85em; }
    .pagination { gap: 4px; padding: 12px; flex-wrap: wrap; }
    .pagination button { padding: 6px 10px; font-size: 0.8em; }
    .pagination .page-info { font-size: 0.75em; }
    .pagination .per-page-select { padding: 4px 6px; font-size: 0.8em; }
    /* Tabs: compact on small screens */
    .epreuve-tabs { padding: 8px 12px; gap: 6px; }
    .epreuve-tabs .tab-btn { padding: 6px 10px; font-size: 0.8em; }
}

/* === Stages tabs === */
.stages-tabs {
    display: flex;
    gap: 8px;
    padding: 15px 20px;
    background: var(--bg-white-heavy);
    backdrop-filter: blur(2px);
    overflow-x: auto;
    border-bottom: 1px solid var(--border-color);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.stages-tabs::-webkit-scrollbar { display: none; }

.stages-tabs .tab-btn {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    padding: 6px 14px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
    background: var(--bg-input);
    font: 600 0.82em / 1.4 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-color);
    cursor: pointer;
    user-select: none;
}

.stages-tabs .tab-btn:hover {
    background: var(--accent-light);
    color: var(--accent);
    border-color: var(--accent);
}

.stages-tabs .tab-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    font-weight: 700;
    box-shadow: 0 1px 4px rgba(236, 72, 153, 0.35);
}

/* === Mode classement général === */

/* Global hide class - applied by JS to hide columns */
.hide {
    display: none !important;
}

/* SEXE column style in general mode - same as other ranking columns */
.general-mode .sexe-cell {
    display: table-cell;
    text-align: center;
    font-weight: 600;
    font-size: 0.9em;
    padding: 8px;
}

/* === Classifications annexes === */
.pts-cell {
    text-align: center;
    font-weight: 600;
    color: var(--accent);
}

.annex-row {
    border-left: 3px solid var(--accent);
}

.annex-filter-section {
    background: var(--bg-white-heavy);
    backdrop-filter: blur(2px);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.annex-label {
    font-size: 0.85em;
    font-weight: 600;
    color: var(--text-muted);
}

.annex-select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9em;
    min-width: 180px;
    background: var(--bg-input);
}

.annex-btn {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-card);
    cursor: pointer;
    font-size: 0.85em;
    color: var(--text-muted);
    transition: all 0.2s;
}

.annex-btn:hover {
    background: var(--bg-hover);
    color: var(--text-color);
}

/* Hide certain columns in annex mode */
.annex-mode .sexe-cell,
.annex-mode .cat-cell,
.annex-mode .clt-sexe-cell,
.annex-mode .clt-cat-cell,
.annex-mode .moy-cell {
    display: none;
}

.annex-mode .results-table th[data-sort="sexe"],
.annex-mode .results-table th[data-sort="categorie"],
.annex-mode .results-table th[data-sort="temps_reel"],
.annex-mode .results-table th[data-sort="temps"] {
    display: none;
}

/* Annex responsive */
@media (max-width: 768px) {
    .annex-filter-section {
        padding: 10px 15px;
        flex-wrap: wrap;
    }

    .annex-select {
        min-width: 140px;
        flex: 1;
    }

    .annex-label {
        width: 100%;
    }
}

@media (max-width: 500px) {
    .annex-filter-section {
        padding: 8px 12px;
        gap: 8px;
    }

    .annex-select {
        min-width: 120px;
        font-size: 0.85em;
    }

    .annex-btn {
        font-size: 0.8em;
        padding: 5px 10px;
    }
}

/* === Pointages (like G-Live #mnuptges) === */
.pointages-section {
    display: block;
    padding: 12px 16px;
    background: var(--bg-white);
    border-radius: 0;
    border: none;
    overflow-x: auto;
    overflow-y: hidden;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.pointages-label {
    display: block;
    font: 600 0.7em / 1 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.pointages-container {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.mnuptg {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    transition: all 0.2s ease;
    position: relative;
    background: var(--bg-input);
    font: 600 0.82em / 1.4 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    padding: 6px 12px;
    color: var(--text-color);
    text-align: center;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    user-select: none;
}

.mnuptg:hover {
    background: var(--accent-light);
    color: var(--accent);
    border-color: var(--accent);
}

.mnuptg.on {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    font-weight: 700;
    box-shadow: 0 1px 4px rgba(236, 72, 153, 0.35);
}

.mnuptg-arrivee {
    border-style: dashed;
}

.mnuptg-arrivee.on {
    border-style: solid;
}

.ptg-dist {
    font-size: 0.72em;
    opacity: 0.55;
    font-weight: 400;
}

.mnuptg.on .ptg-dist {
    opacity: 0.85;
}
