/* Style des composants de base l'accueil*/
* {
  box-sizing: border-box;
}

body {
  display: flex;
  align-items: center;
  flex-direction: column;
  background-color: beige;

  position: relative;
  isolation: isolate;
}

/* Image de fond fixe */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);

  width: 70vw;
  height: 100vh;

  background-image: url('images/image_arriere_plan.jpg');
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;

  z-index: -1;
  pointer-events: none;
}

@media (max-width: 1000px) {
  body {margin: 8px 1px;}
  body::before {
    width: 100vw;
    background-image: url('images/image_arriere_plan_tel.jpg');
  }
}

.titre {
  display: flex;
  justify-content: center;
  text-align: center;
  font-size: clamp(15px, 2vw, 30px);
  white-space: nowrap;
  font-weight: bold;
  color: #55aaee;
  -webkit-text-stroke: 0.3px black;
  border-radius: 5px;
  min-width: 400px;
  width: 70%;
  height: 50px;
  padding: 10px 0;
  background-image: url('images/drapeau.jpeg');
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
}

main {
  display: flex;
  flex-direction: row;
  min-width: 400px;
  min-width: 60%;
  max-width: 70%;
  height: calc(100vh - 50px);
  padding: 10px 5px;
}

.contenu {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.conteneur {
  width: 100%;
  height: min-content;
  border-radius: 15px;
  background-color: rgba(200, 200, 200, 0.5);
  margin: 3px;
  padding: 10px;
}

.conteneur--graphique {
  display: flex;
  flex-direction: column;
  row-gap: 10px;
  max-height: 80%;
}

.conteneur--info {
  display: flex;
  flex-direction: column;
  background-color: rgba(200, 200, 200, 0.7);
  overflow-y: auto;
}
.candidats{display: flex;flex-direction: row;}

@media (max-width: 1000px) {
  .titre{
    min-width: 0;
    width: 96%;
    padding: 2px 0;
    height: 34px;
    white-space: normal;
  }
  main {
    flex-direction: column;
    row-gap: 5px;
    width: 100%;
    height: calc(100vh - 34px);
    margin: 0%;
    min-width: 0;
  }

  .conteneur {
    width: 96%;
    margin: 0 2%;
    min-width: 0;
    padding: 10px 2px;
  }

  span {
    font-size: smaller;
  }
}


/* Style pour le conteneur des candidats */
button {
  background-color: #0000ee;
  color: darkgray;
  font-weight: bold;
  border-radius: 10px;
  padding: 2px 5px;
  margin: 2px;
}
.boutons {
  display: flex;
  flex-direction: column;
}
.case {font-size: 0.7rem;}
.bloc_annee {margin: 10px 0px;}

/* Style pour la liste des instituts */
.instituts {
  margin: 5px 0px;
}
.bouton_institut {
  display: list-item;
}

@media (max-width: 1000px) {
  .case {
    font-size: 0.5rem;
  }
}
/* Styles pour le graphique tracé par graphique.js */
.zone_graphique {
  display: flex;
  position: relative;
  background-color: rgba(200, 200, 200, 0.7);
  width: 100%;
  min-height: min-content;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  font-family: system-ui, sans-serif;
}

/* Curseur vertical de réglage de l'axe Y : barre pleine hauteur, à gauche des étiquettes */
.curseur_y {
  flex: 0 0 auto;
  width: 18px;
  margin: 0 2px;
}

.axe_fixe {
  flex: 0 0 auto;
  border-right: 1px solid #eeeeee;
  z-index: 2;
}

/* Colonne du graphique et de son curseur de réglage horizontal */
.colonne_graphique {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
}

/* Zone du graphique : grille + courbes + axe X, à la taille de la fenêtre choisie.
   overflow visible : les étiquettes d'axe posées près des bords ne sont pas rognées. */
.graphique {
  overflow: visible;
  margin: 5px;
}
@media (max-width: 1000px) {
  .graphique {margin: 2px;}
}
#svg_graphique, #svg_axe_y { display: block; overflow: visible; }

/* Curseurs de zoom (scrollbarres à deux poignées) : sous l'axe X et à gauche de l'axe Y */
.curseur_x {
  flex: 0 0 auto;
  height: 20px;
  margin: 0 5px 2px;
}
.curseur_double {
  position: relative;
}
.curseur_piste {
  position: absolute;
  background: #e4eaf1;
  border: 1px solid #b0bdcc;
  border-radius: 4px;
  touch-action: none;
}
.curseur_double:not(.curseur_double--vertical) .curseur_piste {
  left: 0;
  right: 0;
  top: calc(50% - 4px);
  height: 8px;
}
.curseur_double--vertical .curseur_piste {
  top: 0;
  bottom: 0;
  left: calc(50% - 4px);
  width: 8px;
}
.curseur_intervalle {
  position: absolute;
  background: rgba(90, 150, 210, 0.45);
  border-radius: 4px;
}
.curseur_double:not(.curseur_double--vertical) .curseur_intervalle {
  top: 0;
  bottom: 0;
}
.curseur_double--vertical .curseur_intervalle {
  left: 0;
  right: 0;
}
.curseur_poignee {
  position: absolute;
  width: 14px;
  height: 14px;
  background: #2b6cb0;
  border: 1px solid #1a4a7a;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  cursor: grab;
  touch-action: none;
}
.curseur_poignee:active {
  cursor: grabbing;
}
.curseur_double:not(.curseur_double--vertical) .curseur_poignee {
  top: calc(50% - 7px);
}
.curseur_double--vertical .curseur_poignee {
  left: calc(50% - 7px);
}

/* Info-bulle affichée au survol des points */
.survol_points {
  position: fixed;
  background: #222;
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-family: system-ui, sans-serif;
  pointer-events: none;
  display: none;
  z-index: 10;
}
.survol_points.visible {
  display: block;
}

@media (max-width: 1000px){
  .survol_points{font-size: 10px;}
}

/* Éléments internes du SVG */
.trait_axe {
  stroke: #999;
  stroke-width: 1;
}
.grille {
  stroke: #eee;
  stroke-width: 1;
}
.etiquette_axe {
  font-size: 11px;
  fill: #666;
  font-family: system-ui, sans-serif;
}
.courbe {
  fill: none;
  stroke-width: 1.5;
}
.point_survol {
  cursor: pointer;
  opacity: 0.35;
}
.point_survol:hover {
  opacity: 1;
  stroke: #000;
  stroke-width: 1;
}

/* Légende des courbes */
.legende_graphique {
  font-size: 12px;
  font-family: system-ui, sans-serif;
  background: rgba(255, 255, 255, 0.8);
  padding: 4px 8px;
  border-radius: 4px;
}
.item_legende {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 80px;
  margin: 5px;
}
.pastille_legende {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}