/* Harmony Dashboard - Bundled CSS Dependencies */
/* This file imports all required CSS dependencies for the Harmony Dashboard */

/* Google Fonts - Roboto */
@import url('https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap');

/* MudBlazor CSS - Use absolute paths */
@import url('/_content/MudBlazor/MudBlazor.min.css');

/* Z.Blazor.Diagrams CSS - Use absolute paths */
@import url('/_content/Z.Blazor.Diagrams/style.min.css');
@import url('/_content/Z.Blazor.Diagrams/default.styles.min.css');

/* JSON Editor styles - path relative to THIS CSS file's location in RCL */
@import url('json-editor.css');

/* Harmony Dashboard is ready */

.harmony-graph {
    position: relative;
    width: 100%;
    height: calc(100vh - 70px);
    display: flex;
    flex-direction: column;
}

.harmony-graph .diagram-container {
    flex: 1;
    position: relative;
    min-height: 0;
    transition: opacity 0.25s ease-in-out;
}

.harmony-graph .diagram-container .loading {
    opacity: 0.25;
}

.harmony-graph .diagram-container .grid {
    background-size: unset !important;
}

.harmony-graph .diagram-container .loader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(254, 254, 254, 0.9);
    z-index: 1000;
}

g.diagram-link {
    stroke-dasharray: 5;
    animation: dash .5s linear infinite;
    color: gray;
}

@keyframes dash {
    to {
        stroke-dashoffset: -10;
    }
}

.diagram-loading {
    display: none;
}

.harmony-node {
    width: 100%;
    height: 100%;
    border: 1px dashed gray;
    background-color: snow;
    padding: 30px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.harmony-node .title {
    color: black;
    font-weight: bold;
}

.harmony-node .disabled-overlay {
    position: relative;
}

.harmony-node .disabled-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(128, 128, 128, 0.5);
    pointer-events: none;
}

.selected-node {
    border: 3px solid var(--mud-palette-primary);
    border-style: solid !important;
    background-color: rgba(var(--mud-palette-primary-rgb), 0.08);
    box-shadow: 0 0 0 3px rgba(var(--mud-palette-primary-rgb), 0.2),
                0 8px 16px rgba(0, 0, 0, 0.15);
    transform: scale(1.02);
    z-index: 10;
}

.selected-node::before {
    content: '';
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border: 2px solid var(--mud-palette-primary);
    border-radius: 4px;
    opacity: 0.3;
    pointer-events: none;
    animation: pulse-border 2s ease-in-out infinite;
}

@keyframes pulse-border {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.01);
    }
}

.node-details .scrollable-tab-content {
    overflow-y: auto;
    height: calc(95vh - 265px);
}

.node-details .disabled-overlay {
    position: relative;
}

.node-details .disabled-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(128, 128, 128, 0.5);
    pointer-events: all;
}

.progress {
    height: 25px;
}

.controls {
    height: 25px;
}


@keyframes pulse-red-outline {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.7);
    }
    70% {
        box-shadow: 0 0 0 50px rgba(255, 0, 0, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 0, 0, 0);
    }
}

.error-state {
    border: 5px solid red;
    animation: pulse-red-outline 1.5s infinite;
    border-radius: 10px;
}

.diagram-port {
    position: absolute;
    width: 20px;
    height: 20px;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 1px solid gray;
    background-color: white;
}

.diagram-port.top {
    border-radius: 50%;
    top: 0;
}

.diagram-port.bottom {
    border-radius: 50%;
    bottom: -20px;
}

.buffer-explorer {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.snapshot-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    max-width: 100px;
    vertical-align: middle;
}

.cell-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.cell-content > div {
    flex-grow: 1;
    overflow: hidden;
}

.drawer-container {
    overflow: hidden !important;
}


.overview-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 2rem;
}

.icon-container .icon {
    margin-right: 8px;
}

.title-text {
    font-size: 16px;
    margin: 0;
}

.description-section {
    padding: 8px 16px;
    font-size: 14px;
    color: #666;
}

.hover-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.hover-card:hover {
    transform: translateY(-2px);
}

.graph-overview-container {
    display: flex;
    flex-direction: column;
    height: 100%;

    .graph-container {
        flex-grow: 1;
        display: flex;
        justify-content: center;
        align-items: center;
        min-height: 0; /* Allows flex item to shrink below content size */
    }

    /* Make harmony-graph adapt to parent container height instead of viewport */
    .harmony-graph {
        height: 100%;
    }
}

.log-entry {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.9rem;
    padding: 2px 8px;
    border-bottom: 1px solid var(--mud-palette-divider);
    cursor: default;
    transition: background-color 0.1s ease;
}

.log-entry:hover {
    background-color: var(--mud-palette-action-default-hover);
}

.log-level {
    font-weight: 500;
    border-radius: 4px;
    padding: 0 4px;
    margin-right: 8px;
    min-width: 60px;
    display: inline-block;
    text-align: center;
}

.timestamp {
    color: var(--mud-palette-text-secondary);
    margin-right: 12px;
}

.log-message {
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.compact-input .mud-input-control {
    margin-top: 0 !important;
}

.compact-input .mud-input-label {
    transform: translate(14px, 8px) !important;
    font-size: 0.875rem;
}
