/* Docs Theme - Clean & Modern */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --text: #1f2937;
    --text-light: #6b7280;
    --bg: #ffffff;
    --bg-secondary: #f9fafb;
    --border: #e5e7eb;
    --max-width: 1200px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}

/* Header */
.site-header {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
}

.site-nav a {
    margin-left: 2rem;
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.2s;
}

.site-nav a:hover {
    color: var(--primary);
}

/* Main Layout */
.docs-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 3rem;
}

@media (max-width: 768px) {
    .docs-container {
        grid-template-columns: 1fr;
    }
    .docs-sidebar {
        order: -1;
    }
}

/* Post Items */
.post-item {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border);
}

.post-item:first-child {
    padding-top: 0;
}

.post-item h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.post-item h2 a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s;
}

.post-item h2 a:hover {
    color: var(--primary);
}

.post-meta {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.post-meta time {
    margin-right: 1rem;
}

.post-excerpt {
    color: var(--text-light);
    margin-bottom: 1rem;
    line-height: 1.8;
}

.read-more {
    display: inline-block;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.read-more:hover {
    text-decoration: underline;
}

/* Sidebar */
.docs-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.sidebar-section {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.sidebar-section h3 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
    margin-bottom: 1rem;
}

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

.category-list li {
    margin-bottom: 0.5rem;
}

.category-list a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s;
}

.category-list a:hover {
    color: var(--primary);
}

/* Tags */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 9999px;
    font-size: 0.75rem;
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.2s;
}

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

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
    padding: 1rem 0;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s;
}

.pagination a:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.pagination .current {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Footer */
.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 2rem;
    margin-top: 4rem;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    text-align: center;
    color: var(--text-light);
    font-size: 0.875rem;
}

.footer-inner p {
    margin-bottom: 0.5rem;
}

.footer-inner a {
    color: var(--primary);
    text-decoration: none;
}

/* Single Post */
.post-single .docs-content {
    max-width: 800px;
    margin: 0 auto;
}

.post-single .post-title {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.post-content {
    line-height: 1.8;
}

.post-content h2 {
    margin: 2rem 0 1rem;
    font-size: 1.5rem;
}

.post-content h3 {
    margin: 1.5rem 0 0.75rem;
    font-size: 1.25rem;
}

.post-content p {
    margin-bottom: 1rem;
}

.post-content a {
    color: var(--primary);
}

.post-content code {
    background: var(--bg-secondary);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.875em;
}

.post-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.post-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* ===== Markdown Tables ===== */
.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.9rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

.post-content table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.post-content table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.post-content table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.post-content table tbody tr:nth-child(even) {
    background: var(--bg-secondary);
}

.post-content table tbody tr:hover {
    background: #f0f4ff;
}

.post-content table td {
    padding: 0.75rem 1rem;
    border: none;
}

/* Responsive Tables */
@media (max-width: 768px) {
    .post-content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .post-content table th,
    .post-content table td {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
}

/* Simple Table Borders */
.post-content table {
    border: 1px solid #ddd !important;
}
.post-content table th,
.post-content table td {
    border: 1px solid #ddd !important;
}
.post-content table th {
    background: #f5f5f5 !important;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .header-inner {
        padding: 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .site-nav {
        margin-top: 0.5rem;
    }
    
    .site-nav a {
        margin: 0 0.5rem;
    }
    
    .docs-container {
        padding: 1rem;
        gap: 1.5rem;
    }
    
    .post-item h2 {
        font-size: 1.25rem;
    }
    
    .post-meta {
        font-size: 0.75rem;
    }
    
    /* Table scroll on mobile */
    .post-content {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .post-content table {
        min-width: 100%;
        font-size: 0.8rem;
    }
    
    .post-content table th,
    .post-content table td {
        padding: 0.5rem;
        white-space: nowrap;
    }
}
