/* ── PhET Scaling Base ───────────────────────────────────── */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* PhET Stage — scalable container */
#phet-stage {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: top left;
    background: #0f172a;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Stage itself shouldn't scroll, panels should */
    width: 1280px;
    height: 720px;
}

/* Main container setup */
.sim-container {
    display: flex;
    flex: 1;
    width: 100%;
    margin-top: 0;
    gap: 0;
    overflow: hidden;
    height: calc(720px - 50px); /* 50px is nav height */
}

/* Sidebar Styling */
.controls-wrapper {
    width: 320px;
    display: flex;
    flex-direction: column;
    padding: 15px;
    gap: 12px;
    background: #1e293b;
    border-left: 1px solid #334155;
    overflow-y: auto;
    height: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
}

.panel-dark { background: #1e293b; border: 1px solid #334155; }
.panel-darker { background: #0f172a; border: 1px solid #1e293b; border-radius: 8px; padding: 15px; }

.ph-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Canvas Wrapper */
.canvas-wrapper {
    flex: 3;
    position: relative;
    background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #334155;
    box-shadow: inset 0 0 50px rgba(0,0,0,0.5);
}

#simCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

.law-overlay {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(15, 23, 42, 0.85);
    padding: 8px 15px;
    border-radius: 6px;
    border: 1px solid #38bdf8;
    color: #38bdf8;
    font-weight: 600;
    pointer-events: none;
    font-size: 14px;
    backdrop-filter: blur(4px);
}

/* Control Elements */
.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group label {
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    display: flex;
    justify-content: space-between;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.dark-input {
    background: #1e293b;
    border: 1px solid #475569;
    color: #f8fafc;
    padding: 8px;
    border-radius: 6px;
    font-family: inherit;
    font-size: 13px;
    width: 100%;
    box-sizing: border-box;
    cursor: pointer;
}

.dark-input:focus {
    outline: none;
    border-color: #10b981;
}

.control-group input[type="range"] {
    width: 100%;
    accent-color: #10b981;
}

.amplitude-sliders-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 5px;
}

.amp-slider-row {
    display: grid;
    grid-template-columns: 35px 1fr 35px;
    align-items: center;
    gap: 10px;
}

.amp-slider-row span {
    font-size: 11px;
    color: #94a3b8;
}

/* Buttons */
.btn-group {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    border: none;
    transition: all 0.2s;
    flex: 1;
}

.btn-fire { background: #f43f5e; color: white; }
.btn-fire:hover { background: #e11d48; box-shadow: 0 0 10px rgba(225, 29, 72, 0.4); }

.btn-clear { background: #334155; color: #f8fafc; }
.btn-clear:hover { background: #475569; }

/* HUD Displays */
.amplitude-display {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #1e293b;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 120px;
}

#ampLabel { font-size: 10px; text-transform: uppercase; color: #94a3b8; text-align: center; }

.amp-bar-container {
    height: 100px;
    width: 100%;
    background: #0f172a;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.amp-bar {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: linear-gradient(to top, #38bdf8, #10b981);
    height: 10%;
    transition: height 0.1s;
}

.info-panel .data-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 4px 0;
    border-bottom: 1px solid #1e293b;
    color: #cbd5e1;
    font-family: monospace;
}

/* Responsive Tweaks */
/* Mobile responsiveness handled by PhET Scaling Engine */
