@import (reference) "_vars.less";

svg:root {
  width: 100%;
  height: 100%;
}

svg.causality-graph {
  position: absolute;
  width: 100%;
  height: 100%;
  .node text {
    font-family: 'Inconsolata';
    letter-spacing: 1pt;
  }
}

svg.pipeline-graph {
  position: absolute;
  width: 100%;
  height: 100%;
  h1 {
    margin: 5px;
    width: 100%;
  }

  h1.resource {
    font-size: 1.5em;
    font-weight: normal;
    width: 100%;
  }

  h1 a {
    padding: 5px;
    text-decoration: none;
  }

  .node rect {
    fill: @grey100;
    shape-rendering: crispEdges;
  }

  .node.job {
    &.pending rect { fill: @grey-primary; }
    &.succeeded rect { fill: @green-primary; }
    &.failed rect { fill: @red-primary; }
    &.errored rect { fill: @amber-primary; }
    &.aborted rect { fill: @brown-primary; }
    &.paused rect { fill: @blue-primary; }
    &.no-builds rect { fill: @grey-primary; }
  }

  .node.resource {
    &.failed rect  { stroke: @red-primary; }
    &.errored rect { stroke: @amber-primary; }
    &.aborted rect { stroke: @brown-primary; }

    &.active rect { fill: @grey-secondary; }
    &.pinned rect { fill: @purple; }

    &.constrained-input.pinned {
      rect {
        fill: @purple;
        opacity: 0.8;
      }

      image {
        opacity: 0.7;
      }
    }
  }

  .node text {
    fill: #fff;
  }

  .node.constrained-input {
    text, use {
      fill: @grey50;
    }

    &.pinned {
      text, use {
        fill: #fff;
        opacity: 0.7;
      }
    }

    &.active {
      text, use {
        fill: #fff;
      }
    }
  }

  .edge { stroke: @grey-secondary; }
  .edge.pending { stroke: @grey50; }
  .edge.succeeded { stroke: @green-primary; }
  .edge.failed { stroke: @red-primary; }
  .edge.errored { stroke: @amber-primary; }
  .edge.aborted { stroke: @brown-primary; }
  .edge.paused { stroke: @blue-primary; }
  .edge.trigger-false { stroke-dasharray: 5, 5; }
  .node a {
    cursor: pointer;
  }

  .edge path {
    stroke-width: 2px;
    fill: none;
  }

  .edge.active {
    path {
      stroke-width: 4px;
    }
  }
}
