* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0a0e17;
    color: #c8d6e5;
    overflow: hidden;
    height: 100vh;
}

#app {
    display: flex;
    height: 100vh;
    width: 100vw;
}

#sidebar {
    width: 300px;
    min-width: 300px;
    background: #111827;
    border-right: 1px solid #1e293b;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 10;
}

#sidebar-header {
    padding: 16px;
    border-bottom: 1px solid #1e293b;
}

#sidebar-header h1 {
    font-size: 18px;
    color: #60a5fa;
    margin-bottom: 8px;
}

#stats-bar {
    font-size: 12px;
    color: #64748b;
    line-height: 1.6;
}

#search-container {
    padding: 12px 16px;
    border-bottom: 1px solid #1e293b;
    position: relative;
}

#search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #334155;
    border-radius: 6px;
    background: #1e293b;
    color: #e2e8f0;
    font-size: 13px;
    outline: none;
}

#search-input:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 2px rgba(96,165,250,0.2);
}

#search-results {
    position: absolute;
    top: 100%;
    left: 16px;
    right: 16px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 6px;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    z-index: 100;
}

#search-results.active { display: block; }

.search-result-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #0f172a;
    font-size: 12px;
}

.search-result-item:hover {
    background: #334155;
}

.search-result-item .type-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 10px;
    margin-right: 6px;
    font-weight: 600;
    text-transform: uppercase;
}

#filters {
    padding: 12px 16px;
    flex: 1;
    overflow-y: auto;
}

#filters h3 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin: 12px 0 8px 0;
}

#filters h3:first-child { margin-top: 0; }

.filter-item {
    display: flex;
    align-items: center;
    padding: 4px 0;
    font-size: 12px;
    cursor: pointer;
}

.filter-item input[type="checkbox"] {
    margin-right: 8px;
    accent-color: #60a5fa;
}

.filter-item .color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
    flex-shrink: 0;
}

.filter-item .count {
    margin-left: auto;
    color: #475569;
    font-size: 11px;
}

#layout-controls {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

#layout-controls button {
    padding: 6px 12px;
    border: 1px solid #334155;
    border-radius: 4px;
    background: #1e293b;
    color: #94a3b8;
    font-size: 11px;
    cursor: pointer;
    flex: 1;
}

#layout-controls button:hover {
    background: #334155;
    color: #e2e8f0;
}

#slider-controls { margin-top: 4px; }

.slider-row {
    margin-bottom: 8px;
}

.slider-row label {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #94a3b8;
    margin-bottom: 3px;
}

.slider-row label span {
    color: #60a5fa;
    font-weight: 600;
    font-family: monospace;
}

.slider-row input[type="range"] {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: #334155;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.slider-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #60a5fa;
    border: 2px solid #1e293b;
    cursor: pointer;
}

.slider-row input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #60a5fa;
    border: 2px solid #1e293b;
    cursor: pointer;
}

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

#graph-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

#tooltip {
    position: absolute;
    pointer-events: none;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 12px;
    max-width: 320px;
    display: none;
    z-index: 50;
    line-height: 1.5;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

#tooltip .tt-title {
    font-weight: 600;
    color: #f1f5f9;
    margin-bottom: 4px;
}

#tooltip .tt-type {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 4px;
}

#tooltip .tt-detail {
    color: #94a3b8;
    font-size: 11px;
}

#detail-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 380px;
    height: 100%;
    background: #111827;
    border-left: 1px solid #1e293b;
    z-index: 20;
    overflow-y: auto;
    padding: 20px;
    transition: transform 0.2s ease;
}

#detail-panel.hidden {
    transform: translateX(100%);
}

#detail-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: #64748b;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

#detail-close:hover { color: #e2e8f0; }

#detail-content h2 {
    font-size: 16px;
    color: #60a5fa;
    margin-bottom: 4px;
    word-break: break-all;
}

#detail-content .detail-type {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 12px;
}

#detail-content .detail-section {
    margin-bottom: 16px;
}

#detail-content .detail-section h4 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 6px;
}

#detail-content .detail-field {
    font-size: 12px;
    margin-bottom: 4px;
    color: #94a3b8;
}

#detail-content .detail-field strong {
    color: #cbd5e1;
}

#detail-content .connection-list {
    list-style: none;
}

#detail-content .connection-list li {
    padding: 4px 8px;
    margin: 2px 0;
    background: #1e293b;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
}

#detail-content .connection-list li:hover {
    background: #334155;
}

.connection-list .conn-type {
    color: #64748b;
    font-size: 10px;
    margin-left: 4px;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #475569; }
