/**
 * 09. Modal
 */
.cgps-modal{
  position: fixed;
  z-index: 100101;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;

  &.hidden{
    display: none;
  }
}

.cgps-modal-icon{
  z-index: 100102;
}

.cgps-modal-table{
  display: table;
  width: 100%;
  height: 100%;
}

.cgps-modal-table-cell{
  display: table-cell;
  vertical-align: middle;
  margin: 100px 0;
}

.cgps-modal-inner{
  position: relative;
  z-index: 10;
  width: 760px;
  height: 750px;
  margin: 0 auto;
  background-color: #fff;
}

.cgps-modal-content{
  position: relative;
  overflow: hidden;
  overflow-y: auto;
  height: 595px;

  .cgps-shortcode-button{
    display: none;
  }

  .cgps-field{
    padding: 15px 30px 15px 15px;
  }

  a{
    &:active,
    &:focus{
      outline: none;
      box-shadow: none;
    }
  }

  h4{
    font-size: 13px;

    small{
      font-style: italic;
      font-weight: 400;
      color: #aaa;
    }
  }
}

.cgps-modal-title{
  position: relative;
  background-color: #fcfcfc;
  border-bottom: 1px solid #ddd;
  height: 36px;
  font-size: 16px;
  font-weight: 600;
  line-height: 36px;
  margin: 0;
  padding: 0 36px 0 16px;
}

.cgps-modal-header{
  width: 100%;
  padding: 14px 0;
  background-color: #f5f5f5;
  border-bottom: 1px solid #ddd;

  select{
    display: block;
    width: 250px;
    margin: 0 auto;
    font-size: 13px;
    line-height: 1;
    height: 30px;
    min-height: 30px;
    background-color: #fff;
  }
}

.cgps-modal-close{
  color: #666;
  padding: 0;
  position: absolute;
  top: 0;
  right: 0;
  width: 36px;
  height: 36px;
  text-align: center;
  background: none;
  border: none;
  cursor: pointer;

  &:before{
    font: normal 20px/36px dashicons;
    content: "\f158";
    vertical-align: top;
    width: 36px;
    height: 36px;
  }

  &:hover{
    opacity: 0.5;
  }
}

.cgps-modal-insert-wrapper{
  text-align: center;
  width: 100%;
  padding: 15px 0;
  background-color: #f5f5f5;
  border-top: 1px solid #ddd;
}

.cgps-modal-overlay{
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #000;
  opacity: 0.5;
}

/**
 * 09. 01. Shortcode Modal
 */
.cgps--repeatable{
  padding: 15px 15px 0 15px;
}

.cgps--repeat-button-block{
  text-align: center;
  padding-bottom: 15px;
}

.cgps--repeat-shortcode{
  position: relative;
  margin-bottom: 15px;
  border: 1px dashed #ddd;

  &:first-child{

    .cgps-repeat-remove{
      display: none;
    }
  }

  .cgps-repeat-remove{
    position: absolute;
    right: 10px;
    top: 10px;
    z-index: 10;
    cursor: pointer;
    display: inline-block;
    font-size: 11px;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border-radius: 2px;
    color: #fff;
    background-color: #e14d43;
    opacity: 0.5;

    &:hover{
      opacity: 0.5;
    }
  }
}

.cgps-shortcode-single{

  .cgps-modal-inner{
    height: 750px;
  }

  .cgps-modal-content{
    height: 652px;
  }
}

.elementor-editor-active{

  .cgps-shortcode-button{
    margin-left: 5px;
  }

  .cgps-modal .hidden{
    display: none !important;
  }
}

/**
 * 09. 02. Gutenberg Modal
 */
.cgps-shortcode-block{
  text-align: center;
  padding: 14px;
  font-size: 13px;
  background-color: #f5f5f5;
  font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;
}

.cgps-shortcode-block .components-button{
  margin-bottom: 10px;
}

/**
 * 09. 03. Icon Modal
 */
.cgps-modal-icon{

  .cgps-icon-title{
    padding: 15px 0;
    margin: 4px;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    border: 1px solid #eee;
    background-color: #f7f7f7;
  }

  .cgps-modal-header{
    text-align: center;
  }

  .cgps-icon-search{
    width: 50%;
    height: 40px;
    line-height: 40px;
  }

  i{
    cursor: pointer;
    display: inline-block;
    margin: 4px;
    width: 35px;
    height: 35px;
    line-height: 35px;
    font-size: 16px;
    color: #555;
    text-align: center;
    border: 1px solid #ccc;
    background-color: #f7f7f7;
    border-radius: 2px;
    box-shadow: 1px 1px 0 rgba(0,0,0,0.05);

    &:hover {
      color: #fff;
      border-color: #222;
      background-color: #222;
    }
  }

  .cgps-modal-content{
    padding: 10px;
    height: 618px;
  }

  .cgps-error-text{
    padding: 10px;
  }
}

.cgps-modal-loading{
  display: none;
  position: absolute;
  left: 15px;
  top: 15px;
}

.cgps-loading{
  position: relative;
  width: 20px;
  height: 20px;
  background: #ccc;
  border-radius: 20px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.07);

  &:after{
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 4px;
    content: "";
    margin-top: -2px;
    margin-left: -2px;
    background-color: white;
    animation-duration: 0.5s;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
    animation-name: cgpsLoader;
    border-radius: 4px;
  }
}

@keyframes cgpsLoader {
  0% {
    transform: rotate(0deg) translateX(-6px) rotate(0deg);
  }
  100% {
    transform: rotate(360deg) translateX(-6px) rotate(-360deg);
  }
}
