/* Phase C16: Sphere Mining -- Network Graph Styles */
/* All colors use --closina-* CSS variable tokens */

.sphere-graph-container {
    position: relative;
    width: 100%;
    min-height: calc(90vh - 180px);
    border: 1px solid var(--closina-border);
    border-radius: var(--closina-radius-md);
    background: var(--closina-surface);
    overflow: hidden;
}

.sphere-graph-container .e-diagram {
    background: var(--closina-surface) !important;
}

[data-theme="dark"] .sphere-graph-container {
    border-color: var(--closina-border);
}

/* Graph toolbar */
.sphere-graph-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-bottom: 1px solid var(--closina-border);
    background: var(--closina-surface);
    flex-wrap: wrap;
}

[data-theme="dark"] .sphere-graph-toolbar {
    border-bottom-color: var(--closina-border);
}

/* Node detail side panel */
.sphere-node-panel {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 320px;
    background: var(--closina-surface);
    border-left: 1px solid var(--closina-border);
    box-shadow: var(--closina-shadow-lg);
    z-index: 10; /* Component-scoped: panel above backdrop (9) in mobile overlay pair */
    overflow-y: auto;
    transition: transform var(--closina-transition);
}

.sphere-node-panel.hidden {
    transform: translateX(100%);
}

[data-theme="dark"] .sphere-node-panel {
    border-left-color: var(--closina-border);
}

/* Insight cards */
.sphere-insight-card {
    border-radius: var(--closina-radius-md);
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid var(--closina-border);
    background: var(--closina-surface);
    transition: box-shadow var(--closina-transition);
    cursor: pointer;
}

.sphere-insight-card:hover {
    box-shadow: var(--closina-shadow-md);
}

[data-theme="dark"] .sphere-insight-card {
    border-color: var(--closina-border);
}

/* Path visualization */
.sphere-path-chain {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 16px;
}

.sphere-path-hop {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 16px;
    border-radius: var(--closina-radius-md);
    border: 1px solid var(--closina-border);
    background: var(--closina-surface);
    min-width: 100px;
    text-align: center;
}

.sphere-path-hop.source {
    border-color: var(--closina-primary);
    background: var(--closina-primary-light);
}

.sphere-path-hop.target {
    border-color: var(--closina-primary);
    background: var(--closina-primary-light);
}

.sphere-path-arrow {
    color: var(--closina-text-secondary);
    font-size: 24px;
}

/* Bulk action toolbar */
.sphere-bulk-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--closina-primary-light);
    border-radius: var(--closina-radius-md);
    margin-bottom: 12px;
    flex-wrap: wrap;
}

/* Cluster legend */
.sphere-cluster-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 0;
}

.sphere-cluster-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: var(--closina-radius-full);
    font-size: 0.8rem;
    background: var(--closina-surface);
    border: 1px solid var(--closina-border);
}

/* Empty graph state */
.sphere-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 24px;
    text-align: center;
    color: var(--closina-text-secondary);
}

.sphere-empty-state .sphere-empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    color: var(--closina-text-muted);
}

/* Tab content spacing */
.sphere-tab-content {
    padding: 16px 0;
}

/* Suggested contact card */
.sphere-suggested-card {
    border-radius: var(--closina-radius-md);
    padding: 16px;
    margin-bottom: 8px;
    border: 1px solid var(--closina-border);
    background: var(--closina-surface);
    transition: box-shadow var(--closina-transition);
}

.sphere-suggested-card:hover {
    box-shadow: var(--closina-shadow-sm);
}

/* Settings panel */
.sphere-settings-panel {
    padding: 16px;
    border: 1px solid var(--closina-border);
    border-radius: var(--closina-radius-md);
    background: var(--closina-surface);
}

/* Node detail backdrop -- hidden on desktop, visible on mobile/tablet */
.sphere-node-backdrop {
    display: none;
}

/* Responsive adjustments */
@media (max-width: 959px) {
    .sphere-node-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: var(--closina-surface-overlay, rgba(0, 0, 0, 0.5));
        z-index: 9;
        cursor: pointer;
    }

    .sphere-node-panel {
        width: 100%;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        height: 60vh;
        border-left: none;
        border-top: 1px solid var(--closina-border);
        border-radius: var(--closina-radius-lg) var(--closina-radius-lg) 0 0;
    }

    .sphere-graph-container {
        min-height: calc(80vh - 160px);
    }

    .sphere-path-chain {
        flex-direction: column;
    }

    .sphere-path-arrow {
        transform: rotate(90deg);
    }
}

/* Sphere page tabs (5 tabs) -- keep scrollable at narrow viewports
   instead of squishing to equal-width which truncates labels */
@media (max-width: 480px) {
    .sphere-page-tabs .mud-tab {
        flex: 0 0 auto !important;
        min-width: auto !important;
        padding: 4px 10px !important;
        font-size: 0.7rem !important;
    }

    .sphere-graph-container {
        min-height: calc(70vh - 140px);
    }
}
