* {
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}
body, html {
    height: 100%; 
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif; 
    overflow: hidden; 
}

/* Main container */
.app-container {
    display: grid;
    height: 100vh;
    width: 100vw;
    
    grid-template-rows: 56px 1fr;
    grid-template-columns: 64px 1fr 320px;
    
    grid-template-areas: 
        "header header header"
        "tools  center props";
}

/* Panels */
.header {
    grid-area: header;
    background: #f8f9fa;
    color: #495057;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid #e1e8ed;
}

.header h3 {
    font-weight: 600;
    font-size: 1.25rem;
    letter-spacing: 0.5px;
}

.tools-panel {
    grid-area: tools;
    background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
    border-right: 1px solid #e1e8ed;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 16px;
    gap: 8px;
}

.tool-btn {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.3rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    color: #495057;
}

.tool-btn:hover { 
    background: #f1f3f5;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.tool-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.tool-btn.active { 
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.tool-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.properties-panel {
    grid-area: props;
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
    border-left: 1px solid #e1e8ed;
    display: flex;
    flex-direction: column;
    min-height: 0;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.03);
}

.panel-header {
    padding: 12px 20px;
    background: #f8f9fa;
    color: #495057;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
    border-bottom: 1px solid #e1e8ed;
    flex-shrink: 0;
}

.panel-content {
    padding: 20px;
    padding-bottom: 60px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.panel-content::-webkit-scrollbar {
    width: 8px;
}

.panel-content::-webkit-scrollbar-track {
    background: transparent;
}

.panel-content::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 4px;
}

.panel-content::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

.collapsible-section {
    border: 1px solid #e1e8ed;
    border-radius: 12px;
    margin-bottom: 16px;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
    overflow: hidden;
    transition: all 0.2s ease;
}

.collapsible-section:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06);
}

.collapsible-section summary {
    padding: 14px 16px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
    color: #495057;
    transition: background 0.2s ease;
}

.collapsible-section summary:hover {
    background: linear-gradient(180deg, #f1f3f5 0%, #f8f9fa 100%);
}

.collapsible-section summary::-webkit-details-marker {
    display: none;
}

.collapsible-section summary::after {
    content: '▼';
    font-size: 0.75em;
    color: #6c757d;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-left: auto;
    padding-left: 12px;
}

.collapsible-section[open] summary::after {
    transform: rotate(-90deg);
}

.collapsible-section .collapsible-body {
    padding: 16px;
    border-top: 1px solid #e9ecef;
    background: white;
}

.collapsible-section .collapsible-body label {
    display: block;
    margin-top: 12px;
    margin-bottom: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #495057;
    letter-spacing: 0.2px;
}

.collapsible-section .collapsible-body label:first-child {
    margin-top: 0;
}

.collapsible-section .collapsible-body input[type="number"],
.collapsible-section .collapsible-body input[type="text"],
.collapsible-section .collapsible-body select {
    margin-top: 4px;
    width: 100%;
    padding: 8px 12px;
    border: 1.5px solid #dee2e6;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    background: white;
    color: #212529;
}

.collapsible-section .collapsible-body input[type="number"]:focus,
.collapsible-section .collapsible-body input[type="text"]:focus,
.collapsible-section .collapsible-body select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.collapsible-section .collapsible-body input[type="number"]:hover,
.collapsible-section .collapsible-body input[type="text"]:hover,
.collapsible-section .collapsible-body select:hover {
    border-color: #adb5bd;
}

.center-column {
    grid-area: center;
    display: flex;
    flex-direction: column;
    position: relative;
    background: #f8f9fa;
}

/* Main canvas */
#neuron-canvas-container {
    flex: 1;
    background-color: #ffffff;
    position: relative;
    background-image: radial-gradient(circle, #e1e8ed 1.5px, transparent 1.5px);
    background-size: 24px 24px;
    overflow: hidden;
}

#sim-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.graphs-panel {
    height: 250px;
    background-color: white;
    border-top: 2px solid #e1e8ed;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.03);
}

#no-selection-msg {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

#no-selection-msg p {
    font-size: 0.9rem;
    line-height: 1.6;
}

#prop-id {
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
    color: #495057;
    font-weight: 600;
    margin-left: 8px;
    padding: 2px 8px;
    background: #e9ecef;
    border-radius: 4px;
}