/* KGN Web — Graph view & shared layout styles */

/* ── Graph tab ──────────────────────────────────────────── */

#graph-view {
    flex-direction: column;
}

#graph-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 1rem;
    border-bottom: 1px solid var(--kgn-border, #e5e7eb);
    background: var(--kgn-surface, #fff);
    flex-shrink: 0;
    flex-wrap: wrap;
}

#graph-toolbar label {
    margin: 0;
    font-size: var(--kgn-text-sm, 0.82rem);
    font-weight: 600;
    color: var(--kgn-gray-600, #4b5563);
}

#graph-toolbar select,
#graph-toolbar input {
    margin: 0;
    padding: 0.25rem 0.5rem;
    font-size: var(--kgn-text-sm, 0.82rem);
    height: auto;
    border: 1px solid var(--kgn-gray-300, #d1d5db);
    border-radius: var(--kgn-radius-sm, 6px);
    background: var(--kgn-surface, #fff);
    /* Reset Pico defaults */
    --pico-border-color: var(--kgn-gray-300, #d1d5db);
}

#graph-toolbar button {
    margin: 0;
    padding: 0.3rem 0.75rem;
    font-size: var(--kgn-text-sm, 0.82rem);
    /* Override Pico CSS button defaults */
    --pico-background-color: var(--kgn-primary-light, #eff6ff);
    --pico-border-color: var(--kgn-primary, #3b82f6);
    --pico-color: var(--kgn-primary, #3b82f6);
    border-radius: var(--kgn-radius-sm, 6px);
    font-weight: 600;
    transition: all var(--kgn-ease-fast, 0.15s ease);
}

#graph-toolbar button:hover {
    --pico-background-color: var(--kgn-primary, #3b82f6);
    --pico-color: #fff;
}

#graph-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

#cy {
    flex: 1;
    min-width: 0;
    min-height: 0;
    background: var(--kgn-gray-50, #f9fafb);
    border-right: 1px solid var(--kgn-border, #e5e7eb);
}

/* ── Node type badges ───────────────────────────────────── */

.type-badge {
    display: inline-block;
    border-radius: var(--kgn-radius-xs, 4px);
    padding: 0.1rem 0.5rem;
    font-size: var(--kgn-text-xs, 0.72rem);
    color: #fff;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.type-GOAL       { background: #FF6B6B; }
.type-SPEC       { background: #4ECDC4; }
.type-ARCH       { background: #45B7D1; }
.type-LOGIC      { background: #96CEB4; }
.type-DECISION   { background: #DAA520; }
.type-ISSUE      { background: #DDA0DD; }
.type-TASK       { background: #FF8C00; }
.type-CONSTRAINT { background: #708090; }
.type-ASSUMPTION { background: #D2691E; }
.type-SUMMARY    { background: #9370DB; }

/* ── Status indicator ───────────────────────────────────── */

.status-badge {
    display: inline-block;
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
}

.status-ACTIVE     { background: #dcfce7; color: #166534; }
.status-DEPRECATED { background: #fef3c7; color: #92400e; }
.status-SUPERSEDED { background: #e0e7ff; color: #3730a3; }
.status-ARCHIVED   { background: #f3f4f6; color: #6b7280; }

/* ── Truncation warning ─────────────────────────────────── */

#truncation-warning {
    display: none;
    background: #fffbeb;
    color: #92400e;
    padding: 0.5rem 1rem;
    font-size: var(--kgn-text-sm, 0.82rem);
    text-align: center;
    border-bottom: 1px solid #fcd34d;
}

#truncation-warning.visible {
    display: block;
}

/* ── Navigation tabs ────────────────────────────────────── */

.nav-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--kgn-border, #e5e7eb);
    padding: 0 1rem;
    background: var(--kgn-surface, #fff);
    overflow: visible;
    flex-shrink: 0;
}

.nav-tabs button {
    background: none;
    border: none;
    padding: 0.6rem 1.25rem;
    cursor: pointer;
    font-size: var(--kgn-text-sm, 0.82rem);
    font-weight: 500;
    border-bottom: 2.5px solid transparent;
    margin-bottom: -1px;
    color: var(--kgn-gray-500, #6b7280);
    transition: color var(--kgn-ease-fast, 0.15s ease),
                border-bottom-color var(--kgn-ease-fast, 0.15s ease),
                background var(--kgn-ease-fast, 0.15s ease);
    letter-spacing: 0.01em;
    position: relative;
}

.nav-tabs button:hover {
    color: var(--kgn-primary, #3b82f6);
    background: var(--kgn-primary-light, #eff6ff);
}

.nav-tabs button.active {
    border-bottom-color: var(--kgn-primary, #3b82f6);
    color: var(--kgn-primary, #3b82f6);
    font-weight: 600;
    background: transparent;
}
