/* ==========================================================================
   Physics Sandbox Container
   ========================================================================== */
.physics-sandbox {
    position: relative;
    width: 100%;
    height: 80vh;
    background: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 4px solid #666;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   Toolbar
   ========================================================================== */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 15px;
    background: #2a2a2a;
    border-bottom: 2px solid #333;
    align-items: flex-start;
}

.tool-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 200px;
}

.tool-section h3 {
    color: var(--accent);
    font-size: 1rem;
    margin: 0;
    font-weight: bold;
}

.particle-tools,
.action-tools,
.view-modes {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.tool-btn {
    padding: 8px 12px;
    background: #444;
    color: #fff;
    border: 2px solid #555;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
    min-width: 60px;
    text-align: center;
}

.tool-btn:hover {
    background: #555;
    border-color: #666;
    transform: translateY(-1px);
}

.tool-btn.active {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(0, 255, 204, 0.3);
}

.view-btn {
    padding: 6px 10px;
    background: #444;
    color: #fff;
    border: 2px solid #555;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s;
    min-width: 50px;
    text-align: center;
}

.view-btn:hover {
    background: #555;
    border-color: #666;
    transform: translateY(-1px);
}

.view-btn.active {
    background: #ff6b35;
    color: #000;
    border-color: #ff6b35;
    box-shadow: 0 0 10px rgba(255, 107, 53, 0.3);
}

/* ==========================================================================
   Settings
   ========================================================================== */
.settings {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-group {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.setting-group label {
    color: #ccc;
    min-width: 60px;
    font-size: 0.85rem;
}

.setting-group input[type="range"] {
    width: 80px;
    height: 20px;
    background: #444;
    outline: none;
    border-radius: 10px;
    -webkit-appearance: none;
}

.setting-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
}

.setting-group input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.setting-group span {
    color: var(--accent);
    font-weight: bold;
    min-width: 30px;
    text-align: center;
    font-size: 0.8rem;
}


/* ==========================================================================
   Canvas
   ========================================================================== */
#physicsCanvas {
    flex: 1;
    width: 100%;
    height: 100%;
    background: #111;
    cursor: crosshair;
    display: block;
    border: 3px solid #333;
    border-radius: 8px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
    position: relative;
}

#physicsCanvas::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border: 1px solid var(--accent);
    border-radius: 8px;
    pointer-events: none;
    z-index: 1;
}


/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 1200px) {
    .toolbar {
        flex-direction: column;
        gap: 15px;
    }
    
    .tool-section {
        min-width: auto;
        width: 100%;
    }
    
    .particle-tools,
    .action-tools {
        justify-content: center;
    }
    
    .info-panel {
        margin-left: 0;
        align-items: center;
        flex-direction: row;
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .physics-sandbox {
        height: 70vh;
    }
    
    .toolbar {
        padding: 10px;
        gap: 10px;
    }
    
    .tool-btn {
        padding: 6px 10px;
        font-size: 0.8rem;
        min-width: 50px;
    }
    
    .setting-group {
        font-size: 0.8rem;
    }
    
    .setting-group input[type="range"] {
        width: 60px;
    }
    
    .instructions {
        font-size: 0.8rem;
        padding: 8px;
    }
}

/* ==========================================================================
   Particle Colors (for reference)
   ========================================================================== */
.particle-powder { background: #8B4513; }
.particle-water { background: #0066CC; }
.particle-fire { background: #FF4500; }
.particle-ice { background: #87CEEB; }
.particle-stone { background: #696969; }
.particle-sand { background: #F4A460; }
.particle-oil { background: #2F2F2F; }
.particle-gas { background: #90EE90; }
.particle-acid { background: #32CD32; }
.particle-metal { background: #C0C0C0; }