﻿/* ========================================================================
   ACE EDITOR – THEME-INTEGRATION FÜR WISO (LIGHT / DARK / CONTRAST)
   Gesteuert über:
   :root[data-wiso-theme="dark"]
   :root[data-wiso-theme="contrast-dark"]
   :root[data-wiso-theme="light"]
   :root[data-wiso-theme="contrast-light"]
   ======================================================================== */


/* **********************************************************************
   🌑 DARK / CONTRAST-DARK
   ********************************************************************** */

:root[data-wiso-theme="dark"] .ace_editor,
:root[data-wiso-theme="contrast-dark"] .ace_editor {
    background-color: #2d3039 !important;
    color: #ffffff !important;
}

/* Editor Content*/
:root[data-wiso-theme="dark"] .ace_content,
:root[data-wiso-theme="contrast-dark"] .ace_content {
    background: #2d3039 !important;
}
 
/* Text */
:root[data-wiso-theme="dark"] .ace_text-layer,
:root[data-wiso-theme="dark"] .ace_line,
:root[data-wiso-theme="dark"] .ace_token,
:root[data-wiso-theme="contrast-dark"] .ace_text-layer,
:root[data-wiso-theme="contrast-dark"] .ace_line,
:root[data-wiso-theme="contrast-dark"] .ace_token {
    color: #ffffff !important;
}

/* Gutter (Zeilennummern) */
:root[data-wiso-theme="dark"] .ace_gutter,
:root[data-wiso-theme="contrast-dark"] .ace_gutter {
    background-color: #000000 !important;
    color: #ffffff !important;
    border-right: 1px solid #3f4350;
}

/* Gutter Folding Layer */
:root[data-wiso-theme="dark"] .ace_layer.ace_gutter-layer,
:root[data-wiso-theme="contrast-dark"] .ace_layer.ace_gutter-layer {
    background: #3f4350 !important;
}

/* Aktive Zeile im Gutter */
:root[data-wiso-theme="dark"] .ace_gutter-active-line,
:root[data-wiso-theme="contrast-dark"] .ace_gutter-active-line {
    background: #F49519 !important;
    color: #ffffff !important;
}

/* Aktive Zeile im Editor */
:root[data-wiso-theme="dark"] .ace_marker-layer .ace_active-line,
:root[data-wiso-theme="contrast-dark"] .ace_marker-layer .ace_active-line {
    background: #0b4f9e !important;
}

/* Selection */
:root[data-wiso-theme="dark"] .ace_marker-layer .ace_selection,
:root[data-wiso-theme="contrast-dark"] .ace_marker-layer .ace_selection {
    background: #F49519 !important;
}

    :root[data-wiso-theme="dark"] .ace_marker-layer .ace_selection .ace_line,
    :root[data-wiso-theme="contrast-dark"] .ace_marker-layer .ace_selection .ace_line {
        color: #000000 !important;
    }

/* Cursor */
:root[data-wiso-theme="dark"] .ace_cursor,
:root[data-wiso-theme="contrast-dark"] .ace_cursor {
    color: #ffffff !important;
    background: rgba(244, 149, 25,0.2) !important;
}

/* Toolbar über dem Editor */
:root[data-wiso-theme="dark"] .ace_editor--toolbar,
:root[data-wiso-theme="contrast-dark"] .ace_editor--toolbar {
    background: #000000 !important;
    text-decoration-color: #41A7E1 !important;
}



/* **********************************************************************
   🌕 LIGHT / CONTRAST-LIGHT
   ********************************************************************** */

:root[data-wiso-theme="light"] .ace_editor,
:root[data-wiso-theme="contrast-light"] .ace_editor {
    background-color: #ffffff !important;
    color: #000000 !important;
}

/* Editor Content */
:root[data-wiso-theme="light"] .ace_content,
:root[data-wiso-theme="contrast-light"] .ace_content {
    background: #ffffff !important;
}

/* Text */
:root[data-wiso-theme="light"] .ace_text-layer,
:root[data-wiso-theme="light"] .ace_line,
:root[data-wiso-theme="light"] .ace_token,
:root[data-wiso-theme="contrast-light"] .ace_text-layer,
:root[data-wiso-theme="contrast-light"] .ace_line,
:root[data-wiso-theme="contrast-light"] .ace_token {
    color: #000000 !important;
}

/* Gutter */
:root[data-wiso-theme="light"] .ace_gutter,
:root[data-wiso-theme="contrast-light"] .ace_gutter {
    background-color: #f0f0f0 !important;
    color: #000000 !important;
    border-right: 1px solid #c0c0c0;
}

/* Aktive Zeile */
:root[data-wiso-theme="light"] .ace_marker-layer .ace_active-line,
:root[data-wiso-theme="contrast-light"] .ace_marker-layer .ace_active-line {
    background: #41A7E1 !important;
}

/* Selection */
:root[data-wiso-theme="light"] .ace_marker-layer .ace_selection,
:root[data-wiso-theme="contrast-light"] .ace_marker-layer .ace_selection {
    background: rgba(65, 167, 225, 0.35) !important;
}

/* Cursor */
:root[data-wiso-theme="light"] .ace_cursor,
:root[data-wiso-theme="contrast-light"] .ace_cursor {
    color: #000000 !important;
}

/* Toolbar */
:root[data-wiso-theme="light"] .ace_editor--toolbar,
:root[data-wiso-theme="contrast-light"] .ace_editor--toolbar {
    background: #f0f0f0 !important;
    text-decoration-color: #0b4f9e !important;
}

html[data-wiso-theme="dark"]
.ace_marker-layer .ace_selected-word.ace_active-word {
    background: rgba(255, 220, 120, 0.55) !important;
    box-shadow: 0 0 0 1px rgba(255, 200, 100, 0.6);
}

/* Aktueller Treffer */
html[data-wiso-theme="dark"] .ace_marker-layer .ace_active-line {
    background: rgba(255, 210, 120, 0.25) !important;
}

/* Mehrfach-Selektion (findAll) */
html[data-wiso-theme="dark"] .ace_marker-layer .ace_selection {
    background:  rgba(255, 210, 120, 0.25) !important;
}
html[data-wiso-theme="light"] .ace_marker-layer .ace_selected-word {
    background: rgba(255, 200, 0, 0.45) !important;
    border-radius: 3px;
}

html[data-wiso-theme="light"] .ace_marker-layer .ace_active-line {
    background: rgba(255, 230, 150, 0.35) !important;
}

html[data-wiso-theme="light"] .ace_marker-layer .ace_selection {
    background: rgba(255, 180, 0, 0.55) !important;
}
.ace_marker-layer .ace_selected-word.ace_active-word {
    background: red !important;
    box-shadow: 0 0 0 1px rgba(255, 200, 100, 0.6);
}
.ace-chrome .ace_marker-layer .ace_selected-word {
    background: rgba(244, 149, 25, 0.55);
    border: 1px solid rgb(244, 149, 25);
}

/* Der Container, in dem ACE steckt, muss echte Höhe bekommen */
.w6_ace_viewport {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden; /* Parent clippt, scroller scrollt */
}

    /* ACE füllt den Container */
    .w6_ace_viewport .ace_editor,
    .w6_ace_viewport .ace_scroller {
        width: 100% !important;
        height: 100% !important;
    }

    /* Scrollen NUR im Scroller */
    .w6_ace_viewport .ace_scroller {
        overflow: auto !important;
    }

    /* WICHTIG: ace_content NICHT anfassen 
    .w6_ace_viewport .ace_content {
        width: auto !important;
        height: auto !important;
    }
/* ============================================================
   W6 / WISO: Editor-Cell darf NICHT scrollen – ACE übernimmt.
   ============================================================ 
.wiso_layout-cell[data-cell-id="editor"],
.wiso_layout-cell[data-cell-id="editor"] > .wiso_layout-cell-content,
.wiso_layout-cell[data-cell-id="editor"] > .wiso_layout-cell-content > .wiso_layout-cell-inner_html {
    overflow: hidden !important;
    height: 100% !important;
    min-height: 0 !important;
}
*/
/* 1) Editor-Cell darf NICHT scrollen */
.wiso_layout-cell[data-cell-id="editor"],
.wiso_layout-cell[data-cell-id="editor"] > .wiso_layout-cell-content,
.wiso_layout-cell[data-cell-id="editor"] > .wiso_layout-cell-content > .wiso_layout-cell-inner_html {
    overflow: hidden !important;
    height: 100% !important;
    min-height: 0 !important;
}

/* 2) Mount-Container füllt den Bereich */
.w6_ace_viewport {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

    /* 3) ACE selbst füllt den Mount */
    .w6_ace_viewport .ace_editor {
        position: absolute !important;
        inset: 0 !important;
        width: 100% !important;
        height: 100% !important;
    }

    /* 4) Lass ACE-Scroller/Content in Ruhe (kein overflow/height/width) */
    .w6_ace_viewport .ace_scroller { /* kein overflow:auto/hidden erzwingen */
    }

    .w6_ace_viewport .ace_content { /* NICHTS! */
    }

/* Spacer killen: darf NIE Einfluss auf Layout-Scroll haben */
.w6_ace_scroll_spacer {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}
/* ============================================================
   ACE Scrollbars – DARK
   ============================================================ */

:root[data-wiso-theme="dark"] .ace_scrollbar-v,
:root[data-wiso-theme="dark"] .ace_scrollbar-h,
:root[data-wiso-theme="contrast-dark"] .ace_scrollbar-v,
:root[data-wiso-theme="contrast-dark"] .ace_scrollbar-h {
    background: rgba(255,255,255,0.00) !important; /* Track */
}

/* Thumb */
:root[data-wiso-theme="dark"] .ace_scrollbar-inner,
:root[data-wiso-theme="contrast-dark"] .ace_scrollbar-inner {
    /*background: rgba(244,149,25,0.55) !important;*/
    border-radius: 8px !important;
    transition: background 0.15s ease, transform 0.1s ease;
}

    /* Hover */
    : root[data-wiso-theme="dark"] .ace_scrollbar-inner:hover, :root[data-wiso-theme="contrast-dark"] .ace_scrollbar-inner:hover {
        background: rgba(244,149,25,0.8) !important;
    }

    /* Active (dragging) */
    :root[data-wiso-theme="dark"] .ace_scrollbar-inner:active,
    :root[data-wiso-theme="contrast-dark"] .ace_scrollbar-inner:active {
        background: #F49519 !important;
    }

:root[data-wiso-theme="dark"] .ace_scrollbar-inner {
    box-shadow: 0 0 0 1px rgba(255,255,255,0.08);
}