/* Documentation-specific styles */

/* Layout */
.docs-layout {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    min-height: calc(100vh - 200px);
}

/* Sidebar */
.docs-sidebar {
    width: 260px;
    min-width: 260px;
    padding: 2rem 1.5rem;
    border-right: 1px solid var(--border);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

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

.sidebar-section h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--fg-muted);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-section a {
    display: block;
    padding: 0.5rem 0;
    color: var(--fg-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s, padding-left 0.2s;
}

.sidebar-section a:hover {
    color: var(--fg);
    padding-left: 0.5rem;
}

.sidebar-section a.active {
    color: var(--accent);
    font-weight: 500;
}

/* Main Content */
.docs-content {
    flex: 1;
    padding: 2rem 3rem;
    max-width: 900px;
}

.breadcrumb {
    font-size: 0.85rem;
    color: var(--fg-muted);
    margin-bottom: 1.5rem;
}

.breadcrumb a {
    color: var(--fg-muted);
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--accent);
}

.docs-content h1 {
    font-size: 2.5rem;
    font-weight: 400;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.docs-content .lead {
    font-size: 1.2rem;
    color: var(--fg-muted);
    line-height: 1.6;
    margin-bottom: 2rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--fg-muted);
}

/* Sections */
.docs-section {
    margin-bottom: 3rem;
}

.docs-section h2 {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.docs-section h3 {
    font-size: 1.2rem;
    font-weight: 500;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--fg);
}

.docs-section p {
    color: var(--fg-muted);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.docs-section ul, .docs-section ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.docs-section li {
    color: var(--fg-muted);
    line-height: 1.7;
    margin-bottom: 0.5rem;
}

.docs-section li strong {
    color: var(--fg);
}

/* Architecture Visual */
.architecture-visual {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.architecture-visual pre {
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--fg-muted);
    margin: 0;
    white-space: pre;
}

/* Concept Grid */
.concept-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.concept-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
}

.concept-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.concept-card h3 {
    font-size: 1.1rem;
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: var(--fg);
}

.concept-card p {
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.concept-link {
    font-size: 0.85rem;
    color: var(--accent);
    text-decoration: none;
}

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

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

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

.docs-table th {
    color: var(--fg-muted);
    font-weight: 500;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--card-bg);
}

.docs-table td {
    color: var(--fg);
    font-size: 0.95rem;
}

.docs-table code {
    background: #1a1a1a;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--accent);
}

.docs-table tr:hover td {
    background: var(--card-bg);
}

/* Code Blocks */
.code-block {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin: 1.5rem 0;
    overflow: hidden;
}

.code-header {
    background: #1a1a1a;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    color: var(--fg-muted);
    border-bottom: 1px solid var(--border);
}

.code-block pre {
    margin: 0;
    padding: 1rem;
    overflow-x: auto;
}

.code-block code {
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--fg);
}

/* Inline code */
.docs-content p code,
.docs-content li code {
    background: #1a1a1a;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85em;
    color: var(--accent);
}

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

.callout-info {
    background: rgba(107, 159, 255, 0.1);
    border-color: var(--accent);
}

.callout-warning {
    background: rgba(255, 179, 71, 0.1);
    border-color: #ffb347;
}

.callout-danger {
    background: rgba(255, 107, 107, 0.1);
    border-color: #ff6b6b;
}

.callout-success {
    background: rgba(107, 255, 159, 0.1);
    border-color: #6bff9f;
}

.callout strong {
    color: var(--fg);
}

/* Stack Comparison */
.stack-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 1.5rem;
}

.stack-column {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
}

.stack-column h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--accent);
    font-size: 1rem;
}

.stack-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.stack-column li {
    padding: 0.4rem 0;
    font-size: 0.9rem;
}

/* Navigation Cards */
.nav-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.nav-card {
    display: block;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    text-decoration: none;
    transition: border-color 0.2s, transform 0.2s;
}

.nav-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.nav-card h3 {
    margin: 0 0 0.5rem 0;
    color: var(--fg);
    font-size: 1.1rem;
}

.nav-card p {
    margin: 0;
    font-size: 0.9rem;
}

/* File Tree */
.file-tree {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
}

.file-tree ul {
    list-style: none;
    padding-left: 1.5rem;
    margin: 0;
}

.file-tree > ul {
    padding-left: 0;
}

.file-tree li {
    position: relative;
    color: var(--fg-muted);
}

.file-tree li.folder > span {
    color: var(--accent);
}

.file-tree li.file > span {
    color: var(--fg);
}

.file-tree .comment {
    color: #666;
    font-style: italic;
}

/* Feature Cards */
.feature-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.feature-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
}

.feature-card h3 {
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.feature-card .tag {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: var(--accent);
    color: var(--bg);
    font-weight: 500;
}

.feature-card .tag.offline {
    background: #6bff9f;
}

.feature-card .tag.server {
    background: #ffb347;
}

/* Issue Cards */
.issue-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.issue-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 1.25rem;
}

.issue-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.issue-title {
    font-weight: 500;
    color: var(--fg);
}

.issue-severity {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-weight: 500;
    text-transform: uppercase;
}

.issue-severity.critical {
    background: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
}

.issue-severity.high {
    background: rgba(255, 179, 71, 0.2);
    color: #ffb347;
}

.issue-severity.medium {
    background: rgba(107, 159, 255, 0.2);
    color: var(--accent);
}

.issue-severity.low {
    background: rgba(107, 255, 159, 0.2);
    color: #6bff9f;
}

.issue-location {
    font-size: 0.8rem;
    color: var(--fg-muted);
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    margin-bottom: 0.5rem;
}

.issue-description {
    font-size: 0.9rem;
    color: var(--fg-muted);
    line-height: 1.5;
}

/* API Endpoint List */
.endpoint-list {
    margin-top: 1rem;
}

.endpoint {
    display: flex;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

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

.endpoint-method {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    width: 60px;
    text-align: center;
    margin-right: 1rem;
}

.endpoint-method.get {
    background: rgba(107, 255, 159, 0.2);
    color: #6bff9f;
}

.endpoint-method.post {
    background: rgba(107, 159, 255, 0.2);
    color: var(--accent);
}

.endpoint-method.put {
    background: rgba(255, 179, 71, 0.2);
    color: #ffb347;
}

.endpoint-method.delete {
    background: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
}

.endpoint-path {
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--fg);
    flex: 1;
}

.endpoint-desc {
    font-size: 0.85rem;
    color: var(--fg-muted);
    width: 300px;
    text-align: right;
}

/* Responsive */
@media (max-width: 1200px) {
    .concept-grid,
    .feature-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .docs-layout {
        flex-direction: column;
    }

    .docs-sidebar {
        width: 100%;
        position: relative;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .docs-content {
        padding: 1.5rem;
    }

    .concept-grid,
    .nav-cards,
    .feature-cards,
    .stack-comparison {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .endpoint {
        flex-wrap: wrap;
    }

    .endpoint-desc {
        width: 100%;
        text-align: left;
        margin-top: 0.5rem;
        padding-left: calc(60px + 1rem);
    }
}

@media (max-width: 600px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .docs-content h1 {
        font-size: 1.8rem;
    }
}
