html {
  scroll-behavior: smooth;
}

/*=========================================================================*/

/* FONTS */

@font-face {
  font-family: chalkFont;
  src: url(resources/CoalhandLuke.ttf);
}

@font-face {
  font-family: clashDisplayBold;
  src: url(resources/ClashDisplay-Bold.ttf);
}

@font-face {
  font-family: clashDisplayLight;
  src: url(resources/ClashDisplay-Regular.ttf);
}

/*=========================================================================*/

.navigation {
  height: 100vh;
  /* position: relative; */
  h1 {
    text-shadow: 2px 2px 1px #ffc786;
    line-height: -3;
    font-weight: 700;
    font-size: 50px;
    position: absolute;
    top: 60px;

    left: 50%; /* Move 50% from the left */
    transform: translate(-50%);
  }
  img {
    /* width: 100%;
    height: 100%; */
    /* object-fit: cover; */
    position: absolute;
    bottom: 8px;
    right: 2px;
  }
}
#navigation-menu {
  color: white;

  height: 600px;
  width: 500px;
  background-color: #3e2b22;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: solid 15px;
  border-color: #ffbb79;
}

.nav-btn {
  margin: 10px 0;
  font-family: chalkFont;
  font-size: 20px;
  text-align: center;
}

.btn:hover {
  color: #ffbb79;
}

#map-exports,
#trendYears,
#chart {
  width: 80%;
  max-width: 1000px;
  margin: 30px 0;
}

#tooltip {
  position: absolute;
  visibility: hidden;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 5px;
  border-radius: 3px;
  font-size: 12px;
}
/* 
#my_dataviz {
  margin: 0 auto;
  width: fit-content;

  display: flex;
  flex-direction: column;
}

#my_dataviz > svg {
  padding: 1.5rem;
  overflow: visible;
  margin: 0 auto;
 
}

#my_dataviz > * {
  width: 100%;
} */

/* 
input[type="range"]::-webkit-slider-thumb, input[type="range"]::-moz-range-thumb {
  width: 16px;
} */

/* #container-country-selected {
  display: none;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
}

#country-info-container {
  width: 300px;
  overflow-y: auto;
  border: 1px solid #ccc;
  box-sizing: border-box;
}

#country-info-container h3,
#country-info-container p {
  width: 100%;
  margin: 0;
} */

#container {
  display: flex;
  flex-direction: column;

  width: 100%;
  /* flex-direction: row; */
  /* overflow: hidden; */
}

.tooltip {
  font-size: 12px;
  pointer-events: none;
}

.boxplot {
  stroke-width: 1.2px;
  stroke: #666;
  fill: none;
}

.title {
  text-align: center;
}

.instructions {
  margin-bottom: 20px;
  text-align: center;
  font-weight: 600;
  font-size: 24px;
  text-shadow: 1px 1px 1px #ededed55;
}
/*=========================================================================*/

/* MAIN */

#main {
  position: relative;
  width: fit-content;
}

#main svg.coffee-imports-exports {
  border-radius: 30px;
}

/*=========================================================================*/

.exports-map-container {
  background-color: #fbf1e5;
  border: 3px solid #6f4e37;
  border-radius: 30px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  position: relative;
}

#quality-container {
  border: 3px solid #6f4e37;
  border-radius: 30px;
  background-color: #fbf1e5;

  padding: 30px;
}
.best-coffess-container {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: var(--default-gap);
}

.country {
  fill: #ddbea9;
  stroke: #fff;
  stroke-width: 0.5;
  transition: fill 0.2s;
  cursor: pointer;
}

.country:hover {
  fill: #c58c6e;
}

.tooltip {
  position: absolute;
  background: white;
  padding: 8px;
  border: 1px solid #999;
  pointer-events: none;
  opacity: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.trade-route {
  fill: none;
  stroke: #999;
  stroke-width: 1;
}

.counts {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(255, 255, 255, 0.8);
  padding: 5px;
  border-radius: 3px;
  color: #6f4e37;
  font-weight: bold;
}

/*=========================================================================*/

/* LEGENDS */

.legend {
  position: absolute;
  bottom: 0px;
  background: rgba(255, 255, 255, 0.9);
  padding: 10px;
  border-radius: 5px;
  border: 1px solid #6f4e37;
  left: 30px;
  bottom: 30px;
}

.legend-item {
  display: flex;
  align-items: center;
  margin: 5px 0;
}

.legend-color {
  width: 15px;
  height: 15px;
  margin-right: 8px;
  border-radius: 50%;
}

/*=========================================================================*/

/* GENERAL CSS  */
:root {
  --default-gap: 1rem;
  --default-radius: 30px;

  --max-width-normal: min(85vw, 1200px);
  --max-width-large: min(90vw, 1400px);

  --border-width: 3px;
}

body {
  margin: 0;
  padding: 0 1em;
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: #fbf1e5;
  font-family: clashDisplayLight;
  font-size: large;
  gap: 4rem;
  background-image: url("resources/background.jpg");
  background-repeat: repeat;
  background-size: 300px auto;
  padding-left: 30px;
  padding-right: 30px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: clashDisplayBold;
  margin: 0px;
}
section {
  padding: 40px 0px;
}
h1 {
  font-size: 2rem;
  /* margin-top: 20px; */
}

svg {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  background-color: transparent;
  display: block;
}
/*=========================================================================*/

/* CARD */

.card {
  --card-padding: 1rem;
  --card-border: var(--border-width) solid #6f4e37;
  background: #fbf1e5;
  padding: var(--card-padding);
  border-radius: var(--default-radius);
  border: var(--card-border);

  display: flex;
  flex-direction: column;
}

.card:has(.card-body),
.card:has(.card-head) {
  padding: 0;
}

.card-head {
  padding: var(--card-padding);
  border-bottom: var(--card-border);
}

.card-body {
  padding: var(--card-padding);
  flex: 1;
}

/*=========================================================================*/

/* SECTION */

section {
  width: 100%;
  max-width: var(--max-width-normal);

  /* max-height: 120vh; */
  height: 100%;

  display: flex;
  flex-direction: column;
}

section.large-width {
  max-width: var(--max-width-large);
}

input[type="range"][orient="vertical"] {
  writing-mode: vertical-rl;
  direction: rtl;
}

.selectors-container {
  display: flex;
  /* justify-content: center; */
  gap: 1rem;
  /* margin-bottom: 1rem; */
}

.selector {
  border-bottom-left-radius: 0;
  padding: 0.5rem 1rem;
  background-color: #c79b7f;
  color: #fbf1e5;
  margin-bottom: 15px;
}
.selector:hover {
  cursor: pointer;
}

/*=========================================================================*/

/* ARABICA SECTION  */
#arabica-head {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  position: relative;
}

#arabica-map-container {
  position: relative;
  width: 100%;
  height: fit-content;
  overflow: hidden;
  /* margin: auto 0; */
  display: flex;
  flex-direction: column;
  height: 500px;
}

#arabica-map-container svg {
  /* crops out antarctica */
  height: 82%;
}

#arabica-year {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#arabica-production-dashboard {
  display: flex;
  flex-direction: column;
  /* align-items: center; */

  /* height: 100%; */
  width: 100%;
  /* margin-bottom: 100px; */
}

#arabica-visualisations-container {
  display: grid;
  grid-template-columns: 1fr auto; /*auto;*/
  grid-template-rows: 1fr auto;
  /* grid-template-columns: auto auto 1fr; */
  gap: var(--default-gap);
}
.arabica-main-container {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
  gap: var(--default-gap);
}

#arabica-side-container {
  width: 100%;
  height: 100%;
  /* padding-left: 2rem; */
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--default-gap);
}

#arabica-side-container > * {
  height: 100%;
}
/*=========================================================================*/

/* CONTROLS CONTAINER  */

.controls-container {
  padding: 1rem;
  height: auto; /* Set a fixed height */
  /* transform: translateY(-120px); */
  background-color: #c79b7f;
  /* position: relative; */
  /* margin-top: 20px; */
  width: fit-content; /* Ensures the width adapts to the content */

  margin-left: 0;
  margin-right: auto;
  opacity: 1;
  display: block;
}

.controls-container .tick text {
  fill: #fbf1e5;
  font-size: 12px;
}

.controls-container .slider .parameter-value {
  font-weight: bold;
}

.controls input[type="range"] {
  /* width: 100%;   */
}

/* Keep the thumb styling the same */
.controls input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 26px;
  background: #6f4e37;
  border-radius: 50%;
  cursor: pointer;
}

.controls input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: #6f4e37;
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

/*=========================================================================*/

/* SWITCH AND SLIDER BUTTON  */

.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
  /* margin-bottom: 10px; */
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #6f4e37;

  -webkit-transition: 0.4s;
  transition: 0.4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 24px;
  width: 24px;
  left: 4px;
  bottom: 5px;
  background-color: white;
  -webkit-transition: 0.4s;
  transition: 0.4s;
}

input:checked + .slider {
  background-color: #6f4e37;
}

input:focus + .slider {
  box-shadow: 0 0 1px #6f4e37;
}

input:checked + .slider:before {
  -webkit-transform: translateX(26px);
  -ms-transform: translateX(26px);
  transform: translateX(26px);
}

.slider.round {
  border-radius: 14px;
}

.slider.round:before {
  border-radius: 50%;
}

#slider-container .tick text {
  fill: #c79b7f;
  font-size: 10px;
}

/*=========================================================================*/

/* RADAR CHART  */

#radar-chart {
  width: 400px;
  height: 300px;
}

#radar-chart path {
  fill: #c58c6e;
  fill-opacity: 0.5;
  stroke: #6f4e37;
}

.scale-label {
  font-size: 8px;
  color: #b3b3b3;
  text-align: center;
  margin-top: 20px;
}

/*=========================================================================*/

/* BAR CHART  */

#bar-chart strong {
  font-weight: bold;
  margin-right: 5px;
  margin-bottom: 15px;
}

#bar-chart p {
  margin-bottom: 15px;
  line-height: 1.6;
}

#bar-chart h2 {
  font-size: 30px;
  margin-bottom: 10px;
}

#bar-chart .unit-info {
  font-size: 10px;
  font-style: italic;
  color: grey;
  margin-bottom: 15px;
}
#bar-chart {
  font-size: 15px;
  width: 500px;
  height: 300px;
}

#tooltip {
  position: absolute;
  padding: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  z-index: 10;
}

/*=========================================================================*/

/* LINE CHART  */

#line-chart {
  width: 100%;
  height: 300px;
}

/*=========================================================================*/

/* LOLLIPOP CHART  */

#lollipopSelect {
  width: 250px;
}

#lollipop-chart {
  width: 100%;
  height: 300px;
  position: relative;
  overflow: hidden;
}

#lollipop-chart .line {
  stroke: #d9b38c;
  stroke-width: 3;
  stroke-dasharray: 5, 5;
}

#lollipop-chart .circle {
  fill: #b8860b;
  stroke: #8b4513;
  stroke-width: 2;
}

#lollipop-chart .circle:hover {
  fill: #654321;
}

/*========================tooltip info======================*/

.help-tooltip-container {
  position: absolute; /* Position it absolutely within the parent container */
  top: 10px; /* Adjust the top distance from the container */
  right: 10px; /* Align it to the right */
  display: inline-block;
  text-align: center;
}

.help-btn {
  font-size: 18px;
  cursor: pointer;
  background: #c79b7f;
  border-radius: 50%; /* Make it round */
  width: 40px; /* Set width for the button */
  height: 40px; /* Set height for the button */
  border: none;
  color: #654321;
  border: 2px solid #654321;
  font-weight: bold;
  padding: 0;
}

.tooltip-text {
  visibility: hidden;
  background-color: #c79b7f;
  border: 2px solid #654321;

  color: #fff;
  text-align: center;
  border-radius: 5px;
  padding: 15px 20px; /* Increased padding for larger tooltip */
  position: absolute;
  z-index: 1;
  top: 100%; /* Move it below the button */
  right: 0; /* Align it to the right edge of the parent container */
  width: 300px; /* Set a specific width */
  font-size: 16px; /* Increased font size */
  opacity: 0;
  transition: opacity 0.3s;

  /* Allow wrapping and prevent overflowing */
  white-space: normal;
  word-wrap: break-word;
}

.help-tooltip-container:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* Prevent the tooltip from overflowing beyond the right side */
.help-tooltip-container:hover .tooltip-text {
  max-width: calc(100vw - 40px); /* Prevent overflow by limiting width */
}

/*========================icon chart======================*/
#coffee-consumption {
  display: grid;
  grid-template-columns: 1fr 1fr;
  /* grid-template-rows: 1fr 1fr; */

  gap: var(--default-gap);
  align-items: start;
}

#radar-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 450px;
}

#radar-chart {
  right: 300px;
}

#icon-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 450px;
}

.card-header {
  text-align: center;
  /* font-weight: 400;  */
  /* margin-bottom: 10px; */
}

.absolute-positioning {
  position: relative;
  margin-bottom: 10px;
}

form {
  position: absolute;
  bottom: 0.4rem;
  left: 0.8rem;
}
