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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

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

/* Sidebar menu */
.sidebar {
    width: 300px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}

.sidebar-header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.version {
    font-size: 0.9rem;
    opacity: 0.8;
    background: rgba(255,255,255,0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    display: inline-block;
}

.language-switcher {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.lang-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: 20px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    background: rgba(255,255,255,0.2);
}

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

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

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

.nav-item {
    margin-bottom: 0.25rem;
}

.nav-link {
    display: block;
    padding: 0.75rem 1.5rem;
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background: rgba(255,255,255,0.1);
    color: white;
    border-left-color: rgba(255,255,255,0.5);
}

.nav-link.active {
    background: rgba(255,255,255,0.15);
    color: white;
    border-left-color: white;
    font-weight: 600;
}

.submenu {
    list-style: none;
    margin-left: 1rem;
    margin-top: 0.5rem;
}

.submenu .nav-link {
    padding: 0.5rem 1.5rem;
    font-size: 0.9rem;
    opacity: 0.8;
}

.submenu .nav-link:hover {
    opacity: 1;
}

/* Main content */
.main-content {
    margin-left: 300px;
    flex: 1;
    background: white;
}

.content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

/* Sections */
.section {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e9ecef;
}

.section:last-child {
    border-bottom: none;
}

.section h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #2c3e50;
    font-weight: 700;
}

.section h2 {
    font-size: 2rem;
    margin: 2rem 0 1rem 0;
    color: #34495e;
    font-weight: 600;
    border-left: 4px solid #667eea;
    padding-left: 1rem;
}

.section h3 {
    font-size: 1.5rem;
    margin: 1.5rem 0 1rem 0;
    color: #2c3e50;
    font-weight: 600;
}

.section h4 {
    font-size: 1.25rem;
    margin: 1rem 0 0.5rem 0;
    color: #34495e;
    font-weight: 600;
}

.section h5 {
    font-size: 1rem;
    margin: 0.75rem 0 0.5rem 0;
    color: #495057;
    font-weight: 600;
}

.lead {
    font-size: 1.25rem;
    color: #6c757d;
    margin-bottom: 2rem;
    font-weight: 300;
}

/* Features grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.feature-card p {
    color: #6c757d;
    line-height: 1.6;
}

/* Features list */
.feature-list {
    list-style: none;
    margin: 1rem 0;
}

.feature-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f8f9fa;
    position: relative;
    padding-left: 1.5rem;
}

.feature-list li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #28a745;
    font-weight: bold;
}

/* Architecture diagram */
.architecture-diagram {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 2rem 0;
}

.arch-layer {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    text-align: center;
}

.arch-layer h4 {
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.arch-layer p {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Components grid */
.component-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.component-card {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.component-card h4 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.component-card p {
    color: #6c757d;
    font-size: 0.9rem;
}

/* File structure */
.file-structure {
    background: #2d3748;
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1rem 0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    overflow-x: auto;
}

/* Action cards */
.action-card, .function-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: box-shadow 0.3s ease;
}

.action-card:hover, .function-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.action-card h4, .function-card h4 {
    color: #2c3e50;
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.action-card p, .function-card p {
    color: #6c757d;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.action-params, .function-params {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}

.action-params h5, .function-params h5 {
    color: #495057;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.action-params ul, .function-params ul {
    list-style: none;
    margin: 0;
}

.action-params li, .function-params li {
    padding: 0.25rem 0;
    font-size: 0.9rem;
}

.action-params code, .function-params code {
    background: #e9ecef;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.85rem;
    color: #e83e8c;
}

.action-example, .function-example {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}

.action-example h5, .function-example h5 {
    color: #495057;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Context grid */
.context-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.context-card {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.context-card h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.context-card p {
    color: #6c757d;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.context-card ul {
    list-style: none;
    margin: 0;
}

.context-card li {
    padding: 0.25rem 0;
    font-size: 0.85rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.context-card code {
    background: #e9ecef;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    color: #e83e8c;
}

/* Actions and functions overview */
.actions-overview, .functions-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.action-category, .function-category {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.action-category:hover, .function-category:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.action-category h3, .function-category h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 600;
    border-bottom: 2px solid #667eea;
    padding-bottom: 0.5rem;
}

.action-category ul, .function-category ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.action-category li, .function-category li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f8f9fa;
}

.action-category li:last-child, .function-category li:last-child {
    border-bottom: none;
}

.action-category a, .function-category a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.action-category a:hover, .function-category a:hover {
    color: #5a67d8;
    text-decoration: underline;
}

/* Action and function pages */
.action-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.info-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
}

.info-card h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.info-card ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.info-card li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f8f9fa;
    position: relative;
    padding-left: 1.5rem;
}

.info-card li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #28a745;
    font-weight: bold;
}

.info-card li:last-child {
    border-bottom: none;
}

/* Parameters tables */
.params-table {
    margin: 1.5rem 0;
    overflow-x: auto;
}

.params-table table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.params-table th {
    background: #667eea;
    color: white;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

.params-table td {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.params-table tr:last-child td {
    border-bottom: none;
}

.params-table code {
    background: #f1f3f4;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    color: #e83e8c;
}

/* Example cards */
.example-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.example-card h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Variables grid */
.variables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.variable-card {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.variable-card h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.variable-card ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.variable-card li {
    padding: 0.25rem 0;
    font-size: 0.9rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.variable-card code {
    background: #e9ecef;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    color: #e83e8c;
}

/* Warning card */
.warning-card {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.warning-card ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.warning-card li {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255,234,167,0.5);
    position: relative;
    padding-left: 1.5rem;
}

.warning-card li:before {
    content: "⚠️";
    position: absolute;
    left: 0;
}

.warning-card li:last-child {
    border-bottom: none;
}

/* Navigation links */
.navigation-links {
    display: flex;
    justify-content: space-between;
    margin: 2rem 0;
    padding: 1rem 0;
    border-top: 1px solid #e9ecef;
}

.nav-button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: background 0.3s ease;
}

.nav-button:hover {
    background: #5a67d8;
    color: white;
    text-decoration: none;
}

.nav-button.next {
    margin-left: auto;
}

.nav-button.prev {
    margin-right: auto;
}

/* Related actions */
.related-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.related-action {
    display: block;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.related-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    text-decoration: none;
    color: inherit;
}

.related-action h4 {
    color: #667eea;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.related-action p {
    color: #6c757d;
    margin: 0;
    font-size: 0.9rem;
}

/* Example categories */
.example-category {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.example-category h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: 600;
    border-bottom: 2px solid #667eea;
    padding-bottom: 0.5rem;
}

.example-category p {
    color: #6c757d;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    line-height: 1.6;
}

/* Code blocks */
pre {
    background: #2d3748;
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1rem 0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

code {
    background: #f1f3f4;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    color: #e83e8c;
}

pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* Lists */
ul, ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

li {
    margin: 0.5rem 0;
    line-height: 1.6;
}

/* Paragraphs */
p {
    margin: 1rem 0;
    line-height: 1.6;
    color: #495057;
}

/* Links */
a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #5a67d8;
    text-decoration: underline;
}

/* Responsiveness */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .content {
        padding: 1rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .component-grid {
        grid-template-columns: 1fr;
    }
    
    .context-grid {
        grid-template-columns: 1fr;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section {
    animation: fadeIn 0.6s ease-out;
}

/* Mobile device improvements */
@media (max-width: 480px) {
    .sidebar-header h1 {
        font-size: 1.25rem;
    }
    
    .section h1 {
        font-size: 2rem;
    }
    
    .section h2 {
        font-size: 1.5rem;
    }
    
    .feature-card {
        padding: 1.5rem;
    }
    
    .action-card, .function-card {
        padding: 1rem;
    }
    
    pre {
        padding: 1rem;
        font-size: 0.8rem;
    }
}

/* Function info styles for new function pages */
.function-info {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.function-info h1 {
    color: #333;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    border-bottom: 3px solid #667eea;
    padding-bottom: 0.5rem;
}

.function-info h2 {
    color: #555;
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.function-info h3 {
    color: #666;
    font-size: 1.25rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.function-info p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.function-info code {
    background: #f1f3f4;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
}

.function-info pre {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
    margin: 1rem 0;
}

.function-info pre code {
    background: none;
    padding: 0;
    border-radius: 0;
}

.params-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.params-table th,
.params-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.params-table th {
    background: #667eea;
    color: white;
    font-weight: 600;
}

.params-table tr:hover {
    background: #f8f9fa;
}

.example {
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 0 8px 8px 0;
}

.example h4 {
    margin-bottom: 0.5rem;
    color: #667eea;
}
