@import '../_variables.scss';

$widget-width: 18em;

.widget-panel {
  overflow-y: scroll;
  display: flex;
  flex-flow: row wrap;
  width: ($widget-width * 2) + ($default-spacing * 2);
  padding-top: $default-spacing;
}

.widget {
  margin-right: $default-spacing;
  margin-bottom: $default-spacing;
  border: $border-base;
  width: $widget-width;
  background-color: $background-color;
  border-radius: $border-radius;
  padding: $default-spacing;
  box-shadow: $box-shadow;
  box-sizing: border-box;

  .widget-title {
    font-size: 0.8em;
    text-transform: uppercase;
    color: $info-color;
  }
}

.wps-widget {
  .widget-value {
    font-weight: bold;
    font-size: 2em;
    margin-bottom: 0;
    color: $primary-color;
    overflow: hidden;
  }
}

.category-widget {
  ul {
    list-style: none;
    padding: 0;
    margin: 0.3em 0 0 0;

    li {
      font-size: 0.8em;
      margin-top: $default-spacing;

      span.value {
        float: right;
      }

      &.category {
        .meter {
          height: 1em;
          position: relative;
          background: repeating-linear-gradient(
            to right,
            $light-color,
            $light-color 1px,
            $background-color 1px,
            $background-color 5px
          );

          span {
            display: block;
            height: 100%;
            position: relative;
            overflow: hidden;
          }
        }
      }

      &.total {
        height: 1.5em;
        font-size: 1.5em;
      }
    }
  }
}

.chart-widget {
  canvas {
    margin-top: 1em;
  }
}

.doughnut-widget {
  canvas {
    margin-top: -3.5em;
    margin-bottom: -4em;
  }
}

.filter-widget {
  ul {
    list-style: none;

    li {
      cursor: pointer;
      position: relative;
      margin: 5px 0 10px 0;
      text-align: left;
      height: 16px;
      line-height: 25px;
      vertical-align: middle;
      color: $primary-alpha;

      .filter-widget-color {
        float: left;
        margin: 5px 5px 0 0;
        width: 16px;
        height: 16px;
        border: 1px solid rgba(0, 0, 0, 0.2);
        z-index: 1000;
      }

      &.active {
        font-weight: bold;
        color: $primary-color;

        .filter-widget-color {
          border: $border-base;
        }
      }
    }
  }
}

@include large-desktop {
  .widget-panel {
    width: ($widget-width * 3) + ($default-spacing * 3);
  }
}

@include tablet {
  .widget-panel {
    width: $widget-width + $default-spacing;
    flex-flow: column;
  }
}

@include mobile {
  .widget-panel {
    display: none;
  }
}
