/* ----------------- */
/* Styles généraux */
/* ----------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
}

.container {
    display: grid;
    grid-template-areas:
        "header header"
        "left   main"
        "footer footer";
    grid-template-columns: 2fr 5fr;  /* Colonne gauche + contenu principal */
    grid-template-rows: auto 1fr auto;
    min-height: 100vh;
}






/* ----------------- */
/* Zones spécifiques */
/* ----------------- */

.header {
  grid-area: header;
  background-color: #4CAF50;
  color: white;
  text-align: center;
  padding: 1rem;
  font-weight: bold;
  font-size: 20px;
}




/* Colonne gauche en flex vertical (si tu veux coller graph + radios en bas) */
.left-sidebar {
    display: flex;
    flex-direction: column;
    font-size: 14px;
    background-color: #f4f4f4;
    padding: 1rem;
}

/* Contenu principal de la colonne gauche au-dessus du graphe/paramètres */
.left-top-content {
    flex: 1;                    /* prend toute la place restante */
}

/* ===== Zone de graphe temporel ===== */

.left-graph-container {
    margin-top: 10px;
    margin-bottom: 10px;
    height: 300px;            
    min-height: 300px;            
    width: 100%;
    border: 1px solid #ccc;
    background-color: #ffffff;
    box-sizing: border-box;
    padding: 4px;
}

.left-graph-container canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* ===== Palette de couleurs (colorbar) ===== */
.colorbar-container {
    margin-top: 10px;
    margin-bottom: 10px;
    width: 100%;
}

#colorbar-legend {
    width: 100%;
    height: 30px;
    background: linear-gradient(to right, 
        rgb(0, 0, 255),      /* Bleu foncé */
        rgb(0, 255, 255),    /* Cyan */
        rgb(0, 255, 0),      /* Vert */
        rgb(255, 255, 0),    /* Jaune */
        rgb(255, 128, 0),    /* Orange */
        rgb(255, 0, 0)       /* Rouge vif */
    );
    border: 1px solid #ccc;
    border-radius: 4px;
}

#colorbar-values {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    font-size: 12px;
    color: #333;
}

#colorbar-values span {
    flex: 1;
    text-align: center;
    padding: 0 2px;
}

/* Message d'information pour le survol du graphe */
.graph-hover-message {
    margin-top: 10px;
    margin-bottom: 10px;
    padding: 8px;
    font-size: 13px;
    color: #555;
    text-align: center;
    font-style: italic;
    background-color: #f0f0f0;
    border-radius: 4px;
}

.graph-hover-message.hidden {
    display: none;
}

/* ===== Zone des paramètres (radio-buttons) ===== */



.left-param-choices {
    border-top: 1px solid #ccc;
    padding-top: 8px;
    margin-top: 8px;
    font-size: 15px;
}

.left-param-choices p {
    margin: 0 0 6px 0;
    font-weight: bold;
}

/* Grille 2 colonnes pour les 10 radios */
.param-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;   /* 2 colonnes */
    column-gap: 55px;
    row-gap: 4px;
    font-size: 12px; 
    line-height:1.2;
}

/* Chaque paramètre : radio + texte alignés sur une ligne */
.param-grid label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
}

.param-grid input[type="radio"] {
    margin-right: 4px;
    cursor: pointer;
}

/* Optionnel : style léger sur le focus des radios pour l’accessibilité */
.param-grid input[type="radio"]:focus-visible {
    outline: 2px solid #4CAF50;
    outline-offset: 2px;
}

/* Contrôle sur la carte : choix du gaz (CO2_DRY, CO, CH4_DRY) */
.leaflet-gas-param-control {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 8px 10px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
    font-size: 13px;
}

.leaflet-gas-param-control .gas-param-title {
    font-weight: bold;
    margin-bottom: 6px;
    color: #333;
}

.leaflet-gas-param-control label {
    display: block;
    margin: 4px 0;
    cursor: pointer;
}

.leaflet-gas-param-control input[type="radio"] {
    margin-right: 6px;
    cursor: pointer;
}

/* ===== Version mobile (une seule colonne de paramètres) ===== */

@media (max-width: 480px) {
    .param-grid {
        grid-template-columns: 1fr;   /* 1 colonne sur petits écrans */
    }
}






/* .left-sidebar {
  grid-area: left;
  background-color: #f4f4f4;
  padding: 1rem;
  font-size: 14px; 
} */

/* Alignement et espacement des éléments dans la colonne gauche */
.left-sidebar > * {
  display: block; /* Chaque élément sur une ligne séparée */
  margin-bottom: 15px; /* Espacement uniforme entre les éléments */
}

.left-sidebar select,
.left-sidebar input[type="range"],
.left-sidebar button {
  width: calc(100% - 20px); /* Largeur ajustée pour tenir dans la colonne */
}

.main-content {
  grid-area: main;
  background-color: #fff;
  padding: 1rem;
}

.right-sidebar {
  grid-area: right;
  background-color: #f4f4f4;
  padding: 1rem;
}

.footer {
  grid-area: footer;
  background-color: #333;
  color: white;
  text-align: center;
  padding: 1rem;
  font-size: 14px;
}

/* ------------------------------------ */
/* Design responsive avec Media Queries */
/* ------------------------------------ */

@media (max-width: 768px) {
  .container {
    grid-template-areas:
      "header"
      "main"
      "left"
      "right"
      "footer";
    grid-template-columns: 1fr; /* Une seule colonne */
    grid-template-rows: auto; /* Hauteur automatique */
    min-height: auto; /* Ajustement pour petits écrans */
    padding-bottom: 20px; /* Espacement supplémentaire en bas */
  }
}

/* ---------------------------------------------- */
/* Liste déroulante des trajectoires par campagne */
/* ---------------------------------------------- */

#campaigns {
        padding: 10px; /* Plus d'espace interne */
        border: 1px solid #ccc;
        border-radius: 5px;
        width: calc(100% - 20px); /* Largeur ajustée */
        overflow-y: auto;
}

#campaigns option {
        padding: 5px;
}

.ui-selectmenu-menu {
        max-height: 300px;
        overflow-y: auto;
        font-size: inherit; /* Hérite de la taille de police parent */
        padding: inherit; 
}

.ui-selectmenu-text {
        width: auto;
        padding: 0px;
}

.ui-selectmenu-menu-item-header {
        font-weight: bold;
        padding: 5px;
}

.ui-selectmenu-menu-item-content {
        padding: 5px;
        color: #666;
}

/* Styles pour les boutons */
button {
  background-color: #4CAF50;
  color: white;
  padding: 7px 15px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s;
  font-size: 16px;
  font-weight: bold;
}

button:hover {
  background-color: #45A049;
}

/* Slider */
input[type="range"] {
  width: calc(100% - 20px);
  height: 5px;
  margin: 10px 0;
  -webkit-appearance: none;
  appearance: none;
  background: #ccc;
  border-radius: 5px;
  outline: none;
  opacity: 0.7;
  -webkit-transition: .2s;
  transition: opacity .2s;
}

input[type="range"]:hover {
  opacity: 1;
}

input[type="range"]::-webkit-slider-thumb {
  width: 15px;
  height: 15px;
  background: #4CAF50;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 50%;
}

input[type="range"]::-moz-range-thumb {
  width: 15px;
  height: 15px;
  background: #4CAF50;
  cursor: pointer;
  border-radius: 50%;
}

#retrotraj-label {
  display: inline-block;
  width: 100%; 
  font-size: 14px;
  font-weight: bold;
}

#selected-date {
  display: inline-block;
  width: calc(100% - 100px); 
  margin-left: 5px;
  font-size: 14px;
  font-weight: bold;
}

#retrotraj-label, #selected-date {
    display: inline !important;
    white-space: nowrap;  /* bonus : anti-saut */
}

#logos {
    width: 100%;       /* Prend toute la largeur de la colonne */
    height: auto;      /* hauteur automatique = proportions respectées */
    max-width: 100%;   /* responsive bonus */
    display: block;    /* Pour éviter les espaces inline */
}



#espaces-sous-bouton {
  display: flex;
  flex-direction: column;
  height: 600px;
  border: none;
}

.espace {
  flex:1;
  background-color: #d0d0d0; /* Couleur de fond pour visualiser les espaces */
  border-bottom: none;
  margin-bottom:2px;
}

.campaign-container{
	display: flex;
	align-items: center;
}

.campaign-loader {
  background-color: #4CAF50;
  color: white;
  padding: 5px 10px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s;
  margin-left: 5px; /* Espacement entre la liste et le bouton */
  width: auto;
}

.campaign-loader:hover {
  background-color: #45A049;
}


/* Overlay plein écran */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(2px);
}

.loading-overlay.hidden {
    display: none;
}

/* Sablier animé */
.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-overlay p {
    color: white;
    font-size: 16px;
    font-weight: bold;
    margin: 0;
}

/* Désactive interactions quand overlay actif */
.loading-overlay:not(.hidden) + * {
    pointer-events: none;
}


