@import "./../styles/index.scss";

.rdw-editor-wrapper {
  box-sizing: content-box;
  display: grid;
  flex-grow: 1;

  &:focus{
    outline: none;
  }
}

.rdw-editor-toolbar {
  border-radius: 3px;
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  font-size: 15px;
  max-width: 100%;
  padding: 4px;
  position: relative;
  user-select: none;
  z-index: 1;

  >div{
    align-items: center;
    display: flex;
    font-family: NunitoSans;
    font-size: 13px;
    position: relative;
  }
}

.rdw-inline-wrapper, .rdw-fontsize-wrapper, .rdw-fontfamily-wrapper{
  border-right: 1px solid transparent;
}

.rdw-block-dropdown {
  width: 110px;
}

.rdw-fontsize-dropdown {
  min-width: 40px;

  .rdw-dropdown-optionwrapper{
    max-height: 20px;
    overflow: auto;
    background-color: red;
  }

  .rdw-dropdown-optionwrapper::-webkit-scrollbar-track{
    background-color: rgba(233, 233, 233, 0.76);
    box-shadow: inset 0 0 10px rgba(220,220,220,0.1);
  }

  .rdw-dropdown-optionwrapper::-webkit-scrollbar{
    width: 6.5px;
    position: absolute;
    top: 0;
    right: 0;
  }
  
  .rdw-dropdown-optionwrapper::-webkit-scrollbar-thumb{
    border-radius: 10px;
    background-color: #d8d8d8;
  }
}

.rdw-fontfamily-dropdown {
  width: 115px;
}

.rdw-option-wrapper {
  align-items: center;
  background: white;
  border-radius: 2px;
  cursor: pointer;
  display: flex;
  height: 20px;
  justify-content: center;
  margin: 0 2px;
  min-width: 25px;
  opacity: 0.6;
  padding: 2px 0;
  text-transform: capitalize;

  img {
    border-style: none;
  }
}

.rdw-option-disabled {
  opacity: 0.2;
  cursor: default;
}

.rdw-dropdown-wrapper {
  height: 24px;
  cursor: pointer;
  border-radius: 2px;
  margin: 0 2px;
  opacity: 0.6;
  text-transform: capitalize;
    
  &:focus{
    outline: none;
  }

  .rdw-dropdown-selectedtext {
    display: flex;
    height: 100%;
    align-items: center;
    padding: 0 5px;

    .rdw-dropdown-carettoopen {
      height: 0px;
      width: 0px;
      position: absolute;
      top: 40%;
      right: 10px;
      border-top: 5px solid black;
      border-left: 4px solid transparent;
      border-right: 4px solid transparent;
    }

    .rdw-dropdown-carettoclose {
      height: 0px;
      width: 0px;
      position: absolute;
      top: 40%;
      right: 10px;
      border-bottom: 5px solid black;
      border-left: 4px solid transparent;
      border-right: 4px solid transparent;
    }
  }

  .rdw-dropdown-optionwrapper {
    background: white;
    border-radius: 2px;
    box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.34);
    margin: 0;
    max-height: 165px;
    padding: 0;
    position: absolute;
    top: 31px;
    width: 98%;
    z-index: 100;

    .rdw-dropdownoption-default {
      min-height: 25px;
      display: flex;
      align-items: center;
      padding: 0 5px;
    }

    .rdw-dropdownoption-active {
      background: #f5f5f5;
    }

    .rdw-dropdownoption-highlighted {
      background: #F1F1F1;
    }
  }
}

.rdw-inline-dropdown {
  width: 50px;
}

.rdw-list-dropdown {
  width: 50px;
  z-index: 90;
}

.rdw-link-dropdown {
  width: 42px;
}

.rdw-text-align-dropdown {
  width: 45px;
  z-index: 90;
}

.rdw-editor-main {
  box-sizing: border-box;
  font-size: 13px;
  font-weight: 200;
  overflow: auto; 
  padding: 0px 10px;
  font-family: initial !important;
  height: 100%;


  .DraftEditor-root {
    padding: 10px 5px;
    border-top: 1px solid transparent;
  }
}

.rdw-editor-main blockquote {
  border-left: 5px solid #f1f1f1;
  padding-left: 5px;
}

.rdw-editor-main pre {
  background: #f1f1f1;
  border-radius: 3px;
  padding: 1px 10px;
}

.rdw-colorpicker-modal-header {
  display: flex;
  padding-bottom: 5px;
}

.rdw-colorpicker-modal-style-label {
  font-size: 15px;
  width: 50%;
  text-align: center;
  cursor: pointer;
  padding: 0 10px 5px;
}

.rdw-colorpicker-modal-style-label-active {
  border-bottom: 2px solid #0a66b7;
}

.rdw-colorpicker-modal {
  background: white;
  top: 31px;
  box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.34);
  right: 0px;
  display: flex;
  flex-direction: column;
  width: 168px;
  height: 172px;
  padding: 15px;
  border-radius: 2px;
  position: absolute;
  z-index: 100;
}

.rdw-colorpicker-cube {
  width: 22px;
  height: 22px;
}

.rdw-colorpicker-modal-options { 
  margin: 5px auto;
  display: flex;
  width: 100%;
  height: 100%;
  flex-wrap: wrap;
}

.rdw-colorpicker-option {
  margin: 3px;
  padding: 0;
  min-height: 20px;
  border: none;
  width: 22px;
  height: 22px;
  min-width: 22px;
  box-shadow: 1px 2px 1px #BFBDBD inset;
  
  &:hover{
    box-shadow: 1px 2px 1px #BFBDBD;
  }
}

.rdw-colorpicker-option-active {
  box-shadow: 0px 0px 2px 2px #BFBDBD;
}

.rdw-link-modal {
  background: white;
  border-radius: 2px;
  top: 36px;
  box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.34);
  display: flex;
  flex-direction: column;
  height: 150px;
  right: 5px;
  padding: 10px;
  position: absolute;
  width: 180px;
  z-index: 100;

  .rdw-link-modal-label:nth-child(1)::after{
    color: #000;
    content: 'Text to display';
    position: relative;
    left: -55px;
    font-weight: 500;
  }
  .rdw-link-modal-label:nth-child(3)::after{
    color: #000;
    content: 'Enter a URL';
    position: relative;
    left: -68px;
    font-weight: 500;
  }
  .rdw-link-modal-input:focus{
    border-bottom: 1px solid #0091ff;
  }
}

.rdw-link-modal-label {
  color: white;
  font-size: 15px;
}

.rdw-link-modal-input {
  height: 15px;
  border: none;
  border-bottom: 1px solid #F1F1F1;
  margin-bottom: 5px;
  margin-top: 0px;
  padding: 5px;
  color: #4a4a4a;
  font-weight: 200;
}

.rdw-link-modal-input:focus {
  border-bottom: 1px solid #0091ff;
  outline: none;
}

.rdw-link-modal-buttonsection {
  margin: 20px 0px 0px auto;
}

.rdw-link-modal-target-option {
  display: none;
  margin-bottom: 10px;
}

.rdw-link-modal-target-option > span {
  margin-left: 5px;
}

.rdw-link-modal-btn {
  border: none;
  border-radius: 100px;
  color: white;
  cursor: pointer;
  margin-left: 10px;
  height: 27px;
  background: #0091ff;
  text-transform: uppercase;
  width: 70px;
  float: right;
  text-transform: capitalize;
}

.rdw-link-modal-btn:nth-child(2) {
  color: #4a4a4a;
  background: #fff;
}

.rdw-link-modal-btn:active {
  box-shadow: 1px 1px 0px #BFBDBD inset;
}

.rdw-link-modal-btn:focus {
  outline: none !important;
}

.rdw-link-modal-btn:disabled {
  opacity: 0.5;
  pointer-events: none;
}

.rdw-emoji-modal {
  background: white;
  border-radius: 2px;
  bottom: 36px;
  box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.34);
  display: flex;
  flex-wrap: wrap;
  height: 180px;
  left: 5px;
  overflow: auto;
  padding: 15px;
  position: absolute;
  width: 210px;
  z-index: 100;
}

.rdw-emoji-modal::-webkit-scrollbar-track{
  background-color: rgba(233, 233, 233, 0.76);
  box-shadow: inset 0 0 10px rgba(220,220,220,0.1);
}

.rdw-emoji-modal::-webkit-scrollbar{
  width: 6.5px;
  position: absolute;
  top: 0;
  right: 0;
}

.rdw-emoji-modal::-webkit-scrollbar-thumb{
  border-radius: 10px;
  background-color: #d8d8d8;
}

.rdw-emoji-icon {
  margin: 2.5px;
  height: 24px;
  width: 24px;
  cursor: pointer;
  font-size: 22px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.rdw-link-decorator-wrapper {
  position: relative;
}

.rdw-link-decorator-icon {
  display: none;
}

.public-DraftEditorPlaceholder-root {
  color: #9197a3;
  font-weight: 600;
  position: absolute;
  z-index: 0;
}

.public-DraftStyleDefault-ol, .public-DraftStyleDefault-ul{
  margin: 16px 0;
  padding: 0;
}

.public-DraftStyleDefault-depth0.public-DraftStyleDefault-reset {
  counter-reset: ol0;
}

.public-DraftStyleDefault-unorderedListItem.public-DraftStyleDefault-depth0 {
  list-style-type: disc;
}

.public-DraftStyleDefault-unorderedListItem.public-DraftStyleDefault-depth1{
  list-style-type: circle;
}

.public-DraftStyleDefault-depth0.public-DraftStyleDefault-listLTR {
  margin-left: 1.5em;
}

.public-DraftStyleDefault-depth1.public-DraftStyleDefault-listLTR {
  margin-left: 3em;
}

// Keep formating option selected
.rdw-option-active {
  background-color: rgba($color: #BFBDBD, $alpha: 0.6);
}

/* THEME
   ----------------------------- */
   @mixin themable($_THEME, $_BACKGROUND_COLOR_SETTINGS_SIGNATURE_BUTTON, $_BORDER_COLOR_SETTINGS_SIGNATURE_BUTTON, $_BACKGROUND_COLOR_SETTINGS_SIGNATURE_BUTTON_HOVER){
    [data-theme^=#{$_THEME}],
    [data-theme] [data-theme^=#{$_THEME}] {
      .rdw-inline-wrapper, .rdw-fontsize-wrapper, .rdw-fontfamily-wrapper{
        border-right-color: $_BORDER_COLOR_SETTINGS_SIGNATURE_BUTTON;
      }

      .rdw-option-wrapper {
        background: $_BACKGROUND_COLOR_SETTINGS_SIGNATURE_BUTTON;

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

      .rdw-dropdown-wrapper {
        background: $_BACKGROUND_COLOR_SETTINGS_SIGNATURE_BUTTON;

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

      .rdw-editor-main {
        .DraftEditor-root {
          border-top-color: $_BORDER_COLOR_SETTINGS_SIGNATURE_BUTTON;
        }
      }
    }
  }
    
  @include themable($_THEME_LIGHT, $_BACKGROUND_COLOR_SETTINGS_SIGNATURE_BUTTON_LIGHT, $_BORDER_COLOR_SETTINGS_SIGNATURE_BUTTON_LIGHT, $_BACKGROUND_COLOR_SETTINGS_SIGNATURE_BUTTON_HOVER_LIGHT);
  @include themable($_THEME_DARK, $_BACKGROUND_COLOR_SETTINGS_SIGNATURE_BUTTON_DARK, $_BORDER_COLOR_SETTINGS_SIGNATURE_BUTTON_DARK, $_BACKGROUND_COLOR_SETTINGS_SIGNATURE_BUTTON_HOVER_DARK);