/* BALLS Knowledge Graph - Main Styles */

:root {
    --bg-primary: #0f1419;
    --bg-secondary: #1a1f2e;
    --bg-tertiary: #27272a;
    --text-primary: #e4e4e7;
    --text-secondary: #a1a1aa;
    --accent-primary: #00d4ff;
    --accent-secondary: #3b82f6;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;
    --accent-success: #10b981;
    --border-color: #2d3748;
}

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

html, body {
    height: 100%;
    width: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
}

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

/* Graph Container */
#graph-container {
    flex: 1;
    position: relative;
    background: var(--bg-primary);
    overflow: hidden;
    min-height: 100vh;
    height: 100%;
}

/* Vis.js specific styling */
#graph-container .vis-network {
    width: 100%;
    height: 100%;
}

/* Custom tooltip styling */
.vis-tooltip {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 4px !important;
    color: var(--text-primary) !important;
    font-family: inherit !important;
    padding: 0 !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3) !important;
}

.vis-tooltip-content {
    padding: 12px;
}

.vis-tooltip-content h4 {
    margin: 0 0 8px 0;
    color: var(--accent-primary);
}

.vis-tooltip-content p {
    margin: 4px 0;
    font-size: 12px;
}

.anomaly-badges {
    margin-top: 8px;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.anomaly-badge {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 500;
}

.anomaly-badge.critical {
    background: var(--accent-danger);
    color: white;
}

.anomaly-badge.warning {
    background: var(--accent-warning);
    color: white;
}

.anomaly-badge.info {
    background: var(--accent-secondary);
    color: white;
}

/* Upload Status Indicator */
.upload-status {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 400px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    transition: all 0.3s ease;
}

.upload-status.hidden {
    transform: translateY(120%);
    opacity: 0;
}

.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.upload-header h4 {
    margin: 0;
    color: var(--accent-primary);
    font-size: 16px;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.close-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.upload-progress {
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent-primary);
    transition: width 0.3s ease;
    border-radius: 4px;
}

.progress-text {
    color: var(--text-secondary);
    font-size: 14px;
    min-width: 40px;
    text-align: right;
}

.upload-details {
    padding: 0 16px 16px;
}

.file-name {
    font-weight: 500;
    color: var(--text-primary);
    margin: 0 0 8px 0;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status-message {
    color: var(--text-secondary);
    margin: 0;
    font-size: 13px;
}

.upload-actions {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
}

.cancel-btn {
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.cancel-btn:hover {
    background: var(--accent-danger);
    border-color: var(--accent-danger);
}

/* Responsive upload status */
@media (max-width: 768px) {
    .upload-status {
        width: calc(100% - 40px);
        left: 20px;
        right: 20px;
    }
}

/* Bulk Processor */
.bulk-processor {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    max-width: 90vw;
    max-height: 80vh;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.bulk-processor.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.9);
}

.bulk-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.bulk-header h3 {
    margin: 0;
    color: var(--accent-primary);
}

.bulk-dropzone {
    margin: 20px;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.bulk-dropzone:hover {
    border-color: var(--accent-primary);
    background: rgba(0, 212, 255, 0.05);
}

.bulk-dropzone.dragover {
    border-color: var(--accent-primary);
    background: rgba(0, 212, 255, 0.1);
}

.dropzone-content svg {
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.dropzone-content p {
    margin: 5px 0;
    color: var(--text-secondary);
}

.file-types {
    font-size: 12px;
    color: var(--text-secondary);
}

.bulk-queue {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.bulk-queue h4 {
    margin: 0 0 15px 0;
    color: var(--text-primary);
    font-size: 14px;
}

.queue-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.queue-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    font-size: 13px;
}

.queue-item.processing {
    background: rgba(59, 130, 246, 0.1);
}

.queue-item.complete {
    background: rgba(16, 185, 129, 0.1);
}

.queue-item.error {
    background: rgba(239, 68, 68, 0.1);
}

.file-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    color: var(--text-secondary);
    font-size: 12px;
}

.status-icon {
    font-size: 16px;
}

.error-msg {
    color: var(--accent-danger);
    font-size: 11px;
}

.bulk-stats {
    display: flex;
    justify-content: space-around;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

.bulk-stats .stat-item {
    text-align: center;
}

.bulk-actions {
    display: flex;
    gap: 10px;
    padding: 20px;
}

.btn-primary {
    flex: 1;
    padding: 10px 20px;
    background: var(--accent-primary);
    border: none;
    border-radius: 4px;
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: var(--accent-secondary);
}

.btn-secondary {
    flex: 1;
    padding: 10px 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: var(--accent-success);
    border-color: var(--accent-success);
}

.btn-danger {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--accent-danger);
    border-radius: 4px;
    color: var(--accent-danger);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: var(--accent-danger);
    color: white;
}

.bulk-progress {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

/* Progress Bar Styles */
.progress-message {
    margin-bottom: 10px;
}

.progress-container {
    margin: 10px 0;
    padding: 5px 0;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background-color: var(--bg-tertiary);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    margin-bottom: 5px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #06b6d4);
    border-radius: 10px;
    transition: width 0.3s ease, background-color 0.3s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255,255,255,0.3) 50%,
        transparent 100%
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-percentage {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: right;
    margin-bottom: 5px;
}

.progress-filename {
    font-size: 11px;
    color: var(--text-tertiary);
    font-style: italic;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.progress-text {
    font-weight: 500;
    color: var(--text-primary);
}

/* Node Explorer Styles */
.node-explorer {
    max-height: 600px;
    overflow-y: auto;
}

/* Close button for node panel */
.close-panel-btn {
    background: var(--accent-danger);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    float: right;
    margin-left: 10px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.close-panel-btn:hover {
    background: #dc2626;
    transform: scale(1.1);
}

#selected-node-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.node-explorer .section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.node-explorer .section:last-child {
    border-bottom: none;
}

.node-explorer h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.node-explorer h5 {
    margin: 0 0 8px 0;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.node-type {
    background: var(--accent-primary);
    color: white;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.attention-score {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    color: var(--accent-success);
}

.connection-count {
    font-weight: 600;
    color: var(--accent-primary);
}

.attribute-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    word-break: break-all;
}

/* Relationships */
.relationships-list {
    max-height: 300px;
    overflow-y: auto;
}

.relationship-group {
    margin-bottom: 15px;
}

.relationship-type {
    background: var(--bg-tertiary);
    padding: 4px 8px;
    border-radius: 6px;
    color: var(--text-primary);
    font-weight: 600;
}

.relationship-items {
    margin-top: 8px;
    margin-left: 12px;
}

.relationship-item {
    padding: 6px 8px;
    margin: 2px 0;
    background: var(--bg-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.relationship-item:hover {
    background: var(--accent-primary);
    color: white;
    transform: translateX(4px);
}

.relationship-arrow {
    font-weight: bold;
    color: var(--accent-secondary);
    min-width: 16px;
}

.related-node {
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
}

.related-type {
    font-size: 10px;
    color: var(--text-tertiary);
    font-style: italic;
}

.relationship-weight {
    font-size: 10px;
    background: var(--accent-warning);
    color: white;
    padding: 1px 4px;
    border-radius: 4px;
    font-weight: 600;
}

.no-relationships {
    color: var(--text-tertiary);
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* Actions */
.node-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.action-btn {
    background: var(--accent-primary);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
    min-width: 120px;
}

.action-btn:hover {
    background: var(--accent-secondary);
    transform: translateY(-1px);
}

/* Anomalies */
.anomaly {
    padding: 8px;
    border-radius: 6px;
    margin: 4px 0;
    font-size: 12px;
}

.anomaly-low {
    background: var(--accent-warning);
    color: white;
}

.anomaly-medium {
    background: var(--accent-warning);
    color: white;
}

.anomaly-high {
    background: var(--accent-danger);
    color: white;
}

.bulk-progress.hidden {
    display: none;
}

/* Relationship Builder */
.relationship-builder {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    width: 380px;
    max-height: 80vh;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 1500;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.relationship-builder.hidden {
    transform: translateY(-50%) translateX(120%);
    opacity: 0;
}

.builder-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.builder-header h3 {
    margin: 0;
    color: var(--accent-primary);
    font-size: 18px;
}

.selected-node-info {
    padding: 20px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.selected-node-info h4 {
    margin: 0 0 8px 0;
    color: var(--text-primary);
    font-size: 16px;
}

.node-type, .node-connections {
    margin: 4px 0;
    color: var(--text-secondary);
    font-size: 13px;
}

.builder-options {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.builder-options h4 {
    margin: 0 0 15px 0;
    color: var(--text-primary);
    font-size: 14px;
}

.option-group {
    margin-bottom: 15px;
}

.option-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
}

.option-group input[type="checkbox"] {
    cursor: pointer;
}

.option-group input[type="range"] {
    width: 100%;
    margin: 8px 0;
}

.option-help {
    display: block;
    margin-left: 24px;
    color: var(--text-secondary);
    font-size: 11px;
    margin-top: 4px;
}

#strength-value {
    color: var(--accent-primary);
    font-weight: 500;
}

.builder-actions {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
}

.builder-progress {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.builder-results {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    max-height: 300px;
    overflow-y: auto;
}

.builder-results h4 {
    margin: 0 0 10px 0;
    color: var(--text-primary);
    font-size: 14px;
}

.results-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    font-size: 13px;
    color: var(--text-secondary);
}

.results-stats strong {
    color: var(--accent-primary);
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    font-size: 12px;
}

.rel-icon {
    font-size: 16px;
}

.rel-target {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
}

.rel-strength {
    color: var(--accent-primary);
    font-weight: 500;
}

.rel-reason {
    color: var(--text-secondary);
    font-size: 11px;
    text-align: right;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-more {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 10px;
}

/* IGOR Main Interface */
.igor-main {
    width: 450px; /* Wider than before */
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Changed to hidden for better chat scrolling */
    transition: transform 0.3s ease;
    height: 100vh;
}

@media (max-width: 768px) {
    .igor-main {
        position: fixed;
        right: 0;
        top: 0;
        height: 100%;
        width: 100vw; /* Full width on mobile */
        transform: translateX(100%);
        z-index: 1000;
    }
    
    .igor-main.open {
        transform: translateX(0);
    }
}

/* Igor Header */
.igor-header {
    padding: 20px;
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.igor-header h2 {
    color: var(--accent-primary);
    font-size: 24px;
    margin-bottom: 5px;
}

.igor-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Main Chat Area */
.igor-chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    padding-bottom: 10px;
}

.message {
    margin-bottom: 20px;
    padding: 15px;
    border-radius: 12px;
    max-width: 100%;
    word-wrap: break-word;
}

.igor-message {
    background: linear-gradient(135deg, var(--bg-tertiary), #1e2a3a);
    border-left: 4px solid var(--accent-primary);
}

.user-message {
    background: var(--bg-tertiary);
    margin-left: 20px;
    border-left: 4px solid var(--accent-secondary);
}

.message-content {
    line-height: 1.6;
    color: var(--text-primary);
}

.quick-actions {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.quick-btn {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border: none;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-btn:hover {
    background: var(--accent-secondary);
    transform: translateY(-1px);
}

.chat-input-container {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.stats-panel {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-primary);
}

.stats-panel .stat-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 14px;
}

/* Legacy Igor Chat (remove old styles) */
.igor-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 300px;
    max-height: 400px;
    border-bottom: 1px solid var(--border-color);
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: var(--bg-primary);
}

.chat-message {
    margin-bottom: 15px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-message.user {
    text-align: right;
}

.chat-message.igor {
    text-align: left;
}

.message-bubble {
    display: inline-block;
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.user .message-bubble {
    background: var(--accent-secondary);
    color: white;
}

.igor .message-bubble {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.chat-input-container {
    display: flex;
    padding: 15px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.igor-input {
    flex: 1;
    padding: 10px 15px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.igor-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.igor-send-btn {
    margin-left: 10px;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--accent-primary), #0099cc);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.igor-send-btn:hover {
    transform: translateY(-1px);
}

/* Graph Stats */
.graph-stats {
    padding: 20px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.graph-stats h3 {
    font-size: 16px;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
}

.stat-label {
    color: var(--text-secondary);
}

.stat-value {
    color: var(--accent-primary);
    font-weight: 600;
}

/* Controls */
.controls {
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    border-bottom: 1px solid var(--border-color);
}

.simulation-controls {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.simulation-controls h4 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.simulation-controls .control-btn {
    margin-right: 10px;
    margin-bottom: 8px;
}

.performance-controls {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.performance-controls h4 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.performance-controls .control-btn {
    margin-right: 10px;
    margin-bottom: 8px;
    background: var(--accent-warning);
    color: white;
}

.performance-controls .control-btn:hover {
    background: #f59e0b;
}

.control-btn {
    padding: 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.control-btn:hover {
    background: var(--accent-secondary);
    border-color: var(--accent-secondary);
    transform: translateY(-1px);
}

/* Upload Section */
.upload-section {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.upload-section h3 {
    font-size: 16px;
    margin-bottom: 10px;
}

#file-upload {
    width: 100%;
    padding: 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
}

/* Node Info Panel */
.node-info {
    padding: 20px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.node-info h3 {
    font-size: 16px;
    margin-bottom: 15px;
    color: var(--accent-primary);
}

.node-detail {
    margin-bottom: 8px;
    font-size: 13px;
}

/* Anomaly Analysis */
.anomaly-analysis {
    padding: 20px;
    background: var(--bg-tertiary);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section-header h3 {
    font-size: 16px;
}

.status-indicator {
    font-size: 12px;
    padding: 4px 10px;
    background: rgba(107, 114, 128, 0.1);
    border: 1px solid rgba(107, 114, 128, 0.2);
    border-radius: 12px;
    color: var(--text-secondary);
}

.anomaly-content {
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder {
    color: var(--text-secondary);
    font-size: 13px;
    text-align: center;
}

/* Loading Indicator */
.loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 1000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

/* Tooltip */
.tooltip {
    position: absolute;
    padding: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 12px;
    pointer-events: none;
    z-index: 1000;
    max-width: 250px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Graph-specific styles */
.sphere-visualization {
    pointer-events: none;
}

/* Mobile Toggle Button */
.mobile-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--accent-primary), #0099cc);
    border-radius: 50%;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    z-index: 999;
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3);
}

@media (max-width: 768px) {
    .mobile-toggle {
        display: block;
    }
}