/* Custom styles for Cytoscape.js network visualization */

/* Graph container styling */
#graph-container {
    width: 100%;
    height: calc(100vh - 200px);
    position: relative;
    overflow: hidden;
    background: #f9f9f9;
    opacity: 1;
}

/* Cytoscape container takes full space */
#graph-container > div {
    width: 100%;
    height: 100%;
}

/* Remove any default transparency */
.cytoscape-container {
    opacity: 1;
}

/* Node details panel */
#node-details {
    transition: all 0.3s ease;
}

#node-details-content {
    max-height: 500px;
    overflow-y: auto;
}

/* Graph tooltip styling */
.graph-tooltip {
    position: absolute;
    max-width: 300px;
    background-color: white;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 6px;
    padding: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
    pointer-events: none;
    font-size: 14px;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

.graph-tooltip h4 {
    margin-top: 0;
    font-size: 16px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 5px;
    color: #333;
    font-weight: 600;
    margin-bottom: 8px;
}

.graph-tooltip p {
    margin: 5px 0;
    line-height: 1.4;
}

.graph-tooltip strong {
    font-weight: 600;
    color: #555;
}

/* Graph controls */
.graph-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px;
    border-radius: 5px;
    z-index: 100;
    width: auto !important;
    height: auto !important;
    max-width: fit-content;
    max-height: fit-content;
}

/* Layout dropdown styling */
.graph-controls .dropdown {
    display: inline-block;
}

.dropdown-menu {
    max-height: 400px;
    overflow-y: auto;
}

.dropdown-header {
    font-weight: bold;
    color: #6c757d;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
}

.layout-option {
    cursor: pointer;
}

.layout-option:hover {
    background-color: #f8f9fa;
}

.layout-option.active {
    background-color: #0d6efd;
    color: white;
}

/* Disabled button state */
.btn.disabled,
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Force controls visibility transition */
#force-controls {
    transition: opacity 0.3s ease;
}

/* Animation for status messages */
.status-message {
    transition: opacity 0.5s ease-in-out;
}

/* Graph statistics styling */
.graph-stats .badge {
    font-size: 14px;
}

.graph-stats .list-group-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Search box styling */
#search-nodes {
    font-size: 14px;
}

.input-group .btn-outline-secondary {
    border-color: #ced4da;
}

/* Node properties in details panel */
.node-properties {
    max-height: 500px;
    overflow-y: auto;
}

.node-properties .collapse {
    transition: all 0.2s ease;
}

/* Additional styles for property formatting */
.node-description {
    white-space: pre-wrap;
    word-break: break-word;
}

/* Ensure nodes and edges start fully visible */
.node, .edge {
    opacity: 1;
}

/* Search highlighting - only apply when classes are present */
#graph-container .dimmed {
    opacity: 0.2 !important;
    transition: opacity 0.2s ease;
}

#graph-container .highlighted {
    opacity: 1 !important;
    z-index: 999;
    transition: opacity 0.2s ease;
}