/* ==========================================
   DIAGRAM MODAL STYLES
   Extends .slice-modal base styling
   ========================================== */

.slice-modal.diagram-modal {
    width: 60vw;
    max-width: none;
    height: 70vh;
    max-height: none;
}

.diagram-modal-body {
    flex: 1;
    overflow: hidden;
    padding: 0;
    min-height: 0;
    position: relative;
    background: var(--color-bg-primary);
}

/* Cytoscape container fills the modal body.
   Canvas styling is in cytoscape-diagram.css (fetched at runtime). */
#cy-container {
    width: 100%;
    height: 100%;
    min-height: 300px;
}

/* Loading/error overlays sit on top of the Cytoscape container */
.diagram-loading,
.diagram-error {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--color-text-secondary, #666);
    font-size: 12px;
    background: var(--color-bg-primary);
    z-index: 1;
}

.diagram-error {
    color: #c55;
}


.diagram-modal-footer {
    display: flex;
    gap: 6px;
    padding: 6px 12px;
    border-top: 1px solid var(--color-border, #333);
    justify-content: flex-end;
    background: var(--color-bg-secondary);
}

.diagram-download-btn,
.diagram-close-btn {
    padding: 4px 12px;
    background: var(--color-bg-code-panel);
    color: var(--color-text-primary, #e6edf3);
    border: 1px solid var(--color-border, #333);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 12px;
    transition: all 0.2s;
}

.diagram-download-btn:hover,
.diagram-close-btn:hover {
    background: var(--color-border);
    border-color: var(--color-text-secondary);
    color: #fff;
}

/* Resize handle — bottom-right corner grip */
.diagram-resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 18px;
    height: 18px;
    cursor: nwse-resize;
    z-index: 2;
}

.diagram-resize-handle::after {
    content: '';
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 0 8px 8px;
    border-color: transparent transparent var(--color-text-secondary, #666) transparent;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.diagram-resize-handle:hover::after {
    opacity: 1;
}
