/* DocFx-style documentation layout */

.doc-page {
    display: flex;
    min-height: 100vh;
    background: #fff;
}

/* Left sidebar - TOC tree */
.doc-sidebar {
    flex-shrink: 0;
}

/* Main content area */
.doc-main {
    flex: 1;
    min-width: 0;
    padding: 24px 32px;
    max-width: 900px;
}

/* Right sidebar - In This Article */
.doc-article-nav {
    flex-shrink: 0;
    width: 200px;
}

/* Breadcrumb */
.doc-breadcrumb {
    font-size: 0.85rem;
    margin-bottom: 16px;
    color: #666;
}

.doc-breadcrumb a {
    color: #0078d4;
    text-decoration: none;
}

.doc-breadcrumb a:hover {
    text-decoration: underline;
}

.doc-breadcrumb .sep {
    margin: 0 6px;
    color: #999;
}

/* Title */
.doc-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.doc-title {
    font-size: 2rem;
    font-weight: 400;
    margin: 0;
    color: #1a1a1a;
    line-height: 1.2;
}

.edit-btn {
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 6px 8px;
    cursor: pointer;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.edit-btn:hover {
    background: #f5f5f5;
    border-color: #0078d4;
    color: #0078d4;
}

/* Meta info */
.doc-meta {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

.doc-meta a {
    color: #0078d4;
    text-decoration: none;
}

.doc-meta a:hover {
    text-decoration: underline;
}

/* Summary */
.doc-summary {
    font-size: 1rem;
    line-height: 1.7;
    color: #333;
    margin-bottom: 24px;
}

/* Sections */
.doc-section {
    margin: 32px 0;
}

.doc-section h2 {
    font-size: 1.4rem;
    font-weight: 500;
    color: #1a1a1a;
    margin: 0 0 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e5e5;
}

/* Inheritance chain */
.inheritance-chain {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
}

.inheritance-chain a {
    color: #0078d4;
    text-decoration: none;
}

.inheritance-chain a:hover {
    text-decoration: underline;
}

.inheritance-chain .arrow {
    margin: 0 8px;
    color: #999;
}

.inheritance-chain .current {
    font-weight: 600;
    color: #1a1a1a;
}

.inheritance-chain .external-type,
.implements-list .external-type {
    color: #666;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
}

.inheritance-chain .external-link,
.implements-list .external-link {
    color: #6a737d;
    text-decoration: none;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
}

.inheritance-chain .external-link:hover,
.implements-list .external-link:hover {
    text-decoration: underline;
    color: #0078d4;
}

.inheritance-chain .external-link::after,
.implements-list .external-link::after {
    content: " ↗";
    font-size: 0.7rem;
    opacity: 0.6;
}

/* Implements list */
.implements-list,
.derived-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.implements-list a,
.derived-list a {
    color: #0078d4;
    text-decoration: none;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
}

.implements-list a:hover,
.derived-list a:hover {
    text-decoration: underline;
}

/* Inherited members */
.inherited-members {
    font-size: 0.85rem;
    line-height: 1.8;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.inherited-members a {
    color: #0078d4;
    text-decoration: none;
}

.inherited-members a:hover {
    text-decoration: underline;
}

.inherited-members .sep {
    color: #999;
    margin-right: 4px;
}

/* Member items (properties, methods) */
.member-item {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #f0f0f0;
}

.member-item:last-child {
    border-bottom: none;
}

.member-item h3 {
    font-size: 1.2rem;
    font-weight: 500;
    margin: 0 0 8px;
}

.member-item h3 a {
    color: #1a1a1a;
    text-decoration: none;
}

.member-item h3 a:hover {
    color: #0078d4;
}

.member-item p {
    margin: 8px 0 12px;
    color: #555;
    line-height: 1.6;
}

/* Loading and error states */
.doc-loading,
.doc-not-found {
    padding: 48px;
    text-align: center;
    color: #666;
}

.doc-not-found h2 {
    color: #1a1a1a;
    margin-bottom: 16px;
}

.doc-not-found a {
    color: #0078d4;
}

/* User Tags */
.user-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.user-tags .tag {
    background: #e0e7ff;
    color: #4338ca;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
}

/* Related Examples */
.related-examples-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0 1.5rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #fdf4ff 0%, #fae8ff 100%);
    border: 1px solid #e879f9;
    border-radius: 8px;
    font-size: 0.85rem;
}

.examples-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #d946ef;
    border-radius: 6px;
    color: white;
    flex-shrink: 0;
}

.examples-label {
    font-weight: 600;
    color: #86198f;
    margin-right: 0.25rem;
}

.example-link {
    color: #a21caf;
    text-decoration: none;
    padding: 0.2rem 0.5rem;
    background: #f5d0fe;
    border-radius: 4px;
    font-size: 0.8rem;
    transition: all 0.15s;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.example-link:hover {
    background: #d946ef;
    color: white;
}

.more-examples {
    color: #86198f;
    font-weight: 500;
    text-decoration: none;
    padding: 0.2rem 0.5rem;
    border: 1px dashed #e879f9;
    border-radius: 4px;
    font-size: 0.8rem;
}

.more-examples:hover {
    background: #fae8ff;
    border-style: solid;
}

/* Responsive */
@media (max-width: 1200px) {
    .doc-article-nav {
        display: none;
    }
}

@media (max-width: 900px) {
    .doc-page {
        flex-direction: column;
    }
    
    .doc-sidebar {
        width: 100%;
        height: auto;
        max-height: 300px;
        overflow-y: auto;
    }
    
    .doc-main {
        padding: 16px;
    }
}
