/* ECT based browser (Views/Ontology/Ect.cshtml) */

/* the page itself never scrolls; ECT has its own scrolling panes (avoids double scrollbars) */
html, body {
    overflow: hidden;
    height: 100%;
}

#ectpage {
    margin: 0 8px;
}

/* z-index order (ECT uses very high values: sticky header 100001, search results 100002, tooltips 100003):
     corner icons 100002 < visualization pop-up 100004 < header search 100006 < upper menu 100007 < this app's dialogs 100010 */

/* upper menu (fancydropdown: #menu is absolute with z-index:5): its dropdowns go over all parts of ECT */
#menu {
    z-index: 100007;
}

/* this app's jQuery UI dialogs (help, change history, notification domains) above everything of ECT.
   jQuery UI 1.10 stacks dialogs with the .ui-front class (z-index:100), modal overlay right below the dialog */
.ui-widget-overlay.ui-front {
    z-index: 100009;
}

.ui-dialog.ui-front,
.ui-front {
    z-index: 100010;
}

/* right (details) side starts a bit lower so that the corner icons do not overlap the entity title.
   A transparent border is outside the scrollport, so the scrollbar and sticky headers start below it too */
.ctw-eb-window .browserBodyRight {
    box-sizing: border-box;
    border-top: 42px solid transparent; /* room for the icons (notification icon is 36px) */
}

/* ---- header: same look as the classic browser (#headerleft in _HierarchyBrowserWithContent) ----
   _Layout uses #headerleftWOSearch which has a bigger title. This file is only loaded by the ECT page */
#headerleftWOSearch {
    margin-left: 10px;
    padding: 10px 10px 0 10px;
    overflow: hidden;
    font-family: "Helvetica Neue", "Lucida Grande", "Segoe UI", Arial, Helvetica, Verdana, sans-serif;
}

    #headerleftWOSearch h1 {
        padding: 5px 0;
        font-size: 24px !important;
        display: inline;
    }

    #headerleftWOSearch.header-rtl h1 {
        padding: 5px 0;
    }

/* ---- ECT search box placed in the header bar, below the title (as the classic browser's search) ----
   same approach as the sample ECT based browser (BrowserBasedOnICDAPI/wwwroot/css/browser.css) */
.ctw-eb-window .embeddedBrowserSearch {
    z-index: 100006; /* search results stay above the visualization pop-up */
    position: fixed;
    top: 46px;
    left: 0;
    font-size: 14px !important;
    line-height: 20px !important;
}

#ectpage.rtl .ctw-eb-window .embeddedBrowserSearch {
    left: auto;
    right: 20px;
}

.ctw-eb-window .embeddedBrowserSearchbox {
    width: 25vw !important;
    min-width: 300px;
    box-sizing: border-box;
    font-size: 14px !important;
    font-weight: 400 !important;
    height: 28px !important;
    line-height: 20px !important;
    margin: 0 0 0 20px !important;
}

#ectpage.rtl .ctw-eb-window .popupMode .popupModeResults {
    right: 0 !important;
}

.ctw-eb-window .popupModeResults {
    width: 42vw;
}

.ctw-eb-window .tooltipContentKeyboard {
    width: 30vw;
}

/* ---- undo classic browser styles (search.css) that collide with ECT class names ----
   ECT uses margin-left:-40px on ul.toplevel expecting the default 40px list padding,
   search.css sets ul.toplevel { padding-left:10px } which cuts the left side of the search results */
.ctw-eb-window ul.toplevel {
    padding-left: 40px;
}

.ctw-eb-window .pvs {
    padding-left: 0;
    text-indent: 0;
}

/* the search box no longer takes space at the top of the hierarchy */
.ctw-eb-window .browserBodyLeft {
    padding-top: 6px !important; /* the toggle visualizations icon sits at the right of the first line */
    box-sizing: border-box; /* keep the padding within ECT's height, otherwise the pane overflows by 15px */
}

/* ---- icons above the title of ECT's right side, right aligned: iCat, notifications, ICD-10, (classic browser) ----
   above ECT (incl. its sticky header), below the visualization pop-up */
.ect-corner {
    position: absolute;
    top: 4px;
    left: 0; /* horizontal position: left of ECT's right side, set by ect_browser.js (positionCorner) */
    visibility: hidden; /* until positioned */
    z-index: 100002;
    display: flex;
    align-items: center;
    gap: 3px;
    justify-content: flex-end; /* right (left in rtl); only change history stays at the start */
    white-space: nowrap;
}

    /* the entity items (loaded per entity) and the page's own buttons are ordered together */
    .ect-corner #ectcornerentity {
        display: contents;
    }

    /* order: (change history) | iCat, notifications, ICD-10, classic browser */
    .ect-corner [data-ect-action="history"] { order: 0; margin-inline-end: auto; }
    .ect-corner .ect-icat { order: 1; }
    .ect-corner .conceptcommentbutton { order: 2; }
    .ect-corner .ectbar-icd10 { order: 3; margin-inline-start: 6px; }
    .ect-corner #ectClassicBrowserLink { order: 4; margin-inline-start: 6px; }

    .ect-corner .orangetextbutton {
        display: inline-block;
        padding: 2px 6px;
    }

        .ect-corner .orangetextbutton img {
            height: 14px;
            vertical-align: middle;
            margin-right: 4px;
        }

        .ect-corner .orangetextbutton.selected {
            background-color: #a84a17;
        }

/* ---- top right of the hierarchy: availability in linearizations, toggle visualizations (positioned by ect_browser.js) ---- */
.ect-hierarchytools .ect-iconbutton.loading {
    cursor: progress;
    opacity: 0.5;
}

.ect-hierarchytools {
    position: absolute;
    top: 3px;
    visibility: hidden; /* until positioned */
    z-index: 100002;
    display: flex;
    gap: 3px;
}

    /* icon only buttons (iCat, toggle visualizations) */
    .ect-corner .ect-iconbutton,
    .ect-hierarchytools .ect-iconbutton {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 26px;
        height: 26px;
        border: 1px solid transparent;
        border-radius: 3px;
        cursor: pointer;
    }

        .ect-corner .ect-iconbutton:hover,
        .ect-hierarchytools .ect-iconbutton:hover {
            border-color: #ccc;
            background-color: #f4f4f4;
        }

        .ect-corner .ect-iconbutton.selected,
        .ect-hierarchytools .ect-iconbutton.selected {
            border-color: #DF7030;
            background-color: #fbe3d4;
        }

        .ect-corner .ect-iconbutton img,
        .ect-hierarchytools .ect-iconbutton img {
            width: 20px;
            height: 20px;
        }

    /* iCat: same size as the notification domains icon (40x36), with a similar soft shadow */
    .ect-corner .ect-iconbutton.ect-icat {
        width: 40px;
        height: 36px;
        border: none;
    }

        .ect-corner .ect-iconbutton.ect-icat:hover {
            background-color: transparent;
        }

        .ect-corner .ect-iconbutton.ect-icat img {
            width: 30px;
            height: 30px;
            filter: drop-shadow(2px 2px 2px rgba(0, 0, 0, 0.35));
        }

        .ect-corner .ect-iconbutton.ect-icat:hover img {
            filter: drop-shadow(2px 2px 3px rgba(0, 0, 0, 0.5));
        }

    /* notification domains icon: original size (40x36) as in the classic browser */
    .ect-corner .conceptcommentbutton {
        cursor: pointer;
    }

    .ect-corner .icd10code {
        display: inline-block;
        float: none;
        margin: 0;
    }

    .ect-corner .ectbar-notfound {
        font-size: 0.8em;
        color: #a00;
        background-color: white;
    }

/* ---- ECT + visualization pop-up ---- */
.ect-wrapper {
    position: relative;
    overflow: clip; /* height is set by ect_browser.js; clip (unlike hidden) cannot be scrolled by scrollIntoView */
}

/* above all of ECT and the corner icons (see the z-index order at the top) */
.ect-visualization {
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 100004;
    background-color: white;
    border: 1px solid #ccc;
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

    .ect-visualization #mainvisualizationdiv {
        height: 100%;
        display: flex;
        flex-direction: column;
    }

    .ect-visualization .visicons {
        flex: 0 0 auto;
        padding: 4px;
    }

    .ect-visualization #visualization {
        flex: 1 1 auto;
        overflow: hidden;
    }
