.reference-graph-container {
    height: 500px;
    width: 100%;
    border: 1px solid var(--pf-v5-global--BorderColor--100, #d2d2d2);
    border-radius: 4px;
    background: var(--pf-v5-global--BackgroundColor--100, #ffffff);
    position: relative;
}

.reference-graph-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    gap: 16px;
    color: var(--pf-v5-global--Color--200, #6a6e73);
}

/* Override React Flow default styles to match PatternFly */
.reference-graph-container .react-flow__controls {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    border: 1px solid var(--pf-v5-global--BorderColor--100, #d2d2d2);
}

.reference-graph-container .react-flow__controls-button {
    background: var(--pf-v5-global--BackgroundColor--100, #ffffff);
    border-bottom: 1px solid var(--pf-v5-global--BorderColor--100, #d2d2d2);
    width: 28px;
    height: 28px;
}

.reference-graph-container .react-flow__controls-button:hover {
    background: var(--pf-v5-global--BackgroundColor--200, #f0f0f0);
}

.reference-graph-container .react-flow__controls-button:last-child {
    border-bottom: none;
}

.reference-graph-container .react-flow__minimap {
    border: 1px solid var(--pf-v5-global--BorderColor--100, #d2d2d2);
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.reference-graph-container .react-flow__attribution {
    display: none;
}

/* Edge styling */
.reference-graph-container .react-flow__edge-path {
    stroke: var(--pf-v5-global--BorderColor--200, #8a8d90);
    stroke-width: 1.5;
}

.reference-graph-container .react-flow__edge.selected .react-flow__edge-path {
    stroke: var(--pf-v5-global--primary-color--100, #0066cc);
    stroke-width: 2;
}

/* Legend */
.graph-legend {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: var(--pf-v5-global--BackgroundColor--100, #ffffff);
    border: 1px solid var(--pf-v5-global--BorderColor--100, #d2d2d2);
    border-radius: 4px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 11px;
    color: var(--pf-v5-global--Color--200, #6a6e73);
    z-index: 5;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    border: 1px solid var(--pf-v5-global--BorderColor--100, #d2d2d2);
}

.legend-color.root {
    background: var(--pf-v5-global--BackgroundColor--light-200, #fafafa);
    border-color: var(--pf-v5-global--primary-color--100, #0066cc);
    border-width: 2px;
}

.legend-color.reference {
    background: var(--pf-v5-global--BackgroundColor--100, #ffffff);
}

.legend-color.cycle {
    background: var(--pf-v5-global--BackgroundColor--100, #ffffff);
    border-color: var(--pf-v5-global--danger-color--100, #c9190b);
    border-width: 2px;
}

/* Wrapper and fullscreen styles */
.reference-graph-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.reference-graph-wrapper.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    background: var(--pf-v5-global--BackgroundColor--100, #ffffff);
}

.reference-graph-wrapper.fullscreen .reference-graph-container {
    height: calc(100vh - 60px);
    border: none;
    border-radius: 0;
}

/* Graph controls toolbar */
.graph-controls-toolbar {
    padding: 8px 16px;
    border-bottom: 1px solid var(--pf-v5-global--BorderColor--100, #d2d2d2);
    background: var(--pf-v5-global--BackgroundColor--100, #ffffff);
}

.depth-label {
    font-weight: 500;
    color: var(--pf-v5-global--Color--100, #151515);
}

.depth-slider-item {
    width: 200px;
}

.depth-hint {
    margin-left: auto;
}

.hint-text {
    font-size: 12px;
    color: var(--pf-v5-global--Color--200, #6a6e73);
    font-style: italic;
}

/* Action panel (top-right) */
.graph-action-panel {
    display: flex;
    gap: 4px;
    background: var(--pf-v5-global--BackgroundColor--100, #ffffff);
    border: 1px solid var(--pf-v5-global--BorderColor--100, #d2d2d2);
    border-radius: 4px;
    padding: 4px;
}

/* Warning panel (top-left) */
.graph-warning-panel {
    max-width: 300px;
}

/* Node details panel */
.node-details-panel {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--pf-v5-global--BackgroundColor--100, #ffffff);
    border: 1px solid var(--pf-v5-global--BorderColor--100, #d2d2d2);
    border-radius: 4px;
    padding: 12px;
    min-width: 250px;
    max-width: 320px;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.node-details-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--pf-v5-global--BorderColor--100, #d2d2d2);
    font-weight: 600;
    color: var(--pf-v5-global--Color--100, #151515);
}

.node-details-header button {
    margin-left: auto;
}

.cycle-warning {
    color: var(--pf-v5-global--danger-color--100, #c9190b);
    font-weight: 500;
}
