:root {
    --bg-dark: #121212;
    --bg-panel: #1e1e1e;
    --bg-input: #2d2d2d;
    --text-main: #e0e0e0;
    --text-muted: #aaaaaa;
    --accent: #ff66aa;
    --border: #333;
    --font-ui: 'Inter', sans-serif;
    --font-code: 'JetBrains Mono', monospace;
}

* {
    box-sizing: border-box;
}

body, html {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-ui);
}

.app-container {
    display: flex;
    width: 100%;
    height: 100%;
}

.sidebar {
    width: 340px;
    background-color: var(--bg-panel);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 15px;
    z-index: 2000;
    flex-shrink: 0;
    overflow-y: auto;
}

.viz-area {
    flex-grow: 1;
    position: relative;
    background-color: #000;
}

#plotly-div {
    width: 100%;
    height: 100%;
}

h3 {
    margin: 0 0 15px 0;
    color: var(--accent);
}

hr {
    border: 0;
    border-top: 1px solid #333;
    margin: 15px 0;
}

.control-group {
    margin-bottom: 12px;
}

label {
    display: block;
    font-size: 0.85em;
    color: var(--text-muted);
    margin-bottom: 5px;
}

input[type="text"], select {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: #fff;
    padding: 6px;
    border-radius: 4px;
    font-family: var(--font-code);
    font-size: 0.9em;
}

input[type="range"] {
    width: 100%;
    accent-color: var(--accent);
}

.btn-primary, .btn-small {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    text-align: center;
    display: block;
    width: 100%;
}

.btn-small {
    background: #444;
    margin-top: 5px;
    font-size: 0.8em;
}

.btn-small:hover {
    background: #555;
}

.file-upload-wrapper input {
    display: none;
}

/* Suggestions */
.smart-input-container {
    position: relative;
}

.suggestions-box {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #252526;
    border: 1px solid var(--accent);
    max-height: 200px;
    overflow-y: auto;
    display: none;
    z-index: 100;
}

.suggestions-box.visible {
    display: block;
}

.suggestion-item {
    padding: 5px 10px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    font-size: 0.8em;
}

.suggestion-item:hover {
    background: #333;
}

/* Panels */
.details-panel {
    background: #111;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 0.85em;
    min-height: 200px;
    overflow-y: auto;
    border: 1px solid #333;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #222;
    padding: 2px 0;
}

.neighbors-panel h4 {
    margin: 0 0 5px 0;
    font-size: 0.9em;
    color: #888;
}

#neighbors-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

#neighbors-list li {
    padding: 4px;
    border-bottom: 1px solid #333;
    font-size: 0.8em;
    cursor: pointer;
}

#neighbors-list li:hover {
    background: #333;
    color: var(--accent);
}

/* Overlay */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

#loading-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #333;
    border-top: 4px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px auto;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/* Tooltip */
#custom-tooltip {
    position: absolute;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid #444;
    padding: 5px;
    border-radius: 4px;
    font-size: 0.8em;
    display: none;
    z-index: 3000;
    white-space: nowrap;
}

.radio-group {
    display: flex;
    gap: 10px;
    font-size: 0.85em;
    margin-top: 5px;
}