body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8f9fa;
    overflow: hidden;
}

#graph {
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.controls {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1000;
}

.controls button {
    margin-right: 10px;
    padding: 8px 16px;
    background: #333;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.controls button:hover {
    background: #555;
}

.stats {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 10px;
    border-radius: 4px;
    z-index: 1000;
    font-size: 12px;
}

.stats span {
    margin-right: 15px;
}

.search-panel {
    position: absolute;
    top: 60px;
    left: 10px;
    width: 400px;
    max-height: 60vh;
    background: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1001;
    display: flex;
    flex-direction: column;
}

.search-header {
    padding: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    gap: 10px;
}

.search-header input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.search-header button {
    padding: 8px 16px;
    background: #666;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.search-results {
    max-height: 50vh;
    overflow-y: auto;
    padding: 10px;
}

.search-result {
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s;
}

.search-result:hover {
    background-color: #f8f9fa;
}

.search-result:last-child {
    border-bottom: none;
}

.result-title {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.result-type {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.result-snippet {
    font-size: 13px;
    color: #555;
    line-height: 1.4;
}

.highlight {
    background-color: #fff3cd;
    padding: 1px 2px;
    border-radius: 2px;
}

.detail-panel {
    position: absolute;
    top: 60px;
    right: 10px;
    width: 450px;
    max-height: 80vh;
    background: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1001;
    display: flex;
    flex-direction: column;
}

.detail-header {
    padding: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.detail-header h3 {
    margin: 0;
    color: #333;
}

.detail-header button {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 24px;
    height: 24px;
    text-align: center;
}

.detail-content {
    padding: 15px;
    overflow-y: auto;
    flex: 1;
}

.detail-section {
    margin-bottom: 20px;
}

.detail-section h4 {
    margin: 0 0 10px 0;
    color: #444;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.observation-item {
    background: #f8f9fa;
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 4px;
    border-left: 3px solid #007bff;
    font-size: 13px;
    line-height: 1.5;
}

.connection-item {
    background: #fff3cd;
    padding: 8px;
    margin-bottom: 6px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.connection-item:hover {
    background: #ffeaa7;
}

.observation-item.highlighted {
    background: #fff3cd;
    border-left-color: #ffc107;
}

.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    color: white;
    font-size: 18px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error {
    background: #ffebee;
    color: #c62828;
    padding: 10px;
    border-radius: 4px;
    margin: 10px;
    border-left: 4px solid #c62828;
}

/* Context menu */
.context-menu {
    position: absolute;
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 10000;
    min-width: 150px;
}

.context-menu-item {
    padding: 10px 16px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.context-menu-item:last-child {
    border-bottom: none;
}

.context-menu-item:hover {
    background: #f5f5f5;
}

/* Responsive design */
@media (max-width: 768px) {
    .search-panel {
        width: 90vw;
        left: 5vw;
    }

    .detail-panel {
        width: 90vw;
        right: 5vw;
    }

    .controls button {
        padding: 6px 12px;
        font-size: 12px;
        margin-right: 5px;
    }
}
