/* Strukturelle Layoutregeln der XXX-Konsole. Keine Farbschicht, keine Theme-Ueberschreibung. */

#app-container {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

#galaxy-map { image-rendering: pixelated; }
.grid-stack-item-content { background-color: transparent !important; }

/* Gridstack: nur die unteren Ecken sind Resize-Ziele. */
.grid-stack-item .ui-resizable-handle {
    z-index: 200 !important;
    border: 0 !important;
    background: none !important;
    background-image: none !important;
    opacity: 0 !important;
    content: none !important;
}
.grid-stack-item .ui-resizable-e,
.grid-stack-item .ui-resizable-w,
.grid-stack-item .ui-resizable-n,
.grid-stack-item .ui-resizable-s { display: none !important; }
.grid-stack-item .ui-resizable-se,
.grid-stack-item .ui-resizable-sw {
    display: block !important;
    width: 36px !important;
    height: 36px !important;
    bottom: 0 !important;
    opacity: 0 !important;
}
.grid-stack-item .ui-resizable-se { right: 0 !important; cursor: se-resize !important; }
.grid-stack-item .ui-resizable-sw { left: 0 !important; cursor: sw-resize !important; }

.grid-stack-item:not([data-collapsed="true"])::before,
.grid-stack-item:not([data-collapsed="true"])::after {
    content: "";
    position: absolute;
    bottom: 9px;
    z-index: 150;
    width: 13px;
    height: 13px;
    pointer-events: none;
    opacity: .46;
    border-bottom: 1px solid var(--xxx-cyan);
}
.grid-stack-item:not([data-collapsed="true"])::before {
    left: 9px;
    border-left: 1px solid var(--xxx-cyan);
}
.grid-stack-item:not([data-collapsed="true"])::after {
    right: 9px;
    border-right: 1px solid var(--xxx-cyan);
}
.grid-stack-item:not([data-collapsed="true"]):hover::before,
.grid-stack-item:not([data-collapsed="true"]):hover::after { opacity: .82; }

.grid-stack-item[data-collapsed="true"] {
    min-height: 66px !important;
    padding-bottom: 4px !important;
}
.grid-stack-item[data-collapsed="true"] > .grid-stack-item-content {
    min-height: 58px !important;
    height: 58px !important;
    overflow: visible !important;
    border: 1px solid var(--xxx-line-strong) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}
.grid-stack-item[data-collapsed="true"] .drag-handle {
    display: flex !important;
    align-items: center !important;
    min-height: 56px !important;
    height: 56px !important;
    overflow: visible !important;
    border: 0 !important;
    border-radius: 0 !important;
}
.grid-stack-item[data-collapsed="true"] [id^="content-"] { display: none !important; }
.grid-stack-item[data-collapsed="true"] .ui-resizable-handle,
.grid-stack-item[data-collapsed="true"]::before,
.grid-stack-item[data-collapsed="true"]::after { display: none !important; }

#box-radar { direction: rtl !important; }
#box-radar > * { direction: ltr !important; }

#scanner-static-workspace > div:first-of-type {
    overflow-x: auto;
    flex-wrap: nowrap !important;
}
#scanner-static-workspace > div:first-of-type > * { flex: 0 0 auto; }
#scanner-static-workspace #radar-filter-quick-buttons {
    grid-template-columns: 1fr !important;
    gap: .5rem !important;
    padding: .5rem !important;
}
#scanner-static-workspace #radar-filter-quick-buttons button {
    min-height: 48px !important;
    justify-content: flex-start !important;
    padding: .7rem !important;
    text-align: left !important;
    border-radius: 0 !important;
    font-size: 9px !important;
}

@media (min-width: 1536px) {
    #scanner-static-workspace #scanner-tab-map:not(.hidden) {
        display: grid !important;
        grid-template-columns: minmax(250px,.32fr) minmax(760px,1.55fr) minmax(320px,.48fr) !important;
        gap: 1rem !important;
        align-items: stretch !important;
    }
    #scanner-static-workspace #scanner-tab-map > div.grid { display: contents !important; }
    #scanner-static-workspace #scanner-tab-map > div.grid > aside {
        display: flex !important;
        min-height: 800px !important;
        grid-column: 1 !important;
        grid-row: 1 !important;
    }
    #scanner-static-workspace #scanner-tab-map > div.grid > aside > #box-radar-filters {
        min-height: 800px !important;
        height: 100% !important;
    }
    #scanner-static-workspace #scanner-tab-map > div.grid > main {
        display: flex !important;
        min-width: 0 !important;
        grid-column: 2 !important;
        grid-row: 1 !important;
    }
    #scanner-static-workspace #scanner-tab-map #box-radar {
        width: 100% !important;
        min-height: 800px !important;
    }
    #scanner-static-workspace #scanner-tab-map > #scanner-compact-intel-box {
        grid-column: 3 !important;
        grid-row: 1 !important;
        align-self: stretch !important;
        min-height: 800px !important;
        margin-top: 0 !important;
    }
    #scanner-static-workspace #scanner-tab-map > #scanner-compact-intel-box > div:last-child {
        height: calc(100% - 44px) !important;
        overflow-y: auto !important;
    }
    #scanner-static-workspace #scanner-compact-intel-box [id^="content-"] { max-height: none !important; }
}

@media (max-width: 1023px) {
    .grid-stack-1 > .grid-stack-item {
        position: relative !important;
        left: 0 !important;
        top: auto !important;
        width: 100% !important;
        height: auto !important;
        margin-bottom: 20px !important;
    }
    .grid-stack-1 { height: auto !important; padding-bottom: 30px; }
    .grid-stack-1 > .grid-stack-item > .grid-stack-item-content {
        position: relative !important;
        inset: auto !important;
        height: auto !important;
        min-height: 150px;
    }
    .grid-stack-item .ui-resizable-handle { display: none !important; }
    #box-radar:not([data-collapsed="true"]) > .grid-stack-item-content { height: 550px !important; }
    .grid-stack-1 > .grid-stack-item[data-collapsed="true"],
    .grid-stack-1 > .grid-stack-item[data-collapsed="true"] > .grid-stack-item-content {
        min-height: 0 !important;
        height: auto !important;
        padding-bottom: 0 !important;
    }
}

@media (max-width: 767px) {
    #scanner-static-workspace {
        gap: .75rem !important;
        padding-bottom: 5rem !important;
    }
    #scanner-static-workspace > div:first-of-type {
        margin-inline: -.25rem;
        padding-inline: .5rem;
    }
    #scanner-static-workspace #box-radar { min-height: 70vh !important; border-radius: 0 !important; }
    #scanner-static-workspace #box-radar #content-radar { min-height: 62vh !important; }
    #scanner-static-workspace #box-radar-filters { min-height: auto !important; height: auto !important; border-radius: 0 !important; }
    #scanner-static-workspace #radar-filter-quick-buttons { grid-template-columns: 1fr !important; }
    #scanner-static-workspace #radar-filter-flyout,
    #scanner-static-workspace #scanner-filter-profiles-menu {
        left: .75rem !important;
        right: .75rem !important;
        width: auto !important;
        max-height: 72vh !important;
        overflow-y: auto !important;
        border-radius: 0 !important;
    }
    #scanner-static-workspace #radar-filter-flyout {
        position: fixed !important;
        top: auto !important;
        bottom: .75rem !important;
        z-index: 99990 !important;
    }
    #scanner-static-workspace #scanner-filter-profiles-menu {
        position: fixed !important;
        top: auto !important;
        bottom: .75rem !important;
    }
    #scanner-static-workspace #scanner-compact-intel-box [id^="content-"] { max-height: 52vh !important; }
}
