:root {
    --primary: #6366f1;
    --bg: #0f172a;
    --card: #1e293b;
    --text: #f8fafc;
}

body {
    font-family: 'Segoe UI', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

h1 { text-align: center; color: var(--primary); }

.card {
    background: var(--card);
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

/* Converter Styles */
.converter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.input-group label { display: block; margin-bottom: 0.5rem; font-size: 0.9rem; color: #94a3b8; }

input, select {
    width: 100%;
    padding: 10px;
    background: #0f172a;
    border: 1px solid #334155;
    color: white;
    border-radius: 6px;
    box-sizing: border-box;
}

/* Logic Gate Styles */
.logic-display {
    display: flex;
    align-items: center;
    justify-content: space-around;
    margin-top: 2rem;
    padding: 1rem;
    border: 2px dashed #334155;
    border-radius: 8px;
}

.toggle-btn {
    display: block;
    width: 120px;
    padding: 10px;
    margin: 10px 0;
    cursor: pointer;
    background: #334155;
    color: white;
    border: none;
    border-radius: 4px;
}

.toggle-btn.active { background: var(--primary); }

.gate-icon {
    font-weight: bold;
    font-size: 1.5rem;
    padding: 20px;
    border: 3px solid var(--primary);
    border-radius: 50%;
}

#gateResult {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary);
}

@media (max-width: 600px) {
    .logic-display { flex-direction: column; gap: 20px; }
}