:root {
    --primary-color: #2563eb;
    --secondary-color: #475569;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--card-bg);
    border-right: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    top: 0;
    left: 0;
    z-index: 10;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    display: block;
    text-decoration: none;
}

.tagline {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    display: block;
}

.nav-links {
    list-style: none;
}

.nav-links li {
    margin-bottom: 0.5rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--secondary-color);
    font-weight: 500;
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.nav-links a:hover, .nav-links a.active {
    background-color: #eff6ff;
    color: var(--primary-color);
}

/* Main Content */
.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 2rem 3rem;
    max-width: 1200px;
}

header {
    margin-bottom: 3rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 2rem;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

p.lead {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 700px;
}

/* Demo Sections */
.demo-section {
    margin-bottom: 4rem;
    scroll-margin-top: 2rem;
}

.demo-section h2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    display: inline-block;
}

.demo-description {
    margin-bottom: 1.5rem;
    color: var(--secondary-color);
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.card-body {
    padding: 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.tree-container-wrapper {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    background: #fafafa;
    min-height: 300px;
    max-height: 500px;
    overflow-y: auto;
}

.controls-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.control-group {
    background: #f1f5f9;
    padding: 1rem;
    border-radius: 0.5rem;
}

.control-group h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--text-main);
}

.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.btn:hover {
    background-color: #1d4ed8;
}

.btn-secondary {
    background-color: white;
    color: var(--secondary-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
}

.log-panel {
    background: #1e293b;
    color: #a5b4fc;
    padding: 1rem;
    border-radius: 0.5rem;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.85rem;
    height: 200px;
    overflow-y: auto;
    margin-top: auto;
}

.log-entry {
    margin-bottom: 0.25rem;
    border-bottom: 1px solid #334155;
    padding-bottom: 0.25rem;
}

.log-entry:last-child {
    border-bottom: none;
}

.timestamp {
    color: #64748b;
    margin-right: 0.5rem;
}

/* Specific layout tweaks */
@media (max-width: 1024px) {
    .card-body {
        grid-template-columns: 1fr;
    }
    .sidebar {
        display: none; /* Simple mobile hide for now */
    }
    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
}

/* Custom Tree Styles Overrides (if needed) */
.treejs-node {
    padding: 4px 0;
}
