:root {
    --primary: #3b82f6;
    --accent: #10b981;
    --bg: #0f172a;
    --card: #1e293b;
    --text: #f8fafc;
}

body { font-family: 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); margin: 0; }
.main-container { display: flex; gap: 20px; padding: 20px; min-height: 90vh; }
.theory-section, .visualizer-section { background: var(--card); padding: 25px; border-radius: 15px; flex: 1; }

/* Visualizer Specifics */
.visual-area {
    width: 100%;
    height: 450px;
    background: #0b1120;
    border-radius: 12px;
    margin-top: 20px;
    overflow: auto;
}

#tree-svg { width: 100%; height: 100%; }

.node-circle { fill: var(--primary); stroke: white; stroke-width: 2; transition: all 0.5s ease; }
.node-text { fill: white; font-weight: bold; font-size: 14px; text-anchor: middle; dominant-baseline: middle; }
.edge-line { stroke: #475569; stroke-width: 2; stroke-dasharray: 1000; stroke-dashoffset: 1000; animation: draw 1s forwards; }

@keyframes draw { to { stroke-dashoffset: 0; } }

.btn-group { display: flex; gap: 10px; margin-top: 10px; }
button { flex: 1; padding: 12px; border-radius: 8px; border: none; cursor: pointer; color: white; font-weight: bold; transition: 0.3s; }
.btn-primary { background: var(--primary); }
.btn-danger { background: #ef4444; }
input { width: 100%; padding: 12px; background: #0b1120; border: 1px solid #1e293b; border-radius: 8px; color: white; margin-bottom: 15px; }


.code-link-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    padding: 20px;
    border-radius: 12px;
    text-decoration: none;
    color: white;
    margin-top: 30px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(255,255,255,0.1);
}

.code-link-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.card-content span {
    display: block;
    font-size: 1.1rem;
    font-weight: bold;
}

.card-content small {
    opacity: 0.8;
}

.card-icon {
    font-size: 1.5rem;
}

.highlight {
    color: #ec4899;
    font-weight: bold;
}
.controls input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 5px rgba(99, 102, 241, 0.3);
}
.back-home {
    position: fixed;
    top: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: rgba(30, 41, 59, 0.7); /* Dark semi-transparent */
    color: #f8fafc;
    text-decoration: none;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    backdrop-filter: blur(8px); /* تأثير الزجاج الضبابي */
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    z-index: 9999; /* عشان يفضل فوق أي حاجة */
}

.back-home:hover {
    background: var(--primary); /* يقلب للون الأساسي بتاعك عند الهوفر */
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    border-color: rgba(255, 255, 255, 0.3);
}


