:root {
    --primary: #0d6efd;
    --dark: #1e293b;
    --muted: #64748b;
    --light-bg: #f6f8fb;
    --border: #e8edf4;
}

.api-details-page {
    background: var(--light-bg);
}

.btn-back-apis {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--dark);
    font-weight: 500;
    font-size: 0.9rem;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn-back-apis:hover {
    background: var(--light-bg);
    border-color: var(--primary);
    color: var(--primary);
    text-decoration: none;
}

.btn-back-apis i {
    font-size: 0.85rem;
}

.api-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 60%, #0d6efd 130%);
    border-radius: 18px;
    color: #fff;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.api-hero::before,
.api-hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
}

.api-hero::before {
    width: 300px;
    height: 300px;
    top: -120px;
    right: -80px;
}

.api-hero::after {
    width: 180px;
    height: 180px;
    bottom: -90px;
    left: 35%;
}

.hero-content {
    z-index: 1;
    align-items: center;
    gap: 1rem;
}

.thumb-box {
    width: 104px;
    height: 104px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.12);
    border: 2px solid rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    color: #fff;
    overflow: hidden;
    flex-shrink: 0;
}

.thumb-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.4rem;
}

.hero-desc {
    color: rgba(255, 255, 255, 0.85);
    max-width: 680px;
}

.btn-hero-white {
    background: #fff;
    color: #0a58ca;
    border: none;
}

.btn-hero-white:hover {
    background: #e8f0fe;
    color: #0a58ca;
}

.btn-hero-light {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-hero-light:hover {
    background: rgba(255, 255, 255, 0.28);
    color: #fff;
}

.ts-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.05);
}

.card-head {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-head i {
    color: var(--primary);
}

.card-body-ts {
    padding: 1.25rem;
}

.kv-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin-bottom: 0.25rem;
}

.kv-value {
    font-size: 0.94rem;
    font-weight: 600;
    color: var(--dark);
    word-break: break-word;
}

.url-box {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.65rem 0.9rem;
    font-size: 0.82rem;
    color: #0f172a;
    word-break: break-all;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.btn-copy,
.btn-copy-link {
    border: none;
    background: transparent;
    color: var(--muted);
    font-size: 0.95rem;
    padding: 0.15rem 0.4rem;
    border-radius: 6px;
    text-decoration: none;
}

.btn-copy:hover,
.btn-copy-link:hover {
    background: #e2e8f0;
    color: var(--primary);
}

.desc-text {
    color: #475569;
    line-height: 1.8;
    white-space: pre-line;
}

.swagger-strip {
    background: linear-gradient(135deg, #f0f9ff, #eff6ff);
    border: 1px solid #bae6fd;
    border-radius: 14px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.icon-big {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: #0d6efd;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.steps-list {
    margin: 0;
    padding-left: 1.1rem;
    color: #475569;
    font-size: 0.9rem;
}

.steps-list li {
    margin-bottom: 0.55rem;
}

.step-item {
    display: flex;
    gap: .9rem;
    padding: .65rem 0;
}

.step-num {
    width: 28px !important;
    height: 28px !important;
    font-size: 0.82rem !important;
    border-radius: 50%;
    flex-shrink: 0;
    background: #eff6ff;
    color: var(--primary);
    font-weight: 700;
}

.step-item h6 {
    font-size: 1.05rem !important;
    line-height: 1.35 !important;
    margin-bottom: 0.1rem;
}

.step-item p {
    font-size: 0.92rem !important;
    line-height: 1.45 !important;
    margin: 0;
}

.code-content pre,
.code-shell pre,
.quickstart-pre,
#quickStartCode {
    font-size: 0.9rem !important;
    line-height: 1.55 !important;
}

.how-works-btn {
    font-size: 1rem !important;
    font-weight: 600 !important;
}

.code-shell {
    background: #0b132b;
    border: 1px solid #1b2947;
    border-radius: 16px;
    overflow: hidden;
}

.code-shell-head {
    background: #0f172a;
    border-bottom: 1px solid #1b2947;
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.shell-dots {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.dot-red { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-green { background: #22c55e; }

.shell-title {
    margin-left: 0.15rem;
    color: #94a3b8;
    font-size: 0.82rem;
    font-family: "JetBrains Mono", monospace;
}

.code-tabs {
    background: #0f172a;
    border-bottom: 1px solid #1b2947;
}

.code-tabs .nav-link {
    -webkit-appearance: none;
    appearance: none;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    color: #9fb3cf !important;
    cursor: pointer !important;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 10px;
    padding: 0.35rem 0.8rem;
}

.code-tabs .nav-link:hover,
.code-tabs .nav-link:focus {
    background: #16233c !important;
    color: #dbeafe !important;
    outline: none;
}

.code-tabs .nav-link.active,
.code-tabs .show > .nav-link {
    background: #1e2c49 !important;
    color: #ffffff !important;
}

.code-content {
    background: #0b132b;
}

.code-content pre {
    margin: 0;
    padding: 1rem;
    color: #ffffff;
    font-size: 0.95rem;
    line-height: 1.6;
    white-space: pre;
    overflow: auto;
    font-family: "JetBrains Mono", monospace;
    background: #0b132b;
}

@media (max-width: 767.98px) {
    .api-hero {
        padding: 1.4rem;
    }

    .hero-title {
        font-size: 1.45rem;
    }

    .thumb-box {
        width: 86px;
        height: 86px;
        font-size: 1.8rem;
    }
}

/* Keep compact on mobile */
@media (max-width: 768px) {
    .step-item h6 {
        font-size: 0.98rem !important;
    }

    .step-item p {
        font-size: 0.88rem !important;
    }

    .code-content pre,
    .code-shell pre,
    .quickstart-pre,
    #quickStartCode {
        font-size: 0.82rem !important;
    }
}

.copy-toast {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1080;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.95rem;
    border-radius: 12px;
    background: #0f172a;
    color: #ffffff;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.1;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.28);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
}

.copy-toast i {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #22c55e;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.62rem;
    flex-shrink: 0;
}

.copy-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

@media (max-width: 576px) {
    .copy-toast {
        right: 1rem;
        left: 1rem;
        bottom: 1rem;
        justify-content: center;
    }
}

/* ===== Logged-in layout compatibility fixes (keep same as public view) ===== */

/* Breadcrumb readability + same public look */
.api-details-page .breadcrumb {
    margin-bottom: 0;
    padding: 0;
    background: transparent !important;
}

.api-details-page .breadcrumb-item,
.api-details-page .breadcrumb-item a,
.api-details-page .breadcrumb-item span {
    color: #64748b !important;
    font-weight: 500;
}

.api-details-page .breadcrumb-item.active {
    color: #334155 !important;
    font-weight: 500;
}

.api-details-page .breadcrumb-item + .breadcrumb-item::before {
    color: #94a3b8 !important;
}

/* Hero title/description should stay white on blue banner */
.api-details-page .api-hero .hero-title {
    color: #ffffff !important;
    line-height: 1.2;
}

.api-details-page .api-hero .hero-desc {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* "How It Works" number circle: perfect center align */
.api-details-page .step-num {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    line-height: 1 !important;
    padding: 0 !important;
}

.api-details-page .hero-content {
    align-items: center;
    gap: 1rem;
}

@media (min-width: 768px) {
    .api-details-page .hero-content {
        gap: 1.5rem;
    }
}

.api-details-page .code-tabs .nav-link {
    -webkit-appearance: none;
    appearance: none;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    color: #9fb3cf !important;
    cursor: pointer !important;
}

.api-details-page .code-tabs .nav-link:hover,
.api-details-page .code-tabs .nav-link:focus {
    background: #16233c !important;
    color: #dbeafe !important;
}

.api-details-page .code-tabs .nav-link.active,
.api-details-page .code-tabs .show > .nav-link {
    background: #1e2c49 !important;
    color: #ffffff !important;
}