body {
  background-color: #121212;
  color: #fff;
  font-family: Arial, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
}

#chartjs-tooltip {
  position: absolute;
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 8px 12px;
  border-radius: 5px;
  font-size: 14px;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity 0.2s ease-out;
  max-width: 200px;
  z-index: 100;
}

.progress-bar-container {
  width: 100%;
  background: #333;
  height: 6px;
  border-radius: 3px;
  margin-top: 5px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: #ffb400;
  border-radius: 3px;
  transition: width 0.3s ease-in-out;
  width: 0%;
}

.date-range {
  position: absolute;
  top: calc(50% - 8px);
  left: 17.22px;
  font-weight: 500;
}

.date-range-control {
  position: relative;
  width: 136.4px;
  height: 16px;
  font-size: 12px;
}

/* NEW: Flex-based header controls */
.chart-header-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-evenly;
  align-items: center;
  gap: 36px;
  width: 100%;
  margin-bottom: 24px;
  position: relative;
  z-index: 2;
  align-content: center;
}

/* Title */
.widget-title-performance-histo2 {
  position: relative;
  font-size: 16px;
  font-weight: 600;
  text-align: left;
  margin: 0;
}

/* Dropdown */
.performance-filter-picklist {
  position: relative;
  border-radius: 5px;
  background-color: #111214;
  border: 1px solid #454756;
  box-sizing: border-box;
  width: 126px;
  height: 32px;
  font-family: var(--font-work-sans);
  font-size: 14px;
  color: var(--color-white);
  padding-left: 6px;
  appearance: auto;
  outline: none;
  box-shadow: none;
}

.performance-filter-picklist:focus {
  outline: none;
  box-shadow: none;
}

/* Time period buttons */
.time-period-control {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 2px;
}

.time-period-control button {
  cursor: pointer;
  border: none;
  padding: 5px 10px;
  background: transparent;
  color: var(--color-gray-700);
  font-size: 12px;
  font-family: var(--font-work-sans);
  transition: color 0.2s, background 0.2s;
  text-align: center;
}

/* Button order */
.w {
  order: 1;
}

.w1 {
  order: 2;
}

.m {
  order: 3;
}

.m3 {
  order: 4;
}

.m1 {
  order: 5;
}

.y1 {
  order: 6;
}

.y {
  order: 7;
}

.lifetime {
  order: 8;
}

.time-period-control button.selected {
  background-color: rgba(255, 255, 255, 0.2);
  color: white;
  border-radius: 5px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-tile {
  width: 95%;
  background-color: #111214;
  border-radius: 10px;
  padding: 24px 20px 40px;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: visible;
  border: #454756 1px solid;
}

/* Fixed-height canvas wrapper */
.chart-body {
  width: 100%;
  height: 330px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-controls {
  margin-bottom: 5px;
}

/* Tooltip base */
.chartjs-tooltip {
  background: rgba(20, 20, 25, 0.95);
  color: #fff;
  padding: 12px;
  border-radius: 8px;
  font-family: "Work Sans", sans-serif;
  font-size: 14px;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.5);
  border: 1px solid #444;
  min-width: 180px;
}

.chart-tooltip {
  position: absolute;
  background: rgba(20, 20, 25, 0.95);
  color: #fff;
  padding: 12px;
  border-radius: 8px;
  font-family: "Work Sans", sans-serif;
  font-size: 14px;
  pointer-events: none;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.5);
  border: 1px solid #444;
  display: none;
  width: 197px;
  height: 94px;
  z-index: 9999;
}

.tooltip-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #FFFFFF;
  font-weight: 400;
}

.tooltip-subtitle {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #A8AAAF;
  font-weight: 400;
  text-align: left;
}

.tooltip-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.kda-ratio {
  font-size: 20px;
  font-weight: normal;
}

.kda-details {
  font-size: 16px;
  font-weight: bold;
  color: #ffb400;
}

.tooltip-date {
  font-size: 12px;
  color: #aaa;
  margin-top: 4px;
}

.widget-performance-history3 {
  position: absolute;
  width: 100%;
  top: 667px;
  right: 0;
  border-radius: var(--br-4xs);
  background-color: var(--color-gray-200);
  border: 1px solid var(--color-darkslategray-100);
  box-sizing: border-box;
  height: 400px;
  text-align: center;
  font-size: var(--font-size-3xs);
}

.icon-chevron34 {
  cursor: pointer;
  border: none;
  padding: 0;
  background-color: transparent;
  position: absolute;
  height: calc(100% - 9.2px);
  top: 4.93px;
  right: -7.6px;
  width: 11.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: contain;
}

.icon-chevron34 img {
  width: 5px;
  height: 9px;
}

.icon-chevron35 {
  cursor: pointer;
  border: none;
  padding: 0;
  background-color: transparent;
  /* Remove white box */
  position: absolute;
  height: calc(100% - 9.2px);
  left: 0;
  bottom: 4.27px;
  left: -2.38px;
  width: 11.5px;
  transform: rotate(-180deg);
  /* Rotate so it points right */
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: contain;
}

.icon-chevron35 img {
  width: 5px;
  height: 9px;
}

/* Responsive stacking */

@media (max-width: 800px) {
  .chart-tile {
    width: 90%;
  }
}


@media (max-width: 720px) {
  .chart-header-controls {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding-top: 8px;
  }

  .performance-filter-picklist,
  .widget-title-performance-histo2,
  .time-period-control {
    width: 100%;
  }
}