* {
    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: #f5f5f5;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Navigation Sidebar */
#navigation {
    width: 300px;
    background: #2c3e50;
    color: white;
    padding: 20px;
    overflow-y: auto;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
}

.nav-header h3 {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #34495e;
    color: #ecf0f1;
}

.category-list {
    list-style: none;
}

.category-item {
    margin-bottom: 10px;
}

.category-header {
    padding: 10px;
    background: #34495e;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background-color 0.3s;
}

.category-header:hover {
    background: #4a6741;
}

.category-toggle {
    margin-right: 10px;
    font-size: 12px;
    transition: transform 0.3s;
}

.category-name {
    font-weight: 500;
}

.example-list {
    list-style: none;
    margin-left: 20px;
    margin-top: 5px;
}

.example-item {
    margin: 5px 0;
}

.example-link {
    color: #bdc3c7;
    text-decoration: none;
    padding: 5px 10px;
    display: block;
    border-radius: 3px;
    transition: all 0.3s;
    font-size: 14px;
}

.example-link:hover {
    background: #34495e;
    color: white;
    transform: translateX(5px);
}

/* Main Content Area */
#main-content {
    flex: 1;
    padding: 30px;
    background: white;
    margin: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow-y: auto;
}

/* Welcome Page */
.welcome-page h1 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 2.5em;
}

.subtitle {
    color: #7f8c8d;
    font-size: 1.2em;
    margin-bottom: 30px;
}

.overview {
    margin: 30px 0;
}

.overview h2 {
    color: #34495e;
    margin-bottom: 15px;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.category-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    cursor: pointer;
    transition: all 0.3s;
}

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

.category-card h4 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.example-count {
    background: #3498db;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    float: right;
}

/* Breadcrumb */
.breadcrumb {
    margin-bottom: 20px;
    color: #7f8c8d;
}

.breadcrumb a {
    color: #3498db;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* Example Page */
.example-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #ecf0f1;
}

.example-header h1 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.example-description {
    color: #555;
    font-size: 1.1em;
    margin-bottom: 15px;
}

.concepts {
    margin: 15px 0;
}

.concept-tag {
    background: #3498db;
    color: white;
    padding: 4px 8px;
    border-radius: 15px;
    font-size: 12px;
    margin-right: 8px;
    display: inline-block;
    margin-bottom: 5px;
}

/* Code Blocks */
.compilation-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 4px solid #28a745;
}

.code-block {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 10px 15px;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    margin: 10px 0;
    overflow-x: auto;
}

.source-code {
    margin-bottom: 30px;
}

.source-code h3 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.code-container {
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #dee2e6;
}

.code-container pre {
    margin: 0;
    padding: 20px;
    overflow-x: auto;
    background: #2c3e50;
    color: #ecf0f1;
}

.code-container code {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
}

/* Example explanations */
.explanation {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #e74c3c;
}

.explanation h3 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.explanation p {
    margin-bottom: 15px;
    color: #555;
}

/* Category Overview */
.category-overview h1 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.category-description {
    font-size: 1.1em;
    color: #555;
    margin-bottom: 30px;
}

.examples-list h2 {
    color: #34495e;
    margin-bottom: 20px;
}

.example-preview {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #9b59b6;
}

.example-preview h3 {
    margin-bottom: 10px;
}

.example-preview h3 a {
    color: #2c3e50;
    text-decoration: none;
}

.example-preview h3 a:hover {
    color: #3498db;
}

/* Error Page */
.error-page {
    text-align: center;
    padding: 50px;
    color: #e74c3c;
}

.error-page button {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 20px;
}

.error-page button:hover {
    background: #2980b9;
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    #navigation {
        width: 100%;
        order: 2;
    }
    
    #main-content {
        order: 1;
        margin: 10px;
        padding: 20px;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
    }
}