* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    color: #333;
}

.app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.header {
    background: #2c3e50;
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.toolbar {
    display: flex;
    gap: 0.5rem;
}

.toolbar button {
    background: #3498db;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.toolbar button:hover {
    background: #2980b9;
}

.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.component-panel {
    width: 300px;
    background: white;
    border-right: 1px solid #ddd;
    padding: 1rem;
    overflow-y: auto;
}

.component-group {
    margin-bottom: 1.5rem;
}

.component-group h4 {
    color: #34495e;
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 2px solid #3498db;
}

.component-list {
    display: grid;
    gap: 0.5rem;
}

.component-item {
    background: #ecf0f1;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.component-item:hover {
    background: #d5dbdb;
    border-color: #3498db;
    transform: translateY(-1px);
}

.component-item.dragging {
    opacity: 0.5;
}

.properties-panel {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #ddd;
}

.property-item {
    margin-bottom: 1rem;
}

.property-item label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: #34495e;
}

.property-item input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.design-area {
    flex: 1;
    position: relative;
    background: white;
    display: flex;
    flex-direction: column;
}

#schematic-canvas {
    flex: 1;
    border: 1px solid #ddd;
    cursor: crosshair;
    background: 
        radial-gradient(circle, #ddd 1px, transparent 1px),
        linear-gradient(90deg, rgba(221,221,221,0.3) 1px, transparent 1px),
        linear-gradient(rgba(221,221,221,0.3) 1px, transparent 1px);
    background-size: 20px 20px, 20px 20px, 20px 20px;
}

.canvas-controls {
    background: #ecf0f1;
    padding: 0.5rem;
    display: flex;
    gap: 0.5rem;
    border-top: 1px solid #ddd;
}

.canvas-controls button {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.canvas-controls button:hover,
.canvas-controls button.active {
    background: #7f8c8d;
}

.analysis-panel {
    width: 300px;
    background: white;
    border-left: 1px solid #ddd;
    padding: 1rem;
    overflow-y: auto;
}

.analysis-panel h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #3498db;
}

.analysis-section {
    margin-bottom: 1.5rem;
}

.analysis-section h4 {
    color: #34495e;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.analysis-section p {
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.analysis-section span {
    font-weight: 600;
    color: #27ae60;
}

#circuit-warnings {
    color: #e74c3c;
    font-size: 0.9rem;
}

.warning-item {
    background: #fdf2f2;
    border-left: 4px solid #e74c3c;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    border-radius: 0 4px 4px 0;
}

#voltage-nodes {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
}

.node-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Responsive design */
@media (max-width: 1200px) {
    .component-panel,
    .analysis-panel {
        width: 250px;
    }
}

@media (max-width: 900px) {
    .main-content {
        flex-direction: column;
    }
    
    .component-panel,
    .analysis-panel {
        width: 100%;
        height: 200px;
    }
    
    .design-area {
        order: -1;
        height: 400px;
    }
}