/* Simulator Container */
.simulator-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.simulator-container h1 {
    text-align: center;
    font-size: 2.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.subtitle {
    text-align: center;
    color: #718096;
    font-size: 1.1rem;
    margin-bottom: 30px;
}

/* Layout */
.simulator-layout {
    display: grid;
    grid-template-columns: 250px 1fr 280px;
    gap: 20px;
    margin-bottom: 30px;
}

/* Components Panel */
.components-panel {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.07);
}

.components-panel h2 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: #2d3748;
}

.component-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.component-item:hover {
    transform: translateX(5px);
    border-color: #667eea;
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.2);
}

.component-item.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.component-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: white;
    border-radius: 6px;
}

.component-item.selected .component-icon {
    background: rgba(255, 255, 255, 0.2);
}

.components-panel h2:not(:first-of-type) {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px solid #e2e8f0;
}

/* Example Items */
.example-item {
    padding: 10px 12px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, rgba(67, 233, 123, 0.1) 0%, rgba(56, 249, 215, 0.1) 100%);
    border: 2px solid rgba(67, 233, 123, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.example-item:hover {
    transform: translateX(5px);
    border-color: #43e97b;
    background: linear-gradient(135deg, rgba(67, 233, 123, 0.2) 0%, rgba(56, 249, 215, 0.2) 100%);
    box-shadow: 0 4px 8px rgba(67, 233, 123, 0.3);
}

.example-item span {
    font-size: 0.9rem;
    font-weight: 600;
    color: #2d3748;
}

/* Workspace */
.workspace {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.07);
}

#breadboard {
    width: 100%;
    max-width: 800px;
    height: auto;
    border: 3px solid #e2e8f0;
    border-radius: 8px;
    cursor: crosshair;
    background: #1a1a2e;
    display: block;
}

/* Controls */
.controls {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.control-btn {
    flex: 1;
    min-width: 150px;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.run-btn {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
}

.run-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(67, 233, 123, 0.3);
}

.stop-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.stop-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(245, 87, 108, 0.3);
}

.clear-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.clear-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.3);
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Info Panel */
.info-panel {
    margin-top: 15px;
    padding: 15px;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-radius: 8px;
    border: 2px solid #e2e8f0;
}

.info-item {
    margin-bottom: 8px;
    color: #4a5568;
}

.info-item:last-child {
    margin-bottom: 0;
}

.info-item strong {
    color: #2d3748;
}

#statusLabel {
    color: #667eea;
    font-weight: 600;
}

#statusLabel.running {
    color: #43e97b;
}

#statusLabel.error {
    color: #f5576c;
}

/* Instructions Panel */
.instructions-panel {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.07);
}

.instructions-panel h2 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #2d3748;
}

.instructions-panel ol {
    padding-left: 20px;
    margin-bottom: 20px;
}

.instructions-panel ol li {
    margin-bottom: 10px;
    color: #4a5568;
    line-height: 1.6;
}

.tips {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.tips h3 {
    font-size: 1.1rem;
    color: #667eea;
    margin-bottom: 10px;
}

.tips ul {
    padding-left: 20px;
}

.tips ul li {
    margin-bottom: 8px;
    color: #4a5568;
}

/* Responsive Design */
@media screen and (max-width: 1200px) {
    .simulator-layout {
        grid-template-columns: 200px 1fr 250px;
    }
}

@media screen and (max-width: 992px) {
    .simulator-layout {
        grid-template-columns: 1fr;
    }

    .components-panel {
        order: 1;
    }

    .workspace {
        order: 2;
    }

    .instructions-panel {
        order: 3;
    }

    .component-item {
        display: inline-flex;
        align-items: center;
        width: auto;
        min-width: 110px;
        padding: 8px 10px;
        margin-bottom: 8px;
        font-size: 0.85rem;
    }

    .component-icon {
        width: 32px;
        height: 32px;
        font-size: 1.2rem;
    }

    .components-panel {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        padding: 15px;
    }

    .components-panel h2 {
        width: 100%;
        font-size: 1.1rem;
        margin-bottom: 10px;
    }

    .example-item {
        display: inline-flex;
        padding: 8px 12px;
        margin-bottom: 6px;
        font-size: 0.85rem;
        min-width: 110px;
    }

    .example-item span {
        font-size: 0.85rem;
    }
}

@media screen and (max-width: 768px) {
    .simulator-container {
        padding: 15px;
    }

    .simulator-container h1 {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 1rem;
        margin-bottom: 20px;
    }

    #breadboard {
        width: 100%;
        height: auto;
    }

    .controls {
        flex-direction: column;
    }

    .control-btn {
        width: 100%;
        min-width: auto;
    }

    .component-item {
        min-width: 90px;
        padding: 6px 8px;
        gap: 6px;
    }

    .component-icon {
        width: 28px;
        height: 28px;
        font-size: 1rem;
    }

    .example-item {
        min-width: 90px;
        padding: 6px 10px;
    }

    .components-panel {
        padding: 12px;
    }

    .components-panel h2 {
        font-size: 1rem;
        margin-bottom: 8px;
    }

    .info-panel {
        font-size: 0.9rem;
    }
}

@media screen and (max-width: 480px) {
    .simulator-container h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .component-item,
    .example-item {
        min-width: 80px;
        font-size: 0.75rem;
    }

    .component-item span,
    .example-item span {
        font-size: 0.75rem;
    }

    .control-btn {
        font-size: 0.9rem;
        padding: 10px 16px;
    }
}
