html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #e2e8f0;
}

#phet-stage {
    position: absolute;
    top: 0;
    left: 0;
    width: 1280px;
    height: 950px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    background: #e2e8f0;
    transform-origin: top left;
}

.sim-container {
    display: flex;
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
    gap: 20px;
    min-height: 520px;
}

.canvas-wrapper {
    position: relative;
    flex: 3;
    background: linear-gradient(to bottom, #87CEEB 0%, #a2dcf3 70%, #fff 100%);
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 2px solid #cbd5e1;
    display: flex;
}

canvas#simCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

.controls-wrapper {
    flex: 1;
    min-width: 300px;
    background: #fff;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
}

@media (max-width: 1024px) {
    .controls-wrapper {
        min-width: 220px;
        padding: 10px;
    }
    .btn {
        padding: 8px;
    }
}

.ph-panel {
    background: #fff;
    border: 1px solid #e2e8f0;
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.control-group label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    display: flex;
    justify-content: space-between;
}

.control-group input[type="range"] {
    width: 100%;
    accent-color: #3b82f6;
}

.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 5px;
}

.btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    color: white;
    transition: 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-fire {
    background: #10b981;
    box-shadow: 0 4px 0 #059669;
}

.btn-fire:hover {
    background: #059669;
    transform: translateY(2px);
    box-shadow: 0 2px 0 #047857;
}

.btn-fire:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 #047857;
}

.btn-clear {
    background: #64748b;
    box-shadow: 0 4px 0 #475569;
}

.btn-clear:hover {
    background: #475569;
    transform: translateY(2px);
    box-shadow: 0 2px 0 #334155;
}

.btn-clear:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 #334155;
}

/* Data Section */
.data-wrapper {
    display: flex;
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    gap: 20px;
    margin-bottom: 20px;
}

.table-container {
    flex: 1.5;
    overflow-y: auto;
    max-height: 350px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    position: relative;
    padding-left: 10px;
    padding-right: 10px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

th {
    background: #f1f5f9;
    position: sticky;
    top: 40px;
    z-index: 1;
    border-bottom: 2px solid #cbd5e1;
    padding: 10px 8px;
    color: #334155;
}

td {
    border-bottom: 1px solid #e2e8f0;
    padding: 8px;
    text-align: center;
    color: #475569;
}

tbody tr:hover {
    background: #f8fafc;
}

.graphs-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}