/* ==========================================================================
   qBilling Documentation — Sentry docs (docs.sentry.io) visual makeover.
   Design tokens measured live from docs.sentry.io/platforms/php/guides/laravel/
   (computed styles: heading color, accent purple, code-block colors, Rubik/
   Roboto Mono fonts, 64px fixed header, 300px left nav / 250px right TOC).
   Applied over qBilling's own content/structure — this file only reskins,
   it does not touch section markup. No "Ask AI" affordance, per request.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=Roboto+Mono:wght@400;500&display=swap');

:root {
    --sy-ink: #211f1c;
    --sy-heading: #362d59;
    --sy-purple: #6a5fc1;
    --sy-purple-dark: #554aa8;
    --sy-purple-tint: #f2f0fb;
    --sy-code-bg: #251f3d;
    --sy-code-text: #f2edf6;
    --sy-header-bg: #fdfdfc;
    --sy-border: #e9e6e0;
    --sy-muted: #6b7280;
    --sy-sidebar-bg: #ffffff;
    --sy-search-border: #d2c7da;
    --sy-badge-new-bg: #00f261;
    --sy-badge-new-text: #181423;
    --sy-header-h: 64px;
    --sy-sidebar-w: 300px;
    --sy-toc-w: 250px;
    --sy-max-content: 800px;
}

html.doc-dark {
    --sy-ink: #e4e1ee;
    --sy-heading: #eae7f6;
    --sy-purple: #a79aef;
    --sy-purple-dark: #c3b8f7;
    --sy-purple-tint: rgba(106, 95, 193, 0.18);
    --sy-code-bg: #17131f;
    --sy-code-text: #f2edf6;
    --sy-header-bg: #181423;
    --sy-border: #2f2a41;
    --sy-muted: #9a93b3;
    --sy-sidebar-bg: #1c1729;
    --sy-search-border: #3c3552;
}
html.doc-dark body { background: #14101d; }
html.doc-dark .doc-main { background: #14101d; }
html.doc-dark .doc-search-box { background: rgba(255, 255, 255, 0.04); color: var(--sy-ink); }
html.doc-dark .doc-theme-toggle { background: #1c1729; color: var(--sy-ink); }
html.doc-dark .intro-danger { background: rgba(214, 57, 57, 0.12); border-color: rgba(214, 57, 57, 0.35); color: #ffb4a8; }
html.doc-dark .img-thumbnail { border-color: var(--sy-border); box-shadow: 0 10px 24px -16px rgba(0, 0, 0, 0.6); }

* { box-sizing: border-box; }

html, body {
    background: #fff;
    color: var(--sy-ink);
    font-family: Rubik, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.15s ease, color 0.15s ease;
}

/* Neutralize the old Bootstrap 3 grid — content markup is untouched, only
   the box model is reset so it stacks naturally inside the new shell. */
.row { display: block; margin: 0; }
.row::after { content: none; }
[class*="col-"] { width: auto; float: none; padding: 0; }
hr { border: 0; border-top: 1px solid var(--sy-border); margin: 24px 0; }

a { color: var(--sy-purple); text-decoration: none; }
a:hover { color: var(--sy-purple-dark); text-decoration: underline; }

h1, h2, h3, h4, h5 { color: var(--sy-heading); font-family: Rubik, sans-serif; letter-spacing: -0.01em; }
h2.dark-text {
    font-weight: 300;
    font-size: 26px;
    margin: 0 0 20px;
    padding-top: 56px;
    border-top: 1px solid var(--sy-border);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
main.doc-main > section:first-of-type h2.dark-text,
main.doc-main > section.welcome h2.dark-text { border-top: 0; padding-top: 0; }
h2.dark-text hr { display: none; }
h2.dark-text > a { margin-left: auto; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--sy-muted); }
h2.dark-text > a:hover { color: var(--sy-purple); text-decoration: none; }
h3 { font-size: 20px; font-weight: 500; margin: 28px 0 12px; }
h4 { font-size: 16px; font-weight: 600; margin: 26px 0 10px; color: var(--sy-heading); }

p { margin: 0 0 16px; }
ul, ol { margin: 0 0 16px; padding-left: 22px; }
li { margin-bottom: 6px; }
strong { color: var(--sy-ink); font-weight: 600; }

/* audience badges (kept from the earlier segmentation pass, restyled) */
.doc-audience {
    display: inline-flex; align-items: center; font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.05em; padding: 3px 9px; border-radius: 999px;
    order: -1;
}
.doc-audience--tenant { color: var(--sy-purple); background: var(--sy-purple-tint); }
.doc-audience--portal { color: #0b6e99; background: #e5f6fd; }
.doc-audience--platform { color: #b42318; background: #fdeceb; }
.doc-audience--ref { color: var(--sy-muted); background: #f3f4f6; }

.doc-audience-dot { display: inline-block; width: 7px; height: 7px; border-radius: 999px; margin-right: 8px; }
.doc-audience-dot--start { background: #00c853; }
.doc-audience-dot--tenant { background: var(--sy-purple); }
.doc-audience-dot--portal { background: #0ea5e9; }
.doc-audience-dot--platform { background: #d63939; }
.doc-audience-dot--ref { background: var(--sy-muted); }

/* inline code + code blocks, Sentry's exact palette */
code {
    font-family: "Roboto Mono", SFMono-Regular, Consolas, Menlo, monospace;
    font-size: 0.85em;
    background: var(--sy-purple-tint);
    color: var(--sy-purple-dark);
    border-radius: 4px;
    padding: 2px 6px;
}
pre {
    background: var(--sy-code-bg);
    color: var(--sy-code-text);
    border-radius: 8px;
    padding: 16px 18px;
    margin: 0 0 20px;
    overflow-x: auto;
    font-family: "Roboto Mono", SFMono-Regular, Consolas, Menlo, monospace;
    font-size: 14px;
    line-height: 1.6;
    position: relative;
}
pre code { background: none; color: inherit; padding: 0; font-size: 1em; }
pre.doc-code::before {
    content: attr(data-lang);
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #b7aee0;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 10px;
}

/* screenshots */
.img-thumbnail {
    display: block;
    border: 1px solid var(--sy-border);
    border-radius: 10px;
    padding: 6px;
    margin: 4px 0 20px;
    box-shadow: 0 10px 24px -16px rgba(54, 45, 89, 0.35);
    /* §retina: source screenshots are fixed at 1512px raster width — capping
       display well below the doc-main column's own width keeps real pixel
       density high (more source px per displayed px) instead of stretching
       to fill ~700px+ of column and making 1x JPEG softness visible on a
       retina screen. image-rendering left at the auto/bicubic default,
       which is correct for downscaling a photographic screenshot. */
    max-width: min(100%, 620px);
    width: 100%;
    height: auto;
    image-rendering: -webkit-optimize-contrast;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
a:has(> .img-thumbnail) { display: block; cursor: zoom-in; position: relative; width: fit-content; }
a:hover > .img-thumbnail {
    transform: translateY(-3px);
    box-shadow: 0 16px 32px -14px rgba(106, 95, 193, 0.45);
    border-color: var(--sy-purple);
}
/* magnifier hint on hover, matches the purple accent everywhere else */
a:has(> .img-thumbnail)::after {
    content: '\f00e'; /* fa-search */
    font-family: FontAwesome;
    position: absolute;
    top: 18px; right: 18px;
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(24, 20, 35, 0.72);
    color: #fff;
    border-radius: 999px;
    font-size: 14px;
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 0.15s ease, transform 0.15s ease;
    pointer-events: none;
}
a:hover:has(> .img-thumbnail)::after { opacity: 1; transform: scale(1); }

/* ---- Fancybox theming — purple accent to match the rest of the doc --- */

:root {
    --f-accent-color: #6a5fc1;
    --f-button-icon-length: 24px;
}
.fancybox__backdrop { background: rgba(20, 16, 29, 0.92); }
.fancybox__toolbar { --f-button-hover-color: #a79aef; }

/* ---- header --------------------------------------------------------- */

.doc-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--sy-header-h);
    background: var(--sy-header-bg);
    border-bottom: 1px solid var(--sy-border);
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 0 24px;
    z-index: 100;
}
.doc-header-logo { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 18px; color: var(--sy-ink); flex-shrink: 0; }
.doc-header-logo img { height: 26px; width: auto; }
.doc-header-nav { display: flex; align-items: center; gap: 22px; font-size: 14.5px; font-weight: 500; }
.doc-header-nav a { color: var(--sy-ink); }
.doc-header-nav a:hover { color: var(--sy-purple); text-decoration: none; }
.doc-header-search {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
}
.doc-search-box {
    width: 260px;
    max-width: 100%;
    padding: 8px 12px;
    font-size: 14.4px;
    font-family: Rubik, sans-serif;
    color: var(--sy-ink);
    background: rgba(41, 41, 6, 0.03);
    border: 1.5px solid var(--sy-search-border);
    border-radius: 4px;
}
.doc-search-box:focus { outline: none; border-color: var(--sy-purple); background: #fff; }
.doc-header-actions { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.doc-header-cta { font-size: 15px; font-weight: 500; color: var(--sy-ink); display: inline-flex; align-items: center; gap: 6px; }
.doc-header-cta:hover { color: var(--sy-purple); text-decoration: none; }
.doc-theme-toggle {
    width: 32px; height: 32px; border-radius: 999px; border: 1px solid var(--sy-border);
    background: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.doc-theme-toggle:hover { border-color: var(--sy-purple); }

/* ---- shell: sidebar / main / toc --------------------------------------- */

.doc-shell {
    display: flex;
    align-items: flex-start;
    max-width: 1440px;
    margin: 0 auto;
    padding-top: var(--sy-header-h);
}

.doc-sidebar {
    width: var(--sy-sidebar-w);
    flex-shrink: 0;
    position: sticky;
    top: var(--sy-header-h);
    height: calc(100vh - var(--sy-header-h));
    overflow-y: auto;
    padding: 24px 16px 40px 24px;
    background: var(--sy-sidebar-bg);
}
.doc-search-box.doc-nav-search { width: 100%; margin-bottom: 18px; }

.doc-nav-grouped { list-style: none; margin: 0; padding: 0; }
.doc-nav-grouped .nav-group-header {
    display: flex; align-items: center;
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--sy-muted);
    padding: 18px 10px 6px;
}
.doc-nav-grouped .nav-group-header:first-child { padding-top: 4px; }
.doc-nav-grouped li a {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 7px 10px;
    border-radius: 5px;
    font-size: 14.5px;
    color: var(--sy-ink);
    line-height: 1.35;
}
.doc-nav-grouped li a:hover { background: var(--sy-purple-tint); color: var(--sy-purple-dark); text-decoration: none; }
.doc-nav-grouped li a.is-active { background: var(--sy-purple); color: #fff; font-weight: 500; }
.doc-nav-badge-new {
    background: var(--sy-badge-new-bg); color: var(--sy-badge-new-text);
    font-size: 9.5px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase;
    padding: 2px 5px; border-radius: 4px; flex-shrink: 0;
}
.doc-nav-hidden { display: none !important; }

.doc-main {
    flex: 1 1 auto;
    min-width: 0;
    max-width: var(--sy-max-content);
    padding: 40px 48px 120px;
    margin: 0 auto;
}

.doc-toc {
    width: var(--sy-toc-w);
    flex-shrink: 0;
    position: sticky;
    top: var(--sy-header-h);
    height: calc(100vh - var(--sy-header-h));
    overflow-y: auto;
    padding: 40px 24px 40px 0;
}
.doc-toc-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--sy-muted); margin-bottom: 10px; }
.doc-toc-list { list-style: none; margin: 0 0 24px; padding: 0; border-left: 1px solid var(--sy-border); }
.doc-toc-list li a {
    display: block; padding: 5px 0 5px 14px; margin-left: -1px;
    border-left: 2px solid transparent;
    font-size: 13.5px; color: var(--sy-muted); line-height: 1.4;
}
.doc-toc-list li a:hover { color: var(--sy-purple); text-decoration: none; }
.doc-toc-list li a.is-active { color: var(--sy-purple); border-left-color: var(--sy-purple); font-weight: 500; }
.doc-toc-list li.doc-toc-sub a { padding-left: 28px; font-size: 12.5px; opacity: 0.85; }
.doc-toc-list li.doc-toc-sub a.is-active { opacity: 1; }

.doc-toc-box {
    border: 1px solid var(--sy-border);
    border-radius: 8px;
    padding: 14px 16px;
}
.doc-toc-box .doc-toc-label { margin-bottom: 8px; }
.doc-toc-box ul { list-style: none; margin: 0; padding: 0; font-size: 13px; color: var(--sy-muted); }
.doc-toc-box li { margin-bottom: 6px; }

/* ---- hero / intro ------------------------------------------------------- */

.doc-hero { padding: 0 0 8px; }
.doc-hero .big-title h1 { font-size: 34px; font-weight: 600; margin: 0 0 10px; text-align: left; }
.doc-hero .lead { color: var(--sy-muted); font-size: 16px; margin: 0; }
.doc-breadcrumb { font-size: 13px; color: var(--sy-muted); margin-bottom: 18px; }
.doc-breadcrumb a { color: var(--sy-muted); }
.doc-breadcrumb a:hover { color: var(--sy-purple); }

.intro-danger {
    border: 1px solid #f3c6c6;
    background: #fdeceb;
    border-radius: 8px;
    padding: 14px 16px;
    margin-top: 18px;
    color: #7a271a;
}
.intro-danger .fa { margin-right: 6px; }

/* ---- API reference: method badges, per-endpoint blocks, tabbed cURL/PHP
   code samples — mirrors the in-app API Reference (ApiDocs/RequestCodeBlock
   component) so the static docs and the live app teach the same shape. ---- */

.api-method-badge {
    display: inline-block;
    font-family: "Roboto Mono", SFMono-Regular, Consolas, Menlo, monospace;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #fff;
    padding: 3px 8px;
    border-radius: 5px;
    vertical-align: middle;
}
.api-method-badge--get { background: #0ea5e9; }
.api-method-badge--post { background: #10b981; }
.api-method-badge--put { background: #f59e0b; color: #1a1300; }
.api-method-badge--delete { background: #ef4444; }

.api-endpoint-block {
    border: 1px solid var(--sy-border);
    border-radius: 10px;
    padding: 18px 20px 4px;
    margin: 0 0 22px;
}
.api-endpoint-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 8px;
    font-size: 16px;
}
.api-endpoint-title code {
    font-size: 0.95em;
}
.api-endpoint-meta {
    color: var(--sy-muted);
    font-size: 14px;
    margin: 0 0 16px;
}

/* the tabbed request panel — header bar with cURL/PHP tabs + copy button,
   sitting directly on top of the same dark <pre> the rest of the doc uses
   (no separate background layer, so there's no visible seam between them) */
.api-code-block { margin: 0 0 20px; }
.api-code-tabs-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--sy-code-bg);
    border-radius: 8px 8px 0 0;
    padding: 6px 8px 0 12px;
}
.api-code-tabs { display: flex; gap: 2px; }
.api-code-tab {
    background: transparent;
    border: none;
    color: #9088ab;
    font-family: "Roboto Mono", SFMono-Regular, Consolas, Menlo, monospace;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 8px 10px 9px;
    cursor: pointer;
    border-radius: 6px 6px 0 0;
}
.api-code-tab:hover { color: #cfc9e6; }
.api-code-tab.is-active { color: #fff; background: rgba(255, 255, 255, 0.08); }
.api-code-copy-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #cfc9e6;
    font-family: Rubik, sans-serif;
    font-size: 12px;
    padding: 4px 9px;
    border-radius: 6px;
    cursor: pointer;
    margin: 5px 8px 0 0;
}
.api-code-copy-btn:hover { border-color: #a79aef; color: #fff; }
.api-code-block pre.doc-code {
    margin: 0;
    border-radius: 0 0 8px 8px;
}
.api-code-block pre.doc-code::before { display: none; }
.api-code-block pre.doc-code:not(.is-active) { display: none; }

/* responsive: stack columns below desktop width */
@media (max-width: 1100px) {
    .doc-toc { display: none; }
}
@media (max-width: 860px) {
    .doc-sidebar { display: none; }
    .doc-header-nav { display: none; }
    .doc-main { padding: 28px 20px 80px; }
}
