/* =========================================================
   SOAP API documentation guide
   ========================================================= */

.soap-docs {
    --soap-ink: #1a1a1a;
    --soap-muted: #5f6b7a;
    --soap-border: #e8ecf1;
    --soap-surface: #ffffff;
    --soap-canvas: #f6f8fb;
    --soap-pink: #EC2E5E;
    --soap-deep: #8B1538;
    --soap-amber: #f59e0b;
    --soap-code: #161b22;
    --soap-radius: 16px;
    --soap-shadow: 0 10px 30px rgba(16, 24, 40, 0.07);
    background: var(--soap-canvas);
}

/* ----- Docs hero ----- */
.soap-docs-hero {
    position: relative;
    overflow: hidden;
    margin-top: 72px;
    padding: clamp(2.5rem, 5vw, 3.75rem) 0 clamp(1.75rem, 3vw, 2.5rem);
    background:
        radial-gradient(ellipse 70% 90% at 10% 20%, rgba(236, 46, 94, 0.28), transparent 55%),
        radial-gradient(ellipse 50% 70% at 90% 80%, rgba(245, 158, 11, 0.18), transparent 55%),
        linear-gradient(125deg, #120d12 0%, #1f1218 45%, #2a1620 100%);
    color: #fff;
}

.soap-docs-hero .container {
    max-width: min(1200px, 100%);
    padding: 0 var(--page-gutter, clamp(16px, 3vw, 28px));
    position: relative;
    z-index: 1;
}

.soap-docs-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    font-size: 0.75rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.soap-docs-hero h1 {
    margin: 0 0 0.75rem;
    font-size: clamp(1.9rem, 4vw, 2.75rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: #fff;
}

.soap-docs-hero .lead {
    margin: 0 0 1.35rem;
    max-width: 48rem;
    font-size: clamp(1rem, 2vw, 1.15rem);
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.86);
}

.soap-docs-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-bottom: 1.35rem;
}

.soap-docs-hero-actions .btn {
    min-height: 46px;
    padding: 0.75rem 1.25rem;
    border-radius: 999px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    text-decoration: none;
}

.soap-docs-hero-actions .btn-primary {
    background: #EC2E5E;
    color: #fff;
    border: 2px solid #EC2E5E;
}

.soap-docs-hero-actions .btn-secondary {
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.75);
}

.soap-docs-hero-actions .btn-secondary:hover {
    background: #fff;
    color: #EC2E5E;
}

.soap-docs-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.soap-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
}

.soap-chip i {
    color: #fda4af;
}

/* ----- Layout shell ----- */
.soap-docs-shell {
    max-width: min(1280px, 100%);
    margin: 0 auto;
    padding: 1.5rem var(--page-gutter, clamp(16px, 3vw, 28px)) 3.5rem;
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
}

/* ----- Sidebar ----- */
.soap-docs-sidebar {
    position: sticky;
    top: 92px;
    background: var(--soap-surface);
    border: 1px solid var(--soap-border);
    border-radius: var(--soap-radius);
    padding: 1.15rem 1rem 1.25rem;
    box-shadow: var(--soap-shadow);
}

.soap-docs-sidebar-title {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0 0 0.85rem;
    padding: 0 0.35rem 0.85rem;
    border-bottom: 2px solid rgba(236, 46, 94, 0.2);
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--soap-ink);
}

.soap-docs-sidebar-title i {
    color: var(--soap-pink);
}

.soap-docs-sidebar nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.soap-docs-sidebar nav a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.7rem;
    margin-bottom: 0.2rem;
    border-radius: 10px;
    color: #374151;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    border-left: 3px solid transparent;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.soap-docs-sidebar nav a:hover {
    background: #fff5f7;
    color: var(--soap-pink);
}

.soap-docs-sidebar nav a.active {
    background: #fff5f7;
    color: var(--soap-deep);
    border-left-color: var(--soap-pink);
}

.soap-docs-sidebar-links {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--soap-border);
    display: grid;
    gap: 0.45rem;
}

.soap-docs-sidebar-links a {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.7rem;
    border-radius: 10px;
    text-decoration: none;
    font-size: 0.86rem;
    font-weight: 650;
    color: #4b5563;
    background: var(--soap-canvas);
}

.soap-docs-sidebar-links a:hover {
    color: var(--soap-pink);
    background: #fff5f7;
}

/* ----- Main content ----- */
.soap-docs-main {
    background: var(--soap-surface);
    border: 1px solid var(--soap-border);
    border-radius: var(--soap-radius);
    box-shadow: var(--soap-shadow);
    padding: clamp(1.35rem, 3vw, 2.5rem);
    min-width: 0;
}

.soap-section {
    margin-bottom: 2.25rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--soap-border);
    scroll-margin-top: 110px;
}

.soap-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.soap-section h2 {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0 0 0.75rem;
    font-size: clamp(1.4rem, 2.5vw, 1.85rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--soap-ink);
}

.soap-section h2 i {
    color: var(--soap-pink);
    font-size: 0.95em;
}

.soap-section h3 {
    margin: 1.5rem 0 0.7rem;
    font-size: 1.15rem;
    font-weight: 750;
    color: var(--soap-ink);
}

.soap-section > p,
.soap-lede {
    margin: 0 0 1.15rem;
    color: var(--soap-muted);
    font-size: 1.02rem;
    line-height: 1.7;
}

/* Callouts */
.soap-callout {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.85rem 1rem;
    padding: 1rem 1.15rem;
    border-radius: 12px;
    margin: 1rem 0 1.25rem;
    border: 1px solid transparent;
}

.soap-callout i {
    margin-top: 0.15rem;
    font-size: 1.15rem;
}

.soap-callout strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--soap-ink);
}

.soap-callout p,
.soap-callout > div {
    margin: 0;
    color: #4b5563;
    font-size: 0.95rem;
    line-height: 1.6;
}

.soap-callout a {
    color: var(--soap-pink);
    font-weight: 700;
}

.soap-callout--warn {
    background: #fff7ed;
    border-color: #fed7aa;
}

.soap-callout--warn i { color: #ea580c; }

.soap-callout--info {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.soap-callout--info i { color: #2563eb; }

.soap-callout--success {
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.soap-callout--success i { color: #059669; }

/* Quick facts */
.soap-facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
    margin: 1.25rem 0 0.5rem;
}

.soap-fact {
    background: var(--soap-canvas);
    border: 1px solid var(--soap-border);
    border-radius: 12px;
    padding: 1rem;
}

.soap-fact .label {
    display: block;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--soap-deep);
    margin-bottom: 0.35rem;
}

.soap-fact .value {
    display: block;
    font-size: 0.92rem;
    font-weight: 650;
    color: var(--soap-ink);
    line-height: 1.45;
    word-break: break-word;
}

.soap-fact code {
    font-family: "Fira Code", ui-monospace, monospace;
    font-size: 0.82rem;
    color: var(--soap-pink);
    background: #fff;
    border: 1px solid #f1f5f9;
    padding: 0.15rem 0.35rem;
    border-radius: 6px;
}

/* Feature list */
.soap-feature-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.55rem;
}

.soap-feature-list li {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.65rem;
    align-items: start;
    padding: 0.75rem 0.9rem;
    background: var(--soap-canvas);
    border: 1px solid var(--soap-border);
    border-radius: 12px;
    color: #374151;
    font-size: 0.95rem;
    line-height: 1.5;
}

.soap-feature-list li i {
    color: var(--soap-pink);
    margin-top: 0.15rem;
}

/* Operations grid */
.soap-ops {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.soap-op {
    background: #fff;
    border: 1px solid var(--soap-border);
    border-radius: 14px;
    padding: 1.1rem 1.15rem;
    box-shadow: 0 2px 10px rgba(16, 24, 40, 0.03);
    border-top: 3px solid var(--soap-pink);
}

.soap-op h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.45rem;
    font-size: 1.02rem;
    font-weight: 750;
    color: var(--soap-ink);
}

.soap-op h4 i {
    color: var(--soap-pink);
}

.soap-op p {
    margin: 0;
    color: var(--soap-muted);
    font-size: 0.92rem;
    line-height: 1.55;
}

.soap-op .tag {
    display: inline-block;
    margin-top: 0.65rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: #fff5f7;
    color: var(--soap-deep);
    font-size: 0.72rem;
    font-weight: 750;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Steps */
.soap-steps {
    margin: 0 0 1.25rem;
    padding: 0;
    list-style: none;
    counter-reset: soap-step;
    display: grid;
    gap: 0.65rem;
}

.soap-steps li {
    counter-increment: soap-step;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.75rem;
    align-items: start;
    padding: 0.85rem 1rem;
    background: var(--soap-canvas);
    border: 1px solid var(--soap-border);
    border-radius: 12px;
    color: #374151;
    font-size: 0.95rem;
    line-height: 1.55;
}

.soap-steps li::before {
    content: counter(soap-step);
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(145deg, var(--soap-pink), var(--soap-deep));
    color: #fff;
    font-weight: 800;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 28px;
}

/* Code blocks */
.soap-code {
    margin: 1rem 0 1.35rem;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #0f172a;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
}

.soap-code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.7rem 0.95rem;
    background: linear-gradient(135deg, #EC2E5E 0%, #8B1538 100%);
    color: #fff;
}

.soap-code-title {
    font-size: 0.86rem;
    font-weight: 700;
}

.soap-copy {
    appearance: none;
    border: 0;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    border-radius: 8px;
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 650;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.soap-copy:hover {
    background: rgba(255, 255, 255, 0.26);
}

.soap-code pre {
    margin: 0;
    padding: 1.15rem 1.2rem;
    background: var(--soap-code);
    color: #e6edf3;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-family: "Fira Code", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.84rem;
    line-height: 1.65;
}

.soap-code pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    white-space: pre;
}

/* Inline code */
.soap-docs-main code:not(pre code) {
    font-family: "Fira Code", ui-monospace, monospace;
    font-size: 0.86em;
    background: #f8fafc;
    border: 1px solid #eef2f7;
    color: var(--soap-deep);
    padding: 0.12rem 0.4rem;
    border-radius: 6px;
}

/* Support CTA */
.soap-support {
    background:
        radial-gradient(ellipse 80% 80% at 15% 20%, rgba(236, 46, 94, 0.25), transparent 55%),
        linear-gradient(135deg, #1a1014 0%, #2a1520 55%, #3a1630 100%);
    color: #fff;
    border-radius: 16px;
    padding: clamp(1.5rem, 3vw, 2.25rem);
    text-align: center;
}

.soap-support h3 {
    margin: 0 0 0.55rem;
    color: #fff;
    font-size: 1.35rem;
}

.soap-support p {
    margin: 0 0 1.25rem;
    color: rgba(255, 255, 255, 0.88);
    line-height: 1.6;
}

.soap-support-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    justify-content: center;
}

.soap-support-actions a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.7rem 1.15rem;
    border-radius: 999px;
    background: #fff;
    color: var(--soap-deep);
    font-weight: 750;
    text-decoration: none;
}

.soap-support-actions a:hover {
    background: #fff5f7;
}

/* Mobile toc */
.soap-docs-mobile-toc {
    display: none;
    position: sticky;
    top: 72px;
    z-index: 30;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--soap-border);
    padding: 0.55rem 0;
}

.soap-docs-mobile-toc .container {
    max-width: min(1280px, 100%);
    padding: 0 var(--page-gutter, clamp(16px, 3vw, 28px));
    display: flex;
    gap: 0.45rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.soap-docs-mobile-toc a {
    flex: 0 0 auto;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 650;
    color: #374151;
    text-decoration: none;
    background: #f3f4f6;
}

.soap-docs-mobile-toc a:hover,
.soap-docs-mobile-toc a.active {
    background: #fff5f7;
    color: var(--soap-pink);
}

/* Responsive */
@media (max-width: 1024px) {
    .soap-docs-shell {
        grid-template-columns: 230px minmax(0, 1fr);
        gap: 1rem;
    }

    .soap-facts {
        grid-template-columns: 1fr;
    }

    .soap-ops {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    .soap-docs-hero {
        margin-top: 64px;
    }

    .soap-docs-mobile-toc {
        display: block;
    }

    .soap-docs-shell {
        grid-template-columns: 1fr;
        padding-top: 1rem;
    }

    .soap-docs-sidebar {
        display: none;
    }

    .soap-docs-main {
        padding: 1.15rem;
    }

    .soap-code pre {
        font-size: 0.78rem;
        padding: 0.95rem;
    }
}
