/* ============================================================
   Education Interactive Components
   Shared styles for all article pages
   ============================================================ */

/* ---- Flowchart ---- */
.edu-flow {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 2rem 0;
}

.edu-flow-step {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    position: relative;
}

.edu-flow-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    width: 40px;
}

.edu-flow-dot {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 2px solid var(--accent-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--accent-gold);
    flex-shrink: 0;
    z-index: 1;
}

.edu-flow-step.active .edu-flow-dot {
    background: var(--accent-gold);
    color: var(--bg-primary);
}

.edu-flow-line {
    width: 2px;
    flex-grow: 1;
    min-height: 20px;
    background: var(--border-color);
}

.edu-flow-step:last-child .edu-flow-line {
    display: none;
}

.edu-flow-content {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.25rem;
    flex-grow: 1;
    margin-bottom: 0.75rem;
    transition: all 0.3s;
}

.edu-flow-step:hover .edu-flow-content {
    border-color: var(--accent-gold);
}

.edu-flow-content h4 {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.edu-flow-content p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0;
    font-weight: 300;
}

/* ---- Org Chart ---- */
.edu-org {
    margin: 2rem 0;
    overflow-x: auto;
}

.edu-org-tree {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    min-width: fit-content;
}

.edu-org-node {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1.25rem;
    text-align: center;
    position: relative;
    transition: all 0.3s;
    cursor: default;
}

.edu-org-node:hover {
    border-color: var(--accent-gold);
}

.edu-org-node.root {
    background: rgba(255, 238, 150, 0.08);
    border-color: var(--accent-gold);
}

.edu-org-node .node-title {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
}

.edu-org-node .node-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 300;
}

.edu-org-connector {
    width: 2px;
    height: 24px;
    background: var(--border-color);
    margin: 0 auto;
}

.edu-org-row {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: wrap;
    position: relative;
}

.edu-org-branch {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Horizontal connector line across branches */
.edu-org-h-line {
    height: 2px;
    background: var(--border-color);
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

/* ---- Tabs ---- */
.edu-tabs {
    margin: 2rem 0;
}

.edu-tab-bar {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

.edu-tab-btn {
    padding: 0.75rem 1.25rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.edu-tab-btn:hover {
    color: var(--text-primary);
}

.edu-tab-btn.active {
    color: var(--accent-gold);
    border-bottom-color: var(--accent-gold);
    font-weight: 500;
}

.edu-tab-panel {
    display: none;
}

.edu-tab-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---- Accordion ---- */
.edu-accordion {
    margin: 2rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.edu-accordion-item {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.3s;
}

.edu-accordion-item.open {
    border-color: var(--accent-gold);
}

.edu-accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: var(--bg-tertiary);
    cursor: pointer;
    transition: all 0.3s;
    user-select: none;
}

.edu-accordion-header:hover {
    background: rgba(255, 238, 150, 0.05);
}

.edu-accordion-header h4 {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
}

.edu-accordion-arrow {
    color: var(--accent-gold);
    font-size: 1.2rem;
    transition: transform 0.3s;
    flex-shrink: 0;
}

.edu-accordion-item.open .edu-accordion-arrow {
    transform: rotate(180deg);
}

.edu-accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.edu-accordion-body-inner {
    padding: 1rem 1.25rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.8;
    font-weight: 300;
}

.edu-accordion-body-inner p {
    margin-bottom: 0.75rem;
}

.edu-accordion-body-inner p:last-child {
    margin-bottom: 0;
}

/* ---- Selectable Cards (pick one / multi-select) ---- */
.edu-select-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.edu-select-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    user-select: none;
}

.edu-select-card:hover {
    border-color: rgba(255, 238, 150, 0.4);
    transform: translateY(-2px);
}

.edu-select-card.selected {
    border-color: var(--accent-gold);
    background: rgba(255, 238, 150, 0.06);
}

.edu-select-card .card-check {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 22px;
    height: 22px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    transition: all 0.3s;
}

.edu-select-card.selected .card-check {
    border-color: var(--accent-gold);
    background: var(--accent-gold);
    color: var(--bg-primary);
}

.edu-select-card .card-title {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    padding-right: 2rem;
}

.edu-select-card .card-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    font-weight: 300;
}

/* ---- Interactive Checklist ---- */
.edu-checklist {
    margin: 2rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.edu-checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    user-select: none;
}

.edu-checklist-item:hover {
    border-color: rgba(255, 238, 150, 0.3);
}

.edu-checklist-item.checked {
    border-color: var(--accent-green);
    background: rgba(126, 211, 33, 0.05);
}

.edu-checklist-box {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    margin-top: 1px;
}

.edu-checklist-item.checked .edu-checklist-box {
    border-color: var(--accent-green);
    background: var(--accent-green);
    color: var(--bg-primary);
}

.edu-checklist-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    font-weight: 300;
    transition: all 0.3s;
}

.edu-checklist-item.checked .edu-checklist-text {
    color: var(--text-primary);
}

/* ---- Terminal / Prompt Block ---- */
.edu-terminal {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin: 2rem 0;
    overflow: hidden;
}

.edu-terminal-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--border-color);
}

.edu-terminal-header .dot { width: 10px; height: 10px; border-radius: 50%; }
.edu-terminal-header .dot.red { background: var(--accent-red); }
.edu-terminal-header .dot.yellow { background: var(--accent-yellow); }
.edu-terminal-header .dot.green { background: var(--accent-green); }

.edu-terminal-header .terminal-title {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-left: 0.5rem;
}

.edu-terminal-body {
    padding: 1.25rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.edu-terminal-body .prompt {
    color: var(--accent-green);
}

.edu-terminal-body .output {
    color: var(--text-secondary);
    opacity: 0.8;
}

.edu-terminal-body .highlight-line {
    color: var(--accent-gold);
}

/* ---- Stat Cards ---- */
.edu-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.edu-stat {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.25rem;
    text-align: center;
}

.edu-stat .stat-value {
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 600;
    color: var(--accent-gold);
    line-height: 1.2;
}

.edu-stat .stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 300;
    margin-top: 0.25rem;
}

/* ---- Before/After Comparison ---- */
.edu-compare {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 2rem 0;
}

.edu-compare-side {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
}

.edu-compare-side.before {
    border-top: 3px solid var(--accent-red);
}

.edu-compare-side.after {
    border-top: 3px solid var(--accent-green);
}

.edu-compare-side h4 {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.edu-compare-side.before h4 { color: var(--accent-red); }
.edu-compare-side.after h4 { color: var(--accent-green); }

.edu-compare-side ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.edu-compare-side li {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
    font-weight: 300;
    padding-left: 1.25rem;
    position: relative;
    margin-bottom: 0.5rem;
}

.edu-compare-side.before li::before { content: '✕'; position: absolute; left: 0; color: var(--accent-red); font-size: 0.8rem; }
.edu-compare-side.after li::before { content: '✓'; position: absolute; left: 0; color: var(--accent-green); font-size: 0.8rem; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .edu-compare { grid-template-columns: 1fr; }
    .edu-select-grid { grid-template-columns: 1fr; }
    .edu-org-row { flex-direction: column; align-items: center; }
    .edu-stats { grid-template-columns: repeat(2, 1fr); }
    .edu-tab-btn { padding: 0.6rem 0.9rem; font-size: 0.8rem; }
}
