
@import '../plugins/react-loading-skeleton/index.scss';

.#{$ns}Row-detail{
  width: 1200px;
  height: 100%;
  overflow: hidden;
  border-left: 5px solid #e8e8e8;

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

  &-sash-container{
    position: absolute;
    left: 0;
    width: 4px;
    height: 100%;
    pointer-events: none;
    user-select: none;

    .code-sash-mask{
      position: fixed;
      left: 0;
      right: 0;
      top: 0;
      bottom: 0;
      z-index: 30;

      &.maskShow{
        pointer-events: auto;

        &.vertical{
          cursor: col-resize;// ew-resize

          &.minimum{
            cursor: e-resize;
          }
          &.maximum{
            cursor: w-resize;
          }
        }
      }
    }

    .code-sash{
      position: absolute;
      z-index: 35;
      touch-action: none;
      pointer-events: auto;
      user-select: none;
      &::before{
        content: "";
        pointer-events: none;
        position: absolute;
        width: 100%;
        height: 100%;
        transition: background-color .1s ease-out;
        background: transparent;
        user-select: none;
      }
      &:hover, &.active{
        &::before{
          background: var(--primary);
        }
      }
      &.vertical{
        cursor: col-resize;// ew-resize
        top: 0;
        width: 4px;
        height: 100%;
        &::before{
          width: 4px;
        }
        &.minimum{
          cursor: e-resize;
        }
        &.maximum{
          cursor: w-resize;
        }
      }

      &.horizontal{
        cursor: row-resize;// ew-resize
        left: 0;
        width: 100%;
        height: 4px;
        &::before{
          top: calc(50% - 4px/2);
          height: 4px;
        }
        &.minimum{
          cursor: s-resize;
        }
        &.maximum{
          cursor: n-resize;
        }
      }
    }
  }

  &-head{
    border-bottom: var(--Table-thead-borderWidth) solid var(--Table-thead-borderColor);

    &__topbar{
      display: flex;
      flex-flow: row nowrap;
      align-items: center;
      justify-content: space-between;
      height: 40px;
      padding: 0 20px;
      // overflow: hidden;
    }

    &__nav{
      display: flex;
      align-items: center;
      font-size: 14px;
      flex-shrink: 1;
      overflow: hidden;

      svg{
        width: 16px;
        height: 16px;
        margin-right: 5px;
        flex-shrink: 0;
      }

      a{
        white-space: nowrap;
        cursor: pointer;

        &:hover{
          color: val(--primary-onActive);
          text-decoration: underline;
        }
      }
      span{
        white-space: nowrap;
      }
      span:hover{
        cursor: pointer;
        color: var(--primary);
      }
    }

    &__actions{
      display: flex;
      align-items: center;
      flex-shrink: 0;

      .action-item{
        padding: 0 15px;
      }

      &>div>.#{$ns}Button{
        color: var(--text--muted-color);
        &:hover{
          color: var(--primary);
        }
      }
    }
  }

  &-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);
    }
    &:active{
      border-color: transparent;
      box-shadow: none;
    }
    .#{$ns}ResultBox-value{
      pointer-events: none;
    }
  }

  .#{$ns}Tabs-linksContainer{
    padding: 8px 0 0 8px;
    .#{$ns}Tabs-link{
      .tab-badge{
        background-color: $G8;
        color: $G4;
        height: 16px;
        line-height: 16px;
        min-width: 16px!important;
        padding: 0 4px;
        font-size: 12px;
        border-radius: 8px;
      }
      &.is-active{
        .tab-badge{
          background-color: var(--primary)!important;
          color: #fff!important;
        }
      }
      &:hover{
        .tab-badge{
          background-color: $blue-1;
          color: var(--primary);
        }
      }
    }
  }
}


.#{$ns}RowDetail{

  &-header{
    padding: 10px 20px 0;
    border-bottom: 1px solid #e8e8e8;

    &-main{
      margin-bottom: 10px;
      margin-left: -5px;
      min-height: 39px;

      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: #f8f8f8;
        }
      }

      input{
        font-size: 18px;
        font-weight: 500;
      }
      .#{$ns}InputBox.is-quick-edit{
        &:hover{
          border-color: transparent !important;
          background-color: #f8f8f8;
        }
        &.is-focused{
          box-shadow: none;
          border-color: transparent;
          background-color: #f8f8f8;

        }
      }
    }

    &-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;

          &>div{
            height: 100%;
          }
          .#{$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;
    &-left{
      margin-right: 0;
      border-right: 1px solid #e8e8e8;
      box-shadow: none;
      flex: 1 1 68%;
      min-width: 400px;
    }
    &-right{
      min-width: 300px;
      flex: 0 0 32%;
    }
  }

  &-module{
    margin-bottom: 20px;
    &.list-module{
      flex-flow:column;
      .#{$ns}RowDetail-module-cell{
        width: 66% !important;
      }

    }
    &-wide{
      display: flex;
      flex-flow: row wrap;
      &.column-2{
        .#{$ns}RowDetail-module-item{
          width: 50%;
        }
        .is-block{
          width: 100%;
          align-items: start;
        }

        .#{$ns}RowDetail-module-cell{
          width: calc(100% - 100px) !important;
        }
      }
    }
    &-narrow{

      label{
        width: 33% !important;
      }
      .#{$ns}RowDetail-module-cell{
        width: 66% !important;
      }
    }
    &-textarea{
      width: 100%;
      overflow: hidden;
      flex: 1;
      padding: 10px 10px 0 10px;
      min-height: 102px;
     .#{$ns}Panel--form{
      margin: 0;
      border: 0;
     }
     .#{$ns}Panel-heading{
      display: none;
     }
     .#{$ns}Panel-body{
      padding: 0;
     }
     .#{$ns}Panel-btnToolbar{
      border-top: 0;
     }

    }
    &-item{
      min-height: 34px;
      height: auto;
      display: flex;
      align-items: center;
      padding: 0 10px;
      margin: 3px 0;
      label{
        width: 100px;
      }
      .#{$ns}RowDetail-module-cell{
        display: flex;
        align-items: center;
        &>div{
          width: 100%;
          .#{$ns}TransferDropDown{
            width: 100% !important;
            display: flex !important;
            &-icon{
              margin-right: -10px !important;
            }
          }
        }
      }
      &-divider{
        margin: 10px 10px 0 10px;
        border-bottom: 1px solid #e8e8e8;
        width: 100%;
      }
    }
  }

  &-title{
    width: 100%;
    margin: 10px 10px 5px 10px;
    font-size: 15px;
    color: #303030;
    font-weight: 500;
    display: flex;
    align-items: center;
  }

  &-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: #f8f8f8;
          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: #338fe5;
          box-sizing: border-box;
          display: inline-block;
          height: 20px;
          line-height: 18px;
          border: 1px solid #338fe5;
          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;

    .#{$ns}RowDetail-header{
      &-fields{
        justify-content: 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;
        padding: 0 10px;
      }
    }
  }
}


.#{$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;
  }
}
