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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #1a1a2e;
    color: #e0e0e0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.header {
    background: #16213e;
    padding: 12px 24px;
    display: flex;
    align-items: baseline;
    gap: 16px;
    border-bottom: 1px solid #0f3460;
    flex-shrink: 0;
}

.header h1 {
    font-size: 20px;
    color: #4FC3F7;
}

.header-subtitle {
    font-size: 13px;
    color: #90A4AE;
}

.error-bar {
    background: #c62828;
    color: #fff;
    padding: 10px 24px;
    font-size: 14px;
    flex-shrink: 0;
    transition: opacity 0.3s;
}

.error-bar.hidden {
    display: none;
}

.main-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    width: 280px;
    flex-shrink: 0;
    overflow-y: auto;
    background: #16213e;
    border-right: 1px solid #0f3460;
}

.sidebar-right {
    border-right: none;
    border-left: 1px solid #0f3460;
}

.panel {
    padding: 16px;
}

.panel h3 {
    font-size: 15px;
    margin-bottom: 12px;
    color: #4FC3F7;
}

.upload-panel {
    border-bottom: 1px solid #0f3460;
}

.drop-zone {
    border: 2px dashed #0f3460;
    border-radius: 8px;
    padding: 24px 16px;
    text-align: center;
    transition: border-color 0.2s, background 0.2s;
    cursor: pointer;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: #4FC3F7;
    background: rgba(79, 195, 247, 0.05);
}

.drop-zone p {
    margin-bottom: 6px;
    font-size: 13px;
    color: #90A4AE;
}

.btn {
    display: inline-block;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: opacity 0.2s, transform 0.1s;
}

.btn:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: #0f3460;
    color: #e0e0e0;
}

.btn-success {
    background: #2e7d32;
    color: #fff;
}

.btn-danger {
    background: #c62828;
    color: #fff;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
    background: #0f3460;
    color: #e0e0e0;
}

.action-buttons {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.action-buttons .btn {
    flex: 1;
}

.file-list-container {
    margin-top: 12px;
}

.file-list-container h4 {
    font-size: 13px;
    color: #90A4AE;
    margin-bottom: 6px;
}

#file-list {
    list-style: none;
    max-height: 150px;
    overflow-y: auto;
}

#file-list li {
    font-size: 13px;
    padding: 4px 0;
    border-bottom: 1px solid #0f3460;
    word-break: break-all;
}

.graph-area {
    flex: 1;
    position: relative;
    background: #1a1a2e;
    overflow: hidden;
}

#cy-container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.empty-state {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #546E7A;
    font-size: 16px;
}

.empty-state p:first-child {
    font-size: 48px;
    margin-bottom: 12px;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 26, 46, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.loading-overlay.hidden,
.empty-state.hidden {
    display: none;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #0f3460;
    border-top-color: #4FC3F7;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

#loading-text {
    margin-top: 16px;
    color: #90A4AE;
    font-size: 14px;
}

.detail-panel {
    min-height: 200px;
}

.detail-empty {
    color: #546E7A;
    font-size: 13px;
    text-align: center;
    padding: 24px 0;
}

.detail-content.hidden {
    display: none;
}

.detail-field {
    margin-bottom: 12px;
}

.detail-field label {
    display: block;
    font-size: 11px;
    color: #78909C;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.detail-field span,
.detail-field ul {
    font-size: 14px;
    color: #e0e0e0;
}

.detail-field ul {
    list-style: none;
    padding-left: 0;
}

.detail-field li {
    font-size: 13px;
    padding: 2px 0;
    color: #90A4AE;
}

.footer {
    background: #16213e;
    padding: 8px 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    border-top: 1px solid #0f3460;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.legend {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.legend-item {
    font-size: 12px;
    color: #90A4AE;
    display: flex;
    align-items: center;
    gap: 4px;
}

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

.legend-dot.concept { background: #4FC3F7; }
.legend-dot.person  { background: #FF8A65; }
.legend-dot.event   { background: #AED581; }
.legend-dot.tech    { background: #BA68C8; }
.legend-dot.project { background: #FFD54F; }
.legend-dot.topic   { background: #90A4AE; }
.legend-dot.module  { background: #26C6DA; }
.legend-dot.feature { background: #EF5350; }

.controls {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.controls label {
    color: #90A4AE;
    font-size: 12px;
}

.controls select,
.controls input {
    padding: 4px 8px;
    border: 1px solid #0f3460;
    border-radius: 4px;
    background: #1a1a2e;
    color: #e0e0e0;
    font-size: 13px;
}

.controls select {
    cursor: pointer;
}

.controls input {
    width: 140px;
}

.stats-bar {
    font-size: 13px;
    color: #90A4AE;
    margin-left: auto;
}

.stats-bar.hidden {
    display: none;
}

.stats-bar span {
    color: #4FC3F7;
    font-weight: 600;
}
