/* Dynamic Equilibrium (Haber Process) Styles */

:root {
    --sim-n2: #3b82f6;
    /* Blue for N2 */
    --sim-h2: #f97316;
    /* Orange for H2 */
    --sim-nh3: #22c55e;
    /* Green for NH3 */
}

/* Typography and Header specific to this sim */
.reaction-header {
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.8rem;
    margin-bottom: 1rem;
}

.reaction-eq {
    font-family: monospace;
    font-size: 1.4rem;
    background: #f1f5f9;
    padding: 8px 12px;
    border-radius: 6px;
    display: inline-block;
}

.eq-arrows {
    font-size: 1.8rem;
    margin: 0 8px;
    color: #64748b;
    position: relative;
    top: 3px;
}

.rs-blue {
    color: var(--sim-n2);
}

.rs-orange {
    color: var(--sim-h2);
}

.rs-green {
    color: var(--sim-nh3);
}

.enthalpy {
    display: inline-block;
    margin-left: 1rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    color: #ef4444;
    /* Exothermic = red */
}

/* Canvas Area */
.canvas-container {
    position: relative;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

#particleCanvas {
    display: block;
    width: 100%;
    height: 100%;
}

.sim-legend {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    pointer-events: none;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.legend-item:last-child {
    margin-bottom: 0;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.dot-n2 {
    background: var(--sim-n2);
}

.dot-h2 {
    background: var(--sim-h2);
}

.dot-nh3 {
    background: var(--sim-nh3);
}


/* Live Counters & Status */
.eq-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.eq-status.pending {
    background: #fef08a;
    color: #854d0e;
}

.eq-status.active {
    background: #dcfce7;
    color: #166534;
}

.shift-status {
    font-size: 0.85rem;
    font-weight: 600;
}

.shift-status.left {
    color: #ef4444;
}

.shift-status.right {
    color: var(--sim-nh3);
}

.shift-status.neutral {
    color: #64748b;
}

.pb-controls {
    background: #f1f5f9;
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Action Buttons */
#btn-add-n2 {
    color: var(--sim-n2);
    border-color: var(--sim-n2);
}

#btn-add-n2:hover {
    background: var(--sim-n2);
    color: white;
}

#btn-add-h2 {
    color: var(--sim-h2);
    border-color: var(--sim-h2);
}

#btn-add-h2:hover {
    background: var(--sim-h2);
    color: white;
}

#btn-add-nh3 {
    color: var(--sim-nh3);
    border-color: var(--sim-nh3);
}

#btn-add-nh3:hover {
    background: var(--sim-nh3);
    color: white;
}

#btn-rem-nh3:hover {
    background: #8b5cf6;
    color: white !important;
}

/* Sliders */
.slider-group {
    margin-bottom: 1rem;
}

.slider-group label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.5rem;
    cursor: help;
}

.slider-val {
    color: var(--brand-teal);
    font-family: monospace;
    font-size: 0.95rem;
}

input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: var(--brand-teal);
    cursor: pointer;
    margin-top: -6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: #cbd5e1;
    border-radius: 2px;
}

/* Catalyst Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    margin-right: 10px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider.round {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .2s;
    border-radius: 24px;
}

.slider.round:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .2s;
    border-radius: 50%;
}

input:checked+.slider.round {
    background-color: var(--brand-teal);
}

input:checked+.slider.round:before {
    transform: translateX(20px);
}