@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

:root {
    --bg-color: #0d0f14;
    --panel-bg: rgba(26, 28, 35, 0.8);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-color: #e2e8f0;
    --accent: #3b82f6;
    --highlight: #60a5fa;
    --card-bg: rgba(255, 255, 255, 0.03);
}

body.light-theme {
    --bg-color: #f8fafc;
    --panel-bg: rgba(255, 255, 255, 0.9);
    --border-color: rgba(0, 0, 0, 0.08);
    --text-color: #1e293b;
    --accent: #2563eb;
    --card-bg: rgba(0, 0, 0, 0.02);
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

#canvas-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: radial-gradient(circle at center, rgba(59, 130, 246, 0.05) 0%, transparent 70%);
}

#sidebar {
    width: 320px;
    background: var(--panel-bg);
    border-left: 1px solid var(--border-color);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    padding: 32px 24px;
    gap: 32px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #64748b;
}

button {
    flex: 1;
    padding: 12px;
    border-radius: 10px;
    border: none;
    background: var(--accent);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

button.secondary {
    background: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

button:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
}

button:active {
    transform: translateY(0);
}

#legend-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    background: var(--card-bg);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    transition: transform 0.2s;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 12px;
    box-shadow: 0 0 10px currentColor;
}

.legend-name {
    flex: 1;
    font-weight: 600;
    font-size: 0.85rem;
}

.legend-count {
    font-weight: 700;
    font-size: 0.8rem;
    opacity: 0.8;
}

input[type=range] {
    flex: 1;
    accent-color: var(--accent);
}