.Dashboard {
  margin-top: 2em;
  clear: both;
}

.DashboardSection {
  float: left;
  width: 100%;
  clear: both;
  margin: 1em 0 1.3em;

  &--audience + .DashboardSection--service,
  &--audience + .DashboardSection--service.is-closed {
    margin-top: 4em;
  }

  &-title {
    text-transform: uppercase;
    font-size: 12px;
    color: $light-color;
    float: left;
  }

  &-toggle {
    cursor: pointer;
    &:before {
      font-size: 11px;
      content: '▼ ';
    }
  }

  &.is-closed {
    border-bottom: 1px solid $border-color;

    .DashboardWidget,
    .DashboardNavigation-list-item {
      display: none;
    }

    .DashboardNavigation-list-item.u-notice {
      display: list-item;
    }

    .DashboardSection-toggle:before {
      content: '► ';
    }
  }
}

// DashboardWidget
// this should be encapsulated within individual widget.
.DashboardSection--wide .DashboardWidget {
  width: 100%;
}

.DashboardWidget {
  box-sizing: border-box;
  width: 50%;
  float: left;
  position: relative;
  height: 224px;
  overflow: hidden;
  border: 1px solid $border-color;
  padding: 12px;

  .Dashboard-chart {
    position: absolute !important;
    z-index: 1;
    padding: 0;
    max-height: none !important;
    left: 8px;
    right: 9px;
    top: 5.5em;
    bottom: 5px;

    .c3-bar._expanded_,
    .c3-bar._expanded_:last-child {
      fill: $brand-blue !important;
      fill-opacity: 1;
      stroke: $brand-blue !important;
    }

    .c3-bar:last-child {
      fill: transparent !important;
      shape-rendering: geometricPrecision;
      stroke: $border-color !important;
      stroke-width: 1px;
    }
  }

  i {
    font-size: 16px;
    color: $light-color;
    float: right;
  }

  &-spinner {
    position: absolute;
    top: calc(50% - 12px);
    left: calc(50% - 12px);
  }

  &-title {
    font-weight: normal;
    margin-bottom: 0.25em;
    float: left;
  }

  &-percentageInfo {
    float: right;
    text-align: right;
    font-size: 20px;
    width: 50%;
    margin-bottom: 0.25em;

    a {
      color: $brand-blue;
    }
  }

  &-intro {
    @include ellipsis;
    display: block;
    font-style: italic;
    color: $light-color;
    margin-bottom: 0.75em;
    clear: both;

    &--primary {
      float: left;
    }

    &--secondary {
      float: right;
      clear: none;
    }
  }

  &+ script + .DashboardWidget {
    border-left: 0;
  }

  &-badge {
    width: 100%;
    top: 1em;
    left: 0;
    z-index: 2;
    background-color: rgba(white, 0.5);
  }

  .Dashboard-chart:hover + &-badge {
    background-color: rgba(white, 0);
    z-index: 0;

    .DashboardWidget-values {
      opacity: 0;
    }
  }

  &-values{
    @include transition-property(opacity);
    @include transition-duration(0.5s);
    opacity: 1;
    float: left;

    &:nth-of-type(2) {
      text-align: right;
      margin-left: 3em;
    }
  }

  &-label {
    color: $light-color;
    font-style: italic;
    white-space: nowrap;
  }

  &-value {
    font-size: 48px;
    min-height: 48px;

    strong {
      color: $brand-blue;
    }

    i {
      font-size: 16px;
      color: $light-color;
    }
  }

  &-link {
    color: $brand-blue;

    &--infoOnly {
      color: $font-color;
    }
  }

  &-link:hover,
  &-link:hover strong {
    color: $link-color;
  }
}

.DashboardWidgetList {
  list-style: none inside;
  line-height: 2.6;
  margin: 0.75em 0 0 0.1em;

  &-position {
    display: inline-block;
    width: 20%;
  }

  &-item:nth-of-type(5) .DashboardWidgetList-link {
    border-bottom: 0;
  }

  &-link {
    @include ellipsis;
    display: block;
    color: $font-color;
    border-bottom: 1px solid $border-color;

    &:hover,
    &:hover .DashboardWidgetList-change {
      color: $link-color;
    }
  }

  &-change {
    color: $light-color;
    display: inline-block;
    text-align: right;
    width: 30%;
  }

  // tmp hide out list
  &-item--left {
    display: none;
  }
}


// Layout of widgets and stream
.Dashboard-widgets {
  width: 68%;
  margin-right: 2%;
  float: left;
}

// DashboardStream
.DashboardStream {
  width: 30%;
  float: right;
  padding: 1em 0;


  &-title {
    text-transform: uppercase;
    font-size: 12px;
    color: $light-color;
    font-weight: normal;
  }

  &-list {
    list-style: none outside;
    line-height: 2.6;
    margin-left: 0.1em;
    color: $light-color;

    &+ .DashboardStream-title {
      margin-top: 24px;
    }
  }

  &-listItem {
    border-top: 1px solid $border-color;

    &--empty {
      font-style: italic;
    }
  }

  &-link {
    @include ellipsis;
    display: block;
    color: $light-color;

    &--unread {
      color: $font-color;
    }

    &:hover {
      color: $link-color;
    }
  }

  &-notification {
    color: $font-color;
  }
}

.DashboardSection-header {
  float: left;
  width: 100%;
  border-right: 4px solid transparent;
}

.DashboardNavigation {
  float: right;

  &-list {
    @include horizontal-list();

    li {
      padding: 0;
    }
  }

  &-list-item {
    @include ellipsis;
    border-left: 3em solid transparent;
    color: $light-color;
  }

  &-link {
    text-transform: uppercase;
    font-style: normal;
    font-size: 12px;

    color: $light-color;

    &:hover {
      color: $link-color;
    }

    &--alert {
      color: $error-color;
    }
  }
}

// utility classes
.u-plus:before {
  content: '+';
}

.u-notice {
  color: $font-color;
}

a:hover .u-notice {
  color: $link-color;
}
