/**
 * Dashboard Todos
 *
 */

.todos-list > .todo {
  // workaround because we cannot use border-colapse
  border-top: 1px solid transparent;
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: row;
  flex-direction: row;

  &:hover {
    background-color: $row-hover;
    border-color: $row-hover-border;
    cursor: pointer;
  }

  // overwrite border style of .content-list
  &:last-child {
    border-bottom: 1px solid transparent;

    &:hover {
      border-color: $row-hover-border;
    }
  }

  .todo-avatar,
  .todo-actions {
    @include transition(opacity);
    -webkit-flex: 0 0 auto;
    flex: 0 0 auto;
  }

  .todo-actions {
    display: -webkit-flex;
    display: flex;
    -webkit-justify-content: center;
    justify-content: center;
    -webkit-flex-direction: column;
    flex-direction: column;
    margin-left: 10px;
    min-width: 55px;
  }

  .todo-item {
    -webkit-flex: 0 1 100%;
    flex: 0 1 100%;
    min-width: 0;
  }

  &.todo-pending.done-reversible {
    background-color: $white-light;

    &:hover {
      border-color: $white-normal;
      background-color: $gray-light;
      border-top: 1px solid transparent;

      .todo-avatar,
      .todo-item {
        opacity: .6;
      }
    }

    .todo-avatar,
    .todo-item {
      opacity: .2;
    }

    .btn {
      background-color: $gray-light;
    }
  }
}

.todo-item {
  @include transition(opacity);

  .todo-title {
    display: flex;

    > .title-item {
      -webkit-flex: 0 0 auto;
      flex: 0 0 auto;
      margin: 0 2px;

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

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

    .todo-label {
      -webkit-flex: 0 1 auto;
      flex: 0 1 auto;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
  }

  .status-box {
    margin: 0;
    float: none;
    display: inline-block;
    font-weight: $gl-font-weight-normal;
    padding: 0 5px;
    line-height: inherit;
    font-size: 14px;
  }

  .action-name {
    font-weight: $gl-font-weight-normal;
  }

  .todo-body {
    .todo-note {
      word-wrap: break-word;

      .md {
        color: $gl-grayish-blue;
        font-size: $gl-font-size;

        .label {
          color: $gl-text-color;
          font-size: inherit;
        }

        p {
          color: $gl-text-color;
        }
      }

      code {
        white-space: pre-wrap;
      }

      pre {
        border: none;
        background: $gray-light;
        border-radius: 0;
        color: $todo-body-pre-color;
        margin: 0 20px;
        overflow: hidden;
      }

      .note-image-attach {
        margin-top: 4px;
        margin-left: 0;
        max-width: 200px;
        float: none;
      }

      p:last-child {
        margin-bottom: 0;
      }
    }
  }
}

@media (max-width: $screen-sm-max) {
  .todos-filters {
    .dropdown-menu-toggle {
      width: 130px;
    }

    .dropdown-menu-toggle-sort {
      width: auto;
    }
  }
}

@media (max-width: $screen-xs-max) {
  .todo {
    .avatar {
      display: none;
    }
  }

  .todo-item {
    .todo-title {
      flex-flow: row wrap;
      margin-bottom: 10px;

      .todo-label {
        white-space: normal;
      }
    }

    .todo-body {
      margin: 0;
      border-left: 2px solid $todo-body-border;
      padding-left: 10px;
    }
  }

  .todos-filters {
    .dropdown-menu-toggle {
      width: 100%;
    }
  }
}

.todos-empty {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  flex-direction: column;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;

  @media (min-width: $screen-sm-min) {
    -webkit-flex-direction: row;
    flex-direction: row;
    padding-top: 80px;
  }
}

.todos-empty-content {
  -webkit-align-self: center;
  align-self: center;
  max-width: 480px;
  margin-right: 20px;
}

.todos-empty-hero {
  width: 200px;
  margin-left: auto;
  margin-right: auto;

  @media (min-width: $screen-sm-min) {
    width: 300px;
    margin-right: 0;
    -webkit-order: 2;
    order: 2;
  }
}

.todos-all-done {
  padding-top: 20px;

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

  > svg {
    display: block;
    max-width: 300px;
    margin: 0 auto 20px;
  }

  p {
    max-width: 470px;
    margin-left: auto;
    margin-right: auto;
  }

  a {
    font-weight: $gl-font-weight-bold;
  }
}

.todos-filters {
  @include new-style-dropdown;
}
