/* ==========================================================================
   Content Body
   ========================================================================== */

.content-body {
  background: $white;
  border-radius: 4px;
  box-shadow: 0 2px 12px rgba($primary, .12);
  margin-bottom: 24px;
  padding: 24px 20px;

  @include anim(box-shadow);

  @media (max-width: $screen-sm-min) {
    padding: 12px;
  }

  .form-group.no-help-block {
    padding-bottom: 36px;
  }

  .btn-container {
    margin: 36px 0 24px;
    text-align: center;
  }

  .btn {
    float: none;
  }

  .content-body-header {
    margin: 0 0 12px;
  }

  .content-body-title {
    color: rgba($primary, .8);
    font-family: $font-primary;
    font-size: 19px;
    font-weight: 600;
    line-height: 36px;
    margin: 0 0 12px;
    padding: 0;

    &.top-2b {
      margin: 36px 0 24px;
    }

    &.ws-demo {
      margin: 48px 0 12px;
    }

    .icon-info {
      color: rgba($primary, .4);
      margin-left: 8px;
    }
  }

  .content-body-subtitle {
    color: rgba($primary, .6);
    font-family: $font-primary;
    font-size: 16px;
    font-weight: 600;
    line-height: 24px;
    margin: 24px 0 12px;
    padding: 0;
  }

  .content-link {
    color: $accent;
    font-family: $font-secondary;
    font-size: 12px;
    font-weight: 700;
    line-height: 36px;

    @include anim(color);

    .icon {
      background: rgba($accent, .1);
      border-radius: 50%;
      display: inline-block;
      height: 24px;
      line-height: 22px;
      margin-left: 8px;
      text-align: center;
      vertical-align: middle;
      width: 24px;

      @include anim(background);
    }

    &:hover,
    &:focus {
      color: rgba($accent, .8);

      .icon {
        background: rgba($accent, .2);
      }
    }
  }

  /* Data
   ========================================================================== */

  &.content-body-data {
    margin: 0;
    padding: 0;
    position: relative;

    .data-header,
    .data-footer {
      animation: fadeIn .5s cubic-bezier(.3, 0, .3, 1) 0s 1 forwards;
      background: $white;
      display: flex;
      justify-content: space-between;
      padding: 12px 20px;
      width: 100%;

      @media (max-width: $screen-sm-min) {
        padding: 12px;
      }

      &.align-left {
        justify-content: flex-start;
      }
    }

    .data-header {
      box-shadow: 0 2px 8px rgba($primary, .1);
      z-index: 99;

      @media (max-width: $screen-sm-min) {
        flex-wrap: wrap;
      }

      .table-header-left label {
        margin: 0 12px 0 0;
      }

      .table-header-right .btn-icon {
        margin-left: 10px;

        &:first-child {
          margin-left: 0;
        }
      }
    }

    .data-footer {
      bottom: -60px;
      box-shadow: 0 0 8px rgba($primary, .1);
      height: 60px;
      position: absolute;
      z-index: 98;

      .data-footer-right {
        .data-footer-dropdown,
        .data-footer-pagination {
          display: inline-block;
          float: left;
          height: 36px;
        }

        .data-footer-dropdown .dropdown {
          width: 60px;
        }

        .dropdown-menu {
          margin: -168px 0 0;
        }

        .data-footer-pagination {
          margin-left: 28px;

          label { /* stylelint-disable-line max-nesting-depth */
            margin: 0 10px;
            min-width: 140px;
            text-align: center;
          }
        }
      }

      &.data-footer-small {
        bottom: -24px;
        height: 24px;
      }
    }

    .dropdown {
      display: inline-block;
      max-width: 240px;
      min-width: 110px;
      width: auto;

      @media (max-width: $screen-sm-min) {
        margin-bottom: 12px;
        margin-right: 0;
        max-width: 100%;
        min-width: 100%;
      }

      .btn {
        font-size: 13px;
        height: 36px;
        line-height: 36px;
        padding: 0 32px 0 12px;
        text-align: left;
        width: 100%;

        .instance-name {
          display: block;
          font-family: $font-primary;
          font-weight: 700;
          text-align: left;
          width: inherit;

          @extend .truncate;
        }
      }

      .icon-12-arrows,
      .icon-12-arrow-down-short {
        display: inline-block;
        line-height: 36px;
        position: absolute;
        right: 12px;
        top: 0;
      }

      .dropdown-menu {
        margin: 0;
        max-height: 400px;
        overflow-y: auto;
        padding: 12px 0;
        width: 200px;
        z-index: 9999;

        @media (max-width: $screen-sm-min) {
          max-width: 100%;
          min-width: 100%;
        }

        li,
        li:first-child,
        li:last-child, {
          margin: 0;
        }

        li a {
          @extend .truncate;
        }
      }
    }
  }

  /* Form
   ========================================================================== */

  .read-only {
    align-content: center;
    align-items: center;
    background: $white;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba($primary, .1);
    display: flex;
    flex-flow: row wrap;
    justify-content: space-between;
    min-height: 60px;
    padding: 12px 20px;
    width: 100%;

    .title {
      color: rgba($primary, .8);
      display: block;
      flex: 0 1 auto;
      flex: 1 0 auto;
      font-family: $font-primary;
      font-size: 14px;
      font-weight: 600;
      line-height: 24px;
      margin-right: 20px;

      @extend .truncate;
    }
  }

  .input-group,
  .input-group-addon-input {
    @media (max-width: $screen-sm-min) {
      width: 100%;
    }
  }

  .input-group .form-control:first-child {
    @media (max-width: $screen-sm-min) {
      border-radius: 4px;
    }
  }

  .content-table-header {
    padding: 0 20px;

    @media (max-width: $screen-sm-min) {
      padding: 0 0 0 12px;
    }

    .right {
      text-align: right;
    }

    span {
      color: rgba($primary, .6);
      display: inline-block;
      font-family: $font-secondary;
      font-size: 12px;
      font-weight: 600;
      line-height: 24px;
      margin-bottom: 12px;
    }
  }

  .content-table-row {
    border-radius: 4px;
    box-shadow: 0 2px 12px rgba($primary, .12);
    display: block;
    margin: 0 0 24px;
    padding: 12px 20px;

    &:last-child {
      margin: 0 0 12px;
    }

    &.content-table-row--small {
      .avatar-small {
        height: 24px;
        width: 24px;
      }

      .avatar-initials {
        height: 24px;
        line-height: 24px;
        width: 24px;
      }
    }

    .avatar-container {
      background: $white;

      img[src=""] {
        display: none;
      }
    }

    .avatar-photo,
    .avatar-photo img {
      border-radius: 3px;
    }

    .avatar-initials {
      background: rgba($primary, .8);
      border-radius: 4px;
    }

    .row-item {
      display: inline-block;
      flex: 0 1 auto;
      flex-shrink: 1;
      margin-right: 12px;

      &:last-child {
        margin-right: 0;
      }
    }

    .row-avatar {
      margin-right: 20px;
    }

    .no-shrink {
      flex-shrink: 0;
    }

    .title {
      color: rgba($primary, .8);
      font-family: $font-primary;
      font-size: 14px;
      font-weight: 600;
      line-height: 36px;
      text-align: left;
    }

    .subtitle {
      color: rgba($primary, .6);
      font-family: $font-secondary;
      font-size: 11px;
      font-weight: 600;
      line-height: 24px;
      text-align: left;
    }

    .box.box--small {
      margin-top: 6px;
    }

    .dropdown {
      height: 36px;
      width: 36px;

      .btn.btn-icon {
        background: $white;
        border-radius: 4px;
        font-family: "icon-16";
        height: 36px;
        line-height: 36px;
        padding: 0;
        width: 36px;

        &:hover,
        &:focus {
          background: rgba($accent, .1);
        }
      }

      .dropdown-menu {
        left: auto;
        margin: 0;
        right: 0;
      }
    }

    .col-flex-row-spacebetween-center,
    .col-flex-row-spacebetween-top,
    .col-flex-row-right-center {
      float: none;
    }
  }
}

/* Customization
   ========================================================================== */

.install-project-containers .content-body .btn-container,
.login .content-body .btn-container,
.project-github .content-body .btn-container,
.project-settings .content-body .btn-container,
.create-project .content-body .btn-container {
  @media (max-width: $screen-sm-min) {
    margin-top: 12px;
  }
}

.project-overview .content-body,
.project-activity .content-body {
  .item-avatar {
    @media (max-width: $screen-sm-min) {
      display: none;
    }
  }

  .activity-item .item-label {
    @media (max-width: $screen-sm-min) {
      width: calc(100% - 48px);
    }
  }
}

.container-hybrid,
.container-hybrid-half {
  @media (max-width: $screen-sm-min) {
    padding: 0 12px;
    width: calc(100% - 24px);
  }

  @media (max-width: $screen-md-min) {
    padding: 0 8px;
    width: calc(100% - 16px);
  }
}

/* Not Found
   ========================================================================== */

.notfound {
  text-align: center;
}

.notfound-icon {
  background: rgba($accent, .2);
  border-radius: 50%;
  display: block;
  height: 120px;
  margin: 0 auto 36px;
  width: 120px;

  @media (max-width: $screen-sm-min) {
    height: 60px;
    margin: 0 auto 12px;
    width: 60px;
  }
}

.notfound-icon span {
  color: $accent;
  font-size: 36px;
  line-height: 128px;
  position: relative;

  @media (max-width: $screen-sm-min) {
    font-size: 24px;
    line-height: 60px;
  }
}

.notfound-text {
  color: rgba($primary, .8);
  font-family: $font-primary;
  font-size: 18px;
  font-weight: 700;

  @media (max-width: $screen-sm-min) {
    font-size: 12px;
  }
}
