:root {
    --primary: #f97316; /* Orange */
    --primary-glow: rgba(249, 115, 22, 0.4);
    --bg: #0b1120;
    --card: #1e293b;
    --text: #f8fafc;
    --input-bg: #060b13;
}

body { font-family: 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); margin: 0; overflow-x: hidden; }

.page-wrapper { display: flex; flex-direction: column; align-items: center; padding: 20px; }

.theory-header { 
    width: 95%; max-width: 1000px; background: var(--card); padding: 20px; 
    border-radius: 20px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); margin-bottom: 20px; 
}

.action-row { display: flex; justify-content: space-between; align-items: center; gap: 15px; }

/* Input & Buttons */
.controls { display: flex; align-items: center; gap: 12px; }
.input-group { display: flex; background: var(--input-bg); border: 1px solid #334155; border-radius: 12px; padding: 4px; }
#nodeInput { background: transparent; border: none; color: white; padding: 8px; outline: none; width: 80px; }

.btn-primary {
    background: linear-gradient(135deg, #fb923c 0%, #ea580c 100%);
    border: none; padding: 10px 20px; border-radius: 10px; color: white;
    font-weight: bold; cursor: pointer; transition: 0.3s;
    box-shadow: 0 4px 15px var(--primary-glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px var(--primary-glow); }

.btn-reset {
    background: transparent; color: #94a3b8; border: 1px solid #334155;
    padding: 10px 20px; border-radius: 10px; cursor: pointer; transition: 0.3s;
}
.btn-reset:hover { border-color: var(--primary); color: white; }

/* الـ Code Link Style الجديد */
.code-btn-modern {
    display: flex; flex-direction: column; align-items: center;
    background: rgba(249, 115, 22, 0.05); border: 1px solid rgba(249, 115, 22, 0.2);
    padding: 8px 20px; border-radius: 14px; text-decoration: none; transition: 0.4s;
}
.code-btn-modern span { color: var(--primary); font-weight: bold; font-size: 0.9rem; }
.code-btn-modern small { color: #64748b; font-size: 0.7rem; }
.code-btn-modern:hover { transform: scale(1.05) rotate(2deg); border-color: var(--primary); background: rgba(249, 115, 22, 0.1); }

/* SVG Visuals */
.visual-area { background: #060b13; border-radius: 20px; height: 500px; overflow: auto; border: 1px solid rgba(255,255,255,0.05); }
#tree-svg { width: 2000px; height: 1000px; }
.node-circle { fill: #1e293b; stroke: var(--primary); stroke-width: 3; filter: drop-shadow(0 0 8px var(--primary-glow)); }
.node-text { fill: white; font-weight: bold; text-anchor: middle; dominant-baseline: middle; }
.edge-line { stroke: rgba(249, 115, 22, 0.3); stroke-width: 2; fill: none; }

.back-home { position: fixed; top: 20px; left: 20px; color: var(--primary); text-decoration: none; font-weight: bold; }
.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid #ef4444;
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    margin-left: 5px;
}

.btn-danger:hover {
    background: #ef4444;
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}