/* color variablas */
:root {
  --lightestgray: #c2c4c5;
  --lightgray: #686d76;
  --darkgray: #373a40;
  --green: #be0000;
  --selectedMin: #ff8f8f;
  --selectedMax: #620505;
  --white: #eeeeee;
}

/* Setting a standard margin, padding and box sizing to border box */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Disable shadows and outlines */
input:focus,
button:focus {
  outline: none;
  box-shadow: none;
}

/* Giving the body and html element 100dvh */
body,
html {
  height: 100dvh;
}

/* Header section */
header {
  display: flex;
  background-color: var(--lightgray);
  justify-content: left;
  height: 79px;
  background-image: url("favicon.svg");
  background-repeat: no-repeat;
  background-size: 60px;
  background-position: 40px;
  background-position-y: center;
  position: relative;
}

header .butt {
  display: flex;
}

.main-title {
  color: #373a40;
  margin: 0;
  font-size: 1.4rem;
  font-weight: 400;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  text-align: center;
}

.btn {
  border: none;
  height: 79px;
  text-align: center;
  background-color: transparent;
  color: var(--white);
  width: 130px;
  font-size: 0.95rem;
  font-weight: bold;
}

.active {
  background-color: var(--darkgray);
}

.btn:hover {
  cursor: pointer;
}

.btn:not(.active):hover {
  color: var(--green);
  text-shadow: 0px 0px 5px var(--green);
}

.pageName {
  color: var(--white);
  border: none;
  background-color: transparent;
  font-size: 1.5em;
  font-weight: bold;
  position: absolute;
  top: 50%;
  left: 10%;
  transform: translateY(-50%);
  cursor: pointer;
}

.pageName:hover {
  color: var(--green);
}

.tagline {
  color: var(--white);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translateY(-50%);
  cursor: pointer;
}

/* Main menu section. Main menu is currently set to display: none; in the jsx file */
.main_menu {
  background-color: green;
  height: calc(100dvh - 79px);
  display: flex;
  justify-content: center;
  align-items: center;
}

.p_main_menu {
  color: black;
  font-size: larger;
}

/* Testing menu section. Testing menu is currently set to display: none; in the jsx file */
.testing {
  background-color: yellow;
  height: calc(100dvh - 79px);
  display: flex;
  justify-content: center;
  align-items: center;
}

.p_testing {
  color: black;
  font-size: larger;
}

/* The Diseases section */

/* The screen size itself */
.container {
  display: grid;
  text-align: center;
  /* Disable flexbox */
  background-color: var(--white);
  height: auto;
  width: 100%;
  grid-template-columns: 1fr 1fr;
}

/* Bug fix: content in information and map overlapping footer and graph text*/
.information,
.map {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100vw;
}

/* The box the map is in */
.map {
  vertical-align: top;
  width: 70vw;
  background-color: rgba(213, 220, 223, 0.71);
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  /* Manually position within the container */

  height: 100vh;
}

svg {
  padding-top: 5%;
  height: 100%;
}

/* The styling for the map */
.map svg path {
  fill: var(--lightgray);
  stroke: #eee;
  stroke-width: 0.25;
}

.map svg path:hover {
  fill: var(--green);
  transition: 0.6s;
  cursor: pointer;
}

.highlight {
  fill: var(--green);
  outline: none;
}

/* The box for the graph and the search bar */
.information {
  display: inline-block;
  vertical-align: top;
  width: 480px;
  background-color: rgba(213, 220, 223, 0.71);
  border-radius: 10px;
  border: 1px solid transparent;
  /* Standardize borders */
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  height: 100vh;
}

/* Search box responsiveness */
.search-box {
  width: 100%;
  max-width: 400px;
  margin: 10px auto;
  position: relative; /* for alignment purpose */
}

.row {
  display: flex;
  align-items: center;
  padding: 10px 20px;
}

#input-box,
#input-box-year {
  flex: 1;
  height: 30px;
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 18px;
  color: #333;
  cursor: pointer;
}

.magni-button {
  background: transparent;
  border: 0;
  outline: 0;
}

.magni-button .fa-solid {
  width: 20px;
  color: #555;
  font-size: 22px;
  cursor: pointer;
}

::placeholder {
  color: #555;
}

/* The box that pops upp when you focus on the search box */
.result-box {
  top: 100%; /* align top of result box to the bottom of search box */
  z-index: var(--z-always-front);
  max-height: 250px;
  overflow-y: scroll;
  background: var(--white);
  width: 18vw;
  border: var(--lightgray);
  border-radius: 10px;
  border-color: transparent;
  position: absolute;
  left: 4%;
}

.result-box::-webkit-scrollbar {
  width: 15px;
}

.result-box::-webkit-scrollbar-track {
  display: none;
}

.result-box::-webkit-scrollbar-thumb {
  background: var(--darkgray);
  border-radius: 10px;
}

.result-box ul {
  border-top: 1px solid #999;
  padding: 15px 10px;
}

.result-box ul li {
  list-style: none;
  border-radius: 3px;
  padding: 15px 10px;
  cursor: pointer;
}

.result-box ul li:hover {
  background: #e9f3ff;
}

/* The box the graph pops up in */
.info_graf {
  height: 40%;
  width: 100%;
  border: var(--lightgray), solid, 3px;
  border-radius: 7px;
  position: relative;
  left: 50%;
  bottom: 13px;
  top: 13px;
  transform: translateX(-50%);
  border-color: transparent;
}

/* Styling for the paraghraphs */
.p_source {
  font-size: small;
  color: var(--lightgray);
  padding-left: 13.5px;
}

.p_source_text {
  font-size: 10px;
  color: var(--lightgray);
  text-align: center;
}

.before_graph_text {
  color: var(--darkgray);
  text-align: center;
  font-size: 0.869rem;
  padding: 5px;
  border-color: transparent;
}

/* World Graph */
.worldGrafBox {
  height: 40%;
  width: 100%;
  /* Ensure it takes the full width of the parent */
  border: var(--lightgray), solid, 3px;
  border-radius: 7px;
  margin: 0 auto;
  border-color: transparent;
}

.year-filter {
  padding: 7px 7px;
  margin: 3px 1px;
  position: absolute;
  border: 10px solid whitesmoke;
  background-color: whitesmoke;
  right: 3%;
  top: 29%;
  border-radius: 15px;
}

.year-filter input[type="range"] {
  accent-color: #be0000;
}

.slider-label {
  margin-bottom: 15px;
  display: block;
  text-align: center;
  font-weight: bold;
}

/* .year-filter input {
    padding: 18px 7px;
    font-size: 1rem;
    border: 1px solid #ccc;
    width: 219px;
    margin: 3px 1px;
} */
/* 
#fa-magnifying-glass {
    margin: 3px 7px;
} */

.min-rate {
  fill: yellow !important;
  /* Highlight with yellow for minimum rate */
}

.max-rate {
  fill: red !important;
  /* Highlight with red for maximum rate */
}

/* Gradient scale adjustments */
.gradient-legend {
  position: absolute;
  margin: 10px auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: #f9f9f9;
  padding: 10px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  max-width: 300px;
  left: 30%;
  bottom: 0%;
}

.gradient-legend2 {
  padding: 7px 7px;
  margin: 3px 1px;
  position: absolute;
  right: 10px;
  top: 10px;
  /* width: 250px;
    left: 5px;
    bottom: 3px; */
  border-radius: 1px;
  border: 10px solid whitesmoke;
  background-color: whitesmoke;
  z-index: 1000;
}

.legend-labels2 {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-weight: bold;
  font-size: 14px;
}

.min-label {
  color: var(--selectedMin);
}

.max-label {
  color: var(--selectedMax);
}

.legend-title {
  font-weight: bold;
  margin-bottom: 8px;
  font-size: 16px;
}

.gradient-bar {
  width: 200px;
  height: 15px;
  background: linear-gradient(to right, yellow, red);
  border: 1px solid #ccc;
  border-radius: 5px;
  margin-bottom: 10px;
}

.legend-labels {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 5px;
}

.legend-labels span {
  font-size: 12px;
  color: #555;
}

.dynamic-labels {
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.dynamic-labels span {
  font-size: 12px;
  font-weight: bold;
  color: #333;
}

@media (max-width: 1920px) {
  .main-title {
    font-size: 1.2rem;
  }
}

@media (max-width: 1903px) {
  .country-rate {
    margin-top: 40px;
  }
}

/* Mobile and tablet size adjustments*/
@media (max-width: 1607px) {
  .container {
    display: grid;
    text-align: center;
    /* Disable flexbox */
    background-color: var(--white);
    padding: 0px;
    height: auto;
    width: 100%;
  }

  .map {
    width: 70vw;
    left: 20px;
    height: 100vh;
    margin: 0;
  }

  .information {
    width: 24vw;
    height: 100vh;
    margin: 0;
  }

  canvas {
    box-sizing: border-box;
    display: block;
    height: 200px;
    width: 384px;
  }


  .gradient-legend {
    width: 50%;
    left: 30%;
    bottom: 3px;
  }

  .worldGrafBox {
    height: 223px;
    width: 91%;
  }
}

@media (max-width: 1350px) {
    .year-filter {
        top: 32%;
        right: 5%;
    }
}

@media (max-width: 1200px) {
    .year-filter {
        top: 35%;
    }
}

@media (max-width: 1100px) {

    .year-filter {
        top: 140%;
    }

  .container {
    display: flex;
    flex-wrap: wrap;
  }

  .pageName {
    left: 10%;
    font-size: 18px;
    /* Adjust horizontal positioning */
  }

  .tagline {
    left: 70%;
    font-size: 12px;
    /* Adjust horizontal positioning */
  }

  .search-box {
    width: 100%;
    /* Full width */
    left: 1%;
    /* Align to the left */
    margin-top: 5%;
    margin-bottom: 5%;
  }

  .result-box {
      width: 30vw;
  }

  .worldGrafBox {
    width: 80%;
    /* Ensure it takes the full width of the parent */
    border-radius: 7px;
    border-color: transparent;
  }

  canvas canvas img {
    width: 100%;
    height: 170px;
    /* Full width */
    left: 0;
    /* Align to the left */
    top: 20px;
    /* Adjust vertical positioning */
    padding: 15px;
    /* Reduce padding for smaller screens */
  }

  .information {
    width: 100%;
    /* Full width */
    left: 0;
    /* Align to the left */
    top: 0;
    /* Adjust vertical positioning */
    padding: 0px;
    /* Reduce padding for smaller screens */
  }

  .map {
    width: 100%;
    /* Full width */
    left: 0;
    /* Align to the left */
    top: calc(100% + 20px);
    /* Position below the information */
    padding: 15px;
    /* Reduce padding for smaller screens */
    margin-top: 50px;
  }

  .gradient-legend {
    width: 50%;
    left: 7%;
    bottom: -115%;
  }

  @media (max-width: 768px) {
    header {
      background-image: none;
      /* Remove the favicon image on mobile */
    }
  }
}

@media (max-width: 480px) {
  .main-title {
    font-size: 1rem;
  }
}

