html {
    width: 100%;
    height: 100%;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    position: relative;
}
#sidebar {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 220px;
    max-height: calc(100vh - 40px);
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 8px;
    padding: 15px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    z-index: 100;
    overflow-y: auto;
    transition: transform 0.3s ease;
}
#sidebar.collapsed {
    transform: translateX(-120%);
}
#toggle-sidebar {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 90;
    width: 40px;
    height: 40px;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: opacity 0.3s;
}
#toggle-sidebar:hover {
    background-color: #f8f9fa;
}
#canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background-color: #ffffff;
    background-image: linear-gradient(#e5e5e5 1px, transparent 1px), linear-gradient(90deg, #e5e5e5 1px, transparent 1px);
    background-size: 20px 20px;
    overflow: hidden;
}

#canvas-container canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#inspector {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 280px;
    max-height: calc(100vh - 40px);
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    z-index: 110;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

#inspector.collapsed {
    transform: translateX(120%);
    opacity: 0.2;
    pointer-events: none;
}

#inspector-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

#inspector-title {
    font-weight: 600;
    color: #333;
}

#inspector-close {
    width: 32px;
    height: 28px;
    border: 1px solid rgba(0,0,0,0.15);
    background: white;
    border-radius: 6px;
    cursor: pointer;
}

#inspector-body {
    padding: 10px 12px;
    overflow-y: auto;
}

.inspector-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.inspector-row label {
    font-size: 12px;
    color: #555;
}

.inspector-row input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    box-sizing: border-box;
}
.inspector-row select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    box-sizing: border-box;
    background: white;
}

.inspector-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    justify-self: start;
}

.inspector-empty {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

#inspector-toggle {
    position: absolute;
    right: 20px;
    bottom: 20px;
    z-index: 105;
    padding: 10px 12px;
    border: 1px solid rgba(0,0,0,0.15);
    background: rgba(255,255,255,0.95);
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
    user-select: none;
}
canvas {
    display: block;
    cursor: crosshair;
}
.module-item {
    padding: 8px;
    background-color: white;
    border: 1px solid #ced4da;
    border-radius: 4px;
    cursor: grab;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
    user-select: none;
}
.module-item:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.module-item:active {
    cursor: grabbing;
}
.icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-block;
}
.particle-icon {
    background-color: #ff4444;
    border: 2px solid #333;
}
.field-icon {
    background-color: rgba(0, 123, 255, 0.3);
    border: 1px dashed #007bff;
    border-radius: 4px;
}
.control-btn {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    color: white;
    margin-bottom: 5px;
    transition: opacity 0.2s;
}
.control-btn:hover {
    opacity: 0.9;
}
.start-btn {
    background-color: #28a745;
}
.set-btn {
    background-color: #17a2b8;
}
.reset-btn {
    background-color: #dc3545;
}
/* Removed old .module-btn styles */
h2 {
    margin-top: 0;
    font-size: 1.2rem;
    color: #333;
}
h3 {
    margin-bottom: 5px;
    font-size: 1rem;
    color: #555;
}
.controls {
    margin-top: auto;
    border-top: 1px solid #ccc;
    padding-top: 10px;
}
