@import './token.less';
@import './react-loading-skeleton.less';
@import './wrap.less';

.@{ns}-RowDetail-module-cell{
  display: inline-flex;
  align-items: center;
  &:not(.@{ns}-Checkbox, .@{ns}-Checkboxes, .@{ns}-Switch){
    width: 100%;
    overflow: hidden;
  }
}
.@{ns}-RowInfo{
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translate(0px, 0px);
  .@{ns}-RowDetail-module-item-label{
    display: flex;
    align-items: center;
    line-height: 20px;
    &-descIcon{
      margin-left: 4px;
      cursor: help;
    }
  }

  .is-block{
    width: 100% !important;
  }

  &-nodata{
    height: 100px;
    line-height: 100px;
    text-align: center;
    color: #888;
  }

  // 必填项
  &-star{
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);

    color: var(--danger-color);
    font-size: 12px;
    line-height: 1;
  }

  &-container{
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    overflow: hidden;
  }

  &-content{
    flex: 1;
    min-height: 0;
  }

  &-action{
    position: relative;
    height: 30px;
    display: flex;
    align-items: center;
    font-size: var(--fontSizeMd);
    transition: none;
    color: #606060;
    overflow: hidden;

    & > .@{ns}-Button, & > .@{ns}-Form-item{
      position: absolute;
      opacity: 0;
      left: 0;
      top: 0;
      width: 100%;
      height: 100%;
    }
    & > span{
      margin-left: 5px;
    }

    &:hover{
      color: var(--primary-color);
    }
    &:active{
      border-color: transparent;
      box-shadow: none;
    }
    .@{ns}-ResultBox-value{
      pointer-events: none;
    }
  }


  .@{ns}-Tabs-pane{
    padding-left: 0;
    padding-right: 0;
  }
  &_PLACEHOLDER{
    height: 300px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #909090;
  }
}


.@{ns}-RowDetail{
  overflow: hidden;
  &-header{
    padding: 10px 20px 0;
    border-bottom: 1px solid #e8e8e8;

    &-main{
      margin-bottom: 10px;
      margin-left: -5px;
      min-height: 39px;
      position: relative;
      .@{ns}-RowInfo-star{
        display: none !important;
      }
      textarea{
        border: none;
        outline: none;
        box-shadow: none;
        font-size: 18px;
        color: #303030;
        font-weight: 500;
        line-height: 1.5;

        &:focus, &:hover{
          border: none;
          box-shadow: none;
          background-color: var(--color-fill-2);
        }
      }

      input{
        font-size: 18px;
        font-weight: 500;
      }
      .@{ns}-InputBox.is-quick-edit{
        &:hover{
          border-color: transparent !important;
          background-color: var(--color-fill-2);
        }
        &.is-focused{
          box-shadow: none;
          border-color: transparent;
          background-color: var(--color-fill-2);

        }
      }
    }

    &-fields{

      display: flex;
      flex-wrap: wrap;
      align-items: center;
      justify-content: space-between;
      // padding-left: 10px;
      // padding-right: 10px;
      &__field{
        position: relative;
        flex: 0 0 auto;
        width: calc(50% - 5px);
        margin-bottom: 10px;

        display: flex;
        padding: 4px;
        cursor: pointer;
        align-items: center;
        transition: background-color .2s;
        border-radius: 30px;
        &:hover{
          background-color: #e8f3ff;
        }
        &_icon{
          width: 30px;
          height: 30px;
          background-color: #e8e8e8;
          border-radius: 50%;
          overflow: hidden;
          flex-shrink: 0;

          &>div{
            width: 100%;
            height: 100%;
            display: flex;
            justify-content: center;
            align-items: center;
            svg{
              width: 16px;
              height: 16px;
              fill: currentColor;
            }

            img{
              width: 100%;
              height: 100%;
            }

            &>div.multiavatar-avatar{
              width: 100%;
              height: 100%;

              svg{
                width: 100%;
                height: 100%;
              }
            }
          }
        }
        &_content{
          margin-left: 10px;
          display: flex;
          flex-direction: column;
          overflow: hidden;
          .@{ns}-RowDetail__field-title{
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            font-size: 15px;
            color: #303030;
            font-weight: 500;
            &-empty{
              color: #909090;
            }
            .@{ns}-SelectControl{
              width: max-content;
            }
            .@{ns}-Select-valueWrap{
              width: auto !important;
            }
            .is-quick-static{
              padding: 0;
              font-size: 15px;
              width: auto;
            }
          }
          .@{ns}-RowDetail__field-subTitle{
            line-height: 1;
            margin-top: 2px;
            display: inline-block;
            height: 15px;
            font-size: 12px;
            color: #909090;
            font-weight: 500;
          }
        }
        &_select{
          width: 100%;
          height: 100%;
          position: absolute !important;
          left: 0;
          top: 0;
          background-color: transparent !important;

          .@{ns}-Select{
            height: 100%;
          }
          &.is-quick-edit{
            background-color: transparent !important;
            &:focus{
              box-shadow: none !important;
            }
            &:hover{
              background-color: transparent !important;
              box-shadow: none !important;
              border-color: transparent !important;

              .@{ns}-Select-clear{
                display: none !important;
              }
            }
            &.is-opened,&.is-focused{
              border-color: transparent !important;
            }
          }
          .@{ns}-Select-valueWrap{
            opacity: 0;
          }
        }
      }
    }
  }

  &-container{
    display: flex;
    flex-flow: row nowrap;
    align-items: stretch;
    flex: 1;
    min-height: 0;
    border-top: 1px solid #e8e8e8;

    &-left{
      margin-right: 0;
      box-shadow: none;
      // flex: 1;
      flex-grow: 1;
      min-width: 400px;
      .pd-Tabs{
        height: 100%;
        display: flex;
        flex-flow: column;
        &-content{
          border-width: 0;
          background: 0 0;
          overflow: auto;
          flex: 1;
        }
      }
    }
    &-right{
      min-width: 300px;
      border-left: 1px solid #e8e8e8;
      // max-width: 300px;
      width: 300px;
      transform: translate(0,0);
    }
  }

  &-Custom{
    &.narrow{
      .@{ns}-RowDetail-module-item{
        width: 100% !important;
      }
      .@{ns}-RowDetail-module-item-label{
        width: 33% !important;
      }
      .@{ns}-RowDetail-module-cell:not(.@{ns}-Checkbox,.@{ns}-Checkboxes,.@{ns}-Switch){
        width: 66% !important;
      }
    }
  }


  &-module{
    margin-bottom: 20px;
    padding: 0 12px;
    .@{ns}-RowDetail-module{
      padding: 0;
    }
    &.list-module{
      flex-flow:column;
      .@{ns}-RowDetail-module-cell:not(.@{ns}-Checkbox,.@{ns}-Checkboxes,.@{ns}-Switch){
        width: 66% !important;
      }

    }

    &.column-2{
      display: flex;
      flex-flow: row wrap;
      width: 100%;
      .@{ns}-RowDetail-module-item{
        width: 50%;
      }

      .@{ns}-RowDetail-module-cell:not(.@{ns}-Checkbox,.@{ns}-Checkboxes,.@{ns}-Switch){
        // width: calc(100% - 100px) !important;
        overflow: hidden;
      }

   
    }


    &-narrow{

      .@{ns}-RowDetail-module-item{
        width: 100% !important;
      }
      .@{ns}-RowDetail-module-item-label{
        width: 120px !important;
      }
      .@{ns}-RowDetail-module-item-tip{
        left: 127px !important;
         width: calc(100% - 127px);
      }
      .@{ns}-RowDetail-module-item-actions{
        // left: 127px !important;
        //  width: calc(100% - 127px);
      }
      .@{ns}-RowDetail-module-cell:not(.@{ns}-Checkbox,.@{ns}-Checkboxes,.@{ns}-Switch){
        // width: 66% !important;
      }
    }

    &-item{
      --item-padding_left: 10px;
      height: auto;
      display: flex;
      align-items: center;
      padding:  0 var(--item-padding_left);
      margin: 8px 0;
      position: relative;

      &-content{
        flex: 1;
        overflow: hidden;

        &-actions{
          padding-top: 3px;
          display: flex;
          justify-content: flex-end;
          font-size: calc(@font-size-base - 1px);
          white-space: nowrap;
          overflow: hidden;
        }
      }

      &-tip{
        position: absolute;
        left: 87px;
        bottom: -16px;
        color: var(--danger-6);
        font-size: calc(@font-size-base - 1px);
        white-space: nowrap;
        overflow: hidden;
        width: calc(100% - 87px);
      }
      


      
      &.is-diff-add{
        .@{ns}-RowDetail-module-item-label{
          background-color: @diff-bg-add;
        }
      }
      &.is-diff-edit{
        .@{ns}-RowDetail-module-item-label{
          background-color: @diff-bg-edit;
        }
      }
      &.is-diff-del{
        .@{ns}-RowDetail-module-item-label{
          background-color:  @diff-bg-del;
        }
      }
      &.is-compact{
        margin: 2px 0;
        --item-padding_left:0
      }


      &.is-form-item{
        margin: 5px 0;
      }
      .is-required{
        position: absolute;
        color: var(--danger-6);
        left: 4px;
        top: 50%;
        transform: translateY(-50%);
        line-height: 1;
        
      }
      &-label{
        width: 80px;
        height: 100%;
        flex-shrink: 0;
        margin-right: 2px;
    
        &.is-colon{
          &::after{
            content: ":";
            position: relative;
            margin-block: 0;
            margin-inline-start: 2px;
            margin-inline-end: @size-1;
          }
        }
      }
      &-block{
        width: 100%;
      }
      &.is-vertical{
        flex-direction: column;
        gap: @spacing-2;
        align-items: flex-start;
        .@{ns}-RowDetail-module-item-label{
          width: 100%;
          position: relative;
          .is-required{
            left: -8px;
          }
        }

        .@{ns}-RowDetail-module-item-content{
          width: 100%;
          .@{ns}-RowDetail-module-item-tip{
            left: var(--item-padding_left) !important;
          }

        }
      }
    
      &-divider{
        margin: 10px 10px 0 10px;
        border-bottom: 1px solid #e8e8e8;
        width: 100%;
      }


      .@{ns}-RowDetail-module-item-value{
        display: flex;
        overflow: hidden;
        .@{ns}-Button-group{
          display: flex;
          flex: 1;
          overflow: hidden;
          .@{ns}-Button{
            overflow: hidden;
          }
        }
      }



    }
  }

  &-module-item{
    &.group{
      .@{ns}-RowDetail-module-item-content-tabs{
        display: flex;
        gap: 10px;
        .@{ns}-RowDetail-module-item-content-tab{
          border: 1px solid var(--color-border);
          padding: 2px 5px;
          border-radius: 3px;
          font-size: 12px;
          font-family: ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;
          cursor: pointer;
          user-select: none;

          &:hover{
            background-color: var(--color-fill-1);
          }
          &.is-active{
            background-color: var(--color-fill-4);
          }
        }
      }
      .@{ns}-RowDetail-module-item-content-tabcontent{
        .@{ns}-RowDetail-module-item{
          padding-left: 0px;
        }
  
      }
    }
  }

  &-title{
    width: 100%;
    margin: 10px 10px 5px 10px;
    font-size: 15px;
    color: #303030;
    font-weight: 500;
    vertical-align: bottom;
    &-desc {
      font-size: 12px;
      color: @gray-7;
      margin-left: @spacing-2;
    }
  }

  &-event-components{
    padding-top: 10px;
    .@{ns}-RowDetail-components__header{
      display: flex;
      align-items: center;
      padding: 0 10px;
      margin-bottom: 10px;
      .@{ns}-RowDetail-components__title{
        font-size: 15px;
        color: #303030;
        font-weight: 500;
        flex: 1 1 auto;
        min-width: 0;
      }
      .@{ns}-RowDetail-components__btns{
        display: inline-flex;
        align-items: center;
        gap: 20px;
      }

    }
    .ui-empty{
      margin: 0 10px;
      height: 42px;
      line-height: 42px;
      border-bottom: 1px solid #e8e8e8;
      font-size: var(--fontSizeMd);
      color: #909090;
    }
    .ui-file{
      margin: 0 10px;
      padding-bottom: 10px;

      &.borderBottom{
        border-bottom: 1px solid #e8e8e8;
      }

      & > .ui-item{

        display: flex;
        align-items: center;
        overflow: hidden;

        overflow-y: hidden;
        height: 42px;

        box-sizing: border-box;
        border-bottom: 1px solid #e8e8e8;
        cursor: pointer;

        &:hover{
          color: unset;
          background: var(--color-fill-2);
          margin: 0 -20px;
          padding: 0 20px;
        }

        .ui-tag-key-field{
          max-width: 90px;
          overflow: hidden;
          text-overflow: ellipsis;
          white-space: nowrap;
          margin-left: 10px;
          background-color: rgba(144,144,144,.15);
          height: 20px;
          font-size: 12px;
          color: #303030;
          font-weight: 500;
          line-height: 20px;
          padding-left: 5px;
          padding-right: 5px;
          border-radius: 3px;
          display: inline-block;
          user-select: none;
          flex: 0 0 auto;

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


        .summary-column{
          overflow: hidden;
          text-overflow: ellipsis;
          white-space: nowrap;
          flex: 1 1 auto;
          min-width: 0;
          padding-left: 10px;
          .task-description.one-line--ellipsis {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;

          }
          .task-description {
            display: block;
            max-width: 100%;
            font-size: 1px;

            .prefix-container{
              display: inline-flex;
              flex-direction: row;
              align-items: center;
              margin: 0 5px 0 0;
              vertical-align: middle;
              font-size: 14px;
            }

            & > span{
              vertical-align: middle;
              font-size: 14px;
            }
          }
        }

        .status-column{
          margin-left: 10px;
          max-width: 90px;
          text-align: right;
          flex: 0 0 auto;
          line-height: 0;

          font-size: 12px;
          color: var(--primary-5);
          box-sizing: border-box;
          display: inline-block;
          height: 20px;
          line-height: 18px;
          border: 1px solid var(--info-color-bg);
          transition: border-color .2s;
          border-radius: 20px;
          padding: 0px 8px;
        }

        .delete-btn-column{
          position: relative;
          cursor: pointer;
          transition: color .2s;
          color: #606060;
          margin-left: 10px;

          width: 16px;
          height: 32px;
          display: flex;
          align-items: center;


          &:hover{
            fill: #ea0d0d;
          }

          .@{ns}-Button{
            position: absolute;
            top: 0;
            left: 0;
            opacity: 0;
            width: 100%;
            height: 100%;
            padding: 0;
          }
        }

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

    }
  }

  &--wide{
    position: relative;
    width: 100%;
    max-width: 100%;
    height: 100%;
    display: flex;
    flex-flow: column;
    overflow: auto;

    .@{ns}-RowDetail-header{
      &-fields{
        justify-content: flex-start;

        .@{ns}-RowDetail-header-fields__field{
            width: auto;
            min-width: 120px;
            max-width: 200px;
            margin-right: 10px;

          &_select{
            width: auto;
            min-width: 120px;
            max-width: 200px;
            margin-right: 10px;
          }
        }
      }
    }
  }

  &--narrow{
    display: flex;
    flex-flow: column;
    height: 100%;
    overflow: auto;

    .@{ns}-RowDetail-container{
      flex-flow:column;
      &-left{
        border:0;
      }
      &-right{
        width:auto;
      }
    }
  }
}


.@{ns}-RowDetail-desc{
  border: 1px solid #dedede;
  min-height: 102px;
  cursor: pointer;
  transition: background-color .2s;
  border-radius: 3px;
  padding: 5px 10px;
  &:hover{
    background-color: #fff;
    border-color: #909090;
  }
}


.@{ns}-RowDetail-accept-modal{
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;

  &-content{
    flex: 1;
    overflow: hidden;
  }

  &-footer{
    flex-shrink: 0;
    flex-grow: 0;
    display: flex;
    justify-content: flex-end;
    padding: 10px;
  }
}