.aceditor-container {
  position: relative;
}

.ace-container {
  padding: 1em 0.7em 0 0;
  margin-bottom: 1rem;
}

textarea.aceditor-textarea {
  display: none;
}

.ace-body {
  height: 65px;
  border: none;
  padding: 0;
}

.ace_layer {
  color: var(--main-text-color);
}

.ace-body .ace_cursor {
  color: var(--neutral-color);
  border-width: 1px !important;
}

.ace-body .ace_marker-layer .ace_active-line {
  /* background: rgba(0, 0, 0, 0.03); */
  background: transparent;
  margin: 0 4px;
  border-radius: 3px;
}

.ace-body .ace_markup {
  color: #bc1c96;
}

.ace-body .ace_action-name {
  color: #bc1c96 !important;
}

.ace-body .ace_attribute-name {
  color: var(--primary-color);
}

.ace-body .ace_attribute-value,
.ace-body .ace_attribute-quote-mark {
  color: var(--secondary-color-1) !important;
}

.ace-body .ace_title-quote-mark,
.ace-body .ace_link-title {
  color: var(--neutral-soft-color);
}

.ace-body .ace_md-extra,
.ace-body .ace_md-extra-markup {
  color: var(--secondary-color-1);
}

.ace-body .ace_markup.ace_html {
  color: var(--neutral-soft-color);
}

.ace-body .ace_headings {
  color: var(--primary-color);
  font-weight: bold;
}

.ace-body .ace_link-url {
  color: var(--primary-color);
  text-decoration: underline;
}

.ace-body .ace_list {
  font-weight: bold;
}

.ace-body .ace_comment {
  color: var(--neutral-soft-color);
}

.ace-body .ace_pre {
  background-color: #c33ba30f;
}

/* Page Edit */
#ACEditor {
  position: relative;
  height: auto;
}

#ACEditor .btn-toolbar {
  position: sticky;
  top: 0;
  z-index: 6;
  background-color: white;
}

#ACEditor .ace-container .ace-body {
  min-height: 500px;
}

/* Show line numbers only on page edit */
form:not(#ACEditor) .ace-container .ace_gutter {
  /* Keep it visible because it's just to get the active line height */
  width: 0 !important;
  overflow: hidden;
  padding: 0;
}

form:not(#ACEditor) .ace-container .ace_scroller {
  left: 0.6em !important;
}

.ace_gutter-cell {
  padding-left: 12px;
  padding-top: 3px;
  color: var(--neutral-soft-color);
  padding-right: 8px;
  margin-right: 10px;
}

.ace-tm .ace_gutter-active-line {
  background-color: #f3f1f1;
}

.ace-tm .ace_gutter {
  font-size: 12px;
  padding-right: 10px;
  background: none;
}

.ace_search {
  position: fixed;
  top: 70px;
  right: 0;
}
.ace_mobile-menu {
  display: none;
}
.component-action-list > li.open-existing-action {
  display: none;
}
.component-action-list.only-edit > li.open-existing-action {
  display: block;
}
.component-action-list.only-edit > li:not(.open-existing-action) {
  display: none;
}

.aceditor-btn-comment {
  font-style: italic;
  color: green !important;
}

.ace_editor.ace_autocomplete {
  border: 1px solid #d0d7df;
  border-radius: 3px;
  width: 250px;
  box-shadow: 0 3px 6px rgb(140 149 159 / 15%);
  font-family: inherit;
  margin-left: -4px;
}

.ace_editor.ace_autocomplete .ace_text-layer {
  margin: 0 !important;
}

.ace_editor.ace_autocomplete .ace_text-layer > .ace_line {
  padding: 0 0.5rem;
}

.ace_editor.ace_autocomplete .ace_completion-highlight {
  color: var(--primary-color);
}

.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {
  background-color: var(--neutral-light-color);
}

/* ================= */

/* FLYING ACTION BAR */

/* ================= */
.flying-edit-button {
  opacity: 0;
  transition: opacity 0.3s;
  position: absolute;
  z-index: 50;
  left: 0;
}

.flying-edit-button.active {
  opacity: 1;
}

.flying-edit-button .btn {
  width: 2.3rem;
  padding: 0.4rem 0;
  transform: translateX(-2.3rem);
  border-radius: 5px 0 0 5px;
}

/* In iframe, button is inside the textarea */
.yeswiki-iframe-body .flying-edit-button .btn {
  border-radius: 0 3px 3px 0;
  padding: 0.25rem 0;
  width: 1.8rem;
  transform: translateX(0);
}

/* in small screen, make button smaller and overlapping textarea */
@media (width <= 1200px) {
  body:not(.yeswiki-iframe-body) .flying-edit-button .btn {
    border-radius: 4px;
    padding: 0.4rem 0;
    width: 2rem;
    transform: translateX(-0.9rem);
  }

  body:not(.yeswiki-iframe-body) form#ACEditor .flying-edit-button .btn {
    /* overlap more to cover gutter */
    border-radius: 4px;
    padding: 0.4rem 0;
    width: 2.2rem;
    transform: translateX(-0.5rem);
  }
}

#YesWikiLinkModal .more-options {
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
  margin: 1.5rem 0;
  padding: 0.5rem 0;
}
