/* Modern Documentation Site Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-blue: #0078D4;
    --dark-gray: #1e1e1e;
    --light-gray: #f5f5f5;
    --border-color: #e1e1e1;
    --text-color: #333;
    --code-bg: #f4f4f4;
}

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

/* Skip Links */
.skip-links {
    position: absolute;
    top: -40px;
    left: 0;
    z-index: 100;
}

.skip-links a {
    background: var(--primary-blue);
    color: white;
    padding: 8px;
}

.skip-links a:focus {
    top: 0;
}

/* Header */
.main-header {
    background: var(--dark-gray);
    color: white;
    padding: 1rem 2rem;
    border-bottom: 3px solid var(--primary-blue);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.2em;
    font-weight: 600;
}

.header-nav {
    display: flex;
    gap: 2rem;
}

.header-nav a {
    color: white;
    text-decoration: none;
    transition: opacity 0.2s;
}

.header-nav a:hover {
    opacity: 0.8;
}

/* Page Container */
.page-container {
    display: grid;
    grid-template-columns: 280px 1fr 220px;
    max-width: 1400px;
    margin: 0 auto;
    gap: 2rem;
    padding: 2rem;
}

/* Sidebar Navigation */
.sidebar {
    position: sticky;
    top: 2rem;
    height: fit-content;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
}

.nav-menu {
    border-right: 1px solid var(--border-color);
    padding-right: 1.5rem;
}

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

.nav-section h3 {
    font-size: 0.875rem;
    text-transform: uppercase;
    color: #666;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

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

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

.nav-section a {
    display: block;
    padding: 0.5rem;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.2s;
}

.nav-section a:hover {
    background: var(--light-gray);
}

.nav-section a.active {
    background: var(--primary-blue);
    color: white;
    font-weight: 500;
}

/* Main Content */
.main-content {
    min-width: 0;
}

.breadcrumb {
    margin-bottom: 2rem;
    font-size: 0.875rem;
}

.breadcrumb ol {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.breadcrumb li:not(:last-child)::after {
    content: '›';
    margin-left: 0.5rem;
    color: #666;
}

.breadcrumb a {
    color: var(--primary-blue);
    text-decoration: none;
}

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

/* Article */
.documentation-content {
    max-width: 900px;
}

.article-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.article-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.article-meta {
    display: flex;
    gap: 1.5rem;
    color: #666;
    font-size: 0.875rem;
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-left: 4px solid;
    margin: 1.5rem 0;
    border-radius: 4px;
}

.alert-info {
    background: #E6F3FF;
    border-color: var(--primary-blue);
}

.alert-warning {
    background: #FFF3CD;
    border-color: #FFC107;
}

.alert-tip {
    background: #D4EDDA;
    border-color: #28A745;
}

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

.feature-card {
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: box-shadow 0.2s;
}

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

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

.feature-card h3 {
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
}

/* Architecture Diagram */
.architecture-diagram {
    background: var(--code-bg);
    padding: 2rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    overflow-x: auto;
}

.mermaid-diagram {
    font-family: 'Courier New', monospace;
    line-height: 1.4;
    white-space: pre;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

thead {
    background: var(--light-gray);
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border: 1px solid var(--border-color);
}

th {
    font-weight: 600;
}

tbody tr:hover {
    background: #fafafa;
}

/* Code Blocks */
code {
    background: var(--code-bg);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: 'Courier New', Monaco, monospace;
    font-size: 0.9em;
}

.code-block {
    margin: 1.5rem 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.code-header {
    background: var(--dark-gray);
    color: white;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.code-lang {
    font-size: 0.875rem;
}

.copy-button {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
}

.copy-button:hover {
    opacity: 0.9;
}

.code-block pre {
    background: var(--code-bg);
    padding: 1.5rem;
    overflow-x: auto;
    margin: 0;
}

/* Step-by-Step */
.step-by-step {
    margin: 2rem 0;
}

.step {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.step-number {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: var(--primary-blue);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.25rem;
}

.step-content {
    flex: 1;
}

.step-content h3 {
    margin-bottom: 0.5rem;
}

/* Links */
.doc-link {
    color: var(--primary-blue);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.doc-link:hover {
    text-decoration: underline;
}

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

.next-step-card {
    display: block;
    padding: 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.2s;
}

.next-step-card:hover {
    border-color: var(--primary-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.next-step-card h3 {
    margin-bottom: 0.5rem;
    color: var(--primary-blue);
}

/* Page TOC */
.page-toc {
    position: sticky;
    top: 2rem;
    height: fit-content;
}

.page-toc h4 {
    font-size: 0.875rem;
    text-transform: uppercase;
    color: #666;
    margin-bottom: 0.75rem;
}

.page-toc ul {
    list-style: none;
    border-left: 2px solid var(--border-color);
}

.page-toc li {
    margin-bottom: 0.25rem;
}

.page-toc a {
    display: block;
    padding: 0.25rem 0 0.25rem 1rem;
    color: #666;
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.page-toc a:hover {
    color: var(--primary-blue);
    border-left: 2px solid var(--primary-blue);
    margin-left: -2px;
}

/* Footer */
.main-footer {
    background: var(--dark-gray);
    color: white;
    margin-top: 4rem;
    padding: 3rem 2rem 1rem;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    font-size: 1rem;
}

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

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

.footer-section a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    max-width: 1400px;
    margin: 0 auto;
    padding-top: 2rem;
    border-top: 1px solid #444;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-actions {
    display: flex;
    gap: 1rem;
}

#theme-toggle {
    background: transparent;
    border: 1px solid #666;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
}

#language-selector {
    background: transparent;
    border: 1px solid #666;
    color: white;
    padding: 0.5rem;
    border-radius: 4px;
}

/* Responsive */
@media (max-width: 1024px) {
    .page-container {
        grid-template-columns: 1fr;
    }

    .sidebar, .page-toc {
        display: none;
    }
}

/* Dark Mode */
body.dark-mode {
    background: #1e1e1e;
    color: #e0e0e0;
}

body.dark-mode .main-content {
    background: #1e1e1e;
}

body.dark-mode code {
    background: #2d2d2d;
}
