/* ── Wrapper ── */
.collab-network-wrap {
    font-family: Arial, sans-serif;
    margin: 20px 0;
}

.collab-network-title {
    font-size: 22px;
    margin-bottom: 12px;
    color: #1e1e2e;
}

/* ── Controls bar ── */
.collab-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
}

.collab-status {
    font-size: 13px;
    color: #666;
}

/* ── Main canvas + panel wrapper ── */
.collab-app-wrapper {
    display: flex;
    border: 1px solid #ccc;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
    background: #fff;
    position: relative; /* ← needed for absolute child positioning */
    width: 100%;
}

/* ── Cytoscape canvas — always full width ── */
.collab-cy {
    width: 100%;
    height: 100%;
    background: #fafafa;
}

/* ── Info panel — overlays the canvas from the right ── */
.collab-info-panel, .collab-node-panel {
    position: absolute;   /* ← floats over canvas, doesn't push it */
    top: 0;
    right: -340px;        /* ← starts hidden off-screen to the right */
    width: 320px;
    height: 100%;
    background: #1e1e2e;
    color: #cdd6f4;
    padding: 20px;
    overflow-y: auto;
    display: flex;        /* ← always flex, visibility controlled by right: position */
    flex-direction: column;
    gap: 12px;
    border-left: 2px solid #89b4fa;
    border-radius: 0 0 8px 0;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
    transition: right 0.3s ease;  /* ← smooth slide animation */
    z-index: 100;
}

.collab-node-panel {
    border-left-color: #a6e3a1;
}

/* ── Slide IN when visible ── */
.collab-info-panel.visible, .collab-node-panel.visible {
    right: 0;  /* ← slides into view over the canvas */
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .collab-info-panel, .collab-node-panel {
        width: 100%;
        right: -100%;
    }

    .collab-info-panel.visible, .collab-node-panel.visible {
        right: 0;
    }
}

.collab-info-panel h3, .collab-node-panel h3 {
    font-size: 14px;
    color: #89b4fa;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid #313244;
    padding-bottom: 8px;
}

.collab-node-panel h3 {
    color: #a6e3a1;
}

.collab-names, .collab-node-name {
    font-size: 13px;
    color: #a6e3a1;
    font-weight: bold;
}

.collab-node-name {
    font-size: 15px;
    color: #cdd6f4;
}

/* ── Publication cards ── */
.collab-pub-card {
    background: #313244;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.5;
    border-left: 3px solid #89b4fa;
	margin: 3px 0px;
}

.collab-pub-card .pub-year {
    margin-bottom: 4px;
    font-weight: bold;
    color: #f9e2af;
}

.collab-pub-card a {
    color: #89b4fa;
    text-decoration: underline;
}

.collab-pub-card a:hover, .collab-pub-card a:focus {
    color: #b4befe;
}

.collab-pub-card .pub-journal {
    color: #cdd6f4;
    font-style: italic;
    margin-bottom: 4px;
}

.collab-pub-card .pub-pmid {
    font-size: 10px;
    color: #6c7086;
}

/* ── Close button ── */
.collab-close-panel, .collab-close-node-panel {
    background: none;
    border: none;
    color: #f38ba8;
    cursor: pointer;
    font-size: 12px;
    text-align: right;
    align-self: flex-end;
}

/* ── Node profile panel ── */
.pubmed-profile-btn {
    display: inline-block;
    padding: 8px 14px;
    background: #a6e3a1;
    color: #1e1e2e;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    text-decoration: none;
    text-align: center;
    transition: background 0.2s;
}

.pubmed-profile-btn:hover {
    background: #94d4a0;
    text-decoration: none;
}

.collab-section-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #6c7086;
    margin-top: 4px;
}

/* ── Filter bar ── */
.collab-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-top: none;
}

.filter-label {
    font-size: 13px;
    color: #555;
    font-weight: bold;
}

.collab-filter-bar input[type="number"], .collab-filter-bar input[type="text"] {
    width: 90px;
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 13px;
}

.collab-filter-bar input[type="text"] {
    width: 150px;
}

.filter-apply-btn, .focus-node-btn {
    padding: 6px 14px;
    background: #89b4fa;
    color: #1e1e2e;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}

.filter-apply-btn:hover, .focus-node-btn:hover {
    background: #74c7ec;
}

.filter-reset-btn {
    padding: 6px 14px;
    background: #313244;
    color: #cdd6f4;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}

.filter-reset-btn:hover {
    background: #45475a;
}

.filter-status {
    color: #6c7086;
    font-size: 12px;
}

/* ── Zoom controls ── */
.collab-zoom-controls {
    position  : absolute;
    top       : 12px;
    right     : 12px;
    z-index   : 20;
    display   : flex;
    flex-direction: column;
    gap       : 6px;
}

.collab-zoom-controls button {
    width           : 34px;
    height          : 34px;
    background      : #313244;
    color           : #cdd6f4;
    border          : 1px solid #45475a;
    border-radius   : 6px;
    font-size       : 18px;
    line-height     : 1;
    cursor          : pointer;
    display         : flex;
    align-items     : center;
    justify-content : center;
    transition      : background 0.15s, opacity 0.15s;
}

.collab-zoom-controls button:hover {
    background : #45475a;
}

.collab-zoom-fit {
    font-size : 14px !important;
}

.collab-node-search {
    display    : flex;
    gap        : 6px;
    align-items: center;
    margin-left: 16px;
    border-left: 1px solid #45475a;
    padding-left: 16px;
}

/* ── Accessibility ── */
.collab-network-wrap button:focus,
.collab-network-wrap input:focus,
.pubmed-profile-btn:focus {
    outline: 3px solid #89b4fa;
    outline-offset: 2px;
}
