@import "mixins/mixins";
@import "common/var";
// @import "vue-transform";

@include b(callpanel) {
  display: flex;
  flex-direction: column;
  width: $--callpanel-width;
  &.audio {
    max-height: $--callpanel-height;
  }
  &.video {
    max-height: $--callpanel-video-height + $--callpanel-height;
  }
  // padding: $--callpanel-padding;
  // border-radius: $--callpanel-radius;
  box-sizing: border-box;
  border: 1px solid $--callpanel-border-color;
  position: fixed;
  background-color: $--color-white;
  box-shadow: $--callpanel-shadow;
  transition: opacity .3s, transform .3s, left .3s, right .3s, top 0.4s, bottom .3s;
  overflow: hidden;

  &.right {
    right: 16px;
  }

  &.left {
    left: 16px;
  }

  &.full-size {
    width: $--callpanel-fullsize-width;
    height: $--callpanel-fullsize-height;
    .el-callpanel__video {
      height: 100%;
      .el-callpanel__video_timer {
        text-align: right;
        z-index: 4;
      }
      .el-callpanel__controller {
        display: inline-block !important;
        transition: 0.5s;
        position: absolute;
        width: 100%;
        bottom: 10px;
        z-index: 3;
        text-align: center;
      }
    }
    .el-callpanel__content {
      display: none !important;
    }
    .el-callpanel__controller {
      display: none;
    }
    &.calling {
      .el-callpanel__video {
        .el-callpanel__video_timer {
          display: block !important;
        }
        .el-callpanel__controller {
          display: none !important;
        }
        &:hover {
          .el-callpanel__controller {
            display: inline-block !important;
          }
        }
      }
    }
  }

  @include e(header) {
    height: $--callpanel-header-height;
    padding: $--callpanel-header-padding;
    border-bottom: 1px solid $--cutting-line-color;
    display: flex;
    span {
      margin: 0;
      padding: 0;
      flex: 1;
    }
    .operation {
      display: flex;
      cursor: pointer;
      .mic, .sound, .record, .expand {
        img {
          margin: 3px;
          height: $--callpanel-header-height - 6px;
        }
      }
      // .el-dropdown {
      //   margin: 3px;
      // }
    }
  }

  @include e(video) {
    height: $--callpanel-video-height;
    background-color: #00000019;
    position: relative;
    #remoteVideo, #localVideo {
      position: absolute;
      cursor: pointer;
      z-index: 2;
      right: 0;
      bottom: 0;
      width: 25%;
      height: 25%;
    }
    &.remote {
      #remoteVideo {
        width: 100%;
        height: 100%;
        z-index: 1;
      }
    }
    &.local {
      #localVideo {
        width: 100%;
        height: 100%;
        z-index: 1;
      }
    }
  }

  @include e(tips) {
    height: $--callpanel-tips-height;
    .record {
      background: lightblue;
      text-align: center;
    }
  }

  @include e(content) {
    flex: 1;
    display: flex;
    &_avatar {
      padding: 10px;
      width: $--callpanel-avatar-width;
      a {
        color: #333;
        cursor: pointer;
        .avatar_pic {
          // border-radius: 50%;
          // border: 1px solid;
          width: $--callpanel-avatar-width;
          height: $--callpanel-avatar-width;
        }
      }
    }
    &_info {
      flex: 1;
      padding-left: 20px;
    }
    &_timer {
      border-left: 1px solid #ebeef5;
      text-align: center;
      width: 40%;
      .clock {
        margin: 0;
      }
    }
  }

  @include e(controller) {
    height: $--callpanel-footer-height;
    display: flex;
    .accept {
      width: 50%;
      .el-button:not(.is-circle) {
        border-radius: unset;
        width: 100%;
      }
    }
    .hungup {
      flex: 1;
      margin-left: 0 !important;
      .el-button:not(.is-circle) {
        border-radius: unset;
        width: 100%;
        .el-icon-phone {
          transform: rotate(135deg);
        }
      }
    }
  }

  .el-icon-success {
    color: $--callpanel-success-color;
  }

  .el-icon-error {
    color: $--callpanel-danger-color;
  }

  .el-icon-info {
    color: $--callpanel-info-color;
  }

  .el-icon-warning {
    color: $--callpanel-warning-color;
  }
}

.el-callpanel-fade-enter {
  &.right {
    right: 0;
    transform: translateX(100%);
  }

  &.left {
    left: 0;
    transform: translateX(-100%);
  }
}

.el-callpanel-fade-leave-active {
  opacity: 0;
}
