
 @import "@core/scss/theme/config.scss";

$titleBarheight: 50px;
$footerHeight: 36px;

//遮罩层样式
.cd-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1101;
  overflow: hidden;
  perspective: 1300px;
  background-color: rgba(0, 0, 0, 0.3);
  @include flexBox();
  @include flexCenterBox();
}

//弹窗包裹层
.cd-modal-wrap {
  
  //border: 0px solid rgba(0, 0, 0, .2);
  position: relative;
  background: #fff;
  // overflow                : auto;
  border-radius: 2px;
  outline: none;
  box-shadow: 1px 2px 20px 0px rgba(0, 0, 0, 0.2);

  //&.cd-normal {
  //  //margin: 15% auto;
  //  width: 420px;
  //  //min-height: 1700px;
  //}
  //
  //&.cd-fullscreen {
  //  //margin: 20px 10%;
  //  min-width: 1100px;
  //  min-height: 700px;
  //}

  //标题
  .cd-modal-title-bar {
    width: 100%;
    height: $titleBarheight;
    background: #F5F5F5;
    text-align: left;
    border-bottom: 1px solid #e1e1e1;
    border-radius: 2px 2px 0px 0px;
    cursor: pointer;
    box-sizing: border-box;
    .cd-title {
      @include userSelectNone();
      display: inline-block;
      padding: 0 15px;
      font-size: $fontSize;
      color: $colorBase;
      line-height: $titleBarheight;
      font-weight: bold;
      max-width: 90%;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
  }

  //标题右侧区域
  .cd-title-right-group {
    position: absolute;
    right: 0px;
    top: 10px;
    z-index: 4;
    @include clearFix();

    //关闭按钮
    .cd-modal-btn-close {
      display: inline-block;
      width: 30px;
      height: 30px;
      float: right;
      margin-right: 3px;

      &:hover {
        span {
          @extend .cd-component;
          @extend .cd-component-btn_close_2;
          //@include rotate(90deg);
        }
      }
      span {
        margin: 5px;
        @extend .cd-component;
        @extend .cd-component-btn_close_1;
        ////解决动画导致内容模糊和闪烁的问题
        //-webkit-backface-visibility:hidden;	
        //-moz-backface-visibility:hidden; 	
        //-ms-backface-visibility:hidden; 	
        //@include transition(transform, 0.4s, ease-in-out);
      }
    }

    //帮助
    .cd-modal-btn-helper {
      display: inline-block;
      width: 30px;
      height: 30px;
      float: right;

      &:hover {
        span {
          @extend .cd-component;
          @extend .cd-component-btn_help_2;
        }
      }
      span {
        margin: 5px;
        @extend .cd-component;
        @extend .cd-component-btn_help_1;
      }
    }

    //反馈
    .cd-modal-btn-feedback {
      display: inline-block;
      width: 30px;
      height: 30px;
      float: right;

      &:hover {
        span {
          @extend .cd-component;
          @extend .cd-component-feedback_2;
        }
      }
      span {
        margin: 5px;
        @extend .cd-component;
        @extend .cd-component-feedback_1;
      }
    }
  }

  //内容区
  .cd-modal-content {
    width: 100%;
    position: relative;
    color: $colorBase;
    //text-align: center;
    line-height: 1.1;
    font-size: $fontSize;
    min-height: 50px;
    height: calc(100% - 50px);
    //没有标题栏的全屏模式
    &.cd-fullscreen{
      height:100%;
    }

    //有标题栏的全屏模式
    &.cd-fullscreen-with-titlebar{
      height:calc(100% - 50px);
    }

    //中间内容
    .cd-content-middle{
      position: relative;
      width: 100%;
      box-sizing: border-box;
      overflow-y: auto;
      overflow-x: hidden;
      padding: 0 15px 20px;
      min-height: 250px;
      height: calc(100% - 66px);
    }

    //图标层
    .cd-icon-layer {
      text-align: center;
      .cd-modal-icon {
        @extend .cd-component;
        display: inline-block;
        margin-top: 20px;

        //OK
        &.cd-right {
          @extend .cd-component-icon_right_48;
        }

        //警告
        &.cd-warning {
          @extend .cd-component-icon_warning_48;
        }

        //问题
        &.cd-question {
          @extend .cd-component-icon_question_48;
        }

        //错误
        &.cd-error {
          @extend .cd-component-icon_error_48;
        }
      }
    }

    //文本区域
    .cd-content-box {
      padding: 10px 40px;
      max-height: 150px;
      min-height: 60px;
      overflow-y: auto;
      text-align: center;
      @include flexBox();
      @include flexCenterBox();

      &.cd-icon-md {
        min-height: 20px;
      }

      &.cd-small-title-md{
        padding: 20px 40px;
        flex-direction: column;
      }

      .cd-text {
        font-size: $fontSize;
        line-height: 20px;
        color: $colorBase;
        text-align: center;
      }

      .cd-small-title{
        padding-top: 10px;
        line-height: 16px;
        font-size: $fontSizeSmall;
        color: $colorLight;
      }
    }

    //弹窗底部按钮
    .cd-modal-btns {
      height: $footerHeight;
      line-height: $footerHeight;
      padding: 15px 30px 15px;
      text-align: center; //默认居中
      background: #fff;
      // position: absolute;
      // bottom: 0;
      padding-left: 0;
      // width: 100%;
      
      //靠右
      &.cd-right {
        text-align: right;
      }

      &.cd-center {
        text-align: center;
      }

      //靠左
      &.cd-left {
        text-align: left;
      }

      //确定
      .cd-btn-ok {
        @include bigRedBtn();
        display: inline-block;
        margin: 0 10px;
      }

      //取消
      .cd-btn-cancel {
        @include bigBlackBorderBtn();
        display: inline-block;
        margin: 0 10px;
      }
    }

    // 弹窗底部提示文案
    .cd-modal-foottip{
      padding: 5px 10px;
      background: #fff5dc;
      border: 1px solid #ecdfc1;
      font-size: $fontSizeSmall;
      color: #966722;
      box-sizing: border-box;
    }
  }

  // 新弹框样式
  &.cd-new-modal{
    border-radius: 6px;
    .cd-modal-title-bar{
      height: 60px;
      border-radius: 6px 6px 0 0;
      border-bottom: none;

      .cd-title{
        line-height: 60px;
        padding: 0 20px;
      }
    }
    .cd-title-right-group{
      top: 15px;
      right: 10px;
    }
    .cd-modal-content{
        height: calc(100% - 60px);
        .cd-content-middle{ 
          height: calc(100% - 70px);
        }
        .cd-content-box .cd-text{
          color: #646468;
        }
        .cd-icon-layer{
          .cd-modal-icon{
            margin-top: 30px;
          }
        } 
        .cd-modal-btns {
          padding: 17px 20px;
          text-align: right;
            .cd-btn-cancel,
            .cd-btn-ok {
              border-radius: 6px;
              overflow: hidden;
              margin: 0 0 0 10px;
            }
        }
    }
  }
}
