/* ==========================================
   API Documentation Page Styles
   ========================================== */

.api-docs-page {
    background: var(--color-gray-50);
}

.docs-main {
    padding: 3rem 0 6rem 0;
    min-height: calc(100vh - 200px);
}

.container-wide {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ==========================================
   Layout
   ========================================== */
.docs-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 3rem;
    align-items: start;
}

/* ==========================================
   Sidebar Navigation
   ========================================== */
.docs-sidebar {
    position: sticky;
    top: calc(72px + 2rem);
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    max-height: calc(100vh - 72px - 4rem);
    overflow-y: auto;
}

/* Custom scrollbar for sidebar */
.docs-sidebar::-webkit-scrollbar {
    width: 6px;
}

.docs-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.docs-sidebar::-webkit-scrollbar-thumb {
    background: var(--color-gray-300);
    border-radius: 3px;
}

.docs-sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--color-gray-400);
}

.docs-nav-section {
    margin-bottom: 2rem;
}

.docs-nav-section:last-child {
    margin-bottom: 0;
}

.docs-nav-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-gray-500);
    margin-bottom: 0.75rem;
}

.docs-nav-link {
    display: block;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--color-gray-700);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.docs-nav-link:hover {
    background: var(--color-gray-100);
    color: var(--color-gray-900);
}

.docs-nav-link.active {
    background: var(--color-primary-light);
    color: var(--color-primary);
    font-weight: 500;
}

/* ==========================================
   Content Area
   ========================================== */
.docs-content {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: 3rem;
    box-shadow: var(--shadow-sm);
}

.docs-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-gray-900);
    margin-bottom: 1rem;
}

.docs-lead {
    font-size: 1.25rem;
    line-height: 1.6;
    color: var(--color-gray-600);
    margin-bottom: 2rem;
}

.docs-section {
    margin-bottom: 4rem;
    padding-bottom: 4rem;
    border-bottom: 1px solid var(--color-gray-200);
}

.docs-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.docs-section h2 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--color-gray-900);
    margin-bottom: 1rem;
    margin-top: 0;
}

.docs-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-gray-900);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.docs-section h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-gray-900);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.docs-section p {
    line-height: 1.7;
    color: var(--color-gray-700);
    margin-bottom: 1rem;
}

.docs-section code {
    background: var(--color-gray-100);
    padding: 0.2em 0.4em;
    border-radius: var(--radius-sm);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    font-size: 0.875em;
    color: var(--color-primary);
}

.docs-section a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
}

.docs-section a:hover {
    text-decoration: underline;
}

/* ==========================================
   Info Boxes
   ========================================== */
.docs-info-box {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--color-blue-50);
    border: 1px solid var(--color-blue-200);
    border-radius: var(--radius-lg);
    margin: 1.5rem 0;
}

.info-box-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    color: var(--color-blue-600);
}

.info-box-content {
    flex: 1;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--color-blue-900);
}

.info-box-content code {
    background: var(--color-blue-100);
    color: var(--color-blue-800);
}

.docs-warning-box {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1.25rem;
    background: var(--color-yellow-50);
    border: 1px solid var(--color-yellow-200);
    border-radius: var(--radius-lg);
    margin: 1.5rem 0;
    color: var(--color-yellow-900);
}

.docs-warning-box svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: var(--color-yellow-600);
    margin-top: 2px;
}

/* ==========================================
   Format Badges
   ========================================== */
.format-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 1.5rem 0;
}

.format-badge {
    padding: 0.5rem 1rem;
    background: var(--color-gray-100);
    color: var(--color-gray-700);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
}

/* ==========================================
   Conversion Flow Steps
   ========================================== */
.flow-steps {
    margin: 2rem 0;
}

.flow-step {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--color-gray-200);
}

.flow-step:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.step-number {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary);
    color: white;
    border-radius: 50%;
    font-size: 1.25rem;
    font-weight: 700;
}

.step-content h4 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.125rem;
}

.step-content p {
    margin: 0;
    color: var(--color-gray-600);
}

/* ==========================================
   Code Blocks (Always Dark Theme)
   ========================================== */
.code-block {
    margin: 1.5rem 0;
    border: 1px solid #374151;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #1f2937;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.25rem;
    background: #111827;
    border-bottom: 1px solid #374151;
}

.code-lang {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #9ca3af;
    letter-spacing: 0.05em;
}

.copy-btn {
    padding: 0.375rem 0.75rem;
    background: #374151;
    border: none;
    border-radius: var(--radius-sm);
    color: #d1d5db;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
}

.copy-btn:hover {
    background: #4b5563;
    color: white;
}

.copy-btn svg {
    width: 16px;
    height: 16px;
}

.code-block pre {
    margin: 0;
    padding: 1.5rem 1.25rem;
    overflow-x: auto;
    background: #1f2937;
}

.code-block code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    color: #e5e7eb;
    background: transparent;
    padding: 0;
    border-radius: 0;
}

/* ==========================================
   Endpoint Badge
   ========================================== */
.endpoint-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--color-gray-100);
    border-radius: var(--radius-lg);
}

.method {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.method.get {
    background: #10b981;
    color: white;
}

.method.post {
    background: #3b82f6;
    color: white;
}

.method.put {
    background: #f59e0b;
    color: white;
}

.method.delete {
    background: #ef4444;
    color: white;
}

.path {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    font-size: 0.9375rem;
    color: var(--color-gray-900);
    font-weight: 600;
}

/* ==========================================
   Parameters Table
   ========================================== */
.params-table {
    width: 100%;
    margin: 1.5rem 0;
    border-collapse: collapse;
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.params-table thead {
    background: var(--color-gray-100);
}

.params-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-gray-700);
    border-bottom: 1px solid var(--color-gray-200);
}

.params-table td {
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
    color: var(--color-gray-700);
    border-bottom: 1px solid var(--color-gray-200);
}

.params-table tbody tr:last-child td {
    border-bottom: none;
}

.params-table tbody tr:hover {
    background: var(--color-gray-50);
}

.params-table code {
    background: var(--color-gray-100);
    padding: 0.2em 0.4em;
    border-radius: var(--radius-sm);
    font-size: 0.875em;
    color: var(--color-primary);
}

/* ==========================================
   Limit Cards
   ========================================== */
.limit-card {
    padding: 1.5rem;
    background: var(--color-gray-50);
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
}

.limit-card h4 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    color: var(--color-gray-900);
}

.limit-card ul {
    margin: 0;
    padding-left: 1.5rem;
}

.limit-card li {
    margin-bottom: 0.5rem;
    color: var(--color-gray-700);
    line-height: 1.6;
}

.limit-card li:last-child {
    margin-bottom: 0;
}

/* ==========================================
   Responsive Design
   ========================================== */
@media (max-width: 1024px) {
    .docs-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .docs-sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .docs-content {
        padding: 2rem 1.5rem;
    }

    .docs-title {
        font-size: 2rem;
    }

    .docs-section h2 {
        font-size: 1.5rem;
    }

    .code-block pre {
        padding: 1rem;
    }

    .endpoint-badge {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}
