/**
 * 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.62);
    --bg-white-heavy: rgba(255, 255, 255, 0.60);
    --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;
    /* Fixed background image, responsive via CSS variables */
    background-image: var(--bg-small);
    background-size: cover;
    background-position: top center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

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

@media (min-width: 1200px) {
    body { 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;
}

.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-title {
    font-size: 2em;
    font-weight: 700;
    margin-bottom: 10px;
}

.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; }
}

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

.tab-btn {
    padding: 8px 16px;
    background: var(--bg-input);
    backdrop-filter: blur(6px);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    transition: all 0.2s;
    text-decoration: none;
    font-size: 0.9em;
}

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

.tab-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

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

.stat-card {
    background: var(--bg-card);
    border: 1px solid rgba(0,0,0,0.04);
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1em;
    background: var(--accent-light);
}

.stat-info {
    flex: 1;
}

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

.stat-value {
    font-size: 1.2em;
    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-heavy);
    backdrop-filter: blur(8px);
}

/* --- 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: 3px;
    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: 8px 8px 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: 10px;
    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-heavy);
    backdrop-filter: blur(8px);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border-color);
}

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

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

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

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

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

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

.results-table th {
    background: var(--bg-input);
    backdrop-filter: blur(4px);
    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;
}

.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;
}

.results-table tr.podium-1 { background: rgba(251, 191, 36, 0.08); }
.results-table tr.podium-2 { background: rgba(156, 163, 175, 0.06); }
.results-table tr.podium-3 { background: rgba(217, 119, 6, 0.06); }

/* 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);
}

.athlete-cell {
    font-weight: 600;
}

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

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

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

.sexe-cell, .cat-cell {
    width: 55px;
    text-align: center;
    font-size: 0.8em;
    padding: 3px 6px;
    border-radius: 4px;
    display: inline-block;
}

.sexe-m { background: var(--sexe-m-bg); color: var(--sexe-m-color); }
.sexe-f { background: var(--sexe-f-bg); color: var(--sexe-f-color); }

.temps-cell {
    font-weight: 600;
}

.moy-cell {
    text-align: right;
}

.clt-sexe-cell, .clt-cat-cell {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85em;
}

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

.pagination button {
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-card);
    backdrop-filter: blur(4px);
    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(12px);
    border-radius: 12px;
    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-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

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

.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(4px);
    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;
}

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

/* 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: 6px;
    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(8px);
    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: 10px 12px; }
    .stat-icon { width: 30px; height: 30px; font-size: 0.9em; }
    .stat-value { font-size: 1em; }
    .stat-label { font-size: 0.65em; }

    /* 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; }
    .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; }
    .back-link { font-size: 0.78em; margin-bottom: 0; }
    .lang-wrapper { font-size: 0.85em; }
    .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; font-size: 0.85em; }
    .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-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; }
    .tab-btn { padding: 6px 10px; font-size: 0.8em; }
}
