/* API Docs / Apifox-Style Interactive Documentation Stylesheet */

.apidocs-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 1.5rem 4rem;
}

.apidocs-header {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.apidocs-title-group h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.apidocs-title-group p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.apidocs-baseurl-box {
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    color: var(--primary);
}

.apidocs-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 2rem;
    align-items: start;
    max-width: 100%;
}

.apidocs-content {
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
}

/* Sidebar Tree */
.apidocs-sidebar {
    position: sticky;
    top: 90px;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 0.75rem;
    box-shadow: var(--shadow-sm);
    min-width: 0;
}

.apidocs-sidebar::-webkit-scrollbar {
    width: 4px;
}

.apidocs-sidebar::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: var(--radius-full);
}

.nav-group-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 0.75rem 0.75rem 0.35rem;
    margin-top: 0.5rem;
}

.nav-group-title:first-child {
    margin-top: 0;
}

.apidocs-nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.55rem 0.75rem;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.875rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s var(--ease-out);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.apidocs-nav-item:hover,
.apidocs-nav-item.active {
    background: var(--primary-subtle);
    color: var(--primary);
}

.nav-method {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.nav-method.post {
    background: rgba(37, 99, 235, 0.12);
    color: var(--primary);
}

.nav-method.get {
    background: rgba(16, 185, 129, 0.12);
    color: var(--success);
}

/* API Section Cards */
.api-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    scroll-margin-top: 100px;
    min-width: 0;
    max-width: 100%;
}

.api-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.api-title-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    max-width: 100%;
}

.method-tag {
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.method-tag.post {
    background: var(--primary);
    color: white;
}

.method-tag.get {
    background: var(--success);
    color: white;
}

.api-path {
    font-family: 'Fira Code', monospace;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    word-break: break-all;
}

.api-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.api-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    word-break: break-word;
}

/* Parameter Tables */
.params-table-container {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin-bottom: 1.5rem;
    max-width: 100%;
}

.params-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    min-width: 500px;
}

.params-table th {
    background: var(--bg-main);
    color: var(--text-muted);
    font-weight: 600;
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.params-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
}

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

.param-name {
    font-family: 'Fira Code', monospace;
    font-weight: 600;
    color: var(--primary);
}

.param-type {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: monospace;
}

.badge-req {
    background: var(--error-bg);
    color: var(--error);
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.badge-opt {
    background: var(--bg-light);
    color: var(--text-muted);
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Code Snippet Tabs */
.code-snippets-container {
    background: #0f172a;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 1.5rem;
    border: 1px solid #1e293b;
    max-width: 100%;
}

.snippet-header {
    background: #1e293b;
    padding: 0.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #334155;
    flex-wrap: wrap;
    gap: 8px;
}

.snippet-tabs {
    display: flex;
    gap: 4px;
    overflow-x: auto;
}

.snippet-tab {
    padding: 0.4rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #94a3b8;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.snippet-tab:hover,
.snippet-tab.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.snippet-body {
    padding: 1.25rem;
    color: #e2e8f0;
    font-family: 'Fira Code', monospace;
    font-size: 0.875rem;
    overflow-x: auto;
    margin: 0;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
    max-width: 100%;
}

.copy-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #cbd5e1;
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Try It Out Interactive Tester */
.try-out-card {
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-top: 1.5rem;
}

.try-out-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.try-out-header h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.try-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.try-response-box {
    background: #0f172a;
    border-radius: var(--radius-sm);
    padding: 1rem;
    color: #38bdf8;
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    max-height: 250px;
    overflow-y: auto;
    display: none;
    margin-top: 1rem;
}

/* Responsive */
@media (max-width: 992px) {
    .apidocs-layout {
        grid-template-columns: 1fr;
    }

    .apidocs-sidebar {
        position: relative;
        top: 0;
        max-height: none;
    }
}