$font: "lato, Open Sans";
$font-size: 16px;
$font-color: #404852;
$font-color-light: #9e9e9e;
$border-color: #EEE;
$color: #78AB4E;
$color-alert: #c0392b;

@import 'components/mixins';
@import 'components/codemirror';

textarea {
  height: 400px;
  background: green;
}
.mdeditor {

  margin-top: 20px;
  margin-bottom: 20px;
  position: relative;

  * {
    box-sizing: border-box;
  }

  .toggle_preview{
    padding: 4px 0 4px 0;
    border-bottom: 1px solid #ccc;
    color: #ccc;
    font-weight: bold;
    font-size: 12px;
    text-transform: uppercase;
    margin-bottom: 20px;
    cursor: pointer;
    &.left{
      text-align: left;
    }
    &.right{
      text-align: right;
    }
  }

  &_body{
    @include clearfix;

    border: 1px solid $border-color;
  }

  &_markdown {
    float: left;
    border-right: 1px solid #ccc !important;
    //border-left: 1px solid #ccc !important;
    color: #2c3e50 !important;
    background: #ecf0f1 !important;
    height: 800px !important;
    overflow: auto;
    textarea {
      height: 800px ;
    }


    .toggle_preview {
      .show_preview {
        display: none;
      }
    }
  }

  &_preview {
    float: right;
    border-left: none;
    height: 800px !important;
    overflow: auto;
    img{
      max-width: 100%;
      height:auto;
    }


    .toggle_preview {
      .show_editor {
        display: none;
      }
    }

  }

  &_toolbar {
    position: relative;
    height: 50px;
    z-index: 500;

    background: #fff; //#ecf0f1;
    border: 2px solid #dce4ec;
    //box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.3);
    color: #2c3e50 !important;

    button {
      cursor: pointer;
      display: inline-block;
      width: 40px;
      height: 50px;
      text-align: center;
      border: none;
      margin-left: 4px;
      background: transparent;
      transition: background .3s;

      &:hover {
        background-color: #ecf0f1;
      }

    }
  }

  &_fullscreen {
    float: right;
  }

  &_scroll{

    min-height: 400px;
  }

}

/* Dropzone / Drop File */
.mdeditor_modal {
  position: fixed;
  display: none;
  z-index: 20;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  z-index: 5600;
}

.mdeditor_drop {
  top: 20px;
  right: 20px;
  bottom: 20px;
  left: 20px;
  border: 4px solid #fff;
  padding: 20px;
  height: 450px;
  overflow: scroll;
  background: #2c2c2c;
  color: #fff;

  transition: all .3s ease-in-out;
  transition-property:color opacity border-width;
  @include clearfix;

  .description {
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    color: #fff;
  }
  .close-btn {
    font-size: 32px;
    color: #fff;
    cursor: pointer;
  }


  &.dz-drag-hover {
    border-color: $color;
  }
  .dz-preview {
    text-align: center;
    display: inline-block;
    position: relative;
    overflow: hidden;
    width: 150px;
    height: 150px;
    margin: 10px;
    border-radius: 3px;

    img {
      position: absolute;
      left: 50%;
      height: 100%;
      border-radius: 3px;
      transition: opacity .3s ease-in-out;
      transform: translateX(-50%);
    }
  }
  .dz-size,
  .dz-filename,
  .dz-error-mark,
  .dz-success-mark {
    display: none;
  }
  .dz-upload {
    transition: width 0.3s ease-in-out;
  }
  .dz-progress {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    margin: -7px auto 0 auto;
    height: 15px;
    width: 115px;

    border: 2px solid $color;
    border-radius:20px;
    opacity: 0;
    transition-duration: .5s;
    transform: translateY(20px);
  }
  .dz-upload {
    display: block;
    margin: 2px;
    height: 7px;
    width: 0%;

    border-radius:20px;
    background-color: $color;
  }
  .dz-processing {
    border: 2px dashed $color;

    .dz-progress {
      opacity: 1;
      transform: translateY(0px);
    }
    img {
      opacity:0;
    }
  }
  .dz-error{
    color: $color-alert;
    &,
    .dz-progress {
      border-color: $color-alert;
    }
    .dz-upload {
      background-color: $color-alert;
    }
  }
  .dz-remove,
  .dz-insert {
    position: absolute;
    display: block;
    top: 90px;
    right: 10px;
    left: 10px;

    color: #FFF;
    opacity: 0;
    transition: all .3s ease-in-out;
    transition-property:transform opacity;
    transform: translateY(5px);
    cursor: pointer;
    i {
      &.fa {
        font-size: 24px;
      }
    }
  }

  .dz-preview:hover {
    img{
      opacity: .7;
    }
    .dz-remove,
    .dz-insert {
      opacity: 1;
      transform: translateY(0px);
    }
  }

}


/* Fullscreen mode */
.mdeditor.is-fullscreen{
  position: fixed;
  z-index: 9999;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #fff;

  .mdeditor_body{
    border: none;
  }

  .mdeditor_markdown, .mdeditor_preview{
    position: fixed;
    float: none;
    top: 34px;
    left: 0;
    right: auto;
    bottom: 0;

  }

  .mdeditor_preview{
    right: 0;
    left: auto;
  }

  .mdeditor_scroll{
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0 20px;

    overflow: scroll;
  }

}

/* No preview */
.mdeditor.has-no-preview{
  .mdeditor_markdown{
    width: 100%;
  }
  .mdeditor_preview{
    display: none;
  }
  .mdeditor_modal{
    left: 0;
  }
}
