/* ========================================================================== 
   CHARGE — DESIGN PREMIUM INSIDE PACE
   Navy profond · halos vert/or · filet supérieur · verre blanc
   ========================================================================== */

:root {
  --ip-charge-navy-1: #0b1737;
  --ip-charge-navy-2: #10264f;
  --ip-charge-navy-3: #173663;
  --ip-charge-gold: #ffc447;
  --ip-charge-gold-soft: #ffd978;
  --ip-charge-green: #51d697;
  --ip-charge-blue: #8fbbff;
  --ip-charge-white: rgba(255, 255, 255, 0.97);
  --ip-charge-white-2: rgba(255, 255, 255, 0.72);
  --ip-charge-white-3: rgba(255, 255, 255, 0.47);
  --ip-charge-line: rgba(255, 255, 255, 0.11);
  --ip-charge-glass: rgba(255, 255, 255, 0.075);
  --ip-charge-glass-strong: rgba(255, 255, 255, 0.115);
  --ip-charge-shadow: 0 18px 42px rgba(2, 10, 33, 0.32);
}

/* Sélecteur d’athlète ------------------------------------------------------ */

.ip-charge-athlete-picker {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  background:
    radial-gradient(190px 95px at 100% 0%, rgba(255, 196, 71, 0.18), transparent 72%),
    radial-gradient(210px 110px at 0% 100%, rgba(34, 160, 107, 0.13), transparent 74%),
    linear-gradient(145deg, rgba(11, 23, 55, 0.96), rgba(16, 43, 83, 0.96)) !important;
  box-shadow: var(--ip-charge-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

.ip-charge-athlete-picker::before {
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, #22a06b 0%, #58d39b 48%, #ffc447 100%);
  content: '';
}

.ip-charge-athlete-picker > span {
  color: var(--ip-charge-gold-soft) !important;
  letter-spacing: 0.1em !important;
}

.ip-charge-athlete-picker > select {
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  background:
    linear-gradient(rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.06)),
    rgba(4, 13, 35, 0.48) !important;
  color: #fff !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 8px 18px rgba(2, 9, 28, 0.16) !important;
  font-weight: 780 !important;
  outline: none;
}

.ip-charge-athlete-picker > select:focus {
  border-color: rgba(255, 196, 71, 0.7) !important;
  box-shadow: 0 0 0 3px rgba(255, 196, 71, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.09) !important;
}

.ip-charge-athlete-picker option {
  background: #102247;
  color: #fff;
}

/* Carte principale -------------------------------------------------------- */

.ip-charge-athletes-list {
  display: grid;
  gap: 16px !important;
}

.ip-charge-athlete-card {
  position: relative;
  isolation: isolate;
  overflow: hidden !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 24px !important;
  background:
    radial-gradient(340px 210px at 108% -4%, rgba(255, 196, 71, 0.18), transparent 72%),
    radial-gradient(310px 250px at -5% 106%, rgba(34, 160, 107, 0.15), transparent 74%),
    linear-gradient(145deg, var(--ip-charge-navy-1) 0%, var(--ip-charge-navy-2) 62%, var(--ip-charge-navy-3) 100%) !important;
  color: #fff !important;
  box-shadow:
    var(--ip-charge-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.09) !important;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.ip-charge-athlete-card::before {
  position: absolute;
  z-index: 2;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, #22a06b 0%, #57d49a 48%, #ffc447 100%);
  box-shadow: 0 0 18px rgba(82, 213, 154, 0.28);
  content: '';
}

.ip-charge-athlete-card::after {
  position: absolute;
  z-index: -1;
  inset: -70px -80px auto auto;
  width: 190px;
  height: 190px;
  border: 28px solid rgba(255, 255, 255, 0.025);
  border-radius: 50%;
  content: '';
  pointer-events: none;
}

.ip-charge-athlete-card:has(.ip-charge-detail-toggle[aria-expanded='true']) {
  border-color: rgba(255, 196, 71, 0.72) !important;
  box-shadow:
    0 20px 48px rgba(2, 10, 33, 0.38),
    0 0 0 2px rgba(255, 196, 71, 0.19),
    inset 0 1px 0 rgba(255, 255, 255, 0.11) !important;
}

.ip-charge-athlete-head {
  position: relative;
  z-index: 1;
  padding-top: 3px;
}

.ip-charge-athlete-head > div {
  color: var(--ip-charge-white) !important;
  font-size: 19px !important;
  letter-spacing: -0.025em;
}

.ip-charge-athlete-head > span {
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  background: rgba(255, 255, 255, 0.09) !important;
  color: var(--ip-charge-white) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 8px 18px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.ip-charge-athlete-head > span > span {
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.08), 0 0 14px currentColor;
}

.ip-charge-athlete-head + div:not([class]) {
  color: var(--ip-charge-white-2) !important;
}

/* Historique 6 mois ------------------------------------------------------- */

.ip-charge-histo-scroll {
  position: relative;
  overflow-x: auto;
  padding: 13px 12px 10px !important;
  border: 1px solid rgba(255, 255, 255, 0.105);
  border-radius: 17px;
  background:
    radial-gradient(180px 90px at 100% 0%, rgba(255, 196, 71, 0.08), transparent 75%),
    rgba(1, 10, 31, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
  scrollbar-color: rgba(255, 196, 71, 0.45) rgba(255, 255, 255, 0.04);
  scrollbar-width: thin;
}

.ip-charge-histo-scroll::-webkit-scrollbar {
  height: 4px;
}

.ip-charge-histo-scroll::-webkit-scrollbar-track {
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.04);
}

.ip-charge-histo-scroll::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: linear-gradient(90deg, #43c98a, #ffc447);
}

.ip-charge-histo-bars {
  min-height: 112px !important;
  align-items: end;
  border-bottom-color: rgba(255, 255, 255, 0.11) !important;
}

.ip-charge-histo-bars button {
  border-radius: 5px 5px 2px 2px !important;
  -webkit-tap-highlight-color: transparent;
}

.ip-charge-histo-bars button > div {
  border-radius: 5px 5px 2px 2px !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 4px 10px rgba(0, 0, 0, 0.18);
  transition: filter 130ms ease, transform 130ms ease, outline-color 130ms ease;
}

.ip-charge-histo-bars button:active > div {
  filter: brightness(1.16);
  transform: scaleX(0.9);
}

.ip-charge-histo-bars button[aria-pressed='true'] > div {
  outline: 2px solid var(--ip-charge-gold) !important;
  outline-offset: 2px !important;
  filter: brightness(1.1) saturate(1.05);
}

.ip-charge-histo-labels {
  border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

.ip-charge-histo-labels span {
  color: rgba(255, 255, 255, 0.43) !important;
}

/* Semaine sélectionnée ---------------------------------------------------- */

.ip-charge-semaine {
  position: relative;
  overflow: hidden;
  margin-top: 13px !important;
  border: 1px solid rgba(255, 255, 255, 0.13) !important;
  border-radius: 20px !important;
  background:
    radial-gradient(260px 150px at 100% 0%, rgba(255, 196, 71, 0.14), transparent 74%),
    radial-gradient(260px 160px at 0% 100%, rgba(34, 160, 107, 0.12), transparent 76%),
    rgba(5, 17, 45, 0.62) !important;
  box-shadow:
    0 13px 28px rgba(1, 8, 26, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.07) !important;
}

.ip-charge-semaine::before {
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, #22a06b 0%, #57d49a 48%, #ffc447 100%);
  content: '';
}

.ip-charge-semaine-entete {
  position: relative;
  z-index: 1;
  gap: 14px !important;
  padding: 18px 16px 14px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09) !important;
}

.ip-charge-semaine-identite > span {
  color: var(--ip-charge-gold-soft) !important;
  font-size: 9.5px !important;
  font-weight: 850 !important;
  letter-spacing: 0.11em !important;
  text-transform: uppercase;
}

.ip-charge-semaine-identite > strong {
  color: var(--ip-charge-white) !important;
  font-size: 18px !important;
  letter-spacing: -0.02em;
}

.ip-charge-semaine-identite > small {
  color: var(--ip-charge-white-3) !important;
}

.ip-charge-semaine-stats {
  gap: 8px !important;
}

.ip-charge-semaine-stat {
  min-width: 92px;
  min-height: 68px;
  border: 1px solid rgba(255, 255, 255, 0.115) !important;
  border-radius: 14px !important;
  background: rgba(255, 255, 255, 0.075) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.ip-charge-semaine-stat > strong {
  color: var(--ip-charge-white) !important;
}

.ip-charge-semaine-stat > span {
  color: var(--ip-charge-white-3) !important;
}

.ip-charge-semaine-stat.is-accent {
  border-color: rgba(255, 196, 71, 0.37) !important;
  background:
    radial-gradient(80px 55px at 100% 0%, rgba(255, 216, 117, 0.2), transparent 72%),
    rgba(255, 196, 71, 0.12) !important;
}

.ip-charge-semaine-stat.is-accent > strong,
.ip-charge-semaine-stat.is-accent > span {
  color: var(--ip-charge-gold-soft) !important;
}

/* Calendrier hebdomadaire ------------------------------------------------- */

.ip-charge-calendrier {
  gap: 9px !important;
  padding: 13px !important;
}

.ip-charge-jour {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.085) !important;
  border-radius: 15px !important;
  background: rgba(255, 255, 255, 0.045) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.ip-charge-jour.has-seances {
  border-color: rgba(81, 214, 151, 0.24) !important;
  background:
    radial-gradient(120px 70px at 0% 100%, rgba(34, 160, 107, 0.1), transparent 75%),
    rgba(255, 255, 255, 0.055) !important;
}

.ip-charge-jour-entete {
  padding: 10px 11px 8px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.075) !important;
  background: rgba(0, 0, 0, 0.08) !important;
}

.ip-charge-jour-entete > strong {
  color: var(--ip-charge-white) !important;
  text-transform: capitalize;
}

.ip-charge-jour-entete > span {
  color: var(--ip-charge-white-3) !important;
}

.ip-charge-jour-contenu {
  padding: 8px !important;
}

.ip-charge-jour-vide {
  color: rgba(255, 255, 255, 0.31) !important;
}

/* Séances ----------------------------------------------------------------- */

.ip-charge-seance-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.105) !important;
  border-radius: 13px !important;
  background:
    radial-gradient(100px 65px at 100% 0%, rgba(255, 196, 71, 0.08), transparent 74%),
    rgba(255, 255, 255, 0.065) !important;
  color: #fff !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055), 0 7px 15px rgba(0, 0, 0, 0.1);
  transition: transform 130ms ease, border-color 130ms ease, background 130ms ease;
}

.ip-charge-seance-card:active {
  transform: scale(0.985);
  border-color: rgba(255, 196, 71, 0.4) !important;
  background: rgba(255, 255, 255, 0.09) !important;
}

.ip-charge-seance-card:focus-visible {
  outline: 2px solid var(--ip-charge-gold);
  outline-offset: 2px;
}

.ip-charge-seance-titre > strong {
  color: var(--ip-charge-white) !important;
}

.ip-charge-seance-titre > i {
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.06), 0 0 12px currentColor;
}

.ip-charge-seance-metas,
.ip-charge-seance-metas > span {
  color: var(--ip-charge-white-3) !important;
}

.ip-charge-seance-metas > .is-sport {
  color: var(--ip-charge-blue) !important;
}

.ip-charge-seance-chevron {
  width: 29px;
  height: 29px;
  flex: 0 0 auto;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.085);
  color: rgba(255, 255, 255, 0.88) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 6px 13px rgba(0, 0, 0, 0.12);
}

/* Dépliage des indicateurs ------------------------------------------------ */

.ip-charge-detail-toggle {
  min-height: 42px;
  margin-top: 13px !important;
  border: 1px solid rgba(255, 255, 255, 0.13) !important;
  border-radius: 13px !important;
  background: rgba(255, 255, 255, 0.075) !important;
  color: rgba(255, 255, 255, 0.78) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.ip-charge-detail-toggle[aria-expanded='true'] {
  border-color: rgba(255, 196, 71, 0.42) !important;
  background:
    radial-gradient(150px 65px at 100% 0%, rgba(255, 196, 71, 0.16), transparent 75%),
    rgba(255, 196, 71, 0.09) !important;
  color: var(--ip-charge-gold-soft) !important;
}

.ip-charge-detail-toggle:focus-visible {
  outline: 2px solid var(--ip-charge-gold);
  outline-offset: 2px;
}

/* Bandeau explicatif après ouverture */
.ip-charge-detail-toggle[aria-expanded='true'] + div:not(:has(.ip-charge-indicateurs-entete)) {
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background:
    radial-gradient(180px 90px at 100% 0%, rgba(255, 196, 71, 0.15), transparent 74%),
    radial-gradient(180px 100px at 0% 100%, rgba(34, 160, 107, 0.11), transparent 76%),
    rgba(4, 16, 43, 0.68) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 10px 20px rgba(0, 0, 0, 0.12);
}

.ip-charge-detail-toggle[aria-expanded='true'] + div:not(:has(.ip-charge-indicateurs-entete)) > div {
  color: rgba(255, 255, 255, 0.78) !important;
}

.ip-charge-athlete-card > div:has(> .ip-charge-indicateurs-entete) {
  margin-top: 11px !important;
  padding: 11px 12px 8px;
  border: 1px solid rgba(255, 255, 255, 0.105);
  border-radius: 15px;
  background: rgba(2, 12, 35, 0.32);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

.ip-charge-indicateurs-entete {
  border-bottom: 1px solid rgba(255, 255, 255, 0.075);
}

.ip-charge-indicateurs-entete > span {
  color: rgba(255, 255, 255, 0.38) !important;
}

.ip-charge-indicateurs-ligne {
  border-top-color: rgba(255, 255, 255, 0.075) !important;
}

.ip-charge-indicateurs-ligne > span {
  color: rgba(255, 255, 255, 0.68) !important;
}

.ip-charge-indicateurs-ligne > span[data-label='Charge'] {
  color: #fff !important;
}

.ip-charge-distances-inline,
.ip-charge-distances-inline > span {
  color: rgba(255, 255, 255, 0.6) !important;
}

.ip-charge-distances-inline b {
  color: rgba(255, 255, 255, 0.84) !important;
}

/* Chips de synthèse */
.ip-charge-athlete-card > div[style*='flex-wrap'] > span {
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.075) !important;
  color: rgba(255, 255, 255, 0.72) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* Mobile ------------------------------------------------------------------ */

@media (max-width: 700px) {
  .ip-charge-athlete-picker {
    margin-top: 16px !important;
    padding: 14px 15px 15px !important;
    border-radius: 19px !important;
  }

  .ip-charge-athlete-picker > select {
    min-height: 48px;
    border-radius: 13px !important;
  }

  .ip-charge-athlete-card {
    padding: 15px !important;
    border-radius: 22px !important;
  }

  .ip-charge-athlete-head {
    align-items: flex-start !important;
  }

  .ip-charge-athlete-head > div {
    font-size: 18px !important;
  }

  .ip-charge-athlete-head > span {
    max-width: 64%;
    padding: 6px 10px !important;
    font-size: 11.5px !important;
    white-space: normal !important;
    line-height: 1.2;
  }

  .ip-charge-histo-scroll {
    margin-inline: -2px;
    padding: 12px 10px 9px !important;
    border-radius: 15px;
  }

  .ip-charge-histo-bars {
    min-height: 104px !important;
  }

  .ip-charge-semaine {
    border-radius: 18px !important;
  }

  .ip-charge-semaine-entete {
    padding: 16px 13px 13px !important;
  }

  .ip-charge-semaine-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .ip-charge-semaine-stat {
    min-width: 0;
    min-height: 66px;
  }

  .ip-charge-calendrier {
    padding: 10px !important;
  }

  .ip-charge-jour {
    border-radius: 14px !important;
  }

  .ip-charge-jour-entete {
    padding: 9px 10px 7px !important;
  }

  .ip-charge-seance-card {
    padding: 10px !important;
  }

  .ip-charge-indicateurs-ligne {
    border: 1px solid rgba(255, 255, 255, 0.085) !important;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
  }

  .ip-charge-indicateurs-ligne > span::before {
    color: rgba(255, 255, 255, 0.36) !important;
  }
}

@media (max-width: 390px) {
  .ip-charge-athlete-head {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .ip-charge-athlete-head > span {
    max-width: 155px;
  }

  .ip-charge-semaine-stats {
    gap: 7px !important;
  }

  .ip-charge-semaine-stat {
    min-height: 62px;
    padding: 10px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ip-charge-athlete-card,
  .ip-charge-seance-card,
  .ip-charge-histo-bars button > div {
    transition: none !important;
  }
}
