/* Documentation Styles */

.docs-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 0;
    min-height: calc(100vh - var(--header-height, 60px) - 100px);
    margin: 0 auto;
}

/* Sidebar */
.docs-sidebar {
    background: var(--color-gray-50);
    border-right: 1px solid var(--color-border);
    padding: var(--space-6) 0;
    position: sticky;
    top: var(--header-height, 60px);
    height: calc(100vh - var(--header-height, 60px));
    overflow-y: auto;
}

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

.docs-sidebar-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.docs-sidebar-title svg {
    opacity: 0.7;
}

.docs-nav-section {
    margin-bottom: var(--space-5);
}

.docs-nav-section-title {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0 var(--space-5);
    margin-bottom: var(--space-2);
}

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

.docs-nav-item {
    margin: 0;
}

.docs-nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-5);
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: var(--font-size-sm);
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
}

.docs-nav-link:hover {
    color: var(--color-text);
    background: var(--color-gray-100);
}

.docs-nav-link.active {
    color: var(--color-text);
    background: white;
    border-left-color: var(--color-black);
    font-weight: var(--font-weight-medium);
}

.docs-nav-link svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.6;
}

.docs-nav-link.active svg {
    opacity: 1;
}

/* Main Content */
.docs-content {
    padding: var(--space-8) var(--space-10);
    max-width: 900px;
}

.docs-header {
    margin-bottom: var(--space-8);
    padding-bottom: var(--space-6);
    border-bottom: 1px solid var(--color-border);
}

.docs-title {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-text);
    margin: 0 0 var(--space-3) 0;
}

.docs-description {
    font-size: var(--font-size-lg);
    color: var(--color-text-muted);
    margin: 0;
    line-height: 1.6;
}

/* Content Sections */
.docs-section {
    margin-bottom: var(--space-10);
}

.docs-section-title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
    margin: 0 0 var(--space-4) 0;
    padding-bottom: var(--space-2);
    border-bottom: 2px solid var(--color-gray-200);
}

.docs-section-content {
    color: var(--color-text);
    line-height: 1.7;
}

.docs-section-content p {
    margin: 0 0 var(--space-4) 0;
}

.docs-section-content ul,
.docs-section-content ol {
    margin: 0 0 var(--space-4) 0;
    padding-left: var(--space-6);
}

.docs-section-content li {
    margin-bottom: var(--space-2);
}

/* Code Blocks */
.docs-code-block {
    background: var(--color-gray-900);
    border-radius: var(--radius-lg);
    margin: var(--space-4) 0;
    overflow: hidden;
}

.docs-code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-4);
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.docs-code-lang {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    color: var(--color-gray-400);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.docs-code-copy {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--color-gray-400);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.docs-code-copy:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.docs-code-content {
    padding: var(--space-4);
    overflow-x: auto;
}

.docs-code-content pre {
    margin: 0;
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
    line-height: 1.6;
    color: var(--color-gray-300);
    white-space: pre-wrap;
    word-break: break-word;
}

/* Inline Code */
.docs-section-content code {
    background: var(--color-gray-100);
    padding: 0.125em 0.375em;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.9em;
    color: var(--color-text);
}

/* Info/Warning/Tip Boxes */
.docs-callout {
    padding: var(--space-4);
    border-radius: var(--radius-md);
    margin: var(--space-4) 0;
    display: flex;
    gap: var(--space-3);
}

.docs-callout-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.docs-callout-content {
    flex: 1;
}

.docs-callout-title {
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--space-1);
}

.docs-callout-text {
    font-size: var(--font-size-sm);
    line-height: 1.5;
    margin: 0;
}

.docs-callout-info {
    background: var(--color-gray-50);
    border: 1px solid var(--color-gray-200);
}

.docs-callout-info .docs-callout-icon {
    color: var(--color-gray-600);
}

.docs-callout-tip {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.docs-callout-tip .docs-callout-icon {
    color: #22c55e;
}

.docs-callout-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
}

.docs-callout-warning .docs-callout-icon {
    color: #f59e0b;
}

.docs-callout-pro {
    background: var(--color-gray-900);
    border: 1px solid var(--color-gray-700);
    color: white;
}

.docs-callout-pro .docs-callout-icon {
    color: white;
}

.docs-callout-pro .docs-callout-text {
    color: var(--color-gray-300);
}

/* Steps */
.docs-steps {
    counter-reset: step;
    margin: var(--space-6) 0;
}

.docs-step {
    position: relative;
    padding-left: var(--space-10);
    padding-bottom: var(--space-6);
    border-left: 2px solid var(--color-gray-200);
    margin-left: var(--space-3);
}

.docs-step:last-child {
    border-left-color: transparent;
    padding-bottom: 0;
}

.docs-step::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: -14px;
    top: 0;
    width: 28px;
    height: 28px;
    background: var(--color-black);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
}

.docs-step-title {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
    margin: 0 0 var(--space-2) 0;
}

.docs-step-content {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    line-height: 1.6;
}

/* Feature Grid */
.docs-feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-4);
    margin: var(--space-6) 0;
}

.docs-feature-card {
    background: var(--color-gray-50);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
}

.docs-feature-icon {
    width: 40px;
    height: 40px;
    background: var(--color-black);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-3);
}

.docs-feature-icon svg {
    width: 20px;
    height: 20px;
    color: white;
}

.docs-feature-title {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
    margin: 0 0 var(--space-2) 0;
}

.docs-feature-description {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    line-height: 1.5;
    margin: 0;
}

/* Table of Contents */
.docs-toc {
    position: fixed;
    right: var(--space-8);
    top: calc(var(--header-height, 60px) + var(--space-8));
    width: 200px;
    max-height: calc(100vh - var(--header-height, 60px) - var(--space-16));
    overflow-y: auto;
}

.docs-toc-title {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-3);
}

.docs-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    border-left: 1px solid var(--color-border);
}

.docs-toc-item {
    padding-left: var(--space-3);
}

.docs-toc-link {
    display: block;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    text-decoration: none;
    padding: var(--space-1) 0;
    transition: color 0.15s ease;
}

.docs-toc-link:hover {
    color: var(--color-text);
}

/* Pagination */
.docs-pagination {
    display: flex;
    justify-content: space-between;
    margin-top: var(--space-10);
    padding-top: var(--space-6);
    border-top: 1px solid var(--color-border);
}

.docs-pagination-link {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    padding: var(--space-4);
    background: var(--color-gray-50);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: all 0.15s ease;
    min-width: 200px;
}

.docs-pagination-link:hover {
    background: white;
    border-color: var(--color-black);
}

.docs-pagination-link.next {
    text-align: right;
    margin-left: auto;
}

.docs-pagination-direction {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.docs-pagination-title {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

/* Badge */
.docs-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
}

.docs-badge-pro {
    background: var(--color-black);
    color: white;
}

.docs-badge-free {
    background: var(--color-gray-200);
    color: var(--color-text);
}

/* Mobile Menu Toggle */
.docs-mobile-toggle {
    display: none;
    width: 100%;
    padding: var(--space-3) var(--space-4);
    background: var(--color-gray-50);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    align-items: center;
    justify-content: space-between;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
    margin-bottom: var(--space-3);
}

.docs-mobile-toggle svg {
    transition: transform 0.2s ease;
}

.docs-mobile-toggle.active svg {
    transform: rotate(180deg);
}

.docs-mobile-toggle-label {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

/* Responsive */
@media (max-width: 1200px) {
    .docs-toc {
        display: none;
    }
}

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

    .docs-sidebar {
        position: static;
        height: auto;
        padding: var(--space-4);
        border-right: none;
        border-bottom: 1px solid var(--color-border);
        background: white;
    }

    .docs-sidebar-header {
        display: none;
    }

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

    .docs-sidebar nav {
        display: none;
        background: white;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-md);
        padding: var(--space-3) 0;
        max-height: 60vh;
        overflow-y: auto;
    }

    .docs-sidebar nav.active {
        display: block;
    }

    .docs-nav-section {
        margin-bottom: var(--space-3);
    }

    .docs-nav-section-title {
        padding: var(--space-2) var(--space-4);
    }

    .docs-nav-link {
        padding: var(--space-2) var(--space-4);
        border-left: none;
    }

    .docs-nav-link.active {
        background: var(--color-gray-100);
        border-left: none;
        border-radius: 0;
    }

    .docs-content {
        padding: var(--space-6) var(--space-4);
    }

    .docs-title {
        font-size: var(--font-size-2xl);
    }

    .docs-pagination {
        flex-direction: column;
        gap: var(--space-3);
    }

    .docs-pagination-link {
        min-width: auto;
    }

    .docs-pagination-link.next {
        margin-left: 0;
    }
}
