﻿.aurora-ide {
    display: grid;
    grid-template-columns: 250px 6px 1fr 6px 300px;
    grid-template-rows: 1fr 6px 200px;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

.toolbox {
    grid-column: 1;
    grid-row: 1 / span 3;
    background: #f6f6f6;
    overflow: auto;
}

.splitter-v {
    background: #ccc;
    cursor: col-resize;
}

.center {
    grid-column: 3;
    grid-row: 1 / span 3;
    display: grid;
    grid-template-rows: 1fr 6px 200px;
}

.diagram {
    background: #ffffff;
    overflow: auto;
}

.splitter-h {
    background: #ccc;
    cursor: row-resize;
}

.output {
    background: #1e1e1e;
    color: #ddd;
    font-family: monospace;
    overflow: auto;
}

.properties {
    grid-column: 5;
    grid-row: 1 / span 3;
    background: #fafafa;
    overflow: auto;
}

body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
}

.no-selection {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 13px;
    text-align: center;
    padding: 48px 24px;
}

/* MudBlazor snackbars must float above the Studio's custom overlays
   (clipboard pane z 2500, context menu 3000, hand-rolled modals 4000+) —
   transient feedback is always the topmost layer.
   !important is REQUIRED here: MudBlazor.min.css is linked AFTER this file in
   App.razor, so an equal-specificity rule loses by source order (and a :root
   variable override loses too — the Mud theme provider injects its variables
   inline at runtime). */
div[class*="mud-snackbar-location"] {
    z-index: 5000 !important;
}

/* =========================================================
   Top app bar (Azure-portal-inspired)
   Blue gradient derived from the AlkaFlow brand color #0078D4.
   .mud-appbar.alka-appbar beats the MudBlazor theme selector on
   specificity, so no !important is needed for the background.
   ========================================================= */
.mud-appbar.alka-appbar {
    height: 36px;
    min-height: 36px;
    /* left edge / right edge breathing room — kept tight on purpose */
    padding: 0 4px 0 10px;
    background: linear-gradient(90deg, #0b3e74 0%, #0a5da8 55%, #0078d4 100%);
    color: #fff;
    box-shadow: 0 1px 4px rgba(9, 30, 66, 0.28);
}

    /* MudAppBar wraps children in an inner toolbar that has its own
       min-height — pin it to the same 36px so nothing overflows */
    .mud-appbar.alka-appbar .mud-toolbar {
        height: 36px;
        min-height: 36px;
        padding: 0;
    }

.alka-appbar .alka-appbar-brand {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    line-height: 36px;
    color: #fff;
    user-select: none;
}

/* Shared pane header (Toolbox, Properties): one definition so the two panes
   can never drift apart in font/size. The inset top highlight on the gray
   gradient gives the subtle "shine". */
.alka-pane-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    padding: 4px 12px;
    background: linear-gradient(180deg, #fbfcfd 0%, #eceff1 100%);
    border-bottom: 1px solid #d7dadd;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #37474f;
    user-select: none;
}

    .alka-pane-header .mud-icon-root {
        font-size: 16px;
        opacity: 0.75;
    }

/* For making property grid and toolbox look even smaller */
/* ==============================
   Aurora Compact Theme Tweaks
   ============================== */

/* Reduce overall padding & row height for MudTable (Properties Grid) */
.aurora-compact-table .mud-table-root {
    --mud-table-row-height: 26px;
    --mud-table-cell-padding: 2px 8px;
    font-size: 0.8rem;
}

/* Compact MudTextField / Numeric / Select / Switch */
.aurora-compact-input .mud-input-slot,
.aurora-compact-input .mud-input {
    min-height: 26px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    font-size: 0.8rem;
}

/* Reduce NavMenu spacing (Toolbox) */
.aurora-compact-nav .mud-nav-item {
    padding-top: 2px !important;
    padding-bottom: 2px !important;
    min-height: 26px !important;
    font-size: 0.8rem;
}

.aurora-compact-nav .mud-nav-group {
    margin-top: 2px;
    margin-bottom: 2px;
}

/* Make section headers a bit smaller */
.aurora-compact-nav .mud-nav-group-text {
    font-size: 0.8rem;
}

/* Toolbox search field: parts aurora-compact-input doesn't reach —
   the floating label and the clear-button icon */
.toolbox-search .mud-input-label {
    font-size: 0.8rem;
}

.toolbox-search .mud-icon-root {
    font-size: 16px;
}
/* end smaller props grid and tbx */

/*DIAGRAM BUILDER*/
/* Root layout of the diagram view: full-height flex column so the toolbar sits on
   top, the tree scrolls in the middle (flex:1 + min-height:0), and the status bar
   docks at the bottom. Defined HERE because the previous markup relied on `h-100`,
   a Bootstrap class that MudBlazor does NOT ship — the column had no height at all
   and grew with content (status bar trailed the last node, outer pane scrolled). */
.aurora-diagram {
    height: 100%;
    display: flex;
    flex-direction: column;
}

    /* Only the tree area grows/scrolls. Every other direct child (toolbar MudStack,
       divider, banner, status bar) keeps its natural height — without this, the
       toolbar's own flex-grow split the column 50/50 with the tree, leaving a big
       void under the buttons.
       !important + the `div.` specificity boost are BOTH required: MudBlazor's
       utility classes use !important, and MudBlazor.min.css loads AFTER this file —
       equal specificity would lose by source order even with !important. */
    div.aurora-diagram > * {
        flex: 0 0 auto !important;
    }

    div.aurora-diagram > .aurora-diagram-scroll {
        flex: 1 1 0 !important;
        min-height: 0 !important;
    }

/* Diagram node visuals */
.aurora-diagram .aurora-node {
    position: relative;
    border: 1px solid var(--mud-palette-lines-default, #ccc);
    border-radius: 6px;
    margin: 4px 8px;
    background: var(--mud-palette-surface, #fff);
    display: flex;
    align-items: center;
    transition: border-color 120ms ease, opacity 120ms ease, background 120ms ease;
}

    .aurora-diagram .aurora-node.node-normal {
        border-color: #888;
    }

    .aurora-diagram .aurora-node.node-error {
        border-color: #d32f2f;
    }
    /* red */
    .aurora-diagram .aurora-node.node-moving {
        border-color: #2e7d32;
    }
    /* green */

    .aurora-diagram .aurora-node.node-disabled {
        opacity: 0.5;
    }

.aurora-diagram .node-collapse {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    width: 20px;
    text-align: center;
    color: var(--mud-palette-text-secondary, #666);
}

.aurora-diagram .node-text {
    padding-left: 6px;
    user-select: none;
    cursor: pointer;
}

.aurora-diagram .node-actions {
    position: absolute;
    right: 6px;
    opacity: 0;
    transition: opacity 120ms ease;
    display: inline-flex;
    gap: 2px;
}

.aurora-diagram .aurora-node:hover .node-actions {
    opacity: 1;
}
/*END DIAGRAM BUILDER*/

/* =========================================================
   Aurora IDE - Diagram Builder (V2)
   ========================================================= */
/* Node row: single line, aligns items */
.aurora-diagram .aurora-node-row {
    display: flex;
    align-items: center;
    white-space: nowrap;
}

/* left spacing before collapser */
.aurora-diagram .node-indent {
    display: inline-block;
    width: 0;
}

/* collapser button */
.aurora-diagram .node-collapse {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    width: 20px;
    text-align: center;
    color: var(--mud-palette-text-secondary, #666);
    margin-right: 4px;
}

/* keep alignment when no children */
.aurora-diagram .node-collapse-placeholder {
    display: inline-block;
    width: 20px;
    margin-right: 4px;
}

/* wrapper for rectangle + actions */
.aurora-diagram .node-wrap {
    position: relative;
    display: inline-block;
}

/* the rectangle */
.aurora-diagram .node-box {
    border: 1px solid #888; /* default normal */
    border-radius: 0; /* square corners */
    box-sizing: border-box;
    cursor: pointer;
    transition: border-color 120ms ease, border-width 120ms ease, opacity 120ms ease, background 120ms ease;
}

    /* state colors */
    .aurora-diagram .node-box.node-error {
        border-color: #d32f2f;
    }
    /* red */
    .aurora-diagram .node-box.node-moving {
        border-color: #2e7d32;
    }
    /* green */
    .aurora-diagram .node-box.node-normal {
        border-color: #888;
    }

    /* selected state */
    .aurora-diagram .node-box.node-selected {
        border-color: #64b5f6;
    }

/* disabled look */
.aurora-diagram .node-disabled {
    opacity: .5;
}

/* hover sugar: thicker + blue */
.aurora-diagram .node-box:hover {
    border-width: 2px;
    border-color: #1976d2;
}

/* actions: only when hovering the rectangle */
.aurora-diagram .node-actions {
    position: absolute;
    top: 50%;
    left: 100%; /* start immediately after rectangle edge */
    transform: translateY(-50%);
    margin-left: 6px;
    opacity: 0;
    transition: opacity 120ms ease;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

/* reveal actions when hovering the rectangle */
.aurora-diagram .node-wrap:hover .node-actions {
    opacity: 1;
}
.aurora-diagram .aurora-node-row {
    display: flex;
    align-items: center;
    white-space: nowrap;
    margin-bottom: 4px; /* baseline spacing, overridable via VerticalSpacing */
}

.aurora-diagram-scroll {
    overflow: auto;
    flex: 1;
    min-height: 0; /* flex child must be allowed to shrink, else the status bar is pushed below the fold */
    padding: 4px 0 4px 0; /* <— add this */
}

/* MUDBLAZOR BUTTONS TEXT TO UPPERCASE CORRECTION */
.mud-button-root {
    text-transform: none !important;
}

/* SPLITTER */
/* Gutter styles */
.gutter {
    background-color: #ccc;
    background-repeat: no-repeat;
    background-position: 50%;
}

.gutter.gutter-vertical {
    background-color: #eee;
    background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAFAQMAAABo7865AAAABlBMVEVHcEzMzMzyAv2sAAAAAXRSTlMAQObYZgAAABBJREFUeF5jOAMEEAIEEFwAn3kMwcB6I2AAAAAASUVORK5CYII=');
    background-repeat: no-repeat;
    background-position: center;
    cursor: row-resize;
}

.gutter.gutter-horizontal {
    background-color: #eee;
    background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAeCAYAAADkftS9AAAAIklEQVQoU2M4c+bMfxAGAgYYmwGrIIiDjrELjpo5aiZeMwF+yNnOs5KSvgAAAABJRU5ErkJggg==');
    background-repeat: no-repeat;
    background-position: center;
    cursor: col-resize;
}
.arrow-text {
    font-family: "Segoe UI Symbol", "Noto Sans Symbols", sans-serif;
}
