/* ---------- One Dark Pro – Night Flat for Ace (.ace-tm) ---------- */
/* Base UI */
.ace-tm .ace_gutter {
  background: #21252b;   /* gutter panel */
  color: #636d83;        /* gutter text */
}

.ace-tm .ace_print-margin {
  width: 1px;
  background: #3a3f4b;
}

.ace-tm .ace_fold {
  background-color: #61afef; /* fold widgets */
}

.ace-tm {
  background-color: #282c34; /* editor bg */
  color: #abb2bf;            /* default fg */
}

.ace-tm .ace_cursor {
  color: #528bff;            /* caret */
}

.ace-tm .ace_invisible {
  color: #3e4451;            /* invisibles · */
}

/* Syntax */
.ace-tm .ace_storage,
.ace-tm .ace_keyword {
  color: #c678dd;            /* purple */
}

.ace-tm .ace_constant {
  color: #d19a66;            /* orange */
}

.ace-tm .ace_constant.ace_buildin,
.ace-tm .ace_constant.ace_language,
.ace-tm .ace_support.ace_constant {
  color: #56b6c2;            /* cyan */
}

.ace-tm .ace_constant.ace_library {
  color: #98c379;            /* green */
}

.ace-tm .ace_invalid {
  background-color: rgba(224, 108, 117, 0.15); /* red bg */
  color: #e06c75;                               /* red */
}

.ace-tm .ace_support.ace_function,
.ace-tm .ace_entity.ace_name.ace_function {
  color: #61afef;            /* blue */
}

.ace-tm .ace_support.ace_type,
.ace-tm .ace_support.ace_class {
  color: #e5c07b;            /* yellow (types/classes) */
}

.ace-tm .ace_keyword.ace_operator {
  color: #56b6c2;            /* operators a.k.a. cyan */
}

.ace-tm .ace_string {
  color: #98c379;            /* green strings */
}

.ace-tm .ace_comment {
  color: #5c6370;            /* muted comments */
  font-style: italic;
}

.ace-tm .ace_constant.ace_numeric {
  color: #d19a66;            /* numbers use orange */
}

.ace-tm .ace_variable {
  color: #e06c75;            /* variables (red-ish) */
}

/* Markup-ish */
.ace-tm .ace_heading,
.ace-tm .ace_meta.ace_tag,
.ace-tm .ace_xml-pe,
.ace-tm .ace_list {
  color: #61afef;            /* blue accents for tags/headings */
}

.ace-tm .ace_string.ace_regex {
  color: #56b6c2;            /* regex cyan */
}

/* Selection & guides */
.ace-tm .ace_marker-layer .ace_selection {
  background: #3e4451;       /* selection */
}
.ace-tm.ace_multiselect .ace_selection.ace_start {
  box-shadow: 0 0 3px 0px #282c34;
}

.ace-tm .ace_marker-layer .ace_step {
  background: #528bff55;     /* debug step */
}

.ace-tm .ace_marker-layer .ace_stack {
  background: #2d3139;       /* call stack */
}

.ace-tm .ace_marker-layer .ace_bracket {
  margin: -1px 0 0 -1px;
  border: 1px solid #4b5263;
}

.ace-tm .ace_marker-layer .ace_active-line {
  background: rgba(255, 255, 255, 0.05);
}

.ace-tm .ace_gutter-active-line {
  background-color: #2c313a;
}

.ace-tm .ace_marker-layer .ace_selected-word {
  background: #3e4451;
  border: 1px solid #4b5263;
}

/* Indent guides – nechaj tvoje base64, len stlmíme */
.ace-tm .ace_indent-guide {
  background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;
  opacity: 0.25;
}
.ace-tm .ace_indent-guide-active {
  background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAZSURBVHjaYvj///9/hivKyv8BAAAA//8DACLqBhbvk+/eAAAAAElFTkSuQmCC") right repeat-y;
  opacity: 0.45;
}



/* ============================
   ACE – Modern UI (One Dark Pro Night Flat)
   ============================ */

/* --- Core palette as CSS variables --- */
.ace-tm {
  --ace-bg: #282c34;       /* main editor background */
  --ace-fg: #abb2bf;       /* default text */
  --ace-gutter-bg: #21252b;
  --ace-gutter-fg: #636d83;
  --ace-cursor: #528bff;

  --ace-selection: #3e4451;
  --ace-active-line: rgba(255,255,255,.05);
  --ace-bracket: #4b5263;

  /* Syntax */
  --ace-purple: #c678dd;
  --ace-red: #e06c75;
  --ace-orange: #d19a66;
  --ace-yellow: #e5c07b;
  --ace-green: #98c379;
  --ace-cyan: #56b6c2;
  --ace-blue: #61afef;
  --ace-comment: #5c6370;

  /* UI accents */
  --ace-border: #3a3f4b;
  --ace-tooltip-bg: #2c313a;
  --ace-tooltip-fg: #d7dae0;

  --ace-radius: 6px;       /* unified rounding */
  --ace-focus-ring: #61afef;
}

/* --- Typography / readability --- */
.ace_editor {
  position: relative;
  overflow: hidden;
  padding: 0;
   font: 13px/1.6 "JetBrains Mono", ui-monospace, "Cascadia Code", "SF Mono",
        Menlo, Consolas, "Liberation Mono", "DejaVu Sans Mono", monospace;
  /* bezpečné pre Ace: vypnúť ligatúry (ak ich chceš späť, viď poznámku nižšie) */
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "calt" 0;
  direction: ltr;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  forced-color-adjust: none;
  color: var(--ace-fg);
  background: var(--ace-bg);
}

/* Prefer visible caret + better focus ring */
.ace_keyboard-focus:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--ace-focus-ring) inset;
  border-radius: var(--ace-radius);
}

/* --- Scroller / content --- */
.ace_scroller { position: absolute; top: 0; bottom: 0; overflow: hidden; background: inherit; user-select: none; cursor: text; }
.ace_content  { position: absolute; box-sizing: border-box; min-width: 100%; contain: style size layout; }

/* --- Gutter --- */
.ace_gutter {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: auto; overflow: hidden; pointer-events: auto;
  background: var(--ace-gutter-bg); color: var(--ace-gutter-fg);
  border-right: 1px solid var(--ace-border);
  contain: style size layout;
}
.ace_gutter-active-line { background: rgba(97, 175, 239, 0.10); }
.ace_gutter-cell, .ace_gutter-cell_svg-icons {
  position: absolute; top: 0; left: 0; right: 0;
  padding: 0 10px 0 26px;  /* viac vzduchu, lepšia klikateľnosť */
  background-repeat: no-repeat;
}

/* --- Print margin --- */
.ace_print-margin { position: absolute; height: 100%; width: 1px; background: var(--ace-border); }

/* --- Cursor --- */
.ace_cursor-layer { z-index: 4; }
.ace_cursor { border-left: 2px solid var(--ace-cursor); }

/* --- Selection / Active line / Selected word --- */
.ace_marker-layer .ace_selection { background: var(--ace-selection); }
.ace_marker-layer .ace_active-line { background: var(--ace-active-line); }
.ace_marker-layer .ace_selected-word {
  background: var(--ace-selection);
  outline: 1px solid var(--ace-bracket);
}

/* --- Brackets / stack / step --- */
.ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid var(--ace-bracket); }
.ace_marker-layer .ace_step  { background: #528bff55; }
.ace_marker-layer .ace_stack { background: #2d3139; }

/* --- Syntax colors --- */
.ace-tm .ace_storage, .ace-tm .ace_keyword { color: var(--ace-purple); }
.ace-tm .ace_constant { color: var(--ace-orange); }
.ace-tm .ace_constant.ace_buildin,
.ace-tm .ace_constant.ace_language,
.ace-tm .ace_support.ace_constant { color: var(--ace-cyan); }
.ace-tm .ace_constant.ace_library { color: var(--ace-green); }
.ace-tm .ace_support.ace_function,
.ace-tm .ace_entity.ace_name.ace_function { color: var(--ace-blue); }
.ace-tm .ace_support.ace_type,
.ace-tm .ace_support.ace_class { color: var(--ace-yellow); }
.ace-tm .ace_keyword.ace_operator { color: var(--ace-cyan); }
.ace-tm .ace_string { color: var(--ace-green); }
.ace-tm .ace_comment { color: var(--ace-comment); font-style: italic; }
.ace-tm .ace_constant.ace_numeric { color: var(--ace-orange); }
.ace-tm .ace_variable { color: var(--ace-red); }
.ace-tm .ace_heading,
.ace-tm .ace_meta.ace_tag,
.ace-tm .ace_xml-pe,
.ace-tm .ace_list { color: var(--ace-blue); }
.ace-tm .ace_string.ace_regex { color: var(--ace-cyan); }
.ace-tm .ace_invalid { background: rgba(224,108,117,0.15); color: var(--ace-red); }

/* --- Fold widgets / fold blocks --- */
.ace_line .ace_fold {
  display: inline-block; height: 12px; margin-top: -1px; vertical-align: middle;
  border: 1px solid var(--ace-border); border-radius: 3px;
  background-color: rgba(255,255,255,.06);
  color: transparent; cursor: pointer; pointer-events: auto;
}
.ace_fold:hover { background-color: rgba(255,255,255,.12); }

/* --- Tooltip (docs/hover) --- */
.ace_tooltip {
  background: var(--ace-tooltip-bg); color: var(--ace-tooltip-fg);
  border: 1px solid var(--ace-border); border-radius: var(--ace-radius);
  box-shadow: 0 6px 24px rgba(0,0,0,.45);
  padding: 8px 10px; line-height: 1.45; max-width: min(60em, 66vw);
}
.ace_tooltip:focus { outline: 2px solid var(--ace-focus-ring); }

/* --- Inline button (keep, but modernize) --- */
.ace_inline_button {
  border: 1px solid var(--ace-border);
  background: rgba(255,255,255,.04);
  border-radius: 4px; padding: 2px 6px; margin: -1px 8px;
  pointer-events: auto; cursor: pointer;
}
.ace_inline_button:hover { background: rgba(255,255,255,.10); }

/* --- Mobile menu (light/dark variants retained) --- */
.ace_mobile-menu {
  position: absolute; line-height: 1.5; border-radius: 6px;
  background: var(--ace-bg); color: var(--ace-fg);
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
  border: 1px solid var(--ace-border);
}
.ace_mobile-button { padding: 6px 8px; cursor: pointer; }
.ace_mobile-button:hover { background: rgba(255,255,255,.06); }

/* --- Indent guides: decent contrast, no krikľavosť --- */
.ace_indent-guide,
.ace_indent-guide-active {
  opacity: .35;
  background-image: linear-gradient(to bottom, rgba(255,255,255,.12), rgba(255,255,255,.12));
  background-repeat: repeat-y;
  background-position: right;
  background-size: 1px 8px;
}
.ace_indent-guide-active { opacity: .55; }

/* --- Scrollbars (WebKit) --- */
.ace_scroller::-webkit-scrollbar { width: 12px; height: 12px; }
.ace_scroller::-webkit-scrollbar-track { background: #1f2329; }
.ace_scroller::-webkit-scrollbar-thumb {
  background: #3b4048; border-radius: 8px; border: 3px solid #1f2329;
}
.ace_scroller::-webkit-scrollbar-thumb:hover { background: #4a505a; }

/* --- Error/Warning/Info icons – keep your masks, just align colors --- */
.ace_icon_svg.ace_error,
.ace_icon_svg.ace_security,
.ace_icon_svg.ace_error_fold,
.ace_icon_svg.ace_security_fold { background-color: var(--ace-red); }
.ace_icon_svg.ace_warning,
.ace_icon_svg.ace_warning_fold { background-color: #e5c07b; }
.ace_icon_svg.ace_info,
.ace_icon_svg.ace_hint { background-color: var(--ace-blue); }

/* --- Active/drag overlays jemne --- */
.ace_dragging .ace_scroller:before { background: rgba(0,0,0,0.03); }
.ace_dragging.ace_dark .ace_scroller:before { background: rgba(0,0,0,0.03); }

/* --- Radius utilities: zjednotený vzhľad (ak to používaš inde) --- */
.ace_br1, .ace_br2, .ace_br3, .ace_br4, .ace_br5, .ace_br6,
.ace_br7, .ace_br8, .ace_br9, .ace_br10, .ace_br11, .ace_br12,
.ace_br13, .ace_br14, .ace_br15 { border-radius: var(--ace-radius); }

/* --- Accessibility niceties --- */
.ace_screenreader-only { position:absolute; left:-10000px; top:auto; width:1px; height:1px; overflow:hidden; }
.ace_text-input { opacity: 0; background: transparent; border: 0; font: inherit;          /* dôležité! */
  letter-spacing: 0;      /* pre istotu */ }

/* Preserve your existing structural rules (layers, composition, etc.) – bez zmeny funkčnosti */


/* --- Ace custom scrollbars (match One Dark Pro) --- */
.ace_editor > .ace_sb-v,
.ace_editor > .ace_sb-h {
  position: absolute;
  z-index: 6;
  background: none;
  overflow: hidden !important;
}

/* vertical */
.ace_editor > .ace_sb-v {
  right: 0;
  top: 0;
  width: 12px;
}
.ace_editor > .ace_sb-v div {
  position: absolute;
  right: 0;
  width: 100%;
  box-sizing: border-box;
  background: #3b4048;
  border: 3px solid #1f2329;
  border-radius: 8px;
  z-index: 8;
}

/* horizontal */
.ace_editor > .ace_sb-h {
  bottom: 0;
  left: 0;
  height: 12px;
}
.ace_editor > .ace_sb-h div {
  position: absolute;
  bottom: 0;
  height: 100%;
  box-sizing: border-box;
  background: #3b4048;
  border: 3px solid #1f2329;
  border-radius: 8px;
  z-index: 8;
}

/* hover/drag states */
.ace_editor > .ace_sb-v div:hover,
.ace_editor > .ace_sb-h div:hover { background: #4a505a; }
.ace_editor > .ace_sb_grabbed { z-index: 8; background: #000000; }

/* ak používaš CSS premenné, môžeš to previazať takto:
   background: var(--ace-bg);
   a colorovanie thumbu zjednotiť s ostatnými UI farbami
*/


/* ------------------------------------------------------------------------------------------
 * Editor Search Form – modern dark UI (One Dark Pro)
 * --------------------------------------------------------------------------------------- */
.ace_search {
  position: absolute;
  top: 0;
  z-index: 99;
  margin: 0;
  padding: 6px;
  white-space: normal;

  background-color: var(--ace-tooltip-bg, #2c313a);
  color: var(--ace-fg, #abb2bf);
  border: 1px solid var(--ace-border, #3a3f4b);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.45);
}
.ace_search.left  { left: 0;  border-left: 0;  border-radius: 0 0 8px 0; }
.ace_search.right { right: 0; border-right: 0; border-radius: 0 0 0 8px; }

.ace_search_form,
.ace_replace_form {
  margin: 0 20px 6px 0;
  overflow: hidden;
  line-height: 1.9;
}
.ace_replace_form { margin-right: 0; }

.ace_search_form.ace_nomatch {
  outline: 2px solid var(--ace-red, #e06c75);
  outline-offset: 2px;
}

/* field + buttons */
.ace_search_field {
  min-width: 17em;
  min-height: 2.0em;
  box-sizing: border-box;
  vertical-align: top;

  background-color: #1f2329;
  color: var(--ace-fg, #abb2bf);
  border: 1px solid var(--ace-border, #3a3f4b);
  border-right: 0;
  border-radius: 6px 0 0 6px;
  font-size: 13px;
  line-height: 1.6;
  padding: 0 8px;
  outline: none;
}
.ace_search_field::placeholder { color: #7f8895; }

.ace_searchbtn {
  display: inline-block;
  position: relative;
  margin: 0;
  padding: 0 8px;
  line-height: 2.0em;
  cursor: pointer;

  color: var(--ace-fg, #abb2bf);
  background: #232830;
  border: 1px solid var(--ace-border, #3a3f4b);
  border-left: 1px solid #2b313a;
  border-right: 0;
}
.ace_searchbtn:hover   { background: #2a3038; }
.ace_searchbtn:active  { background: #242a31; }
.ace_searchbtn:disabled{
  background: #1f2329;
  color: #6b7280;
  cursor: default;
}

.ace_searchbtn:last-child {
  border-right: 1px solid var(--ace-border, #3a3f4b);
  border-radius: 0 6px 6px 0;
}

/* prev/next arrows */
.ace_searchbtn.prev, .ace_searchbtn.next { padding: 0 .7em; }
.ace_searchbtn.prev:after, .ace_searchbtn.next:after {
  content: "";
  width: .55em; height: .55em;
  display: inline-block;
  border: solid 2px currentColor;
  border-width: 2px 0 0 2px;
  transform: rotate(-45deg);
  margin-left: .2em;
}
.ace_searchbtn.next:after { border-width: 0 2px 2px 0; }

.ace_searchbtn_close {
  position: absolute; top: 8px; right: 8px;
  width: 20px; height: 20px; border-radius: 50%;
  background: transparent; border: 1px solid var(--ace-border, #3a3f4b);
  color: var(--ace-fg, #abb2bf); cursor: pointer;
}
.ace_searchbtn_close::before {
  content: "✕";
  display: block; text-align: center; line-height: 18px; font-size: 12px;
}
.ace_searchbtn_close:hover { background: #303641; }

/* toggle buttons (regex, case, word, ... ) */
.ace_button {
  margin-left: 4px;
  padding: 2px 6px;
  cursor: pointer; user-select: none;
  color: var(--ace-fg, #abb2bf);
  background: #232830;
  border: 1px solid var(--ace-border, #3a3f4b);
  border-radius: 6px;
  opacity: .9;
}
.ace_button:hover  { background: #2a3038; opacity: 1; }
.ace_button:active { background: #242a31; }
.ace_button.checked {
  border-color: var(--ace-blue, #61afef);
  box-shadow: 0 0 0 2px rgba(97,175,239,.25) inset;
  opacity: 1;
}

.ace_search_options {
  margin: 4px 0 2px;
  text-align: right;
  user-select: none;
  clear: both;
}
.ace_search_counter {
  float: left;
  font-family: ui-sans-serif, system-ui, "Segoe UI", Arial, sans-serif;
  color: #9aa3b2;
  padding: 0 8px;
}


/* --- Inline error widget (clean borders, theme colors) --- */
.error_widget_wrapper {
  background: inherit;
  color: inherit;
  border: none;
}

.error_widget {
  margin: 8px 0;
  padding: 10px 14px 10px 40px; /* nechá miesto pre „šípku“ */
  white-space: pre-wrap;
  border-top: 2px solid;
  border-bottom: 2px solid;
  border-radius: 6px;
  background: rgba(0,0,0,.12);
}

/* color variants */
.error_widget.ace_error,
.error_widget_arrow.ace_error {
  border-color: var(--ace-red, #e06c75);
  background: rgba(224,108,117,.12);
}
.error_widget.ace_warning,
.error_widget_arrow.ace_warning {
  border-color: var(--ace-yellow, #e5c07b);
  background: rgba(229,192,123,.10);
}
.error_widget.ace_info,
.error_widget_arrow.ace_info {
  border-color: var(--ace-blue, #61afef);
  background: rgba(97,175,239,.10);
}
.error_widget.ace_ok,
.error_widget_arrow.ace_ok {
  border-color: var(--ace-green, #98c379);
  background: rgba(152,195,121,.10);
}

/* little arrow indicator */
.error_widget_arrow {
  position: absolute;
  top: -5px;
  border: solid 6px;
  border-top-color: transparent !important;
  border-right-color: transparent !important;
  border-left-color: transparent !important;
  /* bottom border zoberie farbu z variantu (.ace_error/.ace_warning/...) */
}
