.admin-content {
  .rich-text-editor {
    font-size: $font-size-xs;

    label {
      margin: 0 !important;
      font-family: $font-family;
      font-size: $font-size-s;
    }

    .attachments {
      float: none;
      margin-top: 0;
      margin-bottom: 20px;
      font-size: $font-size-xs;
    }

    .modal-body {
      .preview {
        display: block;
      }
    }
  }

  .rich-text-editor .DraftEditor-editorContainer {
    padding: 5px;
    border: 1px solid $light-grey;

    .DraftEditor-root {
      max-height: 180px;
      overflow-y: scroll;
      font-size: $font-size-xs;
      letter-spacing: 0;
    }

    .editor-toolbar {
      background-color: #ccc;
      margin: -5px;

      .btn {
        background-color: #ccc;

        &:first-child,
        &:last-child,
        &:focus,
        &:active {
          border-radius: 0;
          outline: none;
        }
      }
    }
  }
}

.sm-title {
  font-size: $font-size-sm;
}

.margin-left-9 {
  margin-left: 9px;
}

.top-post-form {
  .editor-toolbar {
    margin-bottom: 5px;
  }

  .start-discussion {
    display: inline-block;
    padding: 2px 0 0 10px;
    max-width: 150px;
  }

  .start-discussion-icon {
    display: inline-block;
    padding: 3px 0 0 0;
    vertical-align: top;
  }
}

.collapsed-answer-form {
  .rich-text-editor {
    .editor-toolbar {
      &.top {
        display: none;
      }
    }
  }
}

.rich-text-editor {
  font-family: $font-family;
  margin-top: 16px;
  position: relative;
  letter-spacing: 0;
  font-size: $font-size-s;

  .attachments {
    float: right;
    font-size: $font-size-xs;
  }

  .richtext-large & {
    min-height: 1000px;
  }

  .insertion-box {
    .richtext-label {
      white-space: nowrap;
    }

    background-color: $white;
    min-height: 200px;
    position: fixed;
    top: 25%;
    left: 50%;
    transform: translate(-50%);
    width: 50%;
    min-width: 320px;
    max-width: 550px;
    z-index: 1040;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    box-shadow: 1px 1px 1px 0 #656565;
    padding: 15px;

    .close {
      &:focus {
        outline: none;
      }
    }

    input {
      border-radius: 0;
      box-shadow: none;

      &:focus {
        box-shadow: none;
      }
    }

    .modal-header {
      padding: 0 0 15px;

      .close {
        position: absolute;
        right: 15px;
        top: 15px;
      }
    }

    .modal-body {
      position: initial;
      padding: 25px 0 0;
    }

    .with-image-preview {
      min-height: 350px;
    }

    .assembl-icon-cancel {
      float: right;
      cursor: pointer;
    }

    .attach-file {
      .attachment-label {
        min-width: 150px;

        span {
          position: absolute;
          left: 50%;
          top: 11%;
          transform: translate(-50%);
          font-size: $font-size-s;
        }
      }
    }

    .with-preview {
      min-height: 320px;

      .btn-default {
        top: 21%;
      }

      .preview img {
        top: 35%;
        max-height: 42%;
      }
    }

    .preview img {
      max-width: 400px;
      max-height: 200px;
    }

    .btn-default {
      &:focus {
        outline: none;
      }
    }

    .preview {
      .btn-default {
        border-color: $white;

        &:hover {
          background-color: $white;
        }

        &:focus {
          outline: none;
        }
      }
    }

    .preview-title {
      margin-top: 20px;
      font-size: $font-size-xxs;
    }
  }

  .editor-label {
    float: left;
    padding-top: 12px;
    font-family: $font-family7;
    margin: 0 0 5px 1px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.7px;
  }

  .editor-toolbar-sticky {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
  }

  .toolbar-container.toolbar-blocked button {
    pointer-events: none;
  }

  .editor-toolbar {
    float: right;

    &.top {
      position: absolute;
      top: 0;
      right: 0;
    }

    .btn-group {
      margin-right: 5px;

      .btn {
        font-size: 14px;
        border: 0;
        border-radius: 20px;

        span {
          &:before {
            font-size: $font-size-s;
          }
        }
      }
    }

    .btn-group:first-of-type {
      margin-right: 0;

      .btn {
        border-radius: 20px 0 0 20px;
      }
    }

    .btn-group:nth-of-type(2) {
      margin-right: 0;

      .btn {
        border-radius: 0;
      }
    }

    .btn-group:nth-of-type(3) {
      .btn {
        border-radius: 0 20px 20px 0;
      }
    }
  }

  .public-DraftEditorPlaceholder-root {
    color: $grey;
    font-family: $font-family6;
    position: absolute;
    padding: 5px;
  }

  .DraftEditor-root {
    padding: 5px;
  }

  .DraftEditor-editorContainer {
    padding: 5px;
    background-color: $white;
  }

  .public-DraftEditor-content {
    height: 200px;

    .richtext-large & {
      height: 1000px;
    }

    overflow: auto;
  }
}

.rich-text-editor.hidePlaceholder {
  .public-DraftEditorPlaceholder-inner {
    display: none;
  }
}

img.attachment-image {
  max-width: 100%;
  margin-top: 20px;
  cursor: pointer;
  transition: 0.3s;
}

.atomic-block {
  .attachment-document {
    border: solid 1px;
    margin: 3px;
    padding: 3px;
    font-family: $font-family3;
  }

  img.attachment-icon {
    width: 38px;
  }
}

.administration {
  .rich-text-editor .DraftEditor-editorContainer {
    border-bottom-right-radius: 0;
    border-bottom-left-radius: 0;
  }

  .editor-toolbar {
    float: none;
    background-color: $light-grey;
    width: 100%;
    text-align: right;

    .active {
      background-color: $grey !important;
    }

    .btn {
      background-color: $light-grey;
    }
  }

  .DraftEditor-root {
    padding: 0;
  }

  .DraftEditor-editorContainer {
    background-color: $white;
  }

  .public-DraftEditorPlaceholder-inner {
    font-size: $font-size-xs;
    font-family: $font-family6;
    letter-spacing: 0;
    padding: 5px 0 0 5px;
  }

  .public-DraftStyleDefault-block {
    padding: 5px 0 0 5px;
  }
}

@media screen and (min-width: $screen-xxs-max) {
  .questions-section {
    .rich-text-editor {
      .public-DraftEditor-content {
        height: 200px;
        overflow: auto;
      }
    }
  }
}

@media screen and (min-width: $screen-sm-min) {
  .questions-section {
    .rich-text-editor {
      .public-DraftEditor-content {
        height: 300px;
        overflow: auto;
      }
    }
  }
}

@media screen and (min-width: $screen-xl-min) {
  .questions-section {
    .rich-text-editor {
      .public-DraftEditor-content {
        height: 300px;
        overflow: auto;
      }
    }
  }
}
