.title-flex {
  display: flex;
  justify-content: space-between;
  align-items: end;
}
.title-span {
  color: #787878;
}

.chart-section {
  background-color: #ffffff;
  margin: 30px 0;
  padding: 20px 50px;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 20px;

  /*opacity: 0;
    transform: translateY(50px);
    transition: all 2s ease;*/
}

/*.chart-section.visible {
    opacity: 1;
    transform: translateY(0);
  }*/

.donut-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  height: 400px;
}
.donut-container canvas {
  width: 300px !important;
  max-height: 300px !important;
}

.legend-container {
  /*flex: 1 1 200px;*/
}
.bar-container {
  /*flex: 1 1 300px;*/
  position: relative;
  display: flex;
  justify-content: end;
  width: 370px !important;
}
.bar-container canvas {
  height: 330px !important;
  width: 350px !important;
}

.productBarValues,
.branchBarValues {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.productBarValues h6,
.branchBarValues h6 {
  position: absolute;
  font-size: 14px;
  color: #333;
  transform: translateY(-50%);
}

.productBarValues h6:nth-child(1) {
  top: 5%;
  right: -5%;
}

.productBarValues h6:nth-child(2) {
  top: 36%;
  right: 38%;
}

.productBarValues h6:nth-child(3) {
  top: 67%;
  right: 65%;
}

.branchBarValues h6:nth-child(1) {
  top: 3%;
  right: -2%;
}

.branchBarValues h6:nth-child(2) {
  top: 28%;
  right: 27%;
}

.branchBarValues h6:nth-child(3) {
  top: 53%;
  right: 68%;
}

.branchBarValues h6:last-child {
  top: 78%;
  right: 66%;
}
.legend-container {
  display: flex;
  flex-direction: column;
  gap: 0px;
}

.legend-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 8px 0;
}

.legend-item p:first-child {
  font-size: 16px;
  font-weight: bold;
  width: 65px; /* Adjusted if needed */
  text-align: left;
  flex-shrink: 0;
}

.legend-color {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  margin: 0 10px;
  flex-shrink: 0;
}

.legend-item p:last-child {
  font-size: 16px;
  text-align: right;
  width: 90px; /* Increased width for name text */
}

.total {
  font-size: 20px;
  font-weight: bold;
  color: #73837f;
}
.total p {
  margin: 0;
}
.total p:first-child {
  color: #31544b;
  font-size: 30px;
  /* margin: 10px 90px auto auto; */
}
.total p:last-child {
  color: #444444;
  font-weight: 500;
  text-align: center;
  /* margin: 10px 105px auto auto; */
}
canvas {
  max-width: 100%;
  height: auto;
}
@media (max-width: 1430px) {
  .productBarValues h6:nth-child(1) {
    right: -10%;
  }

  .productBarValues h6:nth-child(2) {
    right: 35%;
  }

  .productBarValues h6:nth-child(3) {
    right: 62%;
  }
  /* second bar chart value for english */
  .branchBarValues h6:nth-child(1) {
    right: -10%;
  }

  .branchBarValues h6:nth-child(2) {
    right: 20%;
  }

  .branchBarValues h6:nth-child(3) {
    right: 65%;
  }

  .branchBarValues h6:last-child {
    right: 63%;
  }
}
@media (max-width: 1200px) {
  .productBarValues h6:nth-child(1) {
    right: -16%;
  }

  .productBarValues h6:nth-child(2) {
    right: 29%;
  }

  .productBarValues h6:nth-child(3) {
    right: 57%;
  }
  /* branchBarValues */
  .branchBarValues h6:nth-child(1) {
    right: -15%;
  }

  .branchBarValues h6:nth-child(2) {
    right: 15%;
  }

  .branchBarValues h6:nth-child(3) {
    right: 62%;
  }

  .branchBarValues h6:last-child {
    right: 58%;
  }
}
@media (max-width: 1110px) {
  .title-flex {
    flex-direction: column;
    gap: 10px;
    text-align: center;
    align-items: center;
  }
}
@media (max-width: 1024px) {
  .title-flex {
    flex-direction: column;
    gap: 10px;
    text-align: center;
    align-items: center;
  }
  .chart-section {
    flex-direction: column;
    align-items: stretch;
  }

  .donut-container,
  .legend-container,
  .bar-container {
    max-width: 100% !important;
    flex: 1 1 100%;
    text-align: center;
    margin: auto;
  }

  .donut-container canvas,
  .bar-container canvas {
    width: 100% !important;
    height: auto !important;
  }

  .total p:first-child,
  .total p:last-child {
    margin: 10px auto;
    text-align: center;
  }

  .legend-item {
    gap: 12px;
  }
  .productBarValues h6:nth-child(1) {
    right: -10%;
  }

  .productBarValues h6:nth-child(2) {
    right: 35%;
  }

  .productBarValues h6:nth-child(3) {
    right: 63%;
  }
  /* branchBarValues */
  .branchBarValues h6:nth-child(1) {
    right: -10%;
  }

  .branchBarValues h6:nth-child(2) {
    right: 20%;
  }

  .branchBarValues h6:nth-child(3) {
    right: 64%;
  }

  .branchBarValues h6:last-child {
    right: 62%;
  }
}

@media (max-width: 768px) {
  .title-flex {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }
  .border-with-title-under-it {
    margin: auto;
  }
  .title-span {
    font-size: 14px;
    margin: auto;
  }

  .legend-container {
    padding-right: 30px;
  }
  .legend-item p:first-child {
    min-width: auto;
    text-align: start;
  }

  .legend-color {
    margin: 0;
  }
}

@media (max-width: 600px) {
  .legend-item p {
    font-size: 16px;
  }

  .total p:first-child {
    font-size: 24px;
  }

  .total p:last-child {
    font-size: 18px;
  }
}
@media (max-width: 480px) {
  .productBarValues h6:nth-child(1) {
    right: -10%;
    top: 4%;
  }

  .productBarValues h6:nth-child(2) {
    right: 35%;
    top: 34%;
  }

  .productBarValues h6:nth-child(3) {
    right: 62%;
    top: 65%;
  }
  /* second bar chart value for english */
  .branchBarValues h6:nth-child(1) {
    right: -10%;
    top: 1%;
  }

  .branchBarValues h6:nth-child(2) {
    right: 20%;
    top: 25%;
  }

  .branchBarValues h6:nth-child(3) {
    right: 65%;
    top: 51%;
  }

  .branchBarValues h6:last-child {
    right: 63%;
    top: 76%;
  }
}
.percent-none {
  display: none;
}
body[lang="en"] {
  .legend-item p:last-child {
    text-align: left;
  }
  .percent-none {
    display: inline;
  }
  .percentage-for-bars {
    left: 0%;
  }

  .total p:first-child {
    color: #31544b;
    font-size: 30px;
    /* margin: 10px auto auto 90px; */
  }

  .total p:last-child {
    color: #444444;
    font-weight: 500;
    /* margin: 10px auto auto 120px; */
  }

  /* first bar chart value for english */
  .productBarValues h6:nth-child(1) {
    right: -8%;
  }

  .productBarValues h6:nth-child(2) {
    right: 35%;
  }

  .productBarValues h6:nth-child(3) {
    right: 60%;
  }
  /* second bar chart value for english */
  .branchBarValues h6:nth-child(1) {
    right: -6%;
  }

  .branchBarValues h6:nth-child(2) {
    right: 22%;
  }

  .branchBarValues h6:nth-child(3) {
    right: 63%;
  }

  .branchBarValues h6:last-child {
    right: 61%;
  }
  @media (max-width: 1200px) {
    /* first bar chart value for english */
    .productBarValues h6:nth-child(1) {
      right: -17%;
    }

    .productBarValues h6:nth-child(2) {
      right: 30%;
    }

    .productBarValues h6:nth-child(3) {
      right: 57%;
    }
    /* second bar chart value for english */
    .branchBarValues h6:nth-child(1) {
      right: -13%;
    }

    .branchBarValues h6:nth-child(2) {
      right: 18%;
    }

    .branchBarValues h6:nth-child(3) {
      right: 62%;
    }

    .branchBarValues h6:last-child {
      right: 59%;
    }
  }

  @media (max-width: 1024px) {
    /* first bar chart value for english */
    .productBarValues h6:nth-child(1) {
      right: -10%;
    }

    .productBarValues h6:nth-child(2) {
      right: 35%;
    }

    .productBarValues h6:nth-child(3) {
      right: 63%;
    }
    /* second bar chart value for english */
    .branchBarValues h6:nth-child(1) {
      right: -9%;
    }

    .branchBarValues h6:nth-child(2) {
      right: 22%;
    }

    .branchBarValues h6:nth-child(3) {
      right: 65%;
    }

    .branchBarValues h6:last-child {
      right: 63%;
    }
    .total p:first-child {
      color: #31544b;
      font-size: 30px;
      margin: 10px auto auto 20px;
    }

    .total p:last-child {
      color: #444444;
      font-weight: 500;
      margin: 10px auto auto 20px;
    }
    .legend-item p:last-child {
      width: 120px; /* Increased width for name text */
    }
    .legend-container {
      padding-right: 0px;
      padding-left: 55px;
    }
  }

  @media (max-width: 480px) {
    .productBarValues h6:nth-child(1) {
      right: -10%;
      top: 4%;
    }

    .productBarValues h6:nth-child(2) {
      right: 35%;
      top: 34%;
    }

    .productBarValues h6:nth-child(3) {
      right: 62%;
      top: 65%;
    }
    /* second bar chart value for english */
    .branchBarValues h6:nth-child(1) {
      right: -10%;
      top: 1%;
    }

    .branchBarValues h6:nth-child(2) {
      right: 20%;
      top: 25%;
    }

    .branchBarValues h6:nth-child(3) {
      right: 65%;
      top: 51%;
    }

    .branchBarValues h6:last-child {
      right: 63%;
      top: 76%;
    }
  }
}
