/* ==================== API Page Styles ==================== */

/* Header Nav */
.header-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 28px;
    margin-left: auto;
}
.header-nav a {
    color: rgba(255,255,255,0.85);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s;
    letter-spacing: 0.5px;
    position: relative;
}
.header-nav a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: #a78bfa;
    transition: width 0.3s;
}
.header-nav a:hover::after,
.header-nav a.active::after {
    width: 100%;
}
.header-nav a:hover,
.header-nav a.active {
    color: #fff;
}
/* Sticky state */
.is-sticky .header-nav a {
    color: #555;
}
.is-sticky .header-nav a:hover,
.is-sticky .header-nav a.active {
    color: #5d16d8;
}

/* API Banner */
#api-banner {
    position: relative;
    min-height: 400px;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #1a0533 0%, #2d1b69 50%, #1a0533 100%);
    overflow: hidden;
}
.api-banner-content {
    position: relative;
    z-index: 2;
    padding: 80px 0 60px;
}
#api-banner h1 {
    color: #fff;
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 15px;
}
.api-banner-desc {
    color: rgba(255,255,255,0.7);
    font-size: 18px;
    margin-bottom: 40px;
}
.api-quick-stats {
    display: flex;
    justify-content: center;
    gap: 60px;
}
.stat-item {
    text-align: center;
}
.stat-number {
    font-size: 36px;
    font-weight: 700;
    color: #a78bfa;
    line-height: 1;
    margin-bottom: 8px;
}
.stat-label {
    font-size: 14px;
    color: rgba(255,255,255,0.6);
}

/* API Nav Bar */
.api-nav-bar {
    background: #fff;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.api-nav-inner {
    display: flex;
    gap: 0;
    overflow-x: auto;
}
.api-nav-link {
    padding: 16px 28px;
    color: #555;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    white-space: nowrap;
}
.api-nav-link:hover,
.api-nav-link.active {
    color: #5d16d8;
    border-bottom-color: #5d16d8;
}

/* API Section */
.api-section {
    padding: 80px 0;
}
.api-section.alt-bg {
    background: #f8f9fc;
}
.api-section-header {
    text-align: center;
    margin-bottom: 60px;
}
.api-section-header h2 {
    font-size: 32px;
    font-weight: 700;
    color: #1a0533;
    margin-bottom: 15px;
}
.api-section-header p {
    color: #666;
    font-size: 16px;
    max-width: 600px;
    margin: 0 auto;
}

/* API Info Card */
.api-info-card {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    height: 100%;
    border: 1px solid #f0f0f0;
    transition: transform 0.3s, box-shadow 0.3s;
}
.api-info-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(93,22,216,0.1);
}
.api-info-card .card-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: linear-gradient(135deg, #5d16d8, #a78bfa);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}
.api-info-card .card-icon i {
    color: #fff;
    font-size: 22px;
}
.api-info-card h4 {
    font-size: 18px;
    font-weight: 700;
    color: #1a0533;
    margin-bottom: 15px;
}

/* Spec Table */
.api-spec-table {
    width: 100%;
}
.api-spec-table td {
    padding: 8px 0;
    font-size: 14px;
    border-bottom: 1px solid #f5f5f5;
}
.api-spec-table td:first-child {
    color: #888;
    font-weight: 600;
    width: 40%;
}
.api-spec-table td:last-child {
    color: #333;
    font-family: 'Consolas', 'Monaco', monospace;
}

/* Interface List */
.api-interface-list {
    list-style: none;
    padding: 0;
}
.api-interface-list li {
    padding: 8px 0;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* API Badge */
.api-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.api-badge.get {
    background: #e8f5e9;
    color: #2e7d32;
}
.api-badge.post {
    background: #e3f2fd;
    color: #1565c0;
}
.api-badge.lg {
    padding: 4px 12px;
    font-size: 13px;
}

/* Security List */
.api-security-list {
    list-style: none;
    padding: 0;
}
.api-security-list li {
    padding: 6px 0;
    font-size: 14px;
    color: #555;
}
.api-security-list li i {
    color: #5d16d8;
    margin-right: 8px;
}

/* Highlight Box */
.api-highlight-box {
    margin-top: 50px;
    background: #fff;
    border-radius: 12px;
    padding: 35px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    border: 1px solid #f0f0f0;
}
.highlight-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}
.highlight-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: #1a0533;
    font-family: 'Consolas', 'Monaco', monospace;
    margin: 0;
}
.highlight-tag {
    background: linear-gradient(135deg, #5d16d8, #a78bfa);
    color: #fff;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* Param Table */
.api-param-group {
    margin: 20px 0;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
}
.param-row {
    display: grid;
    grid-template-columns: 120px 80px 60px 1fr;
    padding: 10px 15px;
    font-size: 14px;
    border-bottom: 1px solid #f5f5f5;
}
.param-row.param-header {
    background: #f8f9fc;
    font-weight: 700;
    color: #555;
}
.param-name {
    font-family: 'Consolas', 'Monaco', monospace;
    color: #5d16d8;
    font-weight: 600;
}

/* Response Box */
.api-response-box {
    margin-top: 20px;
}
.response-label {
    font-size: 13px;
    font-weight: 700;
    color: #2e7d32;
    margin-bottom: 8px;
}

/* Code Box */
.api-code-box {
    background: #1e1e2e;
    border-radius: 10px;
    overflow: hidden;
}
.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: #2d2d3f;
}
.code-lang {
    font-size: 12px;
    color: #a78bfa;
    font-weight: 700;
}
.code-copy {
    background: none;
    border: 1px solid #555;
    color: #aaa;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
}
.code-copy:hover {
    border-color: #a78bfa;
    color: #a78bfa;
}
.api-code-box pre {
    margin: 0;
    padding: 20px;
    overflow-x: auto;
}
.api-code-box code {
    color: #cdd6f4;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre;
}

/* Flow Steps */
.api-flow-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 50px;
    flex-wrap: wrap;
}
.flow-step {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.06);
    flex: 1;
    min-width: 180px;
    max-width: 240px;
    border: 1px solid #f0f0f0;
    transition: transform 0.3s;
}
.flow-step:hover {
    transform: translateY(-3px);
}
.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5d16d8, #a78bfa);
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
}
.flow-step h4 {
    font-size: 15px;
    font-weight: 700;
    color: #1a0533;
    margin-bottom: 8px;
}
.flow-step p {
    font-size: 13px;
    color: #666;
    margin: 0;
}
.flow-connector {
    color: #5d16d8;
    font-size: 20px;
}

/* Flow Diagram */
.api-flow-diagram {
    background: #1e1e2e;
    border-radius: 12px;
    padding: 30px;
    overflow-x: auto;
}
.flow-ascii {
    color: #cdd6f4;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    line-height: 1.6;
    margin: 0;
    white-space: pre;
}

/* Encrypt Card */
.encrypt-card {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.06);
    border: 1px solid #f0f0f0;
    height: 100%;
}
.encrypt-card h4 {
    font-size: 18px;
    font-weight: 700;
    color: #1a0533;
    margin-bottom: 20px;
}
.encrypt-card h4 i {
    color: #5d16d8;
    margin-right: 10px;
}
.encrypt-steps {
    list-style: none;
    padding: 0;
}
.encrypt-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    font-size: 14px;
    color: #555;
    border-bottom: 1px solid #f5f5f5;
}
.encrypt-step:last-child {
    border-bottom: none;
}
.step-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #f0ebff;
    color: #5d16d8;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.encrypt-step code {
    background: #f5f3ff;
    color: #5d16d8;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 12px;
}

/* Note Box */
.api-note-box {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-top: 30px;
    padding: 20px;
    background: #f0ebff;
    border-radius: 8px;
    border-left: 4px solid #5d16d8;
}
.api-note-box i {
    color: #5d16d8;
    font-size: 20px;
    margin-top: 2px;
}
.api-note-box code {
    background: #e8e0ff;
    color: #4a10a8;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 13px;
}

/* Tab System */
.api-tabs {
    margin-top: 20px;
}
.api-tab-nav {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #eee;
    margin-bottom: 30px;
    overflow-x: auto;
}
.api-tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s;
    white-space: nowrap;
}
.api-tab-btn:hover {
    color: #5d16d8;
}
.api-tab-btn.active {
    color: #5d16d8;
    border-bottom-color: #5d16d8;
}
.api-tab-pane {
    display: none;
}
.api-tab-pane.active {
    display: block;
}

/* Field Table */
.api-field-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}
.api-field-table th,
.api-field-table td {
    padding: 8px 12px;
    font-size: 13px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}
.api-field-table th {
    background: #f8f9fc;
    font-weight: 700;
    color: #555;
}
.api-field-table td:first-child {
    font-family: 'Consolas', 'Monaco', monospace;
    color: #5d16d8;
    font-weight: 600;
}
.api-field-table .group-header {
    background: #f0ebff;
    color: #5d16d8;
    font-weight: 700;
    text-align: center;
}

/* SDK Card */
.sdk-card {
    background: #fff;
    border-radius: 12px;
    padding: 35px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    border: 1px solid #f0f0f0;
    transition: transform 0.3s, box-shadow 0.3s;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.sdk-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(93,22,216,0.12);
}
.sdk-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    background: linear-gradient(135deg, #5d16d8, #a78bfa);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}
.sdk-icon i {
    color: #fff;
    font-size: 26px;
}
.sdk-card h4 {
    font-size: 20px;
    font-weight: 700;
    color: #1a0533;
    margin-bottom: 10px;
}
.sdk-card p {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
    flex: 1;
}
.sdk-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: linear-gradient(135deg, #5d16d8, #7c3aed);
    color: #fff;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
}
.sdk-download-btn:hover {
    background: linear-gradient(135deg, #4a10a8, #6d28d9);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(93,22,216,0.3);
    color: #fff;
}
.sdk-card-doc {
    border: 2px dashed #5d16d8;
}

/* ==================== Responsive ==================== */
@media (max-width: 991px) {
    #api-banner h1 {
        font-size: 36px;
    }
    .api-quick-stats {
        gap: 30px;
    }
    .api-flow-steps {
        flex-direction: column;
    }
    .flow-connector {
        transform: rotate(90deg);
    }
    .flow-step {
        max-width: 100%;
    }
    .header-nav {
        gap: 15px;
    }
    .header-nav a {
        font-size: 12px;
    }
}

@media (max-width: 767px) {
    #api-banner h1 {
        font-size: 28px;
    }
    .api-banner-desc {
        font-size: 15px;
    }
    .stat-number {
        font-size: 28px;
    }
    .api-nav-inner {
        padding: 0 10px;
    }
    .api-nav-link {
        padding: 12px 16px;
        font-size: 13px;
    }
    .api-section {
        padding: 50px 0;
    }
    .param-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    .param-row span {
        display: block;
    }
    .header-nav {
        display: none;
    }
    .hb-meta {
        display: none;
    }
}
