:root {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --accent-primary: #e94560;   /* Bright Red/Orange */
    --accent-secondary: #9f7aea;  /* Purple */
    --text-primary: #f0f0f0;
    --text-secondary: #a0a0c0;
    --glass-border: rgba(159, 122, 234, 0.2);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.simulation-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    width: 100%;
    max-width: 1400px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.visualization-panel {
    flex: 2;
    position: relative;
    min-width: 500px;
}

#simulationCanvas {
    width: 100%;
    height: 100%;
    min-height: 600px;
    background-color: #0f0f1f;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    cursor: crosshair;
}

.overlay-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-secondary);
    font-size: 1.2rem;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.control-panel {
    flex: 1;
    background-color: var(--bg-primary);
    border-radius: 10px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 25px;
    min-width: 320px;
    border: 1px solid var(--glass-border);
}

.control-group { border-bottom: 1px solid var(--glass-border); padding-bottom: 20px; }
.control-group:last-of-type { border-bottom: none; }
.control-group h3, .equation-box h4 {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 15px;
    color: var(--accent-secondary);
    font-weight: 500;
}
.control-group label { display: block; margin-bottom: 8px; color: var(--text-secondary); font-size: 0.9rem; }
.actions { display: flex; gap: 10px; }
button {
    flex: 1; padding: 12px;
    border: 1px solid var(--glass-border);
    background-color: var(--accent-primary);
    color: #fff;
    border-radius: 5px; cursor: pointer; transition: all 0.2s ease;
    font-size: 1rem; font-weight: bold;
}
button:hover { background-color: #ff6347; }

.slider {
    -webkit-appearance: none; width: 100%; height: 8px;
    background: var(--bg-secondary); border-radius: 5px; outline: none;
}
.slider::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 18px; height: 18px; background: var(--accent-secondary);
    border-radius: 50%; cursor: pointer;
}

.switch { position: relative; display: inline-block; width: 50px; height: 28px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
    position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--bg-secondary); transition: .4s; border-radius: 28px;
}
.switch-slider:before {
    position: absolute; content: ""; height: 20px; width: 20px;
    left: 4px; bottom: 4px; background-color: white; transition: .4s; border-radius: 50%;
}
input:checked + .switch-slider { background-color: var(--accent-primary); }
input:checked + .switch-slider:before { transform: translateX(22px); }
.switch-label { display: inline-block; vertical-align: middle; margin-right: 10px; }

.equation-box {
    margin-top: auto; padding: 20px;
    background-color: var(--bg-secondary);
    border-radius: 10px; border: 1px solid var(--glass-border);
    font-size: 0.9rem;
}
.equation-box p { color: var(--text-secondary); margin: 10px 0; }