.o2-repeat {
  background-color: white;
  // padding: 18px;
  // border: $border;
}

/* Repeat Simple */
.o2-repeat-simple {
  & > .o2-repeat-wrapper {
    border: $border;
    padding: 8px;

    & > .o2-repeat-item {
      background-color: $white;

      & + .o2-repeat-item {
        border-top: 2px solid darken($color: $cream, $amount: 10%);
        padding-top: 8px;
      }

      .o2-repeat-simple-remove {
        @include reset-button;
        width: 24px;
        height: 24px;
        border-radius: 4px;
        background-color: $red;
        color: $white;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;

        span {
          font-size: 14px;
        }

        &:hover {
          background-color: darken($red, 10%);
        }
      }
    }
  }

  .o2-repeat-add {
    margin-top: 12px;
  }

  .o2-repeat-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background-color: transparent;
    color: $black-light;
    padding: 4px;
    margin-right: 8px;
    cursor: move;
  }
}

/* Repeat Accordion */
.o2-repeat-accordion {
  // padding: 18px;

  & > .o2-repeat-wrapper {
    padding-top: 8px;
    border-top: 1px solid $border-color;
    border-bottom: 1px solid $border-color;

    & > .o2-repeat-item {
      margin-bottom: 8px;

      &:hover > .o2-repeat-item-head .o2-repeat-add-down {
        display: inline-flex;
      }
    }
  }

  .o2-repeat-empty {
    padding: 0 8px 8px 8px;
  }

  .o2-repeat-add {
    margin-top: 8px;
  }

  .o2-repeat-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #f5f5f5;
    border: 1px solid #dfdfdf;
    height: 28px;
    padding: 5px;
    box-sizing: border-box;
    cursor: pointer;

    .o2-repeat-item-title {
      display: inline-block;
      font-size: 13px;
      pointer-events: none;
      flex: 1;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
      color: #3c434a;
    }

    .o2-repeat-item-head-left {
      display: flex;
      align-items: center;
    }

    .o2-repeat-item-head-right {
      display: flex;
    }

    .o2-repeat-item-indicator {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 22px;
      height: 28px;
      color: #adadad;
      pointer-events: none;
    }

    .o2-repeat-remove,
    .o2-repeat-add-down {
      @include reset-button;
      font-size: 20px;
      width: 24px;
      height: 28px;
      color: #adadad;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
    }

    .o2-repeat-remove:hover {
      color: $red;
    }

    .o2-repeat-add-down {
      display: none;
      &:hover {
        color: $blue;
      }
    }
  }

  &:not(.draggable) {
    .o2-repeat-item-title {
      display: inline-flex;
      align-items: center;

      &::before {
        content: "";
        display: block;
        width: 6px;
        height: 6px;
        background-color: #adadad;
        border-radius: 50%;
        margin: 0 7px;
      }
    }
  }

  &.draggable {
    .o2-repeat-handle {
      display: inline-flex;
      height: 28px;
      width: 28px;
      justify-content: center;
      align-items: center;
      // padding: 0 8px;
      // border: none;
      // background-color: transparent;
      cursor: move;
      color: #adadad;

      span {
        font-size: 14px;
      }
    }
  }

  .o2-repeat-item-body {
    padding: 12px;
    border: $border;
    border-top: none;

    &.hidden {
      display: none;
    }
  }
}

.o2-repeat-empty {
  button {
    padding: 0;
    border: none;
    background-color: transparent;
    display: inline;

    color: $blue;
    text-decoration: underline;
    // text-underline-offset: 4px;
    cursor: pointer;

    &:hover {
      color: darken($blue, 10%);
    }
  }
}
