static/scss/admin.scss
@import "globals";
@import "admin-nominee";

$bracket-row-height: 75px;

@mixin admin-button($type) {
  background-image: url(/static/images/admin_icons.png);
  background-repeat: no-repeat;

  @if $type == 'delete' {
    @include button;
    @include button--round;
    @include button--critical;
    background-position: -45px center;
  } @else if $type == 'collapse' {
    @include button;
    @include button--round;
    @include button--neutral;
    background-position: -90px center;
  } @else if $type == 'open' {
    @include button;
    @include button--round;
    @include button--neutral;
    background-position: -135px center;
  } @else {
    @include button;
    @include button--round;
  }
}

#admin {

  &.disabled:after {
    content: 'Working on that. Hang tight...';
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(#000, 0.75) url(/static/images/loading.gif) no-repeat center center;
    z-index: 9001;
  }

  #content {
    @include page;
    @include page--light;

    header {
      @include header;
      @include header--in-light-page;

      span {
        font-weight: normal;
      }

      .top-actions {
        position: absolute;
        right: spacing(10);
        top: 50%;
        transform: translateY(-50%);
        a {
          @include small-button();
        }
      }

    }

    h3 {
      @include subheading;
      @include subheading--in-light-page;
      font-size: 2.4rem;
    }

    .section {
      margin-top: spacing(4);
    }

    .input-group {
      @include input-group;
    }

    .note {
      @include body;
      margin: spacing(1) 0;
    }

    // This is the laziest thing I've ever done...
    // ...and it's only getting lazier, my friend...
    .hide-source {
      > label {
        display: inline;
      }

      .source {
        margin-top: spacing(2);
        display: none;
      }

      #showSource {
        position: relative;
        top: -2px;
        &:checked + label + .source {
          display: block;
        }
      }
    }

    .current-users {
      .delete-button {
        @include admin-button(delete);
      }

      ul {
        margin-top: spacing(2);
      }

      li {
        @include body;
        overflow: hidden;
        display: flex;
        flex-direction: row-reverse;
        align-items: center;
        justify-content: flex-end;
        padding: spacing(1) 0;
        form {
          margin-right: spacing(2);
        }
      }
    }

    .brackets li.bracket {
      padding: spacing(4) 0;
      border-top: 1px solid get-color(light-gray);
      overflow: hidden;
      position: relative;

      &:first-child {
        border-top: 0;
      }

      img {
        width: $bracket-row-height;
        height: $bracket-row-height;
        display: block;
        margin-right: spacing(4);
        float: left;
        background: get-color(dark-gray);
      }

      .info {
        height: $bracket-row-height;
        display: flex;
        flex-direction: column;
        justify-content: center;

        h3,
        h4 {
          @include identifier;
          margin: 0;
        }

        h4 {
          color: get-color(gray);
        }
      }

      .quick-actions {
        position: absolute;
        top: spacing(4);
        right: 0;
        height: $bracket-row-height;
        display: flex;
        align-items: center;

        .button {
          margin-left: spacing(2);

          &.delete {
            @include admin-button(delete);
          }

          &.edit {
            @include admin-button(edit);
          }

          &.open {
            margin-left: spacing(4);
            @include admin-button(open);
          }
        }
      }

      .all-actions {
        clear: both;
        margin: spacing(2) 0 0 ($bracket-row-height + spacing(4));
        overflow: hidden;
        max-height: 0;
        transition: max-height 500ms;

        h5 {
          @include body;
          margin-bottom: spacing(2);
        }

        a {
          @include body;
          color: get-color(dark-green);
          text-decoration: none;
          &:hover {
            text-decoration: underline;
          }
        }

        .actions-panel {
          width: 450px;
          float: left;
        }

        li {
          padding-bottom: spacing(1);
          float: left;
          width: 50%;
        }

        .primary-action {
          width: 100%;
          padding-bottom: spacing(2);
          float: none;
          a {
            font-weight: bold;
          }
        }

      }

      &.open {
        .quick-actions .button.open {
          @include admin-button(collapse);
        }

        .all-actions {
          max-height: 250px;
        }
      }
    }

  }

  footer {
    position: static;
    margin-top: 50px;
  }

  .non-button {
    background: transparent;
  }

  .nominee-head {
    margin-bottom: 10px;
  }

  .nominee-count {
    @include sub-heading();
  }

  .form {

    h3 {
      @include sub-heading();
      margin: 20px 0 10px;
    }

    label {
      @include body;
      display: block;
      margin-bottom: 10px;
    }

    input[type="text"],
    textarea,
    select {
      font: 20px/1.2 'Roboto', sans-serif;
      padding: 5px;
      margin-bottom: 20px;
      width: 75%;
    }

    textarea {
      height: 400px;

      &.short {
        height: 75px;
      }
    }

    .foot {
      font: 20px/1 'Roboto', sans-serif;
      color: #ccc;
      margin-bottom: 10px;
      a {
        color: $light;
        text-decoration: none;
        &:hover {
          color: $dark;
        }
      }
    }

    button {
      display: block;
      border: 0;
      cursor: pointer;
      &:hover {
        background: $dark;
      }
    }

  }

  .eliminations,
  .stats {
    h2 {
      margin-bottom: 5px;
    }

    h3 {
      font: 30px/1 'Roboto Condensed', sans-serif;
      margin-bottom: 40px;
    }

    label {
      font: 30px/1.2 'Roboto', sans-serif;
    }

    p {
      font: 24px/1.2 'Roboto', sans-serif;
      margin-bottom: 20px;
    }

    select {
      font: 24px/1 'Roboto', sans-serif;
      padding: 15px;
      display: block;
      margin-bottom: 20px;
    }

  }

  button.standard {
    @include button;
    @include button--small;
  }

  button.delete {
    @include button;
    @include button--small;
    background: get-color(red);
    color: #fff;
  }

}

#chart {
  margin-top: 20px;
  background: #fff;
  padding: 25px;
  @include border-box();
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid get-color(gray);

  thead {
    background: get-color(gray);
    th {
      @include body;
      @include body--large;
      text-align: left;
      padding: spacing(2);
    }
  }

  tr:nth-child(2n) td {
    background: get-color(light-gray);
  }

  tr.success td {
    background: get-color(light-green);
  }

  td {
    @include body;
    padding: spacing(2);
  }

  .admin-table__number {
    text-align: center;
    width: 150px;
  }

  .admin-table__actions {
    text-align: right;
  }

  // Probably isn't actually BEMy, but meh
  .admin-table__index {
    @include body;
    @include body--large;
    width: 25px;
    text-align: center;
    padding-right: 0;
  }

}
