.graph {
  margin-top: 2.4em;
  height:300px;
  width: 100%;
  position: relative;
}

.graph-header {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    display: flex;
    gap: 10px;
}

#modal_background {
  background-color: rgba(0,0,0,0.5);
  overflow: hidden;
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 99;
  align-items: center;
  justify-content: center;
}

.modal_graph {
  background-color: var(--md-default-bg-color);
  border: 1px solid var(--md-default-fg-color--lightest);
  box-shadow: 0px 0px 10px var(--md-default-fg-color--lightest);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  width: 80%;
  height: 80%;
  z-index: 100;
}

.nodes .node circle {
    fill: var(--md-default-fg-color--lighter);
    transition: r 0.2s;
}

.links .link {
    stroke: var(--md-default-fg-color--lighter);
    stroke-opacity: 0.35;
}

.nodes .node text {
    font-size: 10px;
    fill: var(--md-default-fg-color--light);
    text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}



.arrowhead path {
    fill: var(--md-default-fg-color--lighter);
}

.nodes .node.current circle{
    fill: var(--md-typeset-a-color);
    animation: graph-pulse 2s ease-in-out infinite;
}
.nodes .node.current text {
    fill: var(--md-typeset-a-color);
    font-weight: 700;
}

.nodes .node.hover circle {
    fill: var(--md-accent-fg-color);
}

.nodes .node.hover text {
    fill: var(--md-accent-fg-color);
}

@keyframes graph-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.icon {
    width: 1.2rem;
    height: 1.2rem;
    vertical-align: -0.2em;
    fill: var(--md-default-fg-color--light);
}



.md-button:hover .icon {
    fill: var(--md-accent-fg-color);
}

.hop-selector-container {
    display: flex;
    gap: 5px;
}

.hop-selector-container .md-button {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px;
}

.graph-legend {
    pointer-events: none;
}

.graph-legend-bg {
    fill: var(--md-default-bg-color);
    fill-opacity: 0.85;
    stroke: var(--md-default-fg-color--lightest);
    stroke-width: 0.5;
}

.graph-legend .legend-item {
    pointer-events: all;
    cursor: pointer;
    transition: opacity 0.2s;
}

.graph-legend .legend-item circle {
    transition: r 0.2s, stroke-opacity 0.2s;
}

.nodes .node.dimmed {
    opacity: 0.15 !important;
    transition: opacity 0.2s;
}

.nodes .node.highlighted circle {
    opacity: 1 !important;
    transition: r 0.2s, opacity 0.2s;
}

.nodes .node.highlighted .main-circle {
    stroke: var(--md-accent-fg-color) !important;
    stroke-width: 2px !important;
}
