@import url("/static/base.css");

:root {
    /* Light theme colors */
    --background-color: #f0f0f0;
    --background-color-dim: #e0e0e0;
    --text-color: #080808;
    --node-stroke-color: #080808;
    --node-fill-color: royalblue;
    --node-selected-fill-color: #00aaff;
    --node-text-color: white;

    --edge-stroke-color: #080808;
    --note-background-color: burlywood;
    --note-text-color: white;
    --connector-stroke-color: #080808;
    --note-overlay-opacity: 0.85;
    --note-info-color: green;
    --note-warning-color: orange;
    --note-error-color: red;
    --svg-background-color: #f0f0f0;

    --widget-height: 24px;
    --widget-width: 60px;

    --titlebar-color: rgb(100, 100, 100);

    --ui-button-text-color: white;
    --ui-button-background-color: rgba(147, 147, 147, 0.5);

    --directory-entry-background-color: #f0f0f0;
    --directory-entry-selected-background-color: #96dcff;
}

.dark-mode {
    /* Dark theme colors */
    --background-color: #181818;
    --background-color-dim: #282828;
    --text-color: #f0f0f0;
    --node-stroke-color: #f0f0f0;
    --node-fill-color: #0055a4; /* Darker shade of royalblue */
    --node-selected-fill-color: #0033a4;
    --node-text-color: white;
    --edge-stroke-color: #f0f0f0;
    --note-background-color: #333;
    --note-text-color: #f0f0f0;
    --connector-stroke-color: #f0f0f0;
    --note-overlay-opacity: 0.95;
    --note-info-color: lightgreen;
    --note-warning-color: yellow;
    --note-error-color: pink;
    --svg-background-color: #282c34;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
#header {
    background-color: var(--titlebar-color);
    color: white;
    padding: 5px;
    text-shadow:
        #000 0px 0px 2px,
        #000 0px 0px 2px,
        #000 0px 0px 2px,
        #000 0px 0px 2px,
        #000 0px 0px 2px,
        #000 0px 0px 2px;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    overflow: hidden;
}

body,
html,
#graph_container {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
}

.navbar {
    display: flex;
    justify-content: space-between;
    background-color: var(--titlebar-color);
    color: white;
    text-shadow:
        #000 0px 0px 2px,
        #000 0px 0px 2px,
        #000 0px 0px 2px,
        #000 0px 0px 2px,
        #000 0px 0px 2px,
        #000 0px 0px 2px;

    padding: 5px;

    container-type: inline-size;
}

.logo {
    margin: 0;
}

@container (max-width: 500px) {
    .logo .label {
        display: none;
    }
}

ul li {
    margin-left: 1em;
    list-style: none;
    padding-bottom: 0.5em;
}
ol li {
    margin-left: 1em;
    padding-bottom: 0.5em;
}
h1 {
    margin-top: 0.5em;
}

.menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    overflow-x: scroll;
}

.menu li {
    position: relative;
    padding: 10px;
    cursor: pointer;
    text-align: center;
}
.menu .icon {
    margin-right: 0.5em;
}
/*.menu a {
    color: white;
    text-decoration: none;
  }*/

/* Hover effects and dropdowns */
.menu li:hover {
    background-color: #555;
}

.dropdown {
    display: none;
    position: absolute;
    background-color: #333;
    box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.menu li:hover .dropdown {
    display: block;
}
.menu li a {
    text-decoration: none;
    color: white;
    display: flex;
    flex-direction: row;
    height: 100%;
}
.menu li a * {
    align-content: center;
}

.dropdown li {
    clear: both;
    width: 100px;
}

.dropdown a {
    display: block;
    padding: 10px;
}

#left_header {
    position: absolute;

    margin: 0.5em;
}
#left_header button,
.svgbutton {
    margin: 0.5em;
    padding: 0.5em;
    border-radius: 5px;
    background-color: var(--background-color);
    color: var(--text-color);
    border: 1px solid var(--text-color);
    cursor: pointer;
}
#left_header button:hover,
.svgbutton:hover {
    background-color: var(--background-color-dim);
    border: 2px solid var(--text-color);
}
.node-types-list {
    background-color: var(--background-color);
    color: var(--text-color);
    overflow-y: auto;
}
.node-types-list .node_type_definition {
    margin: 0.5em;
    padding: 0.5em;
    border-radius: 5px;
    background-color: var(--node-fill-color);
    color: var(--node-text-color);
    border: 1px solid var(--text-color);
    cursor: copy;
    text-shadow:
        1px 1px 0 #000,
        1px 1px 0 #000,
        1px 1px 0 #000,
        1px 1px 0 #000;
}
.node_info_panel.docked {
    /*position: absolute;
    min-height: 400px;
    width: 300px;
    margin: 1em;
    padding: 1em;
    border-radius: 5px;
    box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
    top: 1em;
    right: 1em;*/
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    background-color: var(--background-color);
    color: var(--text-color);
    flex: 1 1 auto;
}
.node_info_panel ul {
    list-style-type: none;
    padding: 0;
}
/*.node_info_panel .group {
    border-radius: 1px;
    border: 1px solid var(--text-color);
}*/
.node_info_panel > div {
    overflow-y: auto;
    height: 100%;
}
/*svg {
    display: block;
    width: 100%;
    height: 100%;
    background-color: var(--svg-background-color);
}*/
rect.node {
    fill: var(--node-fill-color);
    stroke: var(--node-stroke-color);
    stroke-width: 2;
}
.edge {
    stroke: var(--edge-stroke-color);
    fill: none;
    stroke-width: 4;
}
.edge.connected:hover {
    stroke: var(--edge-stroke-color);
    stroke-width: 10;
}
.edge.not_connected {
    pointer-events: none;
    filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));
}
.connector {
    stroke: var(--connector-stroke-color);
    stroke-width: 2;
}
.connector:hover {
    stroke: var(--connector-stroke-color);
    stroke-width: 4;
    cursor: copy;
}
/*.selectable {
    stroke: var(--connector-stroke-color);
    stroke-width: 5;
}
.selectable:hover {
    stroke: var(--connector-stroke-color);
    stroke-width: 6;
    cursor: copy;
}*/
.node {
    stroke: var(--node-stroke-color);
    stroke-width: 2;
}
.node.selectable:hover {
    stroke: var(--node-stroke-color);
    stroke-width: 5;
    cursor: grab;
}
rect.selected {
    fill: var(--node-selected-fill-color);
}
svg.dragging {
    cursor: move;
}
svg.drop_edge {
    cursor: grabbing;
}
.node.dragging {
    cursor: grabbing;
    filter: drop-shadow(5px 7px 4px rgb(0 0 0 / 0.8));
}
.node.dragging.selectable:hover {
    cursor: grabbing;
}
.filedrop {
    fill: rgba(1, 1, 1, 0.5);
    stroke: #cccccc;
    stroke-width: 4;
    stroke-dasharray: 9, 5;
}
.filedrop:hover {
    cursor: copy;
}

.shadow {
    filter: drop-shadow(5px 5px 5px rgba(0, 0, 0, 0.5));
}

.note {
    fill: var(--note-background-color);
    /*text-shadow:
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 2px 0 #000,
        2px 2px 0 #000;*/
}
.note.overlay {
    fill: #000;
    fill-opacity: var(--note-overlay-opacity);
    filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));
}
.note .info {
    fill: var(--note-info-color);
}
.note .warning {
    fill: var(--note-warning-color);
}
.note .error {
    fill: var(--note-error-color);
}
svg text {
    pointer-events: none;
    fill: var(--note-text-color);
    text-shadow:
        #000 0px 0px 2px,
        #000 0px 0px 2px,
        #000 0px 0px 2px,
        #000 0px 0px 2px,
        #000 0px 0px 2px,
        #000 0px 0px 2px;
}
svg foreignObject {
    pointer-events: none;
    color: var(--note-text-color);
    text-shadow:
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000;
}

#full {
    display: flex;
    flex-direction: column;
    height: 100%;

    container-type: inline-size;
}

#main {
    background-color: var(--titlebar-color);
    flex-grow: 1;
    height: 100%;
    /*overflow: hidden;*/
    /* padding on left, bottom, and right, but 0 on top */
    padding: 0 0.5em 0.5em 0.5em;
}
.svg-container {
    background-color: var(--background-color);
    border-radius: 15px;
    box-shadow: inset 0px 0px 10px rgba(0, 0, 0, 1);
    overflow: hidden;
}

.tab-headers {
    overflow: hidden;
    background: #f1f1f1;
}

.tab-link {
    background-color: inherit;
    float: left;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 14px 16px;
    transition: 0.3s;
    font-size: 17px;
}

.tab-link:hover {
    background-color: #ddd;
}

.tab-link.active {
    background-color: #ccc;
}

.tab-content {
    /*display: block;
    padding: 6px 12px;
    border-top: none;*/
    border-top: 1px solid #ccc;
}

.layout-engine {
    height: 100%;
}
.close-button {
    background-color: rgba(0, 0, 0, 0);
    color: white;
    border: 0;

    pointer-events: all;
    padding: 5px;
    cursor: pointer;
    margin-left: auto;
    margin-right: 1px;
    /*outline the text */
    text-shadow:
        1px 1px 0 #000,
        1px 1px 0 #000,
        1px 1px 0 #000,
        1px 1px 0 #000;
}
.close-button:hover {
    background-color: rgba(0, 0, 0, 0.5);
    /*color: var(--text-color);
    text-shadow: 0;*/
}

.portaled {
    position: absolute;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.noevents {
    pointer-events: none;
}
.dockable-container {
    /*border: 1px solid var(--text-color);*/
    /*width: 100%;
    height: 100%;*/

    justify-content: center;

    height: 100%;
    display: flex;
    flex-direction: column;

    position: relative;
}
/*.dockable-container.new {
    animation: fadeInZoom 0.3s forwards;
  }*/
.dockable-container.orient-vertical {
    display: flex;
    flex-direction: column;
}
.dockable-container.orient-horizontal {
    display: flex;
    flex-direction: row;
}
.dockable-container-titlebar {
    background-color: rgba(0, 0, 0, 0); /*var(--titlebar-color);*/
    color: white;
    min-height: 30px;
    width: 100%;
    /*border-bottom: 1px solid var(--text-color);*/
    z-index: 10;
    overflow-x: auto;
    /*
    overflow-y: hidden;
    height: 30px;
    */
    display: flex;
    flex-direction: row;
}
.dockable-container-titlebar.highlight-dropzone {
    /*background-color: rgb(0, 100, 100);*/
    background-color: rgba(0, 0, 0, 0.75);
    border: 1px dashed var(--text-color);
}
/*.dockable-container-titlebar.highlight-dropzone > .dockable-container-title:last-child {
    width: 150px;
  }*/
.dockable-container-title {
    min-width: 80px;
    max-width: 200px;
    flex: 1 1 auto;
    cursor: pointer;

    /*padding-left: 5px;
    padding-right: 5px;*/
}
.dockable-container-title > .tab {
    text-shadow:
        #222 0px 0px 2px,
        #222 0px 0px 2px,
        #222 0px 0px 2px,
        #222 0px 0px 2px,
        #222 0px 0px 2px,
        #222 0px 0px 2px;

    /* display:flex breaks the box-shadow */
    /*box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.5);*/
    pointer-events: none;

    font-size: 20px;
    font-weight: bold;
    line-height: 30px;
    /*background-color: rgb(200,200,200);*/
    /*background-color: rgb(120, 120, 120);*/
    background: linear-gradient(
        0,
        rgb(100, 100, 100) 0%,
        rgb(90, 90, 90) 95%,
        rgb(100, 100, 100) 100%
    );

    /*color: var(--text-color);*/
    text-align: center;
    /*border-radius: 15px 15px 0px 0px;*/
    border: 1px solid var(--text-color);
    /*border-top: 1px solid var(--text-color);
    border-left: 1px solid var(--text-color);
    border-right: 1px solid var(--text-color);*/
    margin: 0;
    width: 100%;
    height: 100%;
    display: flex; /* This enables flexbox layout within the container */
    justify-content: space-between; /* This separates the title and the button */
    align-items: center; /* This vertically centers the items in case they have different heights */
}
.dockable-container-title.highlight-dropzone > .tab {
    margin-left: 50px;
    width: 150px;
    border-bottom: 1px solid var(--text-color);
}
.dockable-container-title > .tab > .title-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-left: 5px;
    max-width: 80%;
    pointer-events: none;
}
.dockable-container-title.active > .tab {
    background: linear-gradient(
        0,
        rgb(147, 147, 147) 0%,
        rgb(120, 120, 120) 95%,
        rgb(147, 147, 147) 100%
    );
    border-bottom: none;
}
.dockable-container-title:hover > .tab {
    background-color: rgb(200, 200, 200);
}
.dockable-container-content.with-titlebar {
    border: 1px solid var(--text-color);
    /*border-left: 1px solid var(--text-color);
    border-right: 1px solid var(--text-color);
    border-bottom: 1px solid var(--text-color);*/
    padding: 5px;
    margin-top: -1px;
}
.container-child {
    flex: 1 1 auto;
}
.dockable-container-content {
    background-color: rgb(147, 147, 147);
    /*min-height: 300px;*/
    width: 100%;

    display: flex;
    flex-direction: column;
    height: 100%;
    /*overflow-y: auto;*/
}
/*.dockable-container-content > div {

    flex-grow: 1;


    height: 100%;
    margin: 5px;
    display: flex;
    flex-direction: column;
    height: 100%;
  }*/
.dockable-container-content svg {
    flex-grow: 1;
    height: 100%;
}
.resize-handle {
    z-index: 10;
}
.orient-vertical > .resize-handle {
    /*background: linear-gradient(0, rgb(147, 147, 147) 0%, rgb(120, 120, 120) 65%, rgb(147,147,147) 100%);*/
    background-color: var(--titlebar-color);
    width: 100%;
    height: 5px;
    min-height: 5px;
    cursor: ns-resize;
}
.orient-horizontal > .resize-handle {
    /*background: linear-gradient(90deg, rgb(147, 147, 147) 0%, rgb(120, 120, 120) 65%, rgb(147,147,147) 100%);*/
    background-color: var(--titlebar-color);
    width: 5px;
    min-width: 5px;
    height: 100%;
    cursor: ew-resize;
}
.resize-handle:hover {
    background-color: rgb(200, 200, 200);
    box-shadow: inset 0px 0px 10px rgba(0, 0, 0, 1);
}

.content-area-inner {
    position: relative;
    /*height: 100%;
    width: 100%;*/
    flex-grow: 1;
    overflow: auto;
    flex-basis: 0;
    display: flex;
    flex-direction: column;
}
.content-area-outer {
    position: relative;
    min-height: 0;
    /*height: 100%;
    width: 100%;*/
    flex-grow: 1;
    flex-basis: 0;
}
.snap-target {
    position: absolute;
    background-color: rgba(0, 0, 0, 0);

    z-index: 1000;
}
.snap-target:hover,
.snap-target.hovering {
    background-color: rgba(0, 0, 0, 0.5);
    /*border: 1px solid rgba(0, 0, 0, 0.5);*/
    border: 1px dashed var(--text-color);
    /* when hovering, the snap-target should be above the other elements */
}
.snap-target.drop-left {
    left: 0;
    top: 0%;
    width: 25%;
    height: 100%;
}
.snap-target.drop-right {
    right: 0;
    top: 0%;
    width: 25%;
    height: 100%;
}
.snap-target.drop-top {
    top: 0;
    left: 25%;
    width: 50%;
    height: 45%;
}
.snap-target.drop-bottom {
    bottom: 0;
    left: 25%;
    width: 50%;
    height: 45%;
}
.orphan {
    display: none;
}

.button-bar {
    background-color: rgb(147, 147, 147);
    /*min-height: 300px;*/
    width: 100%;
    /*min-height: 30px;
    flex-basis: 0;*/
    display: flex;
    flex-direction: row;
    overflow-x: auto;

    /*padding-bottom: 5px;*/
    /*min-height: 35px;
    margin-bottom: 5px;*/
    padding: 0.5em;

    flex-shrink: 0;
}
.button-bar.vertical {
    flex-direction: column;
}
.button-bar > button {
    background-color: var(--ui-button-background-color);

    text-shadow: 1px 1px 2px black;
    color: var(--ui-button-text-color);
    border: 0px solid var(--text-color);
    cursor: pointer;
    padding: 0.5em;
    /*border-radius: 5px;*/

    box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.5);
    margin: 1px;
    flex: 0 0 auto;
    font-weight: bold;
}
.button-bar.vertical > button {
    margin: 1em;
    padding: 1em;
}
.button-bar > button:enabled:hover {
    /*background-color: var(--titlebar-color);*/
    /* background: linear-gradient(
        0,
        rgb(147, 147, 147) 0%,
        rgb(120, 120, 120) 5%,
        rgb(147, 147, 147) 100%
    ); */
    background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.3));
}
.button-bar > button:enabled:active {
    background: none;
    background-color: var(--titlebar-color);
}
button:disabled {
    background-color: rgba(147, 147, 147, 0.5);
    color: rgba(255, 255, 255, 0.5);
    cursor: not-allowed;
}
.button-bar .separator {
    width: 1px;
    background-color: var(--text-color);
    margin: 0.5em;
}
.button-bar .spacer {
    flex: 1 1 auto;
}
button div {
    position: relative;
}
button.toggled {
    background-color: var(--titlebar-color);
}
.tooltip {
    visibility: hidden;
    width: 130px;
    background-color: rgba(0, 0, 0, 0.95);
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;

    position: absolute;
    z-index: 100;

    bottom: 100%;
    margin-left: -65px;
}
.tooltip-container {
    position: absolute;
    top: 0;
}
.tooltip-container .tooltip {
    margin-left: 0;
    left: 0;
}
button:hover .tooltip,
.dockable-container-title:hover .tooltip {
    visibility: visible;
    transition-delay: 0.5s;
}
.tooltip::after {
    content: " ";
    position: absolute;
    top: 100%; /* At the bottom of the tooltip */
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: black transparent transparent transparent;
}
.directory-listing {
    background-color: var(--directory-entry-background-color);
    width: 100%;
    height: 100%;
    border: 3px dashed rgba(0, 0, 0, 0);
    overflow: auto;
}
/*.directory-listing.drop * {
    pointer-events: none;
  }*/
.directory-listing.drop {
    background-color: var(--background-color-dim);
    border: 3px dashed var(--text-color);
    box-sizing: border-box;
}
.directory-listing.drop.copy {
    cursor: copy;
}
.directory-listing.drop.move {
    cursor: move;
}
.directory-entry {
    padding: 0.5em;
    background-color: var(--directory-entry-background-color);
    color: var(--text-color);
    /*border-radius: 5px;
    border: 1px solid var(--text-color);*/
    /*text-shadow: 1px 1px 0 #000, 1px 1px 0 #000, 1px 1px 0 #000, 1px 1px 0 #000;*/
    /*text-shadow: #000 0px 0px 1px, #000 0px 0px 1px, #000 0px 0px 1px, #000 0px 0px 1px, #000 0px 0px 1px, #000 0px 0px 1px;*/
    cursor: pointer;
    display: flex;
    flex-direction: row;
}
/*.directory-entry text {
    display: inline ;
  }*/
.directory-entry:hover {
    background-color: var(--background-color-dim);
}
.directory-entry.selected {
    background-color: var(--directory-entry-selected-background-color);
    /*color: white;*/
}

.notifications {
    position: fixed;
    bottom: 0;
    right: 0;
    z-index: 1000;
    padding: 10px;
}
.notification.dismissible {
    cursor: e-resize;
}
.notification {
    background-color: rgba(80, 80, 80, 0.85);
    color: white;
    padding: 10px;
    margin: 10px;
    border-radius: 5px;
}
.notification.error {
    border: 2px solid rgb(150, 0, 0); /* Red border to indicate error */
    box-shadow: 0 0 5px rgba(150, 0, 0, 0.85); /* Subtle red shadow for emphasis */
    background-color: rgba(150, 0, 0, 0.85);
}
.notification .title {
    font-weight: bold;
}
.notification .message {
    margin-top: 5px;
}
.notification .notification-status-request-action {
    display: flex;
    flex-direction: row;
}
.notification-status-request-action button {
    margin: 0;
    flex: 1 1 auto;
    /* nice styled buttons */
    background-color: var(--ui-button-background-color);
    text-shadow: 1px 1px 2px black;
    color: var(--ui-button-text-color);
    border: 0px solid var(--text-color);
    cursor: pointer;
    padding: 0.5em;
    box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.5);
}
.notification-status-request-action button:hover {
    background: linear-gradient(
        0,
        rgb(147, 147, 147) 0%,
        rgb(120, 120, 120) 5%,
        rgb(147, 147, 147) 100%
    );
}
.notification-status-request-action button:active {
    background: none;
    background-color: var(--titlebar-color);
}

.dockable-container-title,
.dockable-container-titlebar {
    touch-action: none;
    -webkit-user-drag: none;
    user-select: none;
}

/* Handle narrow screens / windows */
@container (max-width: 500px) {
    .menu li {
        padding: 0;
        /*margin-left: 0.2em;*/
        margin: 0;
    }
    /*.menu li a {
        flex-direction: column;
        align-items: center;
    }*/
    .menu .icon {
        margin-left: 0.2em;
        margin-right: 0.2em;
        margin-bottom: 0.25em;
    }

    #main {
        padding: 0;
    }
    .dockable-container-content.with-titlebar {
        padding: 1px;
    }
}
