/* Reset */
/* * { box-sizing: border-box; margin: 0; padding: 0; }*/
html, body { margin: 0;
  padding: 0;
  background: #000;   /* fallback background for scrolling */
  color: white; font-family: 'Arial', sans-serif }

/* Main layout */
#mainLayout {
  display: flex;
  flex-direction: row;
  width: 100%;
  height: 100vh; /* full viewport */
   padding: 0 2.5%;
  box-sizing: border-box;
  background: #000;
}

#origineContainer {
  flex: 1 1 auto;    /* flexible */
  background: #000000;
  color: white;
  padding: 1rem;
  min-height: unset;
  height: auto;
  margin-bottom:20px;
}

#origineBars {
  width: 100%;
  height: auto;/*container adapts to content */
  background: #000; /* your background */
}

#globalContainer {
  flex: 0 0 auto;/* don’t stretch */
  width: 100%;
  max-width: 500px;/* never wider than 500px */
  background: #000;
  color: white;
  padding: 1rem;
  margin: 0 auto;    /* center horizontally */
  height: auto; 
}

#titleText {
  text-align: center;
  font-size: 20px;
  margin: 20px 0 0px;
  font-weight: bold;
  color: white; /* base text always white */
}

#titleText .title-dynamic {
  color: white; /* gets updated dynamically */
}

#buttonLayer {
  width: 100%;
  max-width: 500px;
  margin: 20px auto;
  box-sizing: border-box;
  overflow: visible; /* prevent clipping on Firefox */
}

#countryButtons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;  /* center columns under canvas */
  align-items: flex-start;
  margin: 0;
  padding: 0;
}
#countryButtons > div {  /* column containers */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin: 0 0px;/* space between columns */
}
#countryButtons .country-btn {  /* individual country */
  cursor: pointer;
  font-size: 13px;
  max-width: 140px;
  line-height: 12px;     /* single line spacing */
  text-align: left;
}


#globalContainer canvas {
  display: block;
  margin: 0 auto;
}


/* Destination: takes all available space on the right */
#destinationContainer {
  flex: 1 1 auto;    /* flexible */
  background: #000000;
  color: white;
  padding: 1rem;
   height: auto;
  margin-bottom:20px;
}

#destinationBars {
  width: 100%;
  height: auto;/*container adapts to content */

}

#sideBySide {
  display: flex;
  flex-direction: row;
  width: 100%;
}


/* ---------- Mobile (<768px) ---------- */
@media (max-width: 768px) {
  #mainLayout {
    flex-direction: column; /* stack global first */
  }

  #globalContainer {
    order: 1;
    width: 100%;
    max-width: none;
    
  }
  
  #buttonLayer {
    display: block;
    margin: 20px auto;     /* center horizontally */
    width: 90%;            /* shrink to fit smaller screens */
  }
  
  #sideBySide {
    order: 2;
    display: flex;
    flex-direction: row; /* row inside column */
  }

  #origineContainer,
  #destinationContainer {
    flex: 1 1 45%;
    height: auto;
  }
}

@media (max-width: 460px) {
  #buttonLayer {
    width: 90%;      /* responsive width */
  }
}
