/**
 * Nexus Pathway - Knowledge Graph Visualization Styles
 */

/* Breadcrumb Navigation Trail */
.nexus-breadcrumbs {
    position: absolute;
    top: 12px;
    left: 12px;
    display: none;  /* Hidden by default, shown when path > 1 */
    align-items: center;
    gap: 4px;
    z-index: 25;
    background: rgba(28, 25, 23, 0.9);
    backdrop-filter: blur(8px);
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: calc(100% - 180px);  /* Leave space for controls */
    overflow-x: auto;
}

.nexus-breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--color-text-secondary, #A8A29E);
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.nexus-breadcrumb-item:hover:not(.active) {
    background: rgba(74, 124, 93, 0.25);
    color: var(--color-accent, #4a7c5d);
}

.nexus-breadcrumb-item.active {
    color: var(--color-text-primary, #FAFAF9);
    font-weight: 600;
    cursor: default;
    pointer-events: none;
}

.nexus-breadcrumb-separator {
    color: var(--color-text-muted, #78716C);
    display: flex;
    align-items: center;
}

.nexus-breadcrumb-separator svg {
    width: 12px;
    height: 12px;
}

.nexus-pathway-container {
    position: relative;
    width: 100%;
    min-height: 500px;
    height: calc(100vh - 300px);
    max-height: 700px;
    background: var(--color-surface, #1C1917);
    border-radius: 12px;
    overflow: hidden;
}

.nexus-graph-canvas {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

/* Loading State */
.nexus-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    z-index: 10;
}

.nexus-loading__spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #4A90D9;
    border-radius: 50%;
    animation: nexus-spin 1s linear infinite;
}

@keyframes nexus-spin {
    to { transform: rotate(360deg); }
}

.nexus-loading p {
    color: #A8A29E;
    font-size: 0.9rem;
    margin: 0;
}

/* Controls Overlay */
.nexus-controls {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    background: rgba(28, 25, 23, 0.9);
    backdrop-filter: blur(8px);
    padding: 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 20;
}

.nexus-controls__layout,
.nexus-controls__zoom {
    display: flex;
    gap: 4px;
}

.nexus-controls__layout {
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    padding-right: 8px;
}

.nexus-control-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #A8A29E;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nexus-control-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #E8E4E0;
    border-color: rgba(255, 255, 255, 0.2);
}

.nexus-control-btn:active {
    transform: scale(0.95);
}

.nexus-control-btn svg {
    width: 18px;
    height: 18px;
}

/* Tooltip */
.nexus-tooltip {
    position: fixed;
    background: rgba(28, 25, 23, 0.95);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px 12px;
    min-width: 140px;
    max-width: 240px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-5px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 100;
}

.nexus-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

.nexus-tooltip__header {
    margin-bottom: 2px;
}

.nexus-tooltip__header strong {
    color: #E8E4E0;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.2;
}

.nexus-tooltip__sector {
    font-size: 0.75rem;
    color: #A8A29E;
    margin-bottom: 6px;
}

.nexus-tooltip__relationship {
    font-size: 0.75rem;
    padding: 3px 8px;
    background: rgba(74, 124, 93, 0.2);
    color: #6B9B7A;
    border-radius: 4px;
    display: inline-block;
    margin-top: 4px;
}

.nexus-tooltip__full-query {
    font-size: 0.8rem;
    color: #D4D0CC;
    line-height: 1.4;
    max-width: 280px;
    word-wrap: break-word;
    margin-top: 4px;
}

.nexus-tooltip__name {
    color: #A8A29E;
    font-size: 0.85rem;
    margin-bottom: 8px;
    line-height: 1.3;
}

.nexus-tooltip__metrics {
    display: flex;
    gap: 12px;
    font-size: 0.75rem;
    color: #78716C;
}

.nexus-tooltip__metrics span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Error State */
.nexus-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: #A8A29E;
    text-align: center;
}

.nexus-error svg {
    width: 48px;
    height: 48px;
    color: #D45B5B;
}

.nexus-error p {
    margin: 0;
    font-size: 1rem;
    color: #E8E4E0;
}

.nexus-error small {
    color: #78716C;
    font-size: 0.8rem;
}

/* Legend (optional, for future use) */
.nexus-legend {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(28, 25, 23, 0.9);
    backdrop-filter: blur(8px);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 20;
}

.nexus-legend__title {
    font-size: 0.75rem;
    color: #78716C;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.nexus-legend__item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: #A8A29E;
    margin-bottom: 4px;
}

.nexus-legend__color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

/* Responsive */
@media (max-width: 768px) {
    .nexus-pathway-container {
        min-height: 400px;
        height: 60vh;
    }
    
    .nexus-controls {
        bottom: 8px;
        padding: 6px;
    }
    
    .nexus-control-btn {
        width: 32px;
        height: 32px;
    }
    
    .nexus-control-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .nexus-legend {
        padding: 8px;
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .nexus-pathway-container {
        min-height: 350px;
        height: 55vh;
    }
    
    .nexus-controls {
        bottom: 4px;
        left: 8px;
        padding: 4px;
        gap: 4px;
    }
    
    .nexus-control-btn {
        width: 28px;
        height: 28px;
    }
    
    .nexus-legend {
        top: 8px;
        right: 8px;
        padding: 6px;
    }
    
    .nexus-legend__title {
        font-size: 0.65rem;
        margin-bottom: 4px;
    }
    
    .nexus-legend__item {
        font-size: 0.7rem;
        gap: 4px;
    }
    
    .nexus-legend__color {
        width: 10px;
        height: 10px;
    }
}

@media (max-width: 360px) {
    .nexus-pathway-container {
        min-height: 300px;
        height: 50vh;
    }
    
    .nexus-legend {
        display: none;
    }
}
