@use 'sass:color';
$font-size-heatmap-tick: 11px;

.heatmap-canvas-wrapper {
  // position: relative;
  cursor: crosshair;
}

.heatmap-panel {
  position: relative;

  .axis .tick {
    text {
      fill: $text-color;
      color: $text-color;
      font-size: $font-size-heatmap-tick;
    }

    line {
      opacity: 0.4;
      stroke: $text-color-weak;
    }
  }

  // This hack prevents mouseenter/mouseleave events get fired too often
  svg {
    pointer-events: none;

    rect {
      pointer-events: visiblePainted;
    }
  }
}

.heatmap-tooltip {
  white-space: nowrap;
  font-size: $font-size-sm;
  background-color: $graph-tooltip-bg;
  color: $text-color;
}

.heatmap-histogram rect {
  fill: $text-color-weak;
}

.heatmap-crosshair {
  line {
    stroke: color.adjust($red, $lightness: -15%);
    stroke-width: 1;
  }
}

.heatmap-selection {
  stroke-width: 1;
  fill: rgba(102, 102, 102, 0.4);
  stroke: rgba(102, 102, 102, 0.8);
}

.heatmap-legend-wrapper {
  @include clearfix();
  margin: 0 $spacer;
  padding-top: 4px;

  svg {
    width: 100%;
    max-width: 300px;
    height: 18px;
    float: left;
    white-space: nowrap;
  }

  .heatmap-legend-values {
    display: inline-block;
  }

  .axis .tick {
    text {
      fill: $text-color;
      color: $text-color;
      font-size: $font-size-heatmap-tick;
    }

    line {
      opacity: 0.4;
      stroke: $text-color-weak;
    }

    .domain {
      opacity: 0.4;
      stroke: $text-color-weak;
    }
  }
}
