/* ==========================================================================
   Calor Run — Styles communs à toutes les pages
   (live_trail / participants / podiums / resultats / statistiques)
   Les styles spécifiques à chaque page restent dans le <style> de la page,
   chargé après ce fichier, et peuvent surcharger ces règles si besoin.
   ========================================================================== */

:root {
  --primary-color: #215E99;
  --secondary-color: #E61780;
  --bg-white: #fff;
  --bg-light: #f9f9f9;
  --shadow: rgba(0, 0, 0, 0.15);
  --border-radius: 0.5rem;
  --max-width: 62.5rem;
  --text-dark: #333;
  --border-light: #ddd;
  --header-bg: #e0e0e0;
}

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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.5;
  color: var(--text-dark);
  min-height: 100vh;
  padding: 1.25rem;
  position: relative;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: linear-gradient(0.25turn, var(--primary-color), var(--secondary-color));
  opacity: 0.3;
  z-index: -1;
  pointer-events: none;
}

.container { max-width: var(--max-width); margin: 0 auto; }

/* --- En-tête + logo SVG animé --- */
.header {
  text-align: center;
  margin-bottom: 0.625rem;
  color: var(--primary-color);
  font-size: 1.5rem;
  font-weight: bold;
}
.svg-wrapper { position: relative; }
.header-title {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  text-shadow: 0 0 6px rgba(255,255,255,0.85), 0 0 3px rgba(255,255,255,0.85);
}
.header svg {
  width: 100%;
  height: auto;
  max-height: 250px;
  display: block;
  margin: 0 auto;
}
.ecg {
  fill: none;
  stroke: #e61780;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2px;
}
.pulse {
  fill: #ffffff;
  filter: url(#glow);
}
.halo {
  fill: rgba(255,255,255,.3);
  filter: blur(8px);
}
.trail {
  fill: none;
  stroke: #ffffff;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .6;
  filter: blur(4px);
}
.coureur { fill: #204b9b; }
.coeur_gauche { fill: #f0047f; }
.coeur_droit { fill: url(#radial-gradient); }

/* --- Tableaux --- */
.table-container {
  max-width: var(--max-width);
  overflow-x: auto;
  margin: 0 auto 1.25rem;
  background: var(--bg-white);
  border-radius: var(--border-radius);
  box-shadow: 0 0.25rem 0.75rem var(--shadow);
}
table { width: 100%; border-collapse: collapse; min-width: 43.75rem; }
th, td { padding: 0.375rem 0.5rem; border-bottom: 1px solid var(--border-light); text-align: left; white-space: nowrap; }
th { background: var(--header-bg); font-weight: 600; position: sticky; top: 0; z-index: 10; }
tbody tr:nth-child(even) { background: var(--bg-light); }

.text-center { text-align: center; }
.loading { text-align: center; padding: 1.25rem 0; font-size: 1rem; }
.hidden { display: none; }

/* --- Classes communes pour compteurs 10km/20km/Total (live_trail, participants) --- */
.counter-10km { color: var(--primary-color); }
.counter-20km { color: var(--secondary-color); }
.counter-total { color: #000; }

/* --- Barre recherche + compteur (participants, resultats) --- */
.search-counter-container {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 1.25rem;
}
#search {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.75rem;
  border: none;
  border-bottom: 1px solid #888;
  background: transparent;
  color: var(--text-dark);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.3s;
}
#search:focus { border-bottom-color: var(--primary-color); }

/* --- Responsive commun --- */
@media (max-width: 768px) {
  .header { margin-bottom: 0.625rem; font-size: 1rem; }
  table { font-size: 0.85rem; }
}
