
        /* Base Styles */
        body {
            margin: 0;
            padding: 0;
            font-family: 'Poppins', sans-serif;
            background-color: #f8fafc;
            color: #334155;
            overflow: hidden;
        }
        
        /* Header Styles */
        .app-header {
            background: linear-gradient(135deg, #9d1cbd, #580379);
            box-shadow: 0 4px 20px rgba(139, 92, 246, 0.2);
            color: white;
            padding: 0.8rem 2rem;
            position: relative;
            z-index: 10;
        }
        
        .header-container {
            max-width: 1200px;
            margin: 0 auto;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .logo {
            display: flex;
            align-items: center;
            gap: 12px;
        }
        
        .logo-icon {
            font-size: 1.8rem;
            color: #fef08a;
            animation: pulse 2s infinite;
        }
        
        .logo-text {
            font-weight: 600;
            font-size: 1.4rem;
            letter-spacing: 0.5px;
        }
        
        .action-btn {
            background: rgba(255, 255, 255, 0.15);
            border: none;
            border-radius: 8px;
            color: white;
            padding: 0.5rem 1.2rem;
            font-weight: 500;
            font-size: 0.9rem;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        .action-btn:hover {
            background: rgba(255, 255, 255, 0.25);
            transform: translateY(-1px);
        }
        
        .action-btn:active {
            transform: translateY(0);
        }
        
        .primary-btn {
            background: white;
            color: #6d28d9;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        }
        
        .primary-btn:hover {
            background: #f3f4f6;
            color: #5b21b6;
        }
        
        @keyframes pulse {
            0% { transform: scale(1); }
            50% { transform: scale(1.1); }
            100% { transform: scale(1); }
        }
        
        /* Main Layout */
        .main-container {
            display: flex;
            height: calc(100vh - 60px);
        }
        
        /* Sidebar */
        .sidebar {
            width: 250px;
            background: white;
            border-right: 1px solid #e2e8f0;
            padding: 1rem;
            overflow-y: auto;
            z-index: 5;
            box-shadow: 2px 0 5px rgba(0,0,0,0.05);
        }
        
        .sidebar h3 {
            color: #6d28d9;
            margin-bottom: 1rem;
            padding-bottom: 0.5rem;
            border-bottom: 1px solid #e2e8f0;
        }
        
        .component-palette {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 0.75rem;
        }
        
        .palette-item {
            background: #f9fafb;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            padding: 0.75rem;
            cursor: grab;
            text-align: center;
            transition: all 0.2s ease;
        }
        
        .palette-item:hover {
            background: #f1f5f9;
            transform: translateY(-2px);
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        }
        
        .palette-icon {
            font-size: 1.8rem;
            margin-bottom: 0.5rem;
            color: #6d28d9;
        }
        
        .palette-label {
            font-size: 0.75rem;
            font-weight: 500;
        }
        
        /* Canvas area with grid */
        .canvas-container {
            flex: 1;
            position: relative;
            overflow: auto;
            background-color: #f8fafc;
        }
        
        .canvas-scroll {
            width: 100%;
            height: 100%;
            overflow: auto;
            position: relative;
        }
        
        /* The actual grid */
        .circuit-grid {
            position: absolute;
            top: 0;
            left: 0;
            width: 5000px;
            height: 5000px;
            background-image: 
                linear-gradient(rgba(203, 213, 225, 0.3) 1px, transparent 1px),
                linear-gradient(90deg, rgba(203, 213, 225, 0.3) 1px, transparent 1px);
            background-size: 20px 20px;
            background-position: -1px -1px;
            transform-origin: 0 0;
        }
        
        /* Grid controls */
        .grid-controls {
            position: fixed;
            bottom: 20px;
            right: 20px;
            background: white;
            border-radius: 8px;
            padding: 8px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
            display: flex;
            gap: 8px;
            z-index: 20;
        }
        
        .grid-btn {
            width: 36px;
            height: 36px;
            border-radius: 6px;
            border: 1px solid #e2e8f0;
            background: white;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #64748b;
            transition: all 0.2s ease;
        }
        
        .grid-btn:hover {
            background: #f1f5f9;
            color: #475569;
            transform: scale(1.05);
        }
        
        .grid-btn.active {
            background: #6d28d9;
            color: white;
            border-color: #5b21b6;
        }
        
        /* Component styles */
        .component {
            position: absolute;
            width: 80px;
            height: 80px;
            background: white;
            border-radius: 8px;
            border: 1px solid #e2e8f0;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            cursor: move;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
            transition: box-shadow 0.2s, transform 0.1s;
            user-select: none;
            z-index: 2;
        }
        
        .component:hover {
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        }
        
        .component.selected {
            border: 2px solid #6d28d9;
            box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.2);
        }
        
        .component-svg-container {
            width: 50px;
            height: 50px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: move;
        }
        
        .component-svg {
            width: 100%;
            height: 100%;
            pointer-events: none; /* Make SVG non-interactive for dragging */
        }
        
        .component-label {
            font-size: 11px;
            font-weight: 500;
            color: #334155;
            margin-top: 4px;
            pointer-events: none; /* Make label non-interactive for dragging */
        }
        
        /* Connection points */
        .connection-point {
            position: absolute;
            width: 12px;
            height: 12px;
            background: #6d28d9;
            border: 2px solid white;
            border-radius: 50%;
            z-index: 3;
            cursor: pointer;
            box-shadow: 0 0 0 1px rgba(0,0,0,0.2);
        }
        
        .connection-point:hover {
            transform: scale(1.3);
            background: #8b5cf6;
        }
        
        .connection-point.connected {
            background: #10b981;
            box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
        }
        
        /* Wires */
        .wire-segment {
            position: absolute;
            background: #6d28d9;
            z-index: 1;
            pointer-events: none;
            border-radius: 2px;
        }
        
        .wire-segment.horizontal {
            height: 3px;
        }
        
        .wire-segment.vertical {
            width: 3px;
        }
        
        .wire-segment.active {
            background: #10b981;
            box-shadow: 0 0 5px rgba(16, 185, 129, 0.5);
            animation: pulse 1.5s infinite;
        }
        
        /* Zoom level indicator */
        .zoom-indicator {
            position: fixed;
            bottom: 20px;
            left: 20px;
            background: white;
            border-radius: 8px;
            padding: 6px 12px;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
            font-size: 0.85rem;
            font-weight: 500;
        }
        
        /* Simulation Results Modal */
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.5);
            z-index: 100;
            align-items: center;
            justify-content: center;
        }
        
        .modal-content {
            background: white;
            border-radius: 12px;
            width: 80%;
            max-width: 800px;
            max-height: 80vh;
            overflow-y: auto;
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
            animation: modalFadeIn 0.3s ease;
        }
        
        @keyframes modalFadeIn {
            from { opacity: 0; transform: translateY(-20px); }
            to { opacity: 1; transform: translateY(0); }
        }
        
        .modal-header {
            padding: 1.5rem;
            border-bottom: 1px solid #e2e8f0;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .modal-title {
            font-size: 1.5rem;
            font-weight: 600;
            color: #6d28d9;
        }
        
        .modal-close {
            background: none;
            border: none;
            font-size: 1.5rem;
            cursor: pointer;
            color: #64748b;
            transition: color 0.2s;
        }
        
        .modal-close:hover {
            color: #334155;
        }
        
        .modal-body {
            padding: 1.5rem;
        }
        
        .results-table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 1rem;
        }
        
        .results-table th, .results-table td {
            padding: 0.75rem;
            text-align: left;
            border-bottom: 1px solid #e2e8f0;
        }
        
        .results-table th {
            background-color: #f8fafc;
            font-weight: 600;
            color: #6d28d9;
        }
        
        .results-table tr:hover {
            background-color: #f1f5f9;
        }
        
        .results-table .node-id {
            font-weight: 600;
        }
        
        .results-table .voltage-value, .results-table .current-value {
            font-family: 'Courier New', monospace;
            font-weight: 500;
        }
        
        .love-footer {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            text-align: center;
            padding: 10px;
            background: rgba(255, 255, 255, 0.8);
            backdrop-filter: blur(5px);
            font-size: 14px;
            color: #6d28d9;
            z-index: 100;
            border-top: 1px solid rgba(109, 40, 217, 0.1);
        }
        
        .love-footer span {
            color: #e11d48;
            animation: heartbeat 1.5s infinite;
            display: inline-block;
        }
        
        @keyframes heartbeat {
            0% { transform: scale(1); }
            25% { transform: scale(1.1); }
            50% { transform: scale(1); }
            75% { transform: scale(1.1); }
            100% { transform: scale(1); }
        }
        
        /* Property Editor */
        .property-editor {
            position: absolute;
            background: white;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            padding: 1rem;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
            z-index: 50;
            width: 200px;
        }
        
        .property-editor h4 {
            margin-top: 0;
            margin-bottom: 0.75rem;
            color: #6d28d9;
            font-size: 1rem;
        }
        
        .property-field {
            margin-bottom: 0.75rem;
        }
        
        .property-field label {
            display: block;
            font-size: 0.85rem;
            margin-bottom: 0.25rem;
            color: #475569;
        }
        
        .property-field input {
            width: 100%;
            padding: 0.5rem;
            border: 1px solid #e2e8f0;
            border-radius: 4px;
            font-size: 0.9rem;
        }
        
        .property-field button {
            width: 100%;
            padding: 0.5rem;
            background: #6d28d9;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-weight: 500;
            margin-top: 0.5rem;
        }
        
        .property-field button:hover {
            background: #5b21b6;
        }
        
        /* Advanced feature styles */
        .status-bar {
            position: fixed;
            top: 60px;
            left: 250px;
            right: 0;
            height: 30px;
            background: rgba(255, 255, 255, 0.9);
            border-bottom: 1px solid #e2e8f0;
            display: flex;
            align-items: center;
            padding: 0 1rem;
            font-size: 0.85rem;
            z-index: 5;
        }
        
        .status-item {
            margin-right: 1rem;
            display: flex;
            align-items: center;
        }
        
        .status-item i {
            margin-right: 0.5rem;
            color: #6d28d9;
        }
        
        .node-indicator {
            position: absolute;
            width: 20px;
            height: 20px;
            background: rgba(109, 40, 217, 0.8);
            color: white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 10px;
            font-weight: bold;
            z-index: 4;
            pointer-events: none;
        }
        
        .debug-panel {
            position: fixed;
            bottom: 80px;
            right: 20px;
            background: white;
            border-radius: 8px;
            padding: 1rem;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
            width: 300px;
            max-height: 200px;
            overflow-y: auto;
            font-family: 'Courier New', monospace;
            font-size: 0.8rem;
            z-index: 15;
            display: none;
        }
        
        .debug-panel h4 {
            margin-top: 0;
            color: #6d28d9;
        }
        
        .debug-panel pre {
            margin: 0;
            white-space: pre-wrap;
            word-break: break-all;
        }