/* ==========================================
   STICKY HUD ACTION BAR & CANONICAL ALIGNMENT
   ========================================== */
.ec-sticky-hud {
    position: sticky;
    top: 75px; /* Clears the standard 60px CoreUI header + margin */
    z-index: 100;
    box-shadow: var(--shadow-md);
}

/* ─── CANONICAL LAYOUT ─── */
.ec-content-grid {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 16px;
    margin-top: 16px;
    align-items: start;
}
.ec-main-solo {
    display: flex;
    flex-direction: column;
    width: 100%;
}
@media (max-width: 768px) {
    .ec-content-grid { grid-template-columns: 1fr; }
}
.ec-sidebar { display: flex; flex-direction: column; gap: 16px; }
.ec-main-col { display: flex; flex-direction: column; gap: 16px; }

/* ─── SIDEBAR METHOD CARD ─── */
.ec-method-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    padding: 20px;
}
.ec-method-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

/* ─── REFINED BUTTONS ─── */
.btn-primary { 
    background-color: var(--primary); 
    color: white; 
    font-weight: 600; 
    border: none; 
    border-radius: var(--radius-sm); 
    padding: 0.5rem 1.1rem; 
    cursor: pointer; 
    box-shadow: var(--shadow-primary); 
    transition: all var(--transition); 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    font-family: var(--font); 
    font-size: 0.85rem; 
}
.btn-primary:hover { 
    background-color: var(--primary-hover); 
    transform: translateY(-1px); 
}
.btn-primary:disabled { 
    background-color: var(--border-deep); 
    cursor: not-allowed; 
    transform: none; 
    box-shadow: none; 
}

.btn-outline-sm { 
    background-color: var(--surface); 
    color: var(--text-muted); 
    font-weight: 600; 
    border: 1px solid var(--border); 
    border-radius: var(--radius-sm); 
    padding: 0.4rem 0.8rem; 
    cursor: pointer; 
    transition: all var(--transition); 
    display: inline-flex; 
    align-items: center; 
    gap: 0.4rem;
    justify-content: center; 
    font-family: var(--font); 
    font-size: 0.8rem;
}
.btn-outline-sm:hover { 
    color: var(--primary); 
    border-color: var(--primary); 
}

.btn-link { 
    background: none; 
    border: none; 
    color: var(--primary); 
    font-weight: 600; 
    cursor: pointer; 
    padding: 4px 8px; 
    font-family: var(--font); 
    font-size: 0.84rem; 
}
.btn-link:hover { text-decoration: underline; }

/* ─── SHORTHAND BRACKET TRAPS ─── */
.bracket-dropzone {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    margin: 0 2px;
    color: var(--border-deep);
    cursor: pointer;
    font-weight: bold;
    font-size: 1.15rem;
    transition: all 0.2s ease;
}
.bracket-dropzone:hover { color: var(--primary); transform: scale(1.2); }

/* ─── STEP-BY-STEP CARDS (MATCHING STOICH .da-step-card) ─── */
.da-step-card { 
    background: var(--bg); 
    border: 1px solid var(--border-light); 
    border-radius: var(--radius); 
    padding: 14px 18px; 
    margin-bottom: 10px; 
    transition: opacity 0.3s ease; 
}
.da-step-card.active { 
    background: var(--surface); 
    border-color: var(--primary-mid); 
    box-shadow: var(--shadow-sm); 
}
.da-step-card.completed { opacity: 0.7; }

.da-step-header { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    margin-bottom: 8px; 
}
.da-step-num { 
    width: 24px; 
    height: 24px; 
    border-radius: 999px; 
    background: var(--primary-light); 
    color: var(--primary); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 0.75rem; 
    font-weight: 700; 
}
.da-step-card.completed .da-step-num { 
    background: #ecfdf5; 
    color: #16a34a; 
}
.da-step-title { 
    font-weight: 700; 
    font-size: 0.88rem; 
    color: var(--text); 
}
.da-step-body { 
    font-size: 0.84rem; 
    color: var(--text-muted); 
    line-height: 1.6; 
}
/* ==========================================
   THE ELEMENT TILE (FIXED GRID LAYOUT)
   ========================================== */
.element-tile { 
    width: 100%; padding: 1rem; 
    border-radius: var(--radius-lg); color: white; display: flex; 
    flex-direction: column; align-items: center; justify-content: center; 
    box-shadow: var(--shadow-md); transition: background-color 0.3s ease; box-sizing: border-box; 
}
.notation-wrapper { 
    display: inline-grid; 
    grid-template-columns: minmax(2.5rem, auto) auto minmax(2.5rem, auto); 
    grid-template-rows: 1fr 1fr; 
    align-items: center; justify-content: center; gap: 0 6px; margin-top: 15px; 
}
.tile-symbol-wrap { grid-column: 2; grid-row: 1 / span 2; display: flex; align-items: center; justify-content: center; }
.tile-symbol { font-size: 5.5rem; font-weight: 700; line-height: 1; text-shadow: 2px 2px 4px rgba(0,0,0,0.2); }
.not-a { grid-column: 1; grid-row: 1; justify-self: end; align-self: end; font-size: 1.1rem; font-style: italic; opacity: 0.7; margin-bottom: 4px; } 
.not-z { grid-column: 1; grid-row: 2; justify-self: end; align-self: start; font-size: 1.4rem; font-weight: 700; margin-top: 4px; } 
.not-charge { grid-column: 3; grid-row: 1; justify-self: start; align-self: end; font-size: 1.1rem; font-weight: 700; margin-bottom: 4px; } 
.not-sub { grid-column: 3; grid-row: 2; justify-self: start; align-self: start; font-size: 1.1rem; font-style: italic; opacity: 0.7; margin-top: 4px; } 
.tile-name { font-size: 1.1rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; text-align: center; margin-top: 0.3rem; width: 100%; }

.bg-s { background-color: #2C5CC5 !important; } 
.bg-p { background-color: #1B9E77 !important; } 
.bg-d { background-color: #D95F02 !important; } 
.bg-f { background-color: #6B5CA5 !important; }

/* ==========================================
   THE PAULING DIAGRAM (CRITICAL ABSOLUTE POSITIONING)
   ========================================== */
.energy-workspace {
    position: relative;
    width: 100%;
    height: 800px; 
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.subshell-zone {
    position: absolute; /* If this was missing, the whole diagram breaks into a vertical stack */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px; 
}

/* Mathematically Equitable Horizontal Spacing */
.subshell-zone.s-block { left: 30px; }
.subshell-zone.p-block { left: 115px; } 
.subshell-zone.d-block { left: 266px; } 
.subshell-zone.f-block { left: 483px; }

/* ==========================================
   RESTORED: ORBITAL SEATS & PAULING TRAYS
   ========================================== */
.seats-wrapper {
    display: flex;
    gap: 4px; 
    padding: 4px 6px; 
    background: var(--bg);
    border-radius: var(--radius-sm);
    border-bottom: 3px solid;
    transition: background 0.2s ease, border-color 0.2s ease;
}
.seats-wrapper:hover {
    background: var(--primary-light);
}

/* 15% opacity backgrounds and solid bottom borders for the trays */
.subshell-zone.s-block .seats-wrapper { background-color: rgba(44, 92, 197, 0.15); border-color: #2C5CC5; }
.subshell-zone.p-block .seats-wrapper { background-color: rgba(27, 158, 119, 0.15); border-color: #1B9E77; }
.subshell-zone.d-block .seats-wrapper { background-color: rgba(217, 95, 2, 0.15); border-color: #D95F02; }
.subshell-zone.f-block .seats-wrapper { background-color: rgba(107, 92, 165, 0.15); border-color: #6B5CA5; }

.subshell-header {
    display: flex;
    flex-direction: row; 
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: -6px;
}

.subshell-label {
    font-weight: 700;
    font-family: var(--font-mono, monospace);
    font-size: 1.1rem;
    color: var(--text-muted);
}

/* The actual box where the arrow goes */
.orbital-seat {
    width: 28px; 
    min-width: 28px; 
    height: 32px;
    flex-shrink: 0; 
    border: 2px solid var(--border); 
    border-radius: 4px;
    position: relative;
    background-color: var(--surface);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100%' height='100%'><line x1='0' y1='100%' x2='100%' y2='0' stroke='%23cbd5e1' stroke-width='2'/></svg>");
    transition: border-color 0.2s;
}

.orbital-seat:hover { border-color: var(--text); }

.click-zone {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 5;
    cursor: pointer;
}
.click-up { clip-path: polygon(0 0, 100% 0, 0 100%); }
.click-down { clip-path: polygon(100% 100%, 100% 0, 0 100%); }
.click-zone:hover { background: rgba(0,0,0,0.05); }

.electron-vector {
    position: absolute;
    color: var(--text);
    pointer-events: none; 
    z-index: 2;
}

/* ==========================================
   RESTORED: THEATER ELECTRONS & COLORS
   ========================================== */
.visualizer-stage {
    width: 100%;
    height: auto;
    margin: 0 auto;
    overflow: visible;
    display: block; 
}

.vis-ring {
    fill: none;
    stroke: var(--border-deep, #cbd5e1);
    stroke-width: 1.5px;
    opacity: 0; 
    transition: opacity 0.8s ease;
}

.vis-electron {
    transition: cx 1.2s cubic-bezier(0.4, 0, 0.2, 1), 
                cy 1.2s cubic-bezier(0.4, 0, 0.2, 1),
                fill 0.8s ease;
}

/* These color the electrons as they fly around */
.vis-electron.s-block { fill: #2C5CC5 !important; } 
.vis-electron.p-block { fill: #1B9E77 !important; } 
.vis-electron.d-block { fill: #D95F02 !important; } 
.vis-electron.f-block { fill: #6B5CA5 !important; }