/* Vector Addition Lab Styles */

html,
body.phet-theme {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #0f172a;
    font-family: 'Outfit', sans-serif;
    overscroll-behavior: none;
    touch-action: none; /* Disable browser defaults for panning */
}

#phet-stage {
    position: absolute;
    top: 0;
    left: 0;
    width: 1280px;
    height: 720px;
    background: #fdfdfd;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: 0 0; /* Updated for custom pan/zoom math */
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    touch-action: none;
}

#sim-app {
    flex: 1;
    display: flex;
    overflow: hidden;
}

nav {
    position: relative !important;
    background: #f8fafc !important;
    height: 65px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    border-bottom: 2px solid #e2e8f0;
    flex-shrink: 0;
    box-sizing: border-box;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: #1e293b;
}

.separator {
    color: #cbd5e1;
    font-weight: 300;
}

.subject-tag {
    font-size: 0.95rem;
    color: #64748b;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.experiment-tag {
    font-size: 0.95rem;
    color: #3b82f6;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links a {
    text-decoration: none;
    color: #64748b;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: #3b82f6;
}

.sim-container {
    display: flex;
    width: 100%;
    height: 100%;
    padding-top: 0;
}

.canvas-panel {
    flex: 1;
    position: relative;
    background: #f8fafc;
    overflow: hidden;
    min-height: 0;
}

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

#grid-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: 
        linear-gradient(rgba(100, 116, 139, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(100, 116, 139, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
}

/* Sidebar Dark Theme (consistent with user preference) */
.control-panel {
    width: 320px;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1.25rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    color: white;
    z-index: 10;
}

@media (max-width: 1024px) {
    .control-panel {
        width: 220px;
        padding: 0.8rem;
        gap: 10px;
    }
    .hud-item {
        font-size: 0.8rem;
        gap: 10px;
    }
}

.phet-box {
    background: rgba(30, 41, 59, 0.7);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
}

.section-header {
    font-size: 0.85rem;
    margin-bottom: 12px;
    color: #cbd5e1;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
}

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

.control-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: #94a3b8;
}

input[type="range"] {
    width: 100%;
    height: 6px;
    background: #334155;
    border-radius: 5px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #ffffff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-bottom: 10px;
    color: #e2e8f0;
}

/* Vector HUD */
#vector-hud {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.9);
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 10px;
    border: 1px solid rgba(0,0,0,0.05);
    backdrop-filter: blur(10px);
}

.hud-item {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.95rem;
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.hud-label {
    font-weight: 700;
    color: #475569;
}

.a-vec span:last-child { color: #2563eb; }
.b-vec span:last-child { color: #ef4444; }
.sum-vec span:last-child { color: #10b981; font-weight: 700; }

.sim-info {
    padding: 10px;
}

.sim-info h4 { color: #cbd5e1; margin-bottom: 5px; }
.sim-info p { font-size: 0.85rem; color: #94a3b8; line-height: 1.5; }
