/* ===========================================
   Documentation Styles - Clean Two-Column Layout
   =========================================== */

/* Layout Container */
.docs-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: calc(100vh - 140px);
}

/* Sidebar */
.docs-sidebar {
    background: var(--color-bg-card);
    border-right: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.docs-sidebar-inner {
    padding: 2rem 0;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.docs-sidebar-header {
    padding: 0 1.5rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 1rem;
}

.docs-sidebar-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Sidebar Navigation */
.docs-nav {
    flex: 1;
    padding: 0 0.75rem;
}

.docs-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.docs-nav li {
    margin-bottom: 2px;
}

.docs-nav a {
    display: block;
    padding: 0.65rem 0.75rem;
    color: var(--color-text);
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
}

.docs-nav a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-primary);
}

.docs-nav a.active {
    background: rgba(22, 163, 74, 0.15);
    color: var(--color-primary);
    border-left-color: var(--color-primary);
    font-weight: 600;
}

/* Light theme sidebar */
[data-theme="light"] .docs-sidebar {
    background: #f8f9fa;
}

[data-theme="light"] .docs-nav a {
    color: var(--color-text);
}

[data-theme="light"] .docs-nav a:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--color-primary);
}

[data-theme="light"] .docs-nav a.active {
    background: rgba(22, 163, 74, 0.1);
}

/* Sidebar Footer */
.docs-sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--color-border);
    margin-top: auto;
}

.docs-sidebar-footer a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.15s;
}

.docs-sidebar-footer a:hover {
    color: var(--color-primary);
}

/* Mobile Toggle Button */
.docs-mobile-toggle {
    display: none;
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 100;
    background: var(--color-primary);
    color: #000;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.docs-mobile-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4);
}

.docs-mobile-toggle.active {
    background: var(--color-text);
}

/* Main Content Area */
.docs-main {
    padding: 3rem;
    max-width: 100%;
    overflow-x: hidden;
}

.docs-content,
.docs-article {
    max-width: 800px;
}

/* Header */
.docs-header {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.docs-header h1 {
    font-size: 2.25rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    line-height: 1.2;
}

.docs-lead {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    margin: 0 0 1rem;
    line-height: 1.5;
}

.docs-intro {
    font-size: 1rem;
    color: var(--color-text);
    margin: 0;
    line-height: 1.6;
}

/* Quick Links Section */
.docs-quick-links {
    margin-bottom: 2.5rem;
}

.docs-quick-links h2 {
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}

.docs-quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.docs-quick-card {
    display: flex;
    flex-direction: column;
    padding: 1.25rem 1.5rem;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.docs-quick-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.docs-quick-title {
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 0.25rem;
}

.docs-quick-desc {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

/* All Guides List */
.docs-all-guides {
    margin-bottom: 2.5rem;
}

.docs-all-guides h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
}

.docs-guide-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
}

.docs-guide-item {
    display: flex;
    flex-direction: column;
    padding: 1rem 1.25rem;
    text-decoration: none;
    border-bottom: 1px solid var(--color-border);
    transition: background 0.15s ease;
}

.docs-guide-item:last-child {
    border-bottom: none;
}

.docs-guide-item:hover {
    background: var(--color-bg-card);
}

.docs-guide-title {
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 0.25rem;
}

.docs-guide-desc {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

/* Help Section */
.docs-help {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
}

.docs-help h2 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.docs-help > p {
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
}

.docs-help a:not(.btn) {
    color: var(--color-primary);
}

.docs-help-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.docs-help-buttons .btn {
    min-width: 150px;
}

/* Article Body Content */
.docs-body {
    line-height: 1.7;
    font-size: 1rem;
}

.docs-body h2 {
    font-size: 1.6rem;
    font-weight: 600;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border);
}

.docs-body h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.docs-body h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.docs-body p {
    margin-bottom: 1rem;
}

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

.docs-body li {
    margin-bottom: 0.5rem;
}

/* Code Blocks */
.docs-body code {
    background: var(--color-bg-secondary);
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-size: 0.875em;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
}

.docs-body pre {
    background: #1a1a1a;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.25rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.docs-body pre code {
    background: none;
    padding: 0;
    font-size: 0.85rem;
    line-height: 1.6;
    color: #e6e6e6;
}

[data-theme="light"] .docs-body pre {
    background: #f6f8fa;
}

[data-theme="light"] .docs-body pre code {
    color: #24292e;
}

/* Tables */
.docs-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
}

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

.docs-body th {
    background: var(--color-bg-secondary);
    font-weight: 600;
}

.docs-body tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

[data-theme="light"] .docs-body tr:hover td {
    background: rgba(0, 0, 0, 0.02);
}

/* Blockquotes / Callouts */
.docs-body blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    border-left: 4px solid var(--color-primary);
    background: rgba(22, 163, 74, 0.08);
    border-radius: 0 8px 8px 0;
}

.docs-body blockquote p:last-child {
    margin-bottom: 0;
}

/* Links */
.docs-body a {
    color: var(--color-primary);
    text-decoration: none;
}

.docs-body a:hover {
    text-decoration: underline;
}

/* Images */
.docs-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
    border: 1px solid var(--color-border);
}

/* Article Footer */
.docs-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
}

/* Pagination */
.docs-pagination {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
}

.docs-pagination-link {
    display: flex;
    flex-direction: column;
    padding: 1rem 1.25rem;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
    min-width: 0;
    max-width: 45%;
}

.docs-pagination-link:hover {
    border-color: var(--color-primary);
    transform: translateY(-2px);
}

.docs-pagination-prev {
    align-items: flex-start;
}

.docs-pagination-next {
    align-items: flex-end;
    margin-left: auto;
}

.docs-pagination-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    margin-bottom: 0.25rem;
}

.docs-pagination-title {
    font-weight: 600;
    color: var(--color-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.docs-pagination-spacer {
    flex: 1;
}

/* Edit Link */
.docs-edit {
    text-align: center;
    font-size: 0.85rem;
}

.docs-edit a {
    color: var(--color-text-muted);
    text-decoration: none;
}

.docs-edit a:hover {
    color: var(--color-primary);
}

/* ===========================================
   Responsive Design
   =========================================== */

@media (max-width: 1024px) {
    .docs-main {
        padding: 2rem;
    }
}

@media (max-width: 900px) {
    .docs-layout {
        grid-template-columns: 1fr;
    }

    .docs-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: 280px;
        height: 100vh;
        z-index: 200;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: none;
    }

    .docs-sidebar.active {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
    }

    .docs-mobile-toggle {
        display: flex;
    }
}

@media (max-width: 600px) {
    .docs-main {
        padding: 1.5rem;
    }

    .docs-header h1 {
        font-size: 1.75rem;
    }

    .docs-lead {
        font-size: 1rem;
    }

    .docs-quick-grid {
        grid-template-columns: 1fr;
    }

    .docs-pagination {
        flex-direction: column;
    }

    .docs-pagination-link {
        max-width: 100%;
    }

    .docs-pagination-next {
        align-items: flex-start;
    }

    .docs-help {
        padding: 1.5rem;
    }

    .docs-help-buttons {
        flex-direction: column;
    }

    .docs-help-buttons .btn {
        width: 100%;
    }
}
