div.editor{
  border-radius: 4px;
  background-clip: padding-box;
  //border: 1px solid var(--border-color);
  height: unset;
  overflow: hidden;
  background-color: var(--bg-color);
  transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out;
  padding: 0;
  color: #000;
  font-family: sans-serif;
  &_focus{
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.2);
    border-color: #8dbdff;
  }
  &_valid{
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40,167,69,.25);
  }
  &_invalid{
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220,53,69,.25);
  }
}
.editor__mainPlaceholder{
  display: flex;
  flex-direction: row;
  align-items: center;
  color: var(--color-secondary);
  position: absolute;
  z-index: 1;
  left: 18px;
  top: 18px;
  svg{
    fill: var(--color-secondary);
    height: 1rem;
    margin-right: 6px;
    display: inline-flex;
  }
}
.editor__mainWrap{
  position: relative;
}
.editor__main{
  width: 100%;
  min-height: 8em;
  background-clip: padding-box;
  padding: 8px;
  cursor: text;
  position: relative;
  z-index: 2;
  i{
    display: inline;
  }
  ul{
    list-style-type: disc;
  }
  ul.checkList{
    list-style: none;
    margin: 0;
    padding: 0;
    li{
      label{
        margin-right: 6px;
        display: inline-flex;
      }
    }
  }
  ol{
    list-style-type: number;
  }
  table{
    width: 100%;
    th,td{
      padding: 8px 12px;
      text-align: left;
      border: 1px solid #ccc;
    }
  }
  &:focus, &:active{
    outline: none;
  }
}

.editor__controls{
  padding: 0 4px;
  background-color: var(--bg-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  height: 32px;
  position: relative;
  z-index: 1;
  a {
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 6px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    color: #b2b4ba;
    font-size: 14px;
    cursor: pointer;
    margin-right: 2px;
    svg {
      height: 18px;
      display: flex;
      fill: #b2b4ba;
    }

    &:hover {
      color: #2962ff;
      background-color: #e3ebff;

      svg {
        fill: #2962ff;
      }
    }
    &.active{
      background-color: #e3ebff;
      color: #2962ff;
      svg{
        fill: #2962ff;
      }
      &:hover{
        background-color: #e3ebff;
      }
    }
  }
}

@mixin editorControlsDark {
  .editor__controls{
    a{
      &:hover {
        color: #fff;
        background-color: #2962ff;

        svg {
          fill: #fff;
        }
      }
      &.active{
        background-color: #2962ff;
        color: #e3ebff;
        svg{
          fill: #e3ebff;
        }
        &:hover{
          background-color: #2962ff;
        }
      }
    }
  }
}


body.theme-dark {
  @include editorControlsDark;
}
body.theme-auto{
  @media (prefers-color-scheme: dark) {
    @include editorControlsDark;
  }
}

.editor__headerRight{
  display: flex;
  flex-direction: row;
  align-content: center;
  margin-left: auto;
}


.editor__colors{
  display: flex;
  flex-direction: column;
  padding: 8px;
}

.editor__colorsRow{
  display: flex;
  flex-direction: row;
  margin-bottom: 2px;
  &:last-child{
    margin-bottom: 0;
  }
}

.editor__colorsRowItem{
  width: 20px;
  height: 20px;
  border-radius: 50%;
  margin-right: 2px;
  box-shadow: 0 0 1px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  &:last-child{
    margin-right: 0;
  }
  &:hover{
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    outline: 1px solid rgba(0, 0, 0, 0.1);
  }
}

.editor__controls{
  a.editor__colorBtn{
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-content: center;
    justify-content: center;
    background-color: var(--btn-bg);
    //border-radius: 50%;
    position: relative;
    svg{
      position: relative;
      z-index: 2;
      margin-bottom: 3px;
      height: 14px;
      fill: var(--color);
    }
  }

  .editor__colorBtnValue{
    height: 3px;
    border-radius: 2px;
    position: absolute;
    bottom: 4px;
    width: 50%;
  }
}

.editor__resetBgButton{
  display: flex;
  margin: 8px 6px 0 auto;
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
}

.editor__footer{
  padding: 0 12px;
  background-color: var(--transparent-hint);
  display: flex;
  align-items: center;
  flex-direction: row;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
  height: 45px;
  position: relative;
  z-index: 2;
}

.editorTableSelect{
  padding: 4px;
}

.editorTableSelect__grid{
  display: grid;
}

.editorTableSelect__item{
  width: 16px;
  height: 16px;
  padding: 1px;
  &:after{
    content: "";
    display: block;
    width: 100%;
    height: 100%;
    border: 1px solid #ccc;
    border-radius: 3px;
  }
  &_hover{
    &:after{
      border-color: #2962ff;
      background-color: #e0e8fc;
    }
  }
}

.editorTableSelect__label{
  text-align: center;
  margin-top: 4px;
}
