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

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

/* Container and layout */
.container {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

/* Header */
.header {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 2rem 2rem 2.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

.subtitle {
    font-size: 1.125rem;
    font-weight: 400;
    opacity: 0.9;
}

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

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

.nav-section {
    margin-bottom: 2rem;
}

.nav-section h3 {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.nav-section ul {
    list-style: none;
}

.nav-section li {
    margin-bottom: 0.5rem;
}

.nav-section a {
    display: block;
    padding: 0.5rem 0.75rem;
    color: #475569;
    text-decoration: none;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.nav-section a:hover {
    background-color: #f1f5f9;
    color: #1e293b;
}

.nav-section a:active {
    background-color: #e2e8f0;
}

/* Main content */
.main-content {
    padding: 2rem 3rem;
    max-width: 1200px;
}

.section {
    margin-bottom: 4rem;
    background: white;
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.section h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e2e8f0;
}

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

.section h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #475569;
    margin: 1.5rem 0 0.75rem 0;
}

.section p {
    margin-bottom: 1rem;
    color: #475569;
    line-height: 1.7;
}

.section ul, .section ol {
    margin: 1rem 0 1rem 1.5rem;
    color: #475569;
}

.section li {
    margin-bottom: 0.5rem;
}

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

.feature-card {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.feature-card h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.75rem;
}

.feature-card p {
    color: #64748b;
    font-size: 0.875rem;
    line-height: 1.6;
}

/* Architecture diagram */
.architecture-diagram {
    background: #f8fafc;
    padding: 2rem;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
    margin: 2rem 0;
}

.arch-layer {
    background: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    border: 1px solid #e2e8f0;
}

.arch-layer:last-child {
    margin-bottom: 0;
}

.arch-layer h4 {
    color: #1e293b;
    margin-bottom: 0.75rem;
    font-size: 1.125rem;
}

.arch-layer ul {
    margin: 0.75rem 0 0 1.5rem;
}

.arch-layer li {
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

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

.step {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
}

.step h4 {
    color: #1e293b;
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

.step ul {
    margin: 0.75rem 0 0 1.5rem;
}

.step li {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

/* Worker info */
.worker-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.info-card {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
    text-align: center;
}

.info-card h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.info-card p {
    font-size: 0.875rem;
    color: #475569;
    margin: 0;
}

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

.endpoint {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
}

.endpoint h4 {
    color: #1e293b;
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

.endpoint ul {
    margin: 0.75rem 0 0 1.5rem;
}

.endpoint li {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.endpoint code {
    background: #e2e8f0;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.75rem;
}

/* Schema section */
.schema-section {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
    margin: 1.5rem 0;
}

.schema-section h4 {
    color: #1e293b;
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

.schema-section pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
}

.schema-section code {
    color: #fbbf24;
}

/* Example section */
.example-section {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
    margin: 1.5rem 0;
}

.example-section h4 {
    color: #1e293b;
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

.example-section pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
}

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

.function {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
}

.function h4 {
    color: #1e293b;
    margin-bottom: 0.75rem;
    font-size: 1rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.function p {
    color: #64748b;
    font-size: 0.875rem;
    margin: 0;
}

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

.test-section {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
}

.test-section h4 {
    color: #1e293b;
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

.test-section ul {
    margin: 0.75rem 0 0 1.5rem;
}

.test-section li {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

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

.deployment-step {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
}

.deployment-step h4 {
    color: #1e293b;
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

.deployment-step pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 0.75rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.75rem;
    line-height: 1.4;
}

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

.issue {
    background: #fef2f2;
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid #fecaca;
}

.issue h4 {
    color: #991b1b;
    margin-bottom: 0.75rem;
    font-size: 1.125rem;
}

.issue p {
    color: #7f1d1d;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}

.issue ul {
    margin: 0.75rem 0 0 1.5rem;
}

.issue li {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: #7f1d1d;
}

/* Code styling */
code {
    background: #f1f5f9;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875em;
    color: #1e293b;
}

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

/* Responsive design */
@media (max-width: 1024px) {
    .container {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        position: static;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }
    
    .main-content {
        padding: 2rem;
    }
    
    .header {
        padding: 1.5rem 2rem;
    }
    
    .title {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 1rem;
    }
    
    .title {
        font-size: 1.75rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .section {
        padding: 1.5rem;
    }
    
    .feature-grid,
    .setup-steps,
    .worker-info,
    .endpoint-grid,
    .function-grid,
    .test-grid,
    .deployment-grid,
    .troubleshooting-grid {
        grid-template-columns: 1fr;
    }
    
    .feature-card,
    .step,
    .info-card,
    .endpoint,
    .function,
    .test-section,
    .deployment-step,
    .issue {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 1rem;
    }
    
    .title {
        font-size: 1.5rem;
    }
    
    .main-content {
        padding: 0.75rem;
    }
    
    .section {
        padding: 1rem;
    }
    
    .section h2 {
        font-size: 1.5rem;
    }
    
    .section h3 {
        font-size: 1.25rem;
    }
}

/* Print styles */
@media print {
    .sidebar {
        display: none;
    }
    
    .container {
        grid-template-columns: 1fr;
    }
    
    .header {
        background: white !important;
        color: black !important;
        box-shadow: none;
    }
    
    .section {
        box-shadow: none;
        border: 1px solid #e2e8f0;
        page-break-inside: avoid;
    }
    
    .feature-grid,
    .setup-steps,
    .worker-info,
    .endpoint-grid,
    .function-grid,
    .test-grid,
    .deployment-grid,
    .troubleshooting-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
