/* =========================================================================
   SENDPK.COM — API Documentation page styles (api.php only)
   -------------------------------------------------------------------------
   Page-specific styling only. Colours, radii, shadows and fonts are read
   from the shared design tokens in theme.css (:root) — nothing here
   redefines or overrides the global stylesheet. Everything is scoped
   under #apiDocs so it can never leak onto other pages.
   ========================================================================= */

#apiDocs {
  /* Combined height of the site's topbar + sticky navbar (theme.css .topbar + .main-nav).
     Used so this page's own overlays/panels never sit on top of and hide the site header. */
  --api-header-offset: 96px;
  font-size: 15.5px;
  line-height: 1.7;
}
#apiDocs code, #apiDocs pre, #apiDocs .api-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* =========================================================================
   LAYOUT — sticky sidebar + scrolling content column
   ========================================================================= */
.api-shell { display: flex; align-items: flex-start; max-width: 1320px; margin: 0 auto; }
.api-sidebar {
  width: 280px; flex-shrink: 0;
  position: sticky; top: var(--api-header-offset); align-self: flex-start;
  max-height: calc(100vh - var(--api-header-offset) - 20px);
  overflow-y: auto;
  padding: 1.5rem 1rem 3rem 0;
}
.api-main { flex: 1; min-width: 0; padding: 2.5rem clamp(1.25rem, 4vw, 3.5rem) 5rem; }

/* Sidebar search */
.api-search { position: relative; margin-bottom: 1rem; }
.api-search input {
  border: 1px solid var(--wa-line); border-radius: 10px; padding: .5rem .8rem .5rem 2.2rem;
  font-size: .85rem; width: 100%; background: var(--wa-page); color: var(--wa-ink);
}
.api-search input:focus {
  outline: none; border-color: var(--wa-green); background: #fff;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, .15);
}
.api-search i { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: var(--wa-muted); font-size: .8rem; }

.api-nav { list-style: none; padding: 0; margin: 0; }
.api-nav-label {
  font-size: .68rem; font-weight: 700; letter-spacing: .08em; color: var(--wa-muted);
  text-transform: uppercase; margin: 1.1rem 0 .4rem .6rem;
}
.api-nav-label:first-child { margin-top: 0; }
.api-nav li a {
  display: flex; align-items: center; gap: .55rem;
  padding: .42rem .6rem; border-radius: 8px; font-size: .87rem; color: var(--wa-body); font-weight: 500;
  border-left: 2.5px solid transparent;
}
.api-nav li a:hover { background: var(--wa-page); color: var(--wa-ink); }
.api-nav li a.active { background: rgba(34, 197, 94, .12); color: var(--wa-teal-dark); border-left-color: var(--wa-green); font-weight: 600; }
.api-nav li a i { width: 16px; text-align: center; font-size: .78rem; color: #1da851; }
.api-nav .api-sub-link { padding-left: 1.8rem; font-size: .82rem; }
.api-nav-hidden { display: none !important; }

/* =========================================================================
   CONTENT BLOCKS
   ========================================================================= */
section.api-doc-section { scroll-margin-top: 110px; padding-bottom: 3.2rem; border-bottom: 1px solid var(--wa-line); margin-bottom: 3.2rem; }
section.api-doc-section:last-of-type { border-bottom: none; margin-bottom: 0; }

.api-lead { color: var(--wa-body); font-size: 1.05rem; max-width: 760px; }

.api-card { background: #fff; border: 1px solid var(--wa-line); border-radius: var(--radius-card); padding: 1.5rem; height: 100%; box-shadow: var(--shadow-sm); }
.api-card + .api-card { margin-top: 1rem; }
.api-card h2, .api-card h3 { font-size: 1rem; font-weight: 700; margin: .6rem 0 .3rem; letter-spacing: normal; }
.api-card i.api-card-icon { font-size: 1.3rem; color: var(--wa-teal); }

/* Compliance / warning callout (e.g. local-traffic-only notice) */
.api-alert-card { background: #fff8ee; border-color: #f5d9a8; height: auto; }
.api-alert-card p { color: #8a5a12; }
.api-alert-card i { color: #c07d1f; }

/* Mandatory-verification card — pricing-card style with a centered "IMPORTANT"
   pill overlapping the top border, themed in the site's brand green (like
   .price-card.popular on the home page) instead of a generic warning color. */
.api-verify-card {
  position: relative; text-align: center; height: auto;
  background: linear-gradient(160deg, var(--wa-surface), #F3FBF6);
  border: 2px solid var(--wa-green);
  border-radius: var(--radius-card);
  padding: 2.4rem 2rem 2rem;
  box-shadow: var(--shadow-md);
}
.api-verify-card .api-important-tag {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--wa-green); color: var(--wa-ink); font-size: .74rem; font-weight: 800;
  letter-spacing: .05em; text-transform: uppercase; border-radius: 50rem;
  padding: .35rem 1rem; box-shadow: 0 4px 12px rgba(34, 197, 94, .4); white-space: nowrap;
}
.api-verify-card h2 { font-size: 1.2rem; margin: .3rem 0 .4rem; }
.api-verify-card .api-verify-sub {
  color: var(--wa-muted); font-size: .9rem; line-height: 1.6;
  max-width: 540px; margin: 0 auto 1.3rem;
}
/* Compact inline pills instead of one item per line — keeps the card short */
.api-verify-list {
  list-style: none; padding: 0; margin: 0 0 1.5rem;
  display: flex; flex-wrap: wrap; justify-content: center; gap: .55rem;
}
.api-verify-list li {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--wa-surface); border: 1px solid var(--wa-line);
  border-radius: 50rem; padding: .4rem .9rem;
  font-size: .85rem; font-weight: 600; color: var(--wa-body); white-space: nowrap;
}
.api-verify-list li i { color: var(--wa-green); }

/* Inline accent colour for lead icons (CSP forbids style="" attributes) */
.api-icon-accent { color: var(--wa-teal); }

/* Narrow first column for the status-code table */
.api-th-narrow { width: 100px; }
.api-card p { color: var(--wa-muted); font-size: .9rem; margin: 0; }

.api-step { display: flex; gap: 1rem; background: var(--wa-page); border-radius: var(--radius-card); padding: 1.1rem 1.3rem; margin-bottom: .85rem; border: 1px solid var(--wa-line); }
.api-step-num {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%;
  background: var(--wa-green); color: #fff; font-weight: 700;
  display: flex; align-items: center; justify-content: center; font-size: .95rem;
}
.api-step h3 { margin: 0 0 .2rem; font-weight: 700; font-size: .98rem; }
.api-step p { margin: 0; color: var(--wa-muted); font-size: .92rem; }

/* Standalone endpoint titles, e.g. <h3 class="api-endpoint-title">Send Single SMS</h3> */
.api-endpoint-title { font-size: 1.3rem; margin: 0 0 .6rem; }

/* Mini sub-headings inside an endpoint block (e.g. "Request Example") */
.api-doc-section h4 { font-size: .95rem; font-weight: 700; margin: 1.4rem 0 .5rem; }
.api-endpoint-title + h4 { margin-top: .5rem; }

/* Responsive 16:9 video embed (e.g. tutorial videos) */
.api-video-embed {
  position: relative; aspect-ratio: 16 / 9; max-width: 720px;
  border-radius: var(--radius-card); overflow: hidden; box-shadow: var(--shadow-md);
  margin: .75rem 0 1.25rem;
}
.api-video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.api-badge { font-weight: 700; font-size: .72rem; letter-spacing: .03em; padding: .3rem .6rem; border-radius: 6px; display: inline-block; }
.api-badge-get { background: #e7f3ff; color: #0b63c5; }
.api-badge-post { background: rgba(34, 197, 94, .15); color: var(--wa-teal-dark); }

.api-endpoint {
  background: var(--wa-ink); color: #d9fdd3;
  padding: .6rem .9rem; border-radius: 8px; font-size: .85rem; overflow-x: auto; white-space: nowrap;
}

#apiDocs table.api-table { width: 100%; border-collapse: collapse; font-size: .87rem; }
#apiDocs table.api-table th {
  background: var(--wa-page); text-align: left; padding: .6rem .8rem; font-weight: 700;
  border-bottom: 2px solid var(--wa-line); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--wa-muted);
}
#apiDocs table.api-table td { padding: .65rem .8rem; border-bottom: 1px solid var(--wa-line); vertical-align: top; color: var(--wa-body); }
#apiDocs table.api-table td code { background: var(--wa-page); padding: .1rem .4rem; border-radius: 4px; color: var(--wa-teal-dark); }
.api-tag-required { color: #d32f2f; font-size: .72rem; font-weight: 700; }
.api-tag-optional { color: var(--wa-muted); font-size: .72rem; font-weight: 600; }
.api-table-wrap { overflow-x: auto; }

/* Code blocks + language tabs */
.api-code { position: relative; border-radius: 12px; overflow: hidden; background: #1e1e2e; margin: .75rem 0 1.25rem; }
.api-code pre {
  margin: 0 !important; padding: 2.4rem 1.1rem 1.1rem !important; max-height: 440px; overflow: auto;
  color: #e4e4ef; font-size: .83rem; line-height: 1.6; white-space: pre;
}
.api-code .api-copy {
  position: absolute; top: .6rem; right: .6rem; z-index: 5;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2); color: #fff;
  font-size: .72rem; padding: .3rem .65rem; border-radius: 6px; cursor: pointer; display: flex; align-items: center; gap: .35rem;
  transition: .15s;
}
.api-code .api-copy:hover { background: var(--wa-green); border-color: var(--wa-green); }
.api-code .api-lang-label {
  position: absolute; top: .6rem; left: .9rem; z-index: 5; color: #8a8fa3;
  font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}

/* Prism.js syntax-highlighting palette (self-hosted, assets/js/prism.min.js) —
   a custom dark theme tuned to sit on the .api-code #1e1e2e background,
   instead of importing Prism's own CDN theme CSS. */
.api-code .token.comment,
.api-code .token.prolog,
.api-code .token.doctype,
.api-code .token.cdata { color: #7f848e; font-style: italic; }
.api-code .token.punctuation,
.api-code .token.operator { color: #abb2bf; }
.api-code .token.keyword,
.api-code .token.tag,
.api-code .token.important { color: #c678dd; }
.api-code .token.string,
.api-code .token.attr-value,
.api-code .token.regex { color: #98c379; }
.api-code .token.function,
.api-code .token.class-name { color: #61afef; }
.api-code .token.number,
.api-code .token.boolean,
.api-code .token.constant { color: #d19a66; }
.api-code .token.property,
.api-code .token.attr-name,
.api-code .token.variable,
.api-code .token.parameter,
.api-code .token.selector { color: #e5c07b; }
.api-code .token.builtin { color: #56b6c2; }
.api-code .token.deleted { color: #e06c75; }

.api-tabs { display: flex; gap: .35rem; flex-wrap: wrap; margin-bottom: .4rem; }
.api-tabs button {
  border: 1px solid var(--wa-line); background: #fff; color: var(--wa-body); font-size: .78rem; font-weight: 600;
  padding: .35rem .85rem; border-radius: 8px 8px 0 0; cursor: pointer;
}
.api-tabs button.active { background: #1e1e2e; color: #fff; border-color: #1e1e2e; }
.api-panel { display: none; }
.api-panel.active { display: block; }

.api-pill { display: inline-block; padding: .15rem .55rem; border-radius: 20px; font-size: .72rem; font-weight: 700; }
.api-pill-ok { background: rgba(34, 197, 94, .15); color: var(--wa-teal-dark); }
.api-pill-err { background: #fdecea; color: #c0392b; }

.api-faq { border: 1px solid var(--wa-line); border-radius: 12px; margin-bottom: .7rem; overflow: hidden; }
.api-faq-q { padding: 1rem 1.2rem; font-weight: 600; cursor: pointer; display: flex; justify-content: space-between; align-items: center; background: #fff; gap: 1rem; }
.api-faq-q:hover { background: var(--wa-page); }
.api-faq-q i { transition: .2s; color: var(--wa-teal); flex-shrink: 0; }
.api-faq.open .api-faq-q i { transform: rotate(180deg); }
.api-faq-a { display: none; padding: 0 1.2rem 1.1rem; color: var(--wa-body); font-size: .92rem; }
.api-faq.open .api-faq-a { display: block; }

.api-support { background: linear-gradient(135deg, var(--wa-teal-dark), var(--wa-teal)); color: #fff; border-radius: var(--radius-card); padding: 2rem; }
.api-support p { color: rgba(255, 255, 255, .88); }

/* Mobile floating sidebar toggle (separate from the site's own navbar).
   z-index is kept BELOW the site's sticky navbar (Bootstrap .sticky-top = 1020)
   and top offsets start below the header, so the docs sidebar/backdrop/toggle
   can never cover or dim the site's own sticky header. */
.api-mobile-toggle {
  display: none; position: fixed; top: calc(var(--api-header-offset) + 10px); left: 14px; z-index: 1000;
  width: 44px; height: 44px; border-radius: 50%; background: var(--wa-green); color: #fff; border: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .2); align-items: center; justify-content: center; font-size: 1.1rem;
}
.api-backdrop {
  display: none; position: fixed; top: var(--api-header-offset); left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, .4); z-index: 990;
}
.api-backdrop.show { display: block; }

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 991.98px) {
  .api-sidebar {
    position: fixed; top: var(--api-header-offset); left: 0;
    height: calc(100vh - var(--api-header-offset)); max-height: calc(100vh - var(--api-header-offset));
    width: 280px; background: #fff; z-index: 1000;
    transform: translateX(-100%); transition: transform .25s ease; padding: 1.5rem 1rem 3rem;
    box-shadow: 0 0 30px rgba(0, 0, 0, .1);
  }
  .api-sidebar.show { transform: translateX(0); box-shadow: 0 0 30px rgba(0, 0, 0, .25); }
  .api-mobile-toggle { display: flex; }
  /* Top padding must clear the fixed toggle button's own footprint (44px
     tall, starting 10px below the header) — otherwise it overlaps the
     Introduction section's eyebrow/title instead of sitting in its own
     clear space (same fix as price.php's .price-main — see memory). */
  .api-main { padding: 4.5rem 1.1rem 4rem; }
}
@media (max-width: 575.98px) {
  #apiDocs { font-size: 14.5px; }
  .api-endpoint { white-space: normal; word-break: break-all; }
  .api-code pre { font-size: .78rem; }
  .api-step { flex-direction: column; gap: .5rem; }
  .api-support { padding: 1.5rem; text-align: center; }
}
