:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --proton: #ef4444;
    --neutron: #94a3b8;
    --electron: #10b981;
    --bg: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.9);
    --text: #1e293b;
    --text-muted: #64748b;
    --border: rgba(226, 232, 240, 0.8);
    --radius: 12px;
}

[data-theme="dark"] {
    --bg: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.8);
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: rgba(51, 65, 85, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.container-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Header */
.simulation-header {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.sim-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--primary), #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stats-simple {
    display: flex;
    gap: 0.5rem;
}

.badge {
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.8rem;
    color: white;
    min-width: 60px;
    text-align: center;
}

.badge.proton { background: var(--proton); }
.badge.neutron { background: var(--neutron); }
.badge.electron { background: var(--electron); }

/* Layout */
.sim-main {
    padding: 2rem 0;
}

.sim-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 2rem;
}

@media (max-width: 1000px) {
    .sim-layout { grid-template-columns: 1fr; }
}

/* Controls */
.controls-panel {
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 1.5rem;
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    height: fit-content;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.05);
}

.control-section h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* Buttons */
.btn-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.btn {
    padding: 0.75rem;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: 0.2s;
    font-size: 0.9rem;
}

.btn-add.proton { background: rgba(239, 68, 68, 0.1); color: var(--proton); border: 1px solid rgba(239, 68, 68, 0.2); }
.btn-add.neutron { background: rgba(148, 163, 184, 0.1); color: var(--text-muted); border: 1px solid rgba(148, 163, 184, 0.2); }
.btn-add:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,0.05); }

.btn-secondary { background: var(--border); color: var(--text); }
.w-100 { width: 100%; }

/* Layer Buttons */
.layers-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.btn-layer {
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 0.6rem 0.3rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.btn-layer span {
    font-size: 0.6rem;
    font-weight: 400;
    color: var(--text-muted);
}

.btn-layer:hover {
    border-color: var(--electron);
    color: var(--electron);
}

.btn-layer.active {
    background: var(--electron);
    color: white;
    border-color: var(--electron);
}

.btn-layer.active span { color: rgba(255,255,255,0.8); }

/* Element Box */
.info-card {
    background: var(--bg);
    padding: 1.25rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    border: 1px solid var(--border);
}

.element-symbol {
    width: 60px;
    height: 60px;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 800;
    font-family: 'Outfit';
}

.element-info h2 { font-size: 1.2rem; }
.element-info p { font-size: 0.8rem; color: var(--text-muted); }

.data-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.data-item {
    background: rgba(0,0,0,0.02);
    padding: 0.75rem;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
}

.data-item span { font-size: 0.75rem; color: var(--text-muted); }
.data-item strong { font-size: 1rem; font-family: 'Outfit'; }

/* Visualizer */
.visualizer {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.canvas-container {
    position: relative;
    width: 100%;
    height: 600px;
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

#bohrCanvas {
    width: 100%;
    height: 100%;
}

.feedback-msg {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #ef4444;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    transform: translateX(150%);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 15px -3px rgba(239, 68, 68, 0.3);
}

.feedback-msg.show { transform: translateX(0); }

.theory-note {
    background: var(--card-bg);
    padding: 1.25rem;
    border-radius: 12px;
    display: flex;
    gap: 1rem;
    align-items: center;
    border: 1px solid var(--border);
}

.theory-note i { color: var(--primary); font-size: 1.5rem; }
.theory-note p { font-size: 0.9rem; line-height: 1.5; }
