:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --secondary: #10b981;
    --secondary-hover: #059669;
    --bg-main: #f0f2f5;
    --bg-panel: rgba(255, 255, 255, 0.9);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    overflow: hidden;
    margin: 0;
    padding: 0;
}

#phet-stage {
    position: absolute;
    top: 0;
    left: 0;
    width: 1280px;
    height: 720px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #f0f2f5;
    transform-origin: top left;
}

header {
    background: #fff;
    padding: 0.75rem 2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

#sim-app {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
}

main {
    flex: 1;
    display: flex;
    flex-direction: row !important;
    position: relative;
    background: #f8fafc;
    overflow: hidden;
}

.simulation-view {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

#simCanvas {
    width: 100%;
    height: 100%;
    background: #f8fafc;
}

/* Responsive Sidebar and Controls */
.control-panel-sidebar {
    width: 240px;
    background: #fff;
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    padding: 12px;
    gap: 12px;
    flex-shrink: 0;
}

.phet-box {
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.section-header {
    background: #3b82f6;
    color: white;
    padding: 6px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.interaction-section .section-header {
    background: #ec4899;
}

.section-content {
    padding: 10px;
}

.control-group {
    margin-bottom: 10px;
}

.control-group label {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.val-display {
    font-weight: 700;
    font-size: 0.75rem;
}

.k-val { color: #10b981; }
.m-val { color: #6366f1; }
.b-val { color: #ec4899; }
.f-val { color: #f59e0b; }

.btn-reset-main {
    width: 100%;
    background: #ef4444;
    color: white;
    border: none;
    padding: 8px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.2s;
}

.btn-reset-main:hover {
    background: #dc2626;
}