/* Docs Layout */
.docs-layout {
    display: flex;
    max-width: 1400px;
    margin: 80px auto 0;
    padding: 0 24px;
    min-height: calc(100vh - 80px);
    position: relative;
}

/* Sidebar */
.docs-sidebar {
    width: 260px;
    flex-shrink: 0;
    position: sticky;
    top: 80px;
    height: calc(100vh - 80px);
    overflow-y: auto;
    padding: 32px 24px 32px 0;
    border-right: 1px solid var(--border);
}

.sidebar-section {
    margin-bottom: 32px;
}

.sidebar-section h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.sidebar-link {
    display: block;
    padding: 8px 12px;
    color: var(--text-light);
    font-size: 0.95rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    margin-bottom: 4px;
    border-left: 2px solid transparent;
}

.sidebar-link:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.03);
}

.sidebar-link.active {
    color: var(--primary);
    background: rgba(139, 92, 246, 0.1);
    border-left-color: var(--primary);
    font-weight: 500;
}

/* Main Content */
.docs-content {
    flex: 1;
    min-width: 0;
    padding: 32px 0 64px 48px;
}

.docs-section {
    margin-bottom: 64px;
}

.docs-section h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text);
}

.docs-section h2 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.docs-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 32px 0 16px;
    color: var(--text);
}

.docs-section h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 24px 0 12px;
}

.docs-section p {
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 16px;
}

.docs-intro {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 32px;
    line-height: 1.6;
}

code {
    font-family: "JetBrains Mono", monospace;
    background: var(--surface-light);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--primary-light);
    border: 1px solid var(--border);
}

pre {
    margin: 0;
}

pre code {
    background: transparent;
    padding: 0;
    border: none;
    color: inherit;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Code Blocks */
.docs-code {
    background: #0f111a;
    border-radius: 8px;
    border: 1px solid var(--border);
    margin: 24px 0;
    overflow: hidden;
}

.docs-code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text-light);
}

.copy-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-light);
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    background: var(--surface-light);
    color: var(--text);
}

.docs-code pre {
    padding: 20px;
    overflow-x: auto;
}

/* Callouts */
.docs-callout {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: rgba(139, 92, 246, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 8px;
    margin: 24px 0;
}

.docs-callout.callout-warning {
    background: rgba(245, 158, 11, 0.05);
    border-color: rgba(245, 158, 11, 0.2);
}

.callout-icon {
    font-size: 1.5rem;
}

.docs-callout p {
    margin: 0;
    color: var(--text);
    font-size: 0.95rem;
}

.docs-callout code {
    background: rgba(0, 0, 0, 0.2);
}

/* Lists */
.docs-list {
    margin: 0 0 24px;
    padding-left: 24px;
    color: var(--text-light);
    line-height: 1.7;
}

.docs-list li {
    margin-bottom: 8px;
}

.docs-list li strong {
    color: var(--text);
}

/* Steps */
.docs-steps {
    display: flex;
    flex-direction: column;
    gap: 32px;
    margin: 32px 0;
}

.docs-step {
    display: flex;
    gap: 24px;
}

.docs-step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

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

.docs-step-content h3 {
    margin-top: 0;
}

/* Tables */
.docs-table-wrapper {
    overflow-x: auto;
    margin: 24px 0;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.docs-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.docs-table th {
    background: var(--surface);
    padding: 16px;
    font-weight: 600;
    color: var(--text);
    border-bottom: 1px solid var(--border);
}

.docs-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-light);
    vertical-align: middle;
}

.docs-table tr:last-child td {
    border-bottom: none;
}

/* Badges */
.docs-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.badge-green {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-purple {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.badge-blue {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Methods */
.docs-method {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
}

.docs-method.get {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

.docs-method.post {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

/* Tools Grid */
.docs-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.docs-tool-item {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 16px;
    border-radius: 8px;
    text-align: center;
    color: var(--text);
    font-weight: 500;
    transition: all 0.2s ease;
}

.docs-tool-item:hover {
    border-color: var(--primary);
    background: rgba(139, 92, 246, 0.05);
}

/* Error Blocks */
.docs-error-block {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid #ef4444;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 24px;
}

.docs-error-block h4 {
    margin-top: 0;
    color: var(--text);
}

.docs-error-block .docs-code {
    margin-bottom: 0;
}

/* FAQ */
.docs-faq-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.docs-faq-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.docs-faq-question {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 20px;
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.docs-faq-icon {
    font-size: 1.5rem;
    color: var(--primary);
    transition: transform 0.3s ease;
}

.docs-faq-answer {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    opacity: 0;
}

.docs-faq-item.active .docs-faq-answer {
    padding: 0 20px 20px;
    max-height: 500px;
    opacity: 1;
}

.docs-faq-item.active .docs-faq-icon {
    transform: rotate(45deg);
}

/* Mobile Sidebar Toggle */
.docs-sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 24px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
    z-index: 99;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 1024px) {
    .docs-sidebar {
        width: 220px;
    }
    .docs-content {
        padding-left: 32px;
    }
}

@media (max-width: 768px) {
    .docs-layout {
        display: block;
        padding: 0 16px;
    }

    .docs-sidebar-toggle {
        display: block;
    }

    .docs-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        background: var(--bg);
        z-index: 100;
        padding: 80px 24px 32px;
        transition: left 0.3s ease;
        border-right: 1px solid var(--border);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
    }

    .docs-sidebar.active {
        left: 0;
    }

    .docs-content {
        padding: 32px 0 64px 0;
    }

    .docs-section h1 {
        font-size: 2rem;
    }

    .docs-step {
        flex-direction: column;
        gap: 16px;
    }

    .docs-table-wrapper {
        margin: 24px -16px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
}