/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fafafa;
}

/* Layout */
#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.logo-img {
    height: 40px;
    filter: brightness(0) invert(1);
}

/* Navigation */
.nav {
    display: flex;
    gap: 0.5rem;
}

.nav-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.nav-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-1px);
}

.nav-btn.active {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
}

/* Search */
.search-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-input {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    background: rgba(255,255,255,0.1);
    color: white;
    placeholder-color: rgba(255,255,255,0.7);
    min-width: 250px;
}

.search-input::placeholder {
    color: rgba(255,255,255,0.7);
}

.search-btn {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* Main content */
.main {
    flex: 1;
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Sidebar */
.sidebar {
    width: 300px;
    background: white;
    border-right: 1px solid #e1e5e9;
    padding: 2rem 0;
    position: sticky;
    top: 80px;
    height: calc(100vh - 80px);
    overflow-y: auto;
}

.sidebar-content {
    padding: 0 1.5rem;
}

.breadcrumb {
    font-size: 0.9rem;
    color: #666;
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.level-selector h3 {
    display: none; /* Hide heading when zoom controls are hidden */
    color: #333;
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.zoom-controls {
    display: none; /* Hidden for now */
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.zoom-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.zoom-btn:hover {
    background: #e9ecef;
    transform: translateX(2px);
}

.zoom-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.toc h3 {
    color: #333;
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

#toc-list {
    list-style: none;
}

#toc-list li {
    margin-bottom: 0.5rem;
}

#toc-list a {
    color: #666;
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    display: block;
    transition: all 0.3s ease;
}

#toc-list a:hover {
    background: #f8f9fa;
    color: #667eea;
}

/* Content area */
.content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

.content-section {
    display: none;
}

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

.content-section h2 {
    color: #333;
    font-size: 2rem;
    margin-bottom: 2rem;
    border-bottom: 3px solid #667eea;
    padding-bottom: 0.5rem;
}

/* Overview section */
.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.overview-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    border: 1px solid #e1e5e9;
    transition: all 0.3s ease;
}

.overview-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 25px rgba(0,0,0,0.15);
}

.overview-card h3 {
    color: #333;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.overview-card p {
    color: #666;
    margin-bottom: 1rem;
}

.overview-card ul {
    margin-left: 1.5rem;
}

.overview-card li {
    color: #666;
    margin-bottom: 0.5rem;
}

.stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.stat {
    background: #f8f9fa;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #666;
}

.component-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.component-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #667eea;
}

.component-name {
    font-weight: 600;
    color: #333;
}

.component-path {
    font-family: 'Courier New', monospace;
    color: #667eea;
    font-size: 0.9rem;
    background: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* High-level diagram */
.high-level-diagram {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    border: 1px solid #e1e5e9;
}

.high-level-diagram h3 {
    color: #333;
    margin-bottom: 1.5rem;
}

/* Architecture section */
.architecture-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.arch-diagram {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    border: 1px solid #e1e5e9;
}

.module-overview {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    border: 1px solid #e1e5e9;
}

.arch-diagram h3,
.module-overview h3 {
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
}

/* Directory tree */
.directory-tree {
    font-family: 'Courier New', monospace;
}

.tree-node {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 0.25rem;
}

.tree-node:hover {
    background: #f8f9fa;
}

.tree-icon {
    font-size: 1rem;
}

.tree-label {
    font-weight: 600;
    color: #333;
}

.tree-desc {
    color: #666;
    font-size: 0.9rem;
    margin-left: auto;
}

/* Module grid */
#module-grid {
    display: grid;
    gap: 1rem;
}

.module-item {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #667eea;
    cursor: pointer;
    transition: all 0.3s ease;
}

.module-item:hover {
    background: #e9ecef;
    transform: translateX(2px);
}

.module-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.module-desc {
    color: #666;
    font-size: 0.9rem;
}

/* Responsive design */
@media (max-width: 1024px) {
    .header-content {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .nav {
        order: 3;
        flex-basis: 100%;
        justify-content: center;
    }
    
    .main {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid #e1e5e9;
    }
    
    .zoom-controls {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .architecture-content {
        grid-template-columns: 1fr;
    }
    
    .overview-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header-content {
        padding: 0 1rem;
    }
    
    .content {
        padding: 1rem;
    }
    
    .sidebar-content {
        padding: 0 1rem;
    }
    
    .search-input {
        min-width: 200px;
    }
}

/* Zoom-specific Content Styles */
.zoom-content {
    margin-top: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    border: 1px solid #e1e5e9;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
}

.simple-overview {
    text-align: center;
}

.simple-overview .large-text {
    font-size: 1.3rem;
    line-height: 1.6;
    margin: 1.5rem 0;
    color: #333;
}

.simple-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.big-stat {
    text-align: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 12px;
    color: white;
    font-size: 2rem;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.big-stat:hover {
    transform: scale(1.05);
}

.big-stat span {
    display: block;
    font-size: 0.8rem;
    font-weight: 400;
    margin-top: 0.5rem;
    opacity: 0.9;
}

.module-breakdown h3,
.code-examples h3 {
    margin-bottom: 1.5rem;
    color: #333;
}

.module-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.module-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
}

.module-stat:hover {
    background: #e9ecef;
    transform: translateX(2px);
}

.module-stat strong {
    color: #667eea;
    font-size: 1.2rem;
}

.code-examples pre {
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 1.5rem;
    overflow-x: auto;
    margin-top: 1rem;
}

.code-examples code {
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #333;
}

/* Zoom Level Transitions */
.content-section.zoom-1 {
    animation: zoomIn 0.3s ease-out;
}

.content-section.zoom-2 {
    animation: fadeIn 0.3s ease-out;
}

.content-section.zoom-3 {
    animation: slideIn 0.3s ease-out;
}

.content-section.zoom-4 {
    animation: expandIn 0.3s ease-out;
}

@keyframes zoomIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes expandIn {
    from {
        transform: scaleY(0.8);
        opacity: 0;
    }
    to {
        transform: scaleY(1);
        opacity: 1;
    }
}

/* Enhanced Breadcrumb for Zoom Levels */
.breadcrumb {
    font-weight: 500;
    color: #667eea !important;
    border-bottom: 2px solid rgba(102, 126, 234, 0.2);
    padding-bottom: 0.5rem;
}

/* Additional responsive styles for zoom content */
@media (max-width: 768px) {
    .simple-stats {
        grid-template-columns: 1fr;
    }
    
    .module-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .big-stat {
        font-size: 1.5rem;
        padding: 1rem;
    }
    
    .zoom-content {
        padding: 1rem;
        margin-top: 1rem;
    }
}

/* Modules Section Styles */
.modules-content {
    padding: 1rem 0;
}

.modules-grid {
    display: grid;
    gap: 2rem;
}

.module-category {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    border: 1px solid #e1e5e9;
}

.module-category h3 {
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 0.5rem;
}

.module-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.module-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
    cursor: pointer;
}

.module-card:hover {
    background: #e9ecef;
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.module-card h4 {
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    font-family: 'Monaco', 'Consolas', monospace;
}

.module-card p {
    color: #666;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.module-functions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.func-tag {
    background: #667eea;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-family: 'Monaco', 'Consolas', monospace;
}

/* APIs Section Styles */
.apis-content {
    padding: 1rem 0;
}

.api-sections {
    display: grid;
    gap: 2rem;
}

.api-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    border: 1px solid #e1e5e9;
}

.api-section h3 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 0.5rem;
}

.api-overview p {
    color: #666;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.api-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.api-category {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    border-left: 4px solid #667eea;
}

.api-category h4 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.api-category ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.api-category li {
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background: white;
    border-radius: 4px;
    border-left: 2px solid #667eea;
}

.api-category code {
    background: #e9ecef;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.9rem;
    color: #667eea;
    font-weight: 600;
}

/* Implementation Section Styles */
.implementation-content {
    padding: 1rem 0;
}

.impl-sections {
    display: grid;
    gap: 2rem;
}

.impl-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    border: 1px solid #e1e5e9;
}

.impl-section h3 {
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 0.5rem;
}

.arch-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.arch-component {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    border-left: 4px solid #667eea;
}

.arch-component h4 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.arch-component p {
    color: #666;
    margin-bottom: 1rem;
}

.arch-component ul {
    margin-left: 1.5rem;
}

.arch-component li {
    color: #666;
    margin-bottom: 0.5rem;
}

.type-system {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.type-category {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    border-left: 4px solid #667eea;
}

.type-category h4 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.type-category ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.type-category li {
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background: white;
    border-radius: 4px;
    border-left: 2px solid #667eea;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.9rem;
}

.type-category code {
    background: #667eea;
    color: white;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-weight: 600;
    margin-right: 0.5rem;
}

/* System Section Styles */
.system-content {
    padding: 1rem 0;
}

.system-hero {
    background: white;
    border-radius: 12px;
    padding: 3rem 2rem;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    border: 1px solid #e1e5e9;
    text-align: center;
    margin-bottom: 3rem;
}

.system-hero .large-text {
    font-size: 1.4rem;
    line-height: 1.6;
    color: #555;
    margin-top: 1rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.system-flow,
.system-benefits,
.system-components {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    border: 1px solid #e1e5e9;
    margin-bottom: 2rem;
}

.system-flow h3,
.system-benefits h3,
.system-components h3 {
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 0.5rem;
}

.flow-diagram {
    margin-top: 1rem;
    text-align: center;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.benefit-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
}

.benefit-card:hover {
    background: #e9ecef;
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.benefit-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

.benefit-card h4 {
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.benefit-card p {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
}

.components-detailed {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.component-detailed {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    border-left: 4px solid #667eea;
}

.component-detailed h4 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.component-detailed p {
    color: #666;
    margin-bottom: 1rem;
}

.component-detailed ul {
    margin-left: 1.5rem;
}

.component-detailed li {
    color: #666;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

/* Responsive styles for new sections */
@media (max-width: 768px) {
    .module-list,
    .api-categories,
    .arch-details,
    .type-system {
        grid-template-columns: 1fr;
    }
    
    .module-category,
    .api-section,
    .impl-section {
        padding: 1.5rem;
    }
    
    .func-tag {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
}
