.harvesting-menu {
  font-size: $font-size-xs;
  letter-spacing: 1.3px;
  line-height: 1;
  border: 1px solid $light-grey;
  border-radius: 0;
  position: absolute;
  margin-top: -60px !important;
  margin-left: 125px;

  .assembl-icon-cancel {
    cursor: pointer;
    position: absolute;
    right: 5px;
    top: 10px;
    font-size: 13px;
  }

  .button-taxonomy {
    width: 90%;
    border-radius: 0;
    height: auto;
    padding: 3px 0;
    margin: 10px 0;
  }

  .button-taxonomy:hover {
    span {
      color: white;
    }
  }

  .arrow {
    display: none;
  }

  .popover-content {
    padding: 30px 0 10px 0;
    width: 245px;
  }

  .taxonomy-label {
    color: $black;
    padding: 5px 10px 10px 8px;
    font-family: $font-family4;

    .nature-label {
      display: contents;
      position: absolute;
      margin-top: 5px;
      padding-left: 10px;

      span {
        display: block;
        margin: -20px 0 0 32px;
      }
    }

    .action-label {
      display: contents;
      position: absolute;
      margin-top: 5px;

      span {
        display: block;
        margin: -19px 0 0 32px;
      }
    }

    svg {
      width: 22px;
      height: 22px;
    }

    &:hover {
      font-family: $font-family;
    }
  }

  .taxonomy-label-border {
    padding: 5px 10px 10px;
    border-bottom: 1px solid $light-grey;
  }

  .taxonomy-category {
    font-family: $font-family3;
    padding: 25px 10px 10px;
  }

  .taxonomy-label.active {
    font-family: $font-family;
  }
}

.harvesting-anchor {
  position: absolute;
  z-index: 1000;
}

.harvesting-badge {
  position: absolute;
  left: -50px;
  top: 45px;

  .badge-total {
    position: absolute;
    top: 0;
    left: -5px;
    background-color: $white;
    border-radius: 50%;
    width: 14px;
    height: 14px;
    font-size: $font-size-xxs;
    box-shadow: 2px 2px 4px 0 #ccc;
    padding: 0 0 0 4px;
  }

  .left-side-harvesting-button {
    .left-side-harvesting-button__button {
      width: 27px;
      height: 27px;
    }
  }

  .confirm-harvest-button {
    padding: 0;
    margin-top: -9px;

    &:before {
      font-size: $font-size-xs;
    }
  }
}

.harvesting-container {
  position: absolute;
  left: 0;
  z-index: 99;
  padding-top: 10px;
}

.left-side-harvesting-button {
  &:hover {
    .assembl-icon-catch:before {
      font-weight: bold;
    }

    .left-side-harvesting-button__button__inside {
      background-color: #ffed5b;
    }
  }

  .left-side-harvesting-button__button {
    background: white;
    border: 1px solid #ccc;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    box-shadow: 2px 2px 4px 0 #ccc;
    cursor: pointer;

    .left-side-harvesting-button__button__inside {
      text-align: center;
      margin: 4px;
      width: calc(100% - 8px);
      height: calc(100% - 8px);
      background-color: #fff7b5;
      border-radius: 50%;
      display: flex;
    }
  }
}

.confirm-harvest-button {
  text-align: center;
  padding: 1px 0 0 6px;
  font-size: 20px;

  &:before {
    margin-right: 2px;
    font-size: $font-size-sm;
  }
}

.harvesting-mode-on {
  .extracts {
    display: none;
  }

  .post-body--is-harvestable {
    /* FIXME: Factorizing these ::selection rules cancels effect on Firefox */
    .post-body-content *::selection {
      background: $harvesting-yellow;
    }

    .post-body-content *::-moz-selection {
      background: $harvesting-yellow;
    }
  }
}

.active-box {
  border-left-color: $harvesting-green;
}

.box-icon {
  width: 34px;
  height: 34px;
  border: 3px solid $harvesting-green;
  border-radius: 50%;
  position: absolute;
  background-color: $white;
  margin-top: 15px;
  margin-left: 3px;

  svg {
    margin: 4px 0 0 4px;
  }
}

.harvesting-close-button {
  position: absolute;
  right: -9px;
  top: 2px;
  border: 1px solid $grey;
  border-radius: 50%;
  background-color: $white;
  height: 17px;
  font-size: 11px;
  line-height: 13px;
  padding-left: 1px;
  cursor: pointer;

  .assembl-icon-cancel {
    &:before {
      padding-left: 1px;
      font-size: 10px;
    }
  }
}

.box-icon-2 {
  margin-top: 40px;
  z-index: 2;
}

.harvesting-box {
  background-color: $white;
  box-shadow: 2px 2px 4px 0 #ccc;
  width: 295px;

  .harvesting-box-header {
    padding: 16px 20px 15px 20px;
    border-bottom: 1px solid $light-grey;
  }

  .extracts-nb-msg {
    font-size: $font-size-xxs;
    padding-bottom: 10px;
  }

  .harvesting-status {
    display: inline-block;
    font-size: $font-size-xs;

    .harvesting-in-progress {
      color: $black;
      margin-left: -12px;
      padding: 0 0 15px;
    }

    .validated-harvesting {
      color: $harvesting-green;
      margin-left: -12px;
      padding: 0 0 15px;
    }

    .harvesting-status-label {
      display: inline-block;
      vertical-align: sub;
      margin-left: 15px;
      font-size: $font-size-xxs;
      margin-top: 2px;
      width: 145px;
      height: 30px;
      line-height: 30px;
      text-overflow: ellipsis;
      white-space: nowrap;
      overflow: hidden;
    }

    .harvesting-taxonomy-label {
      display: inline-block;
      vertical-align: sub;
      margin-left: 15px;
      font-size: $font-size-xxs;
      margin-top: 2px;
      width: 145px;
      height: 30px;
    }
  }

  .profile {
    font-size: 11px;
    color: $grey;
    margin-left: -5px;
    display: flex;

    img {
      border-radius: 50%;
      margin: 0 10px 0 6px;
    }

    .assembl-icon-profil {
      vertical-align: bottom;

      &:before {
        font-size: 30px;
        margin-right: 10px;
      }
    }

    .harvesting-date {
      font-family: $font-family4;
      font-size: $font-size-xxs;
    }

    .harvesting-infos {
      display: inline-block;
      vertical-align: bottom;

      .username {
        width: 208px;
        text-overflow: ellipsis;
        white-space: nowrap;
        overflow: hidden;
      }
    }
  }

  .button-bar {
    padding-top: 5px;
    float: right;
    margin-right: -25px;

    .taxonomy-menu-btn {
      border: none;
      padding: 0 0 0 2px;
      background: none;

      &:hover,
      &:focus {
        background: none !important;
      }

      .assembl-icon-ellipsis-vert {
        &:before {
          font-size: 20px;
          vertical-align: middle;
          padding: 2px 0 0;
        }

        &:hover {
          color: $harvesting-green;
        }
      }
    }

    .btn[disabled] {
      opacity: 1;
      border-color: $light-grey;

      span {
        color: $light-grey;
      }

      &:hover {
        background-color: $white;
        border-color: $light-grey;

        span {
          color: $light-grey;
        }
      }
    }

    .btn.active {
      background-color: $white;
      box-shadow: none;
    }

    .btn-default {
      margin: 0 3px;
      border-radius: 5px;
      width: 26px;
      height: 26px;
      border-color: $grey;

      span {
        color: $grey;

        &:before {
          font-size: 12px;
          display: block;
          margin: 0 0 0 -6px;
        }
      }

      &:hover {
        background-color: $white;
      }

      &:focus {
        background-color: $white;
        outline: none;
      }

      &:active {
        box-shadow: none;
      }
    }
  }

  .harvesting-box-body {
    padding: 20px 5px 10px;
    font-size: $font-size-xs;
    color: $grey;
    word-wrap: break-word;

    .extract-body {
      max-width: 250px;
    }

    .form-group {
      margin: 0;
    }

    .selection-body {
      padding: 0 20px 20px;
    }

    textarea {
      border: 1px solid $light-grey;
      margin: -20px 0 0;
      color: $grey;
      font-family: $font-family;
      font-size: $font-size-xs;
      min-height: 100px;

      &:focus {
        border: 1px solid $light-grey;
      }
    }

    .body-container {
      display: inline-flex;
      align-items: center;

      .previous-extract {
        cursor: pointer;
        margin-top: 20px;
        font-size: 30px;
        flex-basis: 30px;
        flex-shrink: 0;
      }

      .next-extract {
        cursor: pointer;
        margin-top: 20px;
        font-size: 30px;
        flex-basis: 30px;
        flex-shrink: 0;
        padding-left: 15px;
      }
    }
  }

  .harvesting-tag-form-container {
    border: 1px solid $light-grey;
    width: 100%;

    .form-group {
      margin: 0;
    }

    .select-field__control {
      border: none;
      min-height: auto !important;
      border-radius: 20px !important;
    }

    .select-field__indicator {
      padding: 0 8px;
    }

    .select-field__value-container {
      padding: 0;
    }
  }

  .harvesting-tags-form-container,
  .harvesting-tags-container {
    padding: 15px 15px 10px 26px;
    border-top: 1px solid $light-grey;

    label {
      font-weight: normal;
    }

    .select-field__control {
      border-radius: 0;
      min-height: 34px;
    }

    .select-field__placeholder {
      color: $grey;
      font-size: $font-size-xs;
    }

    .select-field__dropdown-indicator {
      color: $grey;
      padding: 0 8px;

      svg {
        width: 16px;
      }
    }

    .select-field__multi-value {
      border-radius: 0 !important;
    }

    .select-field__multi-value__label {
      padding: 3px;
    }

    .select-field__multi-value__remove {
      padding: 0 !important;

      &:hover {
        background: none;
        color: $grey;
      }
    }

    .harvesting-box-footer {
      padding: 5px 0;
    }

    .harvesting-tags-titles-container {
      margin-left: 6px;
      display: inline;
    }

    .harvesting-tag-container {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      background-color: white;
      border-radius: 13px;
      padding: 2px 2px 2px 10px;
      color: $grey;
      margin-right: 5px;
      margin-bottom: 5px;
      font-family: $font-family4;
      font-size: $font-size-xs;
      font-weight: bold;

      &.editing {
        width: 100%;
      }

      &.editable {
        cursor: pointer;
      }

      .harvesting-tag-title {
        margin-right: 7px;
        white-space: nowrap;
      }

      .assembl-icon-cancel {
        cursor: pointer;

        &::before {
          padding-left: 2px;
        }
      }
    }

    .harvesting-tags-edit {
      display: inline-flex;
      border-radius: 16px;
      padding: 0 0 0 3px;
      border-style: solid;
      border-width: 1px;
      font-size: 13px;
      line-height: 13px;
      height: 15px;
      width: 15px;
      cursor: pointer;

      &:hover {
        color: white;
      }
    }
  }

  .harvesting-box-footer {
    text-align: center;
    display: flex;
    justify-content: space-around;
    padding: 20px 0;

    .btn-default {
      margin: 0 22px;
    }

    .button-submit {
      padding: 8px 17px;
    }

    .button-cancel {
      padding: 8px 17px;
    }
  }

  .extracts-numbering {
    text-align: right;
    padding-right: 20px;
    padding-bottom: 20px;
    font-size: $font-size-xxs;
  }
}

.extract-in-message {
  display: inline;
}

.submitted-harvesting {
  .harvesting-submitted-message {
    color: $harvesting-blue;
    padding-top: 10px;
    font-size: 12px;
    padding-left: 8px;
    margin-bottom: -10px;
  }

  .validated-harvesting {
    color: $harvesting-blue !important;
  }

  .box-icon {
    border: 3px solid $harvesting-blue;
  }

  .active-box {
    border-left-color: $harvesting-blue;
  }
}

.harvesting-tag-input-container {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;

  .harvesting-tag-input {
    display: flex;
    align-items: center;

    > div {
      margin: 0 !important;
      padding: 0 !important;
    }
  }

  .harvesting-tag-input-control {
    display: flex;
    padding: 0 5px;

    .icon {
      margin-right: 5px;
      padding: 2px 1px 0 1px;
      border-radius: 12px;
      cursor: pointer;
    }

    .icon:last-child {
      margin-right: 0;
    }

    .cancel-icon:hover {
      color: white !important;
      background-color: $red !important;
    }

    .validate-icon {
      padding: 2px 1px 0 1px;

      &:hover {
        color: white;
        background-color: $green;
      }
    }
  }
}

@media screen and (max-width: $screen-sm-min) {
  .is-harvesting-button {
    display: none;
  }

  .harvesting-container {
    display: none;
  }
}
