@import '../../../base/style.less';
@popupPrefix: iot-execute-power-out;

.@{popupPrefix} {
  overflow: hidden;
  width: 100%;
  height: auto;

  .iot-power {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: row;
    align-items: center;
    margin: var(--card-margin-size);
    width: var(--card-width-size);
    height: auto;
    border: var(--card-border);
    padding: var(--card-padding-TD);
    background: var(--card-bg-color);
    border-radius: var(--card-border-radius-size);

    .power-left {
      display: flex;
      flex-direction: row;
      align-items: center;
      flex: 1;

      .power-icon {
        margin: var(--icon-margin-all);
        width: var(--icon-width-size);
        height: var(--icon-height-size);
        display: flex;
        flex: 0 0 var(--icon-width-size);
        flex-direction: row;
        justify-content: center;
        align-items: center;
        border-radius: 50%;
        background: var(--icon-bg-color);

        .power-icon-image {
          display: inline-block;
          width: var(--icon-inside-width);
          height: var(--icon-inside-height);
          font-size: var(--icon-inside-font-size);
          color: var(--icon-inside-color);
        }
      }

      .power-title {
        .power-main {
          overflow: hidden;
          font-family: var(--title-font-family);
          display: -webkit-box;
          -webkit-line-clamp: 2;
          -webkit-box-orient: vertical;
          font-size: var(--title-font-size);
          color: var(--title-font-color);
          line-height: var(--title-font-height);
          font-weight: var(--title-font-weight);
        }

        .power-sub {
          overflow: hidden;
          display: -webkit-box;
          font-family: var(--subtitle-font-family);
          -webkit-line-clamp: 2;
          -webkit-box-orient: vertical;
          margin-top: var(--subtitle-margin-Top);
          font-size: var(--subtitle-font-size);
          color: var(--subtitle-font-color);
          line-height: var(--subtitle-font-height);
        }
      }

    }

    .power-right {
      position: relative;
      margin-right: var(--execute-power-marginR);
      border: var(--execute-power-border);
      background: var(--execute-power-gb);
      width: var(--execute-power-width);
      height: var(--execute-power-height);
      border-radius: var(--execute-power-borderRad);
      display: flex;
      justify-content: flex-end;
      text-transform: uppercase;
      overflow: hidden;

      &::before {
        position: absolute;
        content: '';
        bottom: 0;
        left: 0;
        width: 0%;
        height: 100%;
        z-index: 1;
        background: var(--execute-power-gb);
      }

      .power-btn {
        font-family: PingFangSC-Medium;
        font-size: .12rem; 
        color: #fff;
        letter-spacing: 0;
        text-align: center;
        line-height: var(--execute-power-height);
        font-weight: 500;
        text-align: center;
        position: absolute;
        z-index: 2;
        left: 50%;
        transform: translateX(-50%);
        
        .power-btn-span {
          position: absolute;
          top: 0;
          left: 0;
          color: #fff;
          overflow: hidden;
          width: 100%;
          z-index: 2;
          white-space: nowrap;

          &.animation {
            color: #fff;
            animation: test 0.75s;
          }
          &.stop {
            animation-play-state: paused;
          }
        }

        
      }


      .power-btn-icon-on {
        background: var(--power-on-bgcolor);
        color: var(--power-on-color);
        border: var(--power-on-border);

      }

      .power-btn-icon-off {
        background: var(--power-off-bgcolor);
        color: var(--power-off-color);
        border: var(--power-off-border);
      }
      &.active {
        background: #fff;
        .power-btn,.power-btn-span {
          color: var(--execute-power-gb);
        }
      }
      &.active:before {
        width: 100%;
        transition: width 1.5s linear;
      }
    }

    .power-disable {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      z-index: 10;
      background: var(--disable-bg-color);
      border-radius: var(--card-border-radius-size);
    }

    // .title-wrap{
    //   display: flex;
    //   flex-direction: column;
    //   justify-content: center;
    //   .title{
    //     color: @title-color;
    //     font-size: @title-font-size;
    //   }
    //   .subTitle{
    //     margin-top: 8px;
    //     color: @subtitle-color;
    //     font-size: @subtitle-font-size;
    //   }
    // }
  }
  
}

@keyframes test {
  from {
      width: 0%;
  }
  to {
      width: 100%;
  }
}
