/* Pure Black and Green Aesthetic */
:root {
    --bg-color: #000000;      
    --pane-bg: #0a0a0a;       
    --text-main: #39ff14;     
    --text-muted: #00aa00;    
    --border-color: #003300;  
    --hover-bg: #112211;      
    --code-hover: #1a1a1a;
    --text-white: #e0e0e0;    
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Cascadia Code', Consolas, monospace;
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar Layout */
.sidebar {
    width: 330px;
    background-color: var(--pane-bg);
    border-right: 1px solid var(--border-color);
    padding: 20px;
    overflow-y: auto;
    transition: transform 0.3s ease;
    z-index: 100;
}

.sidebar h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    text-transform: uppercase;
    border-bottom: 2px solid var(--text-muted);
    padding-bottom: 10px;
    color: var(--text-white);
    letter-spacing: 2px;
}

.syllabus-item { margin-bottom: 30px; }

/* Global anchor links for page routing */
a.syllabus-module { 
    text-decoration: none; 
    display: block; 
}
a.syllabus-module:hover { 
    color: var(--text-main); 
}

.syllabus-module {
    font-weight: bold;
    margin-bottom: 15px;
    color: var(--text-white);
    font-size: 1.15rem;
    border-left: 3px solid var(--border-color);
    padding-left: 10px;
    letter-spacing: 1px;
}

.active-module { 
    border-left: 3px solid #ff9d00; 
    color: #ff9d00; 
}

.syllabus-subheading {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 18px 0 8px 25px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
}

.atomic-node {
    padding: 10px 10px 10px 35px; 
    margin: 2px 0;
    font-size: 0.95rem;
    color: var(--text-muted);
    border-left: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.atomic-node:hover { background-color: var(--hover-bg); }
.atomic-node.active {
    border-left: 2px solid var(--text-main);
    color: var(--text-main);
    background-color: var(--hover-bg);
    font-weight: bold;
}

/* Main Container */
.main-container {
    display: flex;
    flex: 1;
    position: relative;
    overflow: hidden; 
}

/* Mobile Toggle Button */
.mobile-nav-btn {
    display: none; 
    background: var(--pane-bg);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 12px;
    font-weight: bold;
    font-family: inherit;
    cursor: pointer;
    width: 100%;
    text-align: left;
    border-radius: 0;
    border-bottom: 1px dashed var(--border-color);
    z-index: 50;
}

/* Left Pane */
.left-pane {
    flex: 1;
    padding: 30px;
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    background-color: var(--bg-color);
}

.left-pane h3 {
    margin-top: 0;
    color: var(--text-white);
    margin-bottom: 25px;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 10px;
}

.content-section { display: none; }
.content-section.active { display: block; }

/* The Iframe Embed */
.animation-embed {
    width: 100%;
    height: 400px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin: 15px 0 25px 0;
    background-color: var(--pane-bg);
}

/* Theory & Code Presentation */
.theory-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    margin-bottom: 10px;
    background-color: var(--pane-bg);
    border-radius: 4px;
    border: 1px solid var(--border-color);
    transition: border-color 0.2s;
}
.theory-line:hover { border-color: var(--text-main); }

.code-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 10px; 
    margin-bottom: 2px;
    border-radius: 4px;
    transition: background-color 0.2s;
}
.code-line:hover { background-color: var(--code-hover); }

.content-text {
    flex: 1;
    line-height: 1.5;
    padding-right: 20px;
    white-space: pre-wrap;
    word-break: break-word; 
}

/* Code Indentation */
.indent-1 { padding-left: 20px; }
.indent-2 { padding-left: 40px; }

.code-section .content-text {
    font-size: 0.95rem;
    color: #e6e6e6; 
}

/* Syntax Highlighting */
.co-comment { color: #0088ff; font-style: italic; }
.co-keyword { color: #ff9d00; font-weight: bold; }
.co-func { color: #ffdd00; }
.co-var { color: #cccccc; }
.co-string { color: #3ad900; }
.co-number { color: #ff628c; }
.co-directive { color: #ffdd00; }

/* Buttons */
.explain-btn {
    background-color: transparent;
    color: var(--text-muted);
    border: none;
    border-radius: 4px;
    padding: 8px; 
    cursor: pointer;
    font-family: 'Cascadia Code', monospace;
    font-weight: bold;
    transition: all 0.2s;
}
.explain-btn:hover {
    color: var(--text-main);
    transform: translateX(3px);
}

/* Right Pane */
.right-pane {
    flex: 1;
    padding: 30px;
    background-color: var(--pane-bg);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.right-pane h3 { color: var(--text-white); }
#explanation-content {
    font-size: 1.1rem;
    line-height: 1.6;
    padding: 20px;
    border-left: 4px solid var(--text-main);
    background-color: var(--bg-color);
    min-height: 100px;
    color: var(--text-main);
}
.placeholder-text {
    color: var(--text-muted);
    font-style: italic;
}

/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 900px) {
    .main-container {
        flex-direction: column;
        overflow-y: auto; 
    }
    
    .left-pane, .right-pane {
        flex: none;
        width: 100%;
        overflow-y: visible; 
    }
    
    .mobile-nav-btn { display: block; }
    
    .sidebar {
        position: absolute;
        left: 0;
        top: 0;
        height: 100%;
        transform: translateX(-100%);
        box-shadow: 5px 0 15px rgba(0,0,0,0.9);
    }
    
    .sidebar.sidebar-open { transform: translateX(0); }
    .animation-embed { height: 450px; }
}