/* Knowledge Graph Page Styles */

/* Container */
#kg-app {
    width: 100%;
    margin: 0 auto;
}

/* Controls bar */
#kg-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
    padding: 10px 14px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

#kg-controls label {
    font-weight: 600;
    font-size: 0.85em;
    color: #555;
    margin-right: 2px;
}

#kg-view-select {
    padding: 5px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.85em;
    background: #fff;
}

#kg-search {
    padding: 5px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.85em;
    flex: 1;
    min-width: 150px;
    max-width: 280px;
}

#kg-search::placeholder {
    color: #aaa;
}

/* Graph canvas */
#kg-network {
    width: 100%;
    height: 600px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fafbfc;
    position: relative;
}

/* Detail panel (right-side overlay) */
#kg-detail {
    display: none;
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    max-height: 100%;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.97);
    border-left: 2px solid #4a90d9;
    border-radius: 0 8px 8px 0;
    padding: 16px;
    box-shadow: -2px 0 12px rgba(0, 0, 0, 0.08);
    z-index: 10;
}

#kg-detail h3 {
    margin: 0 0 8px 0;
    font-size: 1.05em;
    color: #333;
}

#kg-detail .kg-type {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75em;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
}

#kg-detail .kg-desc {
    font-size: 0.88em;
    color: #555;
    line-height: 1.6;
    margin: 8px 0;
}

#kg-detail .kg-relations {
    margin-top: 10px;
    font-size: 0.82em;
}

#kg-detail .kg-relations h4 {
    margin: 8px 0 4px;
    color: #666;
    font-size: 0.9em;
}

#kg-detail .kg-relations ul {
    margin: 0;
    padding-left: 16px;
}

#kg-detail .kg-relations li {
    margin: 2px 0;
}

#kg-detail .kg-link {
    display: inline-block;
    margin-top: 10px;
    padding: 6px 14px;
    background: #4a90d9;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 500;
}

#kg-detail .kg-link:hover {
    background: #357abd;
}

#kg-detail .kg-close {
    position: absolute;
    top: 8px;
    right: 10px;
    cursor: pointer;
    font-size: 1.1em;
    color: #999;
    background: none;
    border: none;
    padding: 2px 6px;
}

#kg-detail .kg-close:hover {
    color: #333;
}

/* Graph wrapper for positioning detail panel */
#kg-graph-wrapper {
    position: relative;
    width: 100%;
}

/* Legend */
#kg-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 10px;
    padding: 8px 14px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.82em;
}

.kg-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.kg-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

/* Type colors */
.kg-color-phase { background-color: #e74c3c; }
.kg-color-milestone { background-color: #e67e22; }
.kg-color-discipline { background-color: #16a085; }
.kg-color-role { background-color: #3498db; }
.kg-color-activity { background-color: #27ae60; }
.kg-color-artifact { background-color: #f39c12; }

/* Stats bar */
#kg-stats {
    font-size: 0.8em;
    color: #888;
    margin-top: 6px;
    text-align: right;
}

/* Responsive */
@media (max-width: 768px) {
    #kg-network {
        height: 400px;
    }
    #kg-detail {
        width: 100%;
        position: relative;
        border-left: none;
        border-top: 2px solid #4a90d9;
        border-radius: 0 0 8px 8px;
        max-height: 300px;
    }
    #kg-controls {
        flex-direction: column;
        align-items: stretch;
    }
    #kg-search {
        max-width: 100%;
    }
}

/* Dark theme support */
.coal #kg-controls,
.coal #kg-legend,
.navy #kg-controls,
.navy #kg-legend {
    background: #2b2b2b;
    border-color: #444;
}

.coal #kg-controls label,
.navy #kg-controls label {
    color: #ccc;
}

.coal #kg-view-select,
.coal #kg-search,
.navy #kg-view-select,
.navy #kg-search {
    background: #1e1e1e;
    border-color: #555;
    color: #ddd;
}

.coal #kg-network,
.navy #kg-network {
    background: #1e1e1e;
    border-color: #444;
}

.coal #kg-detail,
.navy #kg-detail {
    background: rgba(30, 30, 30, 0.97);
    border-left-color: #5ba0e0;
}

.coal #kg-detail h3,
.navy #kg-detail h3 {
    color: #eee;
}

.coal #kg-detail .kg-desc,
.navy #kg-detail .kg-desc {
    color: #bbb;
}
