/* Graph and Canvas Styles */

/* ===== SIMPLE GRAPH SPACING CONTROLS ===== */
:root {
    /* Simple ratio controls - default to compact spacing for better node visibility */
    --graph-x-ratio: 0.2;  /* Horizontal spacing multiplier (0.3 = very tight, 1.0 = normal, 2.0 = very wide) */
    --graph-y-ratio: 0.2;  /* Vertical spacing multiplier (0.3 = very tight, 1.0 = normal, 2.0 = very tall) */
}

/* Quick preset classes for common layouts */
.graph-tight {
    --graph-x-ratio: 0.2;
    --graph-y-ratio: 0.2;
}

.graph-compact {
    --graph-x-ratio: 0.4;
    --graph-y-ratio: 0.4;
}

.graph-normal {
    --graph-x-ratio: 0.6;
    --graph-y-ratio: 0.6;
}

.graph-spacious {
    --graph-x-ratio: 1.0;
    --graph-y-ratio: 1.0;
}

/* ===== END SPACING CONTROLS ===== */

/* Canvas Area */
.canvas-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #070708;
    height: 100%;
}

#graph {
    width: 100%;
    height: 100%;
    background: #070708;
    background-image: radial-gradient(circle at 0.5px 0.5px, rgba(255, 255, 255, 0.25) 0.5px, transparent 0);
    background-size: 15px 15px;
    display: block;
}

/* Navigation Controls */
.canvas-controls {
    position: absolute;
    bottom: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 50;
}

.canvas-btn {
    font-size: 20.8px;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: #000000;
    color: #e3e4e8;
    border: 1px solid #232427;
    cursor: pointer;
    transition: all 0.2s;
}

.canvas-btn:hover {
    background: #30363d;
    border-color: var(--accent-primary);
}

/* Enhanced Graph Styles */
.link {
    stroke-opacity: 0.8;
    transition: all 0.3s;
}

.link.aliases {
    stroke: var(--accent-primary);
    stroke-width: 2px;
    stroke-dasharray: 5,5;
}

.node-group {
    cursor: pointer;
    transition: all 0.2s;
}

.node-group:hover {
    filter: brightness(1.4);
}

/* Link and Marker Styling */
.link.alias-link {
    fill: none;
}

/* Ensure markers are visible if they overflow their container */
marker {
    overflow: visible;
}

/* Gradient Stop Styles for Links */
.link-gradient-start {
    stop-color: #5a5a5a !important;
    stop-opacity: 0.1 !important;
}

.link-gradient-end {
    stop-color: #f8fbff !important;
    stop-opacity: 1.0 !important;
}

/* Node Rectangle Styles */
.node-rect {
    stroke: #0000008a;
    stroke-width: 4px;
    rx: 4px;
    ry: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

/* Node highlight effect - higher specificity to override base styles */
.node-rect.highlighted,
.style-rect.highlighted {
    stroke: #ffffff8a !important;
    stroke-width: 3px !important;
    filter: drop-shadow(0 0 2px #ffffff);
    animation: highlight-pulse 1.5s ease-in-out;
}

@keyframes highlight-pulse {
    0% { stroke-opacity: 1; }
    50% { stroke-opacity: 0.7; }
    100% { stroke-opacity: 1; }
}

/* Node label styling */
.node-label {
    font-size: 12px;
    font-weight: 700;
    fill: #333;
    pointer-events: none;
    user-select: none;
    text-anchor: middle;
    dominant-baseline: central;
    alignment-baseline: central;
}

/* Node gradient indicators */
.radial-gradient-node {
    /* Add a subtle visual indicator for radial gradients */
    stroke-width: 2px !important;
    /* Make radial gradient nodes slightly more rounded */
    rx: 6px !important;
    ry: 6px !important;
}

.angular-gradient-node {
    /* Add a dotted border for angular gradients */
    stroke-dasharray: 2, 2 !important;
    stroke-width: 2px !important;
}

.linear-gradient-node {
    /* Keep solid border for linear gradients but make it slightly thicker */
    stroke-width: 2px !important;
}

/* Additional styling for radial gradient tooltips */
.tooltip .gradient-stop {
    position: relative;
}

.tooltip .gradient-stop:before {
    content: "●";
    margin-right: 4px;
    color: #888;
}

/* Responsive adjustments for canvas controls */
@media (max-width: 768px) {
    .canvas-controls {
        bottom: 16px;
        right: 16px;
        flex-direction: row;
        gap: 4px;
    }
    
    .canvas-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .canvas-controls {
        bottom: 8px;
        right: 8px;
    }
}
