@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
        
:root {
    /* Brand colors */
    --primary-color: #ed1c24;
    --primary-light: rgba(237, 28, 36, 0.1);
    
    /* Light theme */
    --light-background: #fafafa;
    --light-surface: #f5f5f5;
    --light-card: #ffffff;
    --light-text-primary: #333333;
    --light-text-secondary: #666666;
    --light-border: #e0e0e0;
    --light-shadow: rgba(0, 0, 0, 0.08);
    
    /* Dark theme */
    --dark-background: #1a1a1a;
    --dark-surface: #2a2a2a;
    --dark-card: #2f2f2f;
    --dark-text-primary: #f0f0f0;
    --dark-text-secondary: #b0b0b0;
    --dark-border: #404040;
    --dark-shadow: rgba(0, 0, 0, 0.3);
}

/* Default to light theme */
body {
    --background: var(--light-background);
    --surface: var(--light-surface);
    --card: var(--light-card);
    --text-primary: var(--light-text-primary);
    --text-secondary: var(--light-text-secondary);
    --border: var(--light-border);
    --shadow: var(--light-shadow);
}

/* Dark theme */
body.dark-theme {
    --background: var(--dark-background);
    --surface: var(--dark-surface);
    --card: var(--dark-card);
    --text-primary: var(--dark-text-primary);
    --text-secondary: var(--dark-text-secondary);
    --border: var(--dark-border);
    --shadow: var(--dark-shadow);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 16px;
    transition: all 0.2s ease;
}

.logo {
            height: 200px;
            width: auto;
        }

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 24px;
}

.back-link {
    padding-bottom: 1.5rem;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0;
    border-bottom: 1px solid var(--primary-color);
    margin-bottom: 32px;
}

.header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.back-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.back-link:hover {
    text-decoration: underline;
}

.theme-toggle {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    border-color: var(--primary-color);
}

.theme-icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Lesson Header */
.lesson-header {
    background: var(--card);
    padding: 32px;
    border-radius: 12px;
    margin-bottom: 32px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 2px 8px var(--shadow);
}



.lesson-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.lesson-summary {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.lesson-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 32px;
    margin-bottom: 24px;
}

.meta-item {
    display: flex;
    flex-direction: column;
    padding: 12px 0;
}

.meta-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.meta-value {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.lesson-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    background: var(--surface);
    color: var(--text-secondary);
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    border: 1px solid var(--border);
    font-weight: 500;
}

/* Content Sections */
.content-section {
    background: var(--card);
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px var(--shadow);
}

.content-section h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 8px;
}

.content-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.content-section p {
    margin-bottom: 16px;
    line-height: 1.7;
}

.content-section ul {
    margin-left: 20px;
    margin-bottom: 16px;
}

.content-section li {
    margin-bottom: 8px;
}

/* Prerequisites */
.prereq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.prereq-box {
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid;
}

.prereq-box.scientific {
    background: rgba(34, 139, 34, 0.1);
    border-left-color: #228b22;
}

.prereq-box.programming {
    background: rgba(30, 144, 255, 0.1);
    border-left-color: #1e90ff;
}

.prereq-box h4 {
    font-weight: 600;
    margin-bottom: 12px;
}

.prereq-box.scientific h4 {
    color: #228b22;
}

.prereq-box.programming h4 {
    color: #1e90ff;
}

.prereq-box ul {
    margin-left: 16px;
}

.prereq-box li {
    margin-bottom: 6px;
    color: var(--text-secondary);
}

/* Learning Objectives */
.objectives-list {
    background: var(--surface);
    padding: 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

/* Notebook Sequence */
.notebook-sequence {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.notebook-item {
    background: var(--surface);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.notebook-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.notebook-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.notebook-number {
    background: var(--primary-color);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.notebook-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.notebook-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
}

.duration {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
}

/* Materials Section */
.materials-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.material-item {
    background: var(--surface);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.material-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.material-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.material-type-icon {
    width: 18px;
    height: 18px;
    fill: var(--primary-color);
    flex-shrink: 0;
}

.material-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.notebook-buttons {
    display: flex;
    gap: 8px;
}

.material-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
}

.material-objectives {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.material-objectives.collapsed {
    display: none;
}

.objectives-toggle {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 12px;
    padding: 4px 0;
    text-decoration: underline;
}

.objectives-toggle:hover {
    opacity: 0.8;
}

.material-objectives h5 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.material-objectives ul {
    margin-left: 16px;
}

.material-objectives li {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.btn {
    display: inline-block;
    padding: 12px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    text-align: center;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #d91920;
    transform: translateY(-1px);
}

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

.btn-secondary:hover {
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.access-note {
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-secondary);
}

.access-note a {
    color: var(--primary-color);
    text-decoration: none;
}

.access-note a:hover {
    text-decoration: underline;
}

/* Platform Options */
.platform-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.platform-card {
    background: var(--surface);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.platform-card.recommended {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.platform-card h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.platform-card.recommended h4 {
    color: var(--primary-color);
}

.platform-card p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.platform-card ul {
    margin-left: 16px;
}

.platform-card li {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 32px 0;
    color: var(--text-secondary);
    border-top: 1px solid var(--primary-color);
    margin-top: 48px;
    font-size: 14px;
}

/* Links */
a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .lesson-title {
        font-size: 28px;
    }
    
    .lesson-meta-grid {
        grid-template-columns: 1fr;
    }
    
    .materials-grid {
        grid-template-columns: 1fr;
    }
    
    .platform-options {
        grid-template-columns: 1fr;
    }
    
    .prereq-grid {
        grid-template-columns: 1fr;
    }
    
    .notebook-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

    /* Search Section */
.search-section {
    background: var(--card);
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 32px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 2px 8px var(--shadow);
}

.search-bar {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    margin-bottom: 20px;
    transition: border-color 0.2s ease;
}

.search-bar:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-bar::placeholder {
    color: var(--text-secondary);
}

.filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-primary);
    font-size: 14px;
}

.filter-select {
    padding: 10px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Active filters */
.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.filter-tag {
    background-color: var(--primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.filter-tag .remove {
    cursor: pointer;
    font-size: 14px;
    opacity: 0.8;
}

.filter-tag .remove:hover {
    opacity: 1;
}

/* Results */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary-color);
}

.results-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
}

.results-count {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Lesson Cards */
.lessons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 20px;
    margin-bottom: 48px;
}

.lesson-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s ease;
    cursor: pointer;
    box-shadow: 0 2px 8px var(--shadow);
    text-decoration: none;
    color: inherit;
}

.lesson-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px var(--shadow);
    text-decoration: none;
    color: inherit;
}

.lesson-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.lesson-description {
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.5;
}

.lesson-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.meta-item {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.meta-label {
    font-weight: 500;
    color: var(--text-secondary);
}

.meta-value {
    color: var(--text-primary);
}

.lesson-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    background: var(--surface);
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    border: 1px solid var(--border);
}

/* Footer */
.footer {
    text-align: center;
    padding: 32px 0;
    color: var(--text-secondary);
    border-top: 1px solid var(--primary-color);
    margin-top: 48px;
    font-size: 14px;
}

/* Links */
a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Hidden class for filtering */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    h1 {
        font-size: 28px;
    }
    
    .filters {
        grid-template-columns: 1fr;
    }
    
    .lessons-grid {
        grid-template-columns: 1fr;
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* Responsive container width - wider but with reasonable limits */
.container {
    max-width: min(80%, 1400px);
    margin: 0 auto;
    padding: 0 24px;
}
.lesson-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 24px;
    align-items: start;
}

/* Sidebar TOC */
.sidebar-toc {
    position: sticky;
    top: 24px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 2px 8px var(--shadow);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    transition: all 0.3s ease;
}

.sidebar-toc.collapsed {
    width: 40px;
    overflow: hidden;
}

.toc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    border-radius: 12px 12px 0 0;
}

.toc-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.toc-collapse {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--text-secondary);
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toc-collapse:hover {
    color: var(--primary-color);
}

.toc-collapse svg {
    fill: currentColor;
}

.sidebar-toc .toc-nav {
    padding: 12px 0;
}

.sidebar-toc .toc-link {
    display: block;
    padding: 8px 16px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar-toc .toc-link:hover {
    background-color: var(--surface);
    border-left-color: var(--primary-color);
    color: var(--text-primary);
}

.sidebar-toc .toc-link.active {
    background-color: var(--primary-light);
    border-left-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: 600;
}

.sidebar-toc .toc-submenu {
    margin-left: 0;
    border-left: none;
    padding-left: 0;
}

.sidebar-toc .toc-sublink {
    display: block;
    padding: 6px 16px 6px 32px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    position: relative;
}

.sidebar-toc .toc-sublink::before {
    content: '•';
    position: absolute;
    left: 20px;
    color: var(--text-secondary);
}

.sidebar-toc .toc-sublink:hover {
    background-color: var(--surface);
    color: var(--text-primary);
    border-left-color: var(--primary-color);
}

.sidebar-toc .toc-sublink.active {
    background-color: var(--primary-light);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 500;
}

.sidebar-toc .toc-sublink.active::before {
    color: var(--primary-color);
}

/* Main content area */
.lesson-content {
    min-width: 0; /* Prevents flex items from overflowing */
}

/* Collapsed sidebar styles */
.sidebar-toc.collapsed .toc-header h3,
.sidebar-toc.collapsed .toc-nav {
    display: none;
}

.sidebar-toc.collapsed .toc-header {
    justify-content: center;
    padding: 12px;
}

/* Mobile responsive */
@media (max-width: 1024px) {
    .lesson-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .sidebar-toc {
        position: static;
        order: -1;
        max-height: none;
        margin-bottom: 24px;
    }
    
    .sidebar-toc.collapsed {
        width: auto;
        overflow: visible;
    }
    
    .sidebar-toc.collapsed .toc-header h3,
    .sidebar-toc.collapsed .toc-nav {
        display: block;
    }
    
    .sidebar-toc.collapsed .toc-header {
        justify-content: space-between;
        padding: 16px;
    }
}

@media (max-width: 768px) {
    .lesson-layout {
        gap: 16px;
    }
    
    .sidebar-toc {
        margin-bottom: 16px;
    }
    
    .sidebar-toc .toc-link {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .sidebar-toc .toc-sublink {
        padding: 4px 12px 4px 24px;
        font-size: 12px;
    }
    
    .sidebar-toc .toc-sublink::before {
        left: 16px;
    }
}

/* Smooth scrolling for better UX */
html {
    scroll-behavior: smooth;
}

/* Adjust scroll margin for better positioning */
.content-section,
.material-item {
    scroll-margin-top: 80px;
}

