/* Knowledge Graph Styles - Minimal Integration */
.connections-section {
    display: flex;
    gap: 2rem;
    margin: 1.5rem 0 0 0;
    align-items: flex-start;
}

.connected-notes {
    flex: 1;
    min-width: 0;
}

.connected-notes h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1em;
    color: #555;
    font-weight: normal;
}

.connection-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.connection-link {
    color: #007acc;
    text-decoration: none;
    font-size: 0.9em;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.connection-link:hover {
    border-bottom-color: #007acc;
}

.connection-link::after {
    content: " •";
    color: #ccc;
    margin-left: 0.75rem;
}

.connection-link:last-child::after {
    display: none;
}

.mini-graph-container {
    flex-shrink: 0;
    width: 200px;
    position: relative;
}

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

.graph-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ddd;
    border-radius: 50%;
    text-align: center;
    line-height: 18px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.graph-icon:hover {
    background: #007acc;
    color: white;
    border-color: #007acc;
    transform: scale(1.1);
}

.mini-graph {
    height: 150px;
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

/* D3 specific styles for mini-graph */
.mini-link {
    fill: none;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.mini-link:hover {
    opacity: 1;
}

/* Arrow marker styles are handled in JavaScript for dynamic coloring */

/* Global Graph Modal */
.global-graph-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    padding: 20px;
    box-sizing: border-box;
}

.global-graph-modal.active {
    display: flex;
    flex-direction: column;
}

.global-graph-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    color: white;
}

.global-graph-title {
    font-size: 1.5em;
    margin: 0;
}

.global-graph-close {
    background: none;
    border: none;
    color: white;
    font-size: 2em;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.global-graph-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.global-graph-container {
    flex: 1;
    background: white;
    border-radius: 8px;
    position: relative;
    min-height: 400px;
    display: flex;
    overflow: hidden;
}

.global-graph {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    flex: 1;
}

/* Global Graph Controls */
.global-graph-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 10;
    min-width: 200px;
}

.global-graph-controls h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.control-group {
    margin-bottom: 16px;
}

.control-group:last-child {
    margin-bottom: 0;
}

.control-group label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

.zoom-controls {
    display: flex;
    gap: 8px;
}

.zoom-btn {
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.2s ease;
}

.zoom-btn:hover {
    background: #e0e0e0;
}

.graph-stats {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

.legend {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #666;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.mini-node {
    stroke: #fff;
    stroke-width: 2;
    cursor: pointer;
}

.mini-label {
    font-size: 9px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    fill: #555;
    text-anchor: middle;
    pointer-events: none;
}

@media (max-width: 768px) {
    .connections-section {
        flex-direction: column;
        gap: 1rem;
    }
    
    .mini-graph-container {
        width: 100%;
    }
    
    .mini-graph {
        height: 120px;
    }
    
    .connection-links {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .connection-link::after {
        display: none;
    }
}