#wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

#page-wrapper {
  display: flex;
  flex-direction: row;
  flex-grow: 1;
}

#page-content {
  background: $white;
  flex-grow: 1;
  padding: 20px 40px;
  margin-left: 250px;
  margin-top: 50px;
}

aside.sidebar {
  background-color: $gray-lightest;
  width: 250px;
  height: 100vh;
  font-size: 14px;
  flex-grow: 0;
  flex-shrink: 0;
  flex-wrap: nowrap;
  z-index: 150;
  position: fixed;
  margin-top: 50px;
  overflow-y: auto;

  a {
    color: $body-color-light;
    font-weight: bold;
  }

  .nav-fold span.has-children {
    display: flex;
    flex-direction: row;

    a {
      flex-grow: 1;
    }

    .arrow {
      flex-grow: 0;
      width: 50px;
      border: none;
      display: flex;
      justify-content: center;

      i {
        padding-top: 4px;
      }
    }
  }

  .nav-link,
  .nav-fold {
    border-top: 1px solid $gray-light;
  }

  .nav-link {
    padding: 10px 15px;

    &:last-child {
      border-bottom: 1px solid $gray-light;
    }
  }

  .nav-link {
    .fa {
      margin-right: 5px;
    }

    &.nav-link-second-level span {
      padding-left: 1.6em;
    }
  }

  .nav-link.nav-link-second-level,
  .nav-link.nav-link-inner,
  .nav-link.nav-link-inner.active {
    border: none;
  }

  .nav-link.active,
  .nav-link.active:hover,
  .nav-link.nav-link-second-level.active,
  .nav-link.nav-link-second-level.active:hover {
    background-color: fade-out($brand-primary, 0.8);
  }
  .nav-link:hover,
  .nav-link.nav-link-second-level:hover {
    background-color: $gray-lighter;
  }
}

.navbar {
  height: 50px;
  color: $brand-primary;
  background-color: $offwhite;
  border-bottom: 4px $brand-primary solid;
  padding: 0.25rem;
  box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.12), 1px 1px 2px rgba(0, 0, 0, 0.24);
  z-index: 200;

  .twitter-typeahead {
    width: inherit;
    margin-right: 8px;
  }

  .fa-eye {
    margin-top: 15px;
    margin-left: 5px;
  }

  .dropdown-menu {
    position: absolute;
    top: 49px;
    padding: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    border-radius: 0;
    width: 300px;
    z-index: 0;
    background: $offwhite;
    max-height: 500px;
    overflow-y: auto;
    li {
      border-top: $gray-light 1px solid;
      &:hover,
      &.active {
        background: $gray-lightest;
      }
    }
  }

  #eventDropdown {
    display: flex;
    align-items: center;
    padding: 7px;

    .event-text {
      width: 200px;
    }
    &[aria-expanded="true"] {
      background: $gray-lighter;
    }
  }
  #eventDropdown .event-text,
  .dropdown-menu .event-text {
    padding: 8px;
    font-size: 14px;
    line-height: 15px;
    display: flex;
    flex-direction: column;
    text-decoration: none;

    span {
      display: inline-block;
      text-overflow: ellipsis;
      white-space: nowrap;
      overflow: hidden;
    }

    .event-name {
      font-family: "Titillium Web";
      font-weight: 600;
    }

    .event-date,
    .event-organiser {
      font-size: 11px;
      color: $body-color-light;
    }
  }
  a {
    color: $brand-primary;
  }
}

.navbar-brand {
  font-family: "Titillium Web";
  font-weight: 600;
  img {
    height: 30px;
    width: auto;
    margin: auto;
  }
}

.speaker-info {
  display: flex;
  flex-direction: row;

  .speaker-image img {
    max-height: 160px;
    float: right;
  }
}

#speaker-typeahead {
  span.twitter-typeahead,
  input {
    width: 350px;
    margin-right: 8px;
  }
}

.orga-headline {
  font-weight: bold;
}

ul.nav-tabs {
  border-bottom: $gray-light solid 1px;
  margin-bottom: 16px;

  .nav-link {
    border: none;
  }

  .nav-link:hover,
  .nav-link:focus {
    border-bottom: $gray-light solid 2px;
  }

  .nav-link:hover,
  .nav-link:focus .nav-link.active {
    border-bottom: $brand-primary 2px solid;
    background-color: $white;
  }

  .nav-link.active {
    border-bottom: $brand-primary 4px solid;
  }
}

legend {
  border-bottom: 1px solid $gray-lighter;
  margin-bottom: 20px;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  font-size: 28px;
}

footer {
  margin-top: 20px;
  text-align: center;
  font-size: 11px;
}

#main-title .text-muted {
  margin-left: 4px;
}

.dashboard-live {
  margin: 6px;
  font-size: 22px;
}

.dashboard-live-text,
.dashboard-live {
  margin-top: 12px;
}

.feedback-card {
  margin-bottom: 8px;

  .card-body {
    padding: 16px 16px 0px 16px;
    transition: display 0.5s;
  }
}

.question-option-row {
  margin-left: -4px;
  display: flex;
  padding-bottom: 8px;
}

.question-option-input.disabled input {
  background-color: $gray-lighter;
  opacity: 1;
  cursor: not-allowed;
}

.form-control.tt-hint[readonly] {
  background-color: $white !important;
}

.search-submit-group {
  padding-bottom: 0;
}
.search-form {
  display: flex;
  flex-wrap: wrap;
  align-content: center;

  & > .form-group {
    width: 300px;
    display: flex;
    margin-right: 16px;

    [type="text"] {
      height: 2.25rem;
    }

    label {
      display: none;
    }
    .form-control.is-valid {
      background-image: none;
    }
  }

  .btn, details {
    align-self: flex-start;
    margin-top: auto;
    margin-bottom: 16px;
  }
  .btn {
    margin-right: 16px;
  }
}
.filter-form {
  .form-group {
    margin-right: 8px;
    .form-control.is-valid {
      background-image: none;
    }
  }
}
.resource-option-row,
.resource-option-input {
  display: flex;
  flex-direction: row;
  width: 100%;
  margin-left: 8px;

  .resource-option-delete {
    float: right;
    padding-right: 8px;
    flex-grow: 0;
  }

  .form-group {
    display: flex;
    padding-right: 16px;

    .bootstrap-multi-input {
      flex-grow: 1;
    }

    input {
      width: 280px;
      height: 2rem;
    }
  }
}

.input-group-text.input-group-append {
  padding: 0 0.75rem;
}

.event-logo-field {
  .event-logo-form-fields .form-group {
    display: inline-block;
    max-width: 100%;
    a {
      word-wrap: break-word;
    }
  }
  img.event-logo-display {
    padding: 2px;
    border: 1px solid $gray-light;
    max-width: 180px;
  }
}

.bootstrap4-multi-input {
  margin: auto;
}

.history-sidebar {
  max-height: 90vh;
  overflow-y: scroll;
  border-bottom: 1px solid rgba(0, 0, 0, 0.125);
}

.dashboard-history {
  overflow-y: none;
  max-height: none;
  border: none;

  .list-group {
    .logentry {
      border: none;
      display: flex;
      padding: 0;
      margin: 0;
      padding-right: 8px;

      p {
        br {
          display: none;
        }
      }

      .meta {
        display: flex;
        flex-direction: row;
        align-content: baseline;
        padding-right: 8px;
        width: 350px;

        .time {
          width: 200px;
        }

        .person {
          width: 150px;
        }
      }
    }
  }
}

@include media-breakpoint-down(md) {
  nav input,
  nav #navigate,
  nav .twiter-typeahead {
    display: none !important;
  }
  nav #event-navigation #eventDropdown {
    display: none;
  }
  .container-fluid {
    padding: 0;
    width: 100%;
  }

  .flex-content {
    max-width: 100%;
  }

  .navbar {
    padding: 0.1rem 1rem;

    ul {
      flex-direction: row;

      .fa {
        padding-left: 12px;
        padding-right: 12px;
        margin-top: 0;
      }
    }
  }

  .navbar-collapse {
    flex-basis: auto;
  }

  aside.sidebar {
    position: absolute;
    display: none;
  }

  aside.sidebar-uncollapsed {
    display: inherit;
    z-index: 600;

    /* display above timeline in dashboard */
  }

  fieldset .alert.col-md-9.offset-md-3 {
    margin: 0;
  }

  .history-sidebar {
    display: none;
  }

  #page-content {
    padding: 4px 8px;
    flex-grow: 0;
    width: 100%;
    margin-left: 0;
  }

  ul.nav-pills {
    li.nav-item {
      padding: 0;
      margin: 0;

      a {
        padding: 4px 8px;
      }
    }
  }

  .col-form-label {
    text-align: left;
    display: flex;

    span {
      padding-left: 4px;
    }
  }
  .dashboard-history .list-group .logentry {
    flex-direction: column;
    border-bottom: 1px solid $gray-light;
    padding-top: 16px;
    .meta {
      flex-direction: column;
      .time {
        padding-bottom: 16px;
      }
    }
  }
}

td.reviewer {
  display: flex;
  flex-direction: row;
}

form #id_settings-display_header_pattern,
form #id_display-display_header_pattern {
  display: flex;
  padding: 0;
  overflow-x: auto;

  .form-check {
    padding-left: 0;
  }

  label {
    width: 100px;
    position: relative;
    margin-right: 8px;

    &:before {
      left: 40px;
      top: 8px;
    }

    &:after {
      left: 44px;
      top: 8px;
    }
  }

  .mini-header {
    width: 100px;
    height: 100px;
    background-color: var(--color, $brand-primary);
  }
}

.form-plugins {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: stretch;
  align-content: stretch;

  .plugin-card {
    margin: 16px;
    width: 40%;
    flex-grow: 1;
    flex-shrink: 0;

    .card-header {
      display: flex;
      flex-direction: row;
      justify-content: space-between;
      align-items: baseline;
      font-weight: bold;

      .btn {
        max-width: 150px;
      }
    }
  }
}

h2 .submission-state-dropdown {
  padding: 4px;
}

.submission-state-dropdown {
  display: inline-block;

  summary {
    display: flex;
    align-items: baseline;

    & > * {
      padding: 0 4px;
    }
  }

  a {
    font-weight: bold;
    font-size: 16px;
  }
}

.submission-state-deleted,
.submission-state-withdrawn,
.submission-state-canceled {
  color: $gray;
  border-color: $gray;
}
.submission-state-deleted:hover,
.submission-state-withdrawn:hover,
.submission-state-canceled:hover {
  color: $white;
  background-color: $gray;
  border-color: $gray;
}

.submission-state-submitted {
  color: $brand-info;
  border-color: $brand-info;
  background-color: $white;
}
.submission-state-submitted:hover {
  color: $white;
  background-color: $brand-info;
  border-color: $brand-info;
}

.submission-state-accepted {
  color: lighten($brand-success, 10%);
  border-color: lighten($brand-success, 10%);
  background-color: $white;
}
.submission-state-accepted:hover {
  background-color: lighten($brand-success, 10%);
  border-color: lighten($brand-success, 10%);
  color: $white;
}

.submission-state-confirmed {
  color: lighten($brand-primary, 10%);
  border-color: lighten($brand-primary, 10%);
  background-color: $white;
}
.submission-state-confirmed:hover {
  color: $white;
  border-color: lighten($brand-primary, 10%);
  background-color: lighten($brand-primary, 10%);
}

.submission-state-rejected {
  color: $danger;
  border-color: $danger;
  background-color: $white;
}
.submission-state-rejected:hover {
  color: $white;
  border-color: $danger;
  background-color: $danger;
}

#cfp-option-table {
  width: 75%;
  display: table;
  .form-group {
    margin-bottom: 4px;
    display: flex;
    align-content: center;
    input {
      margin-left: auto;
      margin-right: auto;
    }
  }
  small {
    margin-top: 0;
    padding-top: 0;
  }
  thead th {
    line-height: 1;
    vertical-align: top;
    text-align: center;
    .text-muted {
      font-weight: normal;
    }
  }
  input[type="number"] {
    width: 64px;
    margin-top: -8px;
  }
  tr,
  tr td {
    padding-top: 16px;
    line-height: 2.5;
  }
  tr th:first-child {
    max-width: 200px
  }
}
#id_locales.checkbox,
#id_initial-locales.checkbox,
#id_tags {
  padding: 0;
  label {
    display: inline-block !important;
    margin-bottom: 8px;
  }
}
.tag-widget-wrapper label {
  border: 2px solid;
  border-color: var(--tag-color);
  padding: 0 8px;
  border-radius: 14px;
}
.colorpicker-element .colorpicker-input-addon {
  display: flex;
  width: 36px;
  align-items: center;
  justify-content: space-around;
  background: #dfe4e6;
  border: 1px solid #ced4da;
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
  i {
    border-radius: 2px;
    width: 18px;
    height: 18px;
  }
}
.colorpicker-2x {
  width: auto !important;
}
.colorpicker-2x.colorpicker-with-alpha {
  width: 272px;
}

.colorpicker-2x .colorpicker-saturation {
  width: 200px;
  height: 200px;
}

.colorpicker-2x .colorpicker-hue,
.colorpicker-2x .colorpicker-alpha {
  width: 30px;
  height: 200px;
}

.colorpicker-2x .colorpicker-alpha,
.colorpicker-2x .colorpicker-preview {
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
}

.colorpicker-2x .colorpicker-preview,
.colorpicker-2x .colorpicker-preview div {
  height: 30px;
  font-size: 16px;
  line-height: 160%;
}

.colorpicker-saturation .colorpicker-guide {
  height: 10px;
  width: 10px;
  border-radius: 10px;
  margin: -5px 0 0 -5px;
}
.color-square {
  display: inline-block;
  align-self: baseline;
  width: 20px;
  height: 20px;
  border: 2px solid $gray-light;
  margin-right: 2px;
}
.phase-option-row .row, .score-row .row {
  margin-bottom: 8px;
}
#stats {
  display: flex;
  flex-wrap: wrap;
  .card {
    display: inline-flex;
    flex-grow: 1;
    margin: 4px;
    &.stats-timeline {
      width: 100%;
    }
  }
  .pie svg,
  .pie {
    min-height: 400px;
    min-width: 500px;
    max-width: 500px;
  }
  #toggle-button {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: $brand-success;
    background: $brand-success;
    &:before,
    &:after {
      color: $brand-success;
    }
    margin: 0 8rem 0 4rem;
    padding: 0;
    position: relative;
    border: none;
    height: 1.5rem;
    width: 3rem;
    border-radius: 1.5rem;

    &:before,
    &:after {
      line-height: 1.5rem;
      text-align: center;
      font-weight: 600;
      font-size: 14px;
      text-transform: uppercase;
      letter-spacing: 2px;
      position: absolute;
      bottom: 0;
      transition: opacity 0.25s;
    }
    &:before {
      content: attr(data-left);
      right: 4rem;
    }
    &:after {
      content: attr(data-right);
      left: 4rem;
      opacity: 0.5;
    }

    > .handle {
      position: absolute;
      top: 0.1875rem;
      left: 0.1875rem;
      width: 1.125rem;
      height: 1.135rem;
      border-radius: 1.125rem;
      background: #fff;
      transition: left 0.25s;
    }
    &.active {
      transition: background-color 0.25s;
      > .handle {
        left: 1.6875rem;
        transition: left 0.25s;
      }
      &:before {
        opacity: 0.5;
      }
      &:after {
        opacity: 1;
      }
    }
  }
}
#question-stats {
  display: flex;
  flex-wrap: wrap;
  .table {
    width: auto;
    padding: 16px;
  }
  #question-answers {
    margin-right: 32px;
  }
}
#release #id_version {
  height: auto;
}
#review-filter-form {
  #range-wrapper {
    margin-right: 48px;
    padding-left: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    label {
      color: #495057;
      font-size: 1rem;
    }
    .rs-container {
      font-family: inherit;
      color: #495057;
      .rs-selected {
        background-color: $brand-primary;
      }
    }
  }

}
.review-table.table {
  thead th {
    position: sticky;
    top: 50px;
    background-color: white;
    border-bottom: none;
    z-index: 50;
    &:after {
      border-bottom: 2px solid #c7d1d3;
      content: " ";
      position: absolute;
      width: 100%;
      bottom: 0px;
      left: 0px;
    }
  }
  td {
    margin-top: -1px;
  }
  tbody tr,
  thead tr {
    .unmark-radio {
      opacity: 0;
      margin-top: 1px;
      color: $gray-500;
      font-size: 16px;
    }
    .unmark-radio.always-active {
      opacity: 1;
      cursor: pointer;
    }
    .radio {
      label::before {
        font-family: ForkAwesome;
        font-weight: bold;
        color: rgba(0, 0, 0, 0.3);
        text-align: center;
      }
      &.reject {
        label::after {
          background: $brand-danger;
        }
        label::before {
          content: "\f00d";
        }
      }
      &.accept {
        label::before {
          content: "\f00c";
        }
      }
    }
    &:hover .unmark-radio.active {
      opacity: 1;
      cursor: pointer;
    }
    &:first-child td {
      border-top: none;
    }
    .form-check {
      width: 40px;
      padding: 4px;
      padding-top: 0;
    }
  }
}
.review-table + #submitBar {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  position: fixed;
  right: 0;
  bottom: 0;
  background: $gray-lightest;
  width: 100%;
  z-index: 50;
  > span {
    font-size: 16px;
    margin-right: 16px;
    span {
      font-weight: bold;
      margin-right: 16px;
    }
  }
  button {
    margin: 16px;
  }
}
#csswrap {
  position: relative;
  button {
    position: absolute;
    top: 0;
    right: 0;
  }
}
main .progress {
  position: relative;
  width: 100%;
  &::after {
    color: black;
    content: attr(title);
    position: absolute;
    text-align: center;
    width: 100%;
  }
}
#anonymise {
  display: flex;
  flex-direction: column;
  > div {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    > div {
      flex-grow: 1;
      min-width: 300px;
      width: 48%;
    }
  }
}
#anon-menu {
  position: absolute;
  margin-top: -48px;
  margin-right: 42px;
  right: 0;

  button {
    padding: 0;
    margin: 0;
    border: none;
    background-color: rgba(0, 0, 0, 0.72);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    position: relative;
    &:after {
      width: 0;
      height: 0;
      border-left: 12px solid transparent;
      border-right: 12px solid transparent;
      content: " ";
      border-top: 12px solid rgba(0, 0, 0, 0.72);
      position: absolute;
      right: 70%;
      bottom: -12px;
    }
  }
}
.hide-label {
  label {
    display: none;
  }
}
