/* Styling for the GowSign API docs' Swagger UI page (index.html). Loaded
   after swagger-ui.css and the highlight.js theme CSS so these rules can
   override them where needed. */
@import url("./segmented-toggle.css");

body {
  margin: 0;
}

.topbar {
  display: none;
}

/* JSON code blocks embedded in markdown descriptions (info.description) don't get
   real syntax highlighting from Swagger UI — they're flat-colored via a fixed CSS
   rule (.renderedMarkdown code { color: #9012fe }). doc-viewer.js re-highlights them
   with highlight.js (agate theme, the same palette Swagger UI uses for its native
   "Example Value" panels) and this makes the resulting block look right. */
.swagger-ui .renderedMarkdown pre {
  background: #333 !important;
  border-radius: 6px;
  padding: 1em !important;
  position: relative;
}

.swagger-ui .renderedMarkdown pre code {
  background: transparent !important;
  color: #fff !important;
  padding: 0 !important;
  font-weight: 400 !important;
}

/* Copy-to-clipboard button injected by doc-viewer.js onto every JSON block in a
   markdown description (self-contained styling, independent of Swagger's own
   internal, context-specific .copy-to-clipboard rules). */
.swagger-ui .renderedMarkdown pre .doc-copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 4px;
  background: #545d61;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.swagger-ui .renderedMarkdown pre .doc-copy-btn:hover {
  opacity: 1;
  background: #6b7478;
}

.swagger-ui .renderedMarkdown pre .doc-copy-btn.copied {
  background: #3b8a4e;
}

/* Typography pass for the long markdown description (info.description) —
   Authentication, Create Document flows, Response, Examples, etc. Swagger's
   default renders it as one flat, full-width wall of text. */
:root[data-theme="dark"] { --doc-accent: #6ea8fe; --doc-heading: #eef0f3; }
:root[data-theme="light"] { --doc-accent: #2f6feb; --doc-heading: #1a1d23; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) { --doc-accent: #6ea8fe; --doc-heading: #eef0f3; }
}
:root:not([data-theme]) { --doc-accent: #2f6feb; --doc-heading: #1a1d23; }

.swagger-ui .renderedMarkdown {
  max-width: 46rem;
}

.swagger-ui .renderedMarkdown p,
.swagger-ui .renderedMarkdown li {
  line-height: 1.7;
}

/* h1 is the description's own title line, rendered above the auto-generated
   Table of Contents — kept plain (no accent) so it doesn't compete with h2
   section headers below it. */
.swagger-ui .renderedMarkdown h1 {
  color: var(--doc-heading);
}

/* Each h2 opens a new top-level section (Authentication, Base URL, Create
   Document flows, ...). The accent-colored left rule turns every one of
   them into a scannable landmark instead of just another bold line — this
   is the piece a plain border-top couldn't give: an identity per section,
   not just a gap between them. */
.swagger-ui .renderedMarkdown h2 {
  margin: 3.5rem 0 1.25rem;
  padding-left: 0.9rem;
  border-left: 4px solid var(--doc-accent);
  color: var(--doc-accent);
  font-size: 1.4rem;
  letter-spacing: -0.01em;
}

.swagger-ui .renderedMarkdown h1 + h2,
.swagger-ui .renderedMarkdown h2:first-child {
  margin-top: 0;
}

/* h3/h4 are subsections of the h2 above them — bold and indented in the
   heading color (not the accent) so "new top-level section" vs. "part of
   the section above" stays visually unambiguous at a glance. */
.swagger-ui .renderedMarkdown h3 {
  margin-top: 2.25rem;
  padding-left: 0.9rem;
  color: var(--doc-heading);
}

.swagger-ui .renderedMarkdown h4 {
  margin-top: 1.5rem;
  padding-left: 0.9rem;
  color: var(--doc-heading);
}

/* Anchor link injected by doc-viewer.js next to every heading — hidden until
   hover/focus, same pattern used by most docs sites (GitHub, Stripe, ...) so
   a section can be linked without the id cluttering the heading at rest. */
.swagger-ui .renderedMarkdown .doc-heading-anchor {
  margin-left: 0.5rem;
  color: var(--doc-accent);
  opacity: 0;
  text-decoration: none;
  font-weight: 400;
  transition: opacity 0.1s ease;
}

.swagger-ui .renderedMarkdown h1:hover .doc-heading-anchor,
.swagger-ui .renderedMarkdown h2:hover .doc-heading-anchor,
.swagger-ui .renderedMarkdown h3:hover .doc-heading-anchor,
.swagger-ui .renderedMarkdown h4:hover .doc-heading-anchor,
.swagger-ui .renderedMarkdown .doc-heading-anchor:focus {
  opacity: 1;
}

/* The hand-written "Table of Contents" heading + list inside info.description
   is redundant now that .doc-sidebar (below) covers the same job persistently
   across scroll — hidden here rather than removed from the spec itself, see
   hideInlineToc() in doc-viewer.js. */
.doc-toc-inline-hidden {
  display: none !important;
}

/* Sidebar nav generated from the description's own h2/h3 headings — the
   "on this page" rail. A fixed rail from 960px up; below that there isn't
   room for it alongside Swagger's operation layout without cramping both,
   so the same nav becomes an off-canvas drawer opened by .doc-sidebar-menu
   (see createSidebarDrawer() in doc-viewer.js). */
body.doc-has-sidebar {
  --doc-sidebar-width: 280px;
}

.doc-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 110;
  width: var(--doc-sidebar-width);
  overflow-y: auto;
  padding: 2rem 1.25rem 2rem 1.75rem;
  box-sizing: border-box;
  border-right: 1px solid rgba(127, 127, 127, 0.2);
  /* .doc-sidebar hangs off <body>, outside .swagger-ui — swagger-ui.css scopes
     its sans-serif font-family to that class, so without this the rail falls
     back to the browser's default serif font. */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (min-width: 960px) {
  body.doc-has-sidebar {
    margin-left: var(--doc-sidebar-width);
  }

  .doc-sidebar {
    background: rgba(127, 127, 127, 0.04);
  }

  .doc-sidebar-backdrop {
    display: none;
  }
}

/* Drawer mode. The drawer covers the page, so unlike the rail it needs an
   opaque background — the same one swagger-ui paints per theme. */
@media (max-width: 959.98px) {
  .doc-sidebar {
    width: min(var(--doc-sidebar-width), 85vw);
    padding-top: 66px;
    background: #fff;
    box-shadow: 4px 0 16px rgba(0, 0, 0, 0.2);
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.2s ease, visibility 0s linear 0.2s;
  }

  body.doc-sidebar-open .doc-sidebar {
    transform: none;
    visibility: visible;
    transition: transform 0.2s ease;
  }

  :root[data-theme="dark"] .doc-sidebar {
    background: #1c2022;
  }

  body.doc-sidebar-open {
    overflow: hidden;
  }

  .doc-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 105;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  body.doc-sidebar-open .doc-sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  /* Clears the menu button, which sits over the page's top-left corner. */
  body.doc-has-sidebar #swagger-ui {
    padding-top: 52px;
  }
}

/* Same footprint and look as the toolbar's segmented switches
   (segmented-toggle.css), on the opposite corner. Stays above the open
   drawer, where it doubles as the close button. */
.doc-sidebar-menu {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 120;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 19px;
  background: #fff;
  color: #1c2022;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: box-shadow 0.15s ease;
}

.doc-sidebar-menu:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.doc-sidebar-menu:focus-visible {
  outline: 2px solid #2f6feb;
  outline-offset: 1px;
}

.doc-sidebar-menu svg {
  width: 20px;
  height: 20px;
}

:root[data-theme="dark"] .doc-sidebar-menu {
  background: #1c2022;
  border-color: rgba(255, 255, 255, 0.16);
  color: #f5f5f5;
}

:root[data-theme="dark"] .doc-sidebar-menu:focus-visible {
  outline-color: #6ea8fe;
}

@media (min-width: 960px) {
  .doc-sidebar-menu {
    display: none;
  }
}

.doc-sidebar-label {
  margin-bottom: 0.9rem;
  color: var(--doc-heading);
  opacity: 0.55;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.doc-sidebar-label:not(:first-child) {
  margin-top: 1.5rem;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(128, 128, 128, 0.25);
}

.doc-sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.doc-sidebar li.doc-sidebar-h2 {
  margin-top: 0.85rem;
}

.doc-sidebar li.doc-sidebar-h2:first-child {
  margin-top: 0;
}

.doc-sidebar a {
  display: block;
  padding: 0.2rem 0 0.2rem 0.7rem;
  border-left: 2px solid transparent;
  color: var(--doc-heading);
  text-decoration: none;
  font-size: 0.88rem;
  line-height: 1.5;
  transition: color 0.1s ease, border-color 0.1s ease;
}

.doc-sidebar li.doc-sidebar-h2 > a {
  font-weight: 600;
}

.doc-sidebar li.doc-sidebar-h3 {
  margin-left: 0.75rem;
}

.doc-sidebar li.doc-sidebar-h3 > a {
  font-size: 0.82rem;
  opacity: 0.75;
}

.doc-sidebar a:hover {
  color: var(--doc-accent);
}

.doc-sidebar a.active {
  color: var(--doc-accent);
  border-left-color: var(--doc-accent);
  font-weight: 700;
  opacity: 1;
}
