/* ============================================================================
   docs.css — Centralized design system for EMSX API endpoint documentation.
   Scoped under .docs-content-wrapper (the <HtmlDocs> component root) so it
   overrides the removed per-file <style> blocks and normalizes all 81 doc
   pages into one consistent, modern developer-portal look.
   Loaded after style.css / site.css in App.razor.
   ============================================================================ */

.docs-content-wrapper {
    font-family: 'Raleway', 'Mada', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #3a3f4b;
    font-size: 0.95rem;
    line-height: 1.7;
}

.docs-content-wrapper *,
.docs-content-wrapper *::before,
.docs-content-wrapper *::after {
    box-sizing: border-box;
}

/* ── Typography ─────────────────────────────────────────────────── */
/* The doc <h1> ("EMSX API — <endpoint> Endpoint") becomes a small eyebrow;
   the page shell's section-title already names the endpoint. */
.docs-content-wrapper h1 {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: #8a93a6;
    margin: 0 0 0.35rem;
    border: none;
    padding: 0;
    background: none;
}

.docs-content-wrapper h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f1724;
    margin: 0 0 0.5rem;
    padding: 0;
    border: none;
    background: none;
    line-height: 1.4;
}

.docs-content-wrapper h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #0f1724;
    margin: 0 0 0.85rem;
    padding-bottom: 0.4rem;
    border: none;
    border-bottom: 1px solid #e8ecf1;
    background: none;
    text-transform: none;
    letter-spacing: normal;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.docs-content-wrapper h3::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #2962ff;
    flex-shrink: 0;
}

.docs-content-wrapper h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: #0f1724;
    margin: 1rem 0 0.5rem !important;
    padding: 0;
    border: none;
    background: none;
}

.docs-content-wrapper p {
    margin: 0 0 0.85rem;
}

.docs-content-wrapper p:last-child {
    margin-bottom: 0;
}

.docs-content-wrapper ul,
.docs-content-wrapper ol {
    margin: 0 0 0.85rem 1.25rem;
    padding-left: 0.5rem;
}

.docs-content-wrapper li {
    margin-bottom: 0.4rem;
}

.docs-content-wrapper a {
    color: #2962ff;
    text-decoration: none;
}

.docs-content-wrapper a:hover {
    text-decoration: underline;
}

.docs-content-wrapper strong {
    color: #0f1724;
    font-weight: 700;
}

/* Inline code */
.docs-content-wrapper code {
    font-family: 'Cascadia Code', 'Fira Code', Consolas, monospace;
    font-size: 0.85em;
    background: #f0f2f5;
    color: #c7254e;
    padding: 2px 6px;
    border-radius: 4px;
    border: none;
    font-weight: 400;
}

/* ── Section cards ──────────────────────────────────────────────── */
.docs-content-wrapper .section {
    background: #fff;
    border: 1px solid #e8ecf1;
    border-radius: 10px;
    padding: 18px 20px;
    margin: 0 0 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 36, 0.04);
}

/* ── Endpoint hero (the section that carries the method badge) ──── */
.docs-content-wrapper .section:has(.method-get, .method-post, .method-put, .method-delete, .method-patch) {
    background: linear-gradient(135deg, #f4f8ff 0%, #eaf1ff 100%);
    border-color: #cfe0ff;
    padding: 16px 20px;
}

.docs-content-wrapper .section:has(.method-get, .method-post, .method-put, .method-delete, .method-patch) h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 0.4rem;
}

/* HTTP method pills */
.docs-content-wrapper .method-get,
.docs-content-wrapper .method-post,
.docs-content-wrapper .method-put,
.docs-content-wrapper .method-delete,
.docs-content-wrapper .method-patch {
    display: inline-block;
    width: auto;
    color: #fff;
    font-family: 'Cascadia Code', Consolas, monospace;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 4px 10px;
    border-radius: 5px;
    margin: 0;
    vertical-align: middle;
    flex-shrink: 0;
}

.docs-content-wrapper .method-get { background: #2962ff; }
.docs-content-wrapper .method-post { background: #16a34a; }
.docs-content-wrapper .method-put { background: #d97706; }
.docs-content-wrapper .method-delete { background: #dc2626; }
.docs-content-wrapper .method-patch { background: #7c3aed; }

/* Endpoint path chip */
.docs-content-wrapper .endpoint-box {
    display: inline-block;
    background: #fff;
    border: 1px solid #cfe0ff;
    color: #0f1724;
    font-family: 'Cascadia Code', 'Fira Code', Consolas, monospace;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    margin: 0;
    word-break: break-all;
}

/* ── Code blocks (dark) ─────────────────────────────────────────── */
.docs-content-wrapper pre {
    position: relative;
    background: #0f1724;
    color: #e4e8f0;
    border: none;
    border-radius: 8px;
    padding: 16px 18px;
    margin: 0 0 14px;
    overflow-x: auto;
    font-family: 'Cascadia Code', 'Fira Code', Consolas, monospace;
    font-size: 0.82rem;
    line-height: 1.6;
}

.docs-content-wrapper pre code {
    background: none;
    color: inherit;
    padding: 0;
    border: none;
    border-radius: 0;
    font-size: inherit;
    font-family: inherit;
}

/* Copy button (code blocks) */
.docs-content-wrapper .docs-copy {
    position: absolute;
    top: 8px;
    right: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
    color: #c5cad3;
    font: 600 11px 'Segoe UI', system-ui, sans-serif;
    padding: 3px 9px;
    border-radius: 5px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s, background 0.15s, color 0.15s;
}

.docs-content-wrapper pre:hover .docs-copy,
.docs-content-wrapper .docs-copy:focus {
    opacity: 1;
}

.docs-content-wrapper .docs-copy:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.docs-content-wrapper .docs-copy.docs-copied {
    opacity: 1;
    background: #16a34a;
    border-color: #16a34a;
    color: #fff;
}

/* Copy-path button (endpoint hero, on light background) */
.docs-content-wrapper .docs-copy-url {
    display: inline-block;
    border: 1px solid #cfe0ff;
    background: #fff;
    color: #2962ff;
    font: 600 11px 'Segoe UI', system-ui, sans-serif;
    padding: 5px 11px;
    border-radius: 6px;
    cursor: pointer;
    opacity: 1;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    flex-shrink: 0;
}

.docs-content-wrapper .docs-copy-url:hover {
    background: #2962ff;
    color: #fff;
    border-color: #2962ff;
}

.docs-content-wrapper .docs-copy-url.docs-copied {
    background: #16a34a;
    border-color: #16a34a;
    color: #fff;
}

/* ── Parameter tables ───────────────────────────────────────────── */
.docs-content-wrapper table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 14px;
    font-size: 0.88rem;
    border: 1px solid #e8ecf1;
    border-radius: 8px;
    overflow: hidden;
}

.docs-content-wrapper th {
    background: #f7f8fb;
    color: #5a6070;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: left;
    padding: 10px 14px;
    border: none;
    border-bottom: 1px solid #e8ecf1;
}

.docs-content-wrapper td {
    padding: 10px 14px;
    border: none;
    border-bottom: 1px solid #eef0f4;
    vertical-align: top;
    color: #3a3f4b;
}

.docs-content-wrapper tbody tr:nth-child(even) td {
    background: #fafbfd;
}

.docs-content-wrapper tbody tr:hover td {
    background: #f0f5ff;
}

.docs-content-wrapper tbody tr:last-child td {
    border-bottom: none;
}

.docs-content-wrapper td code {
    font-size: 0.82em;
}

.docs-content-wrapper .parameter-name {
    font-family: 'Cascadia Code', Consolas, monospace;
    font-weight: 600;
    color: #0f1724;
}

.docs-content-wrapper .parameter-name code {
    color: #0b57d0;
    background: #eef4ff;
}

.docs-content-wrapper .param-type {
    font-family: 'Cascadia Code', Consolas, monospace;
    color: #0b57d0;
    font-size: 0.85em;
}

/* ── Callouts ───────────────────────────────────────────────────── */
.docs-content-wrapper .note,
.docs-content-wrapper .info,
.docs-content-wrapper .warning,
.docs-content-wrapper .success,
.docs-content-wrapper .danger {
    border-radius: 8px;
    padding: 12px 16px;
    margin: 0 0 14px;
    font-size: 0.9rem;
    border: 1px solid transparent;
    border-left-width: 4px;
    background: #eef4ff;
    border-color: #cfe0ff;
    border-left-color: #2962ff;
}

.docs-content-wrapper .warning {
    background: #fffbeb;
    border-color: #fde68a;
    border-left-color: #d97706;
}

.docs-content-wrapper .success {
    background: #eefbf3;
    border-color: #bbf7d0;
    border-left-color: #16a34a;
}

.docs-content-wrapper .danger {
    background: #fef2f2;
    border-color: #fecaca;
    border-left-color: #dc2626;
}

/* ── Function blocks (EMSX_GetData / FunctionIds catalogs) ──────── */
.docs-content-wrapper .function-block {
    background: #f7f8fb;
    border: 1px solid #e8ecf1;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 0 0 12px;
}

.docs-content-wrapper .func-title {
    color: #2962ff;
    font-family: 'Cascadia Code', Consolas, monospace;
    font-weight: 700;
    font-size: 0.92rem;
    margin-bottom: 6px;
}

.docs-content-wrapper .meta {
    margin: 3px 0;
    font-size: 0.85rem;
    color: #5a6070;
}

/* ── Misc leftovers from the doc template ───────────────────────── */
.docs-content-wrapper .subheading {
    margin: 1rem 0 0.5rem;
    font-weight: 700;
    color: #0f1724;
}

.docs-content-wrapper .try-it-out {
    display: inline-block;
    float: none;
    background: #2962ff;
    color: #fff;
    font-weight: 600;
    font-size: 0.82rem;
    padding: 5px 14px;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    margin: 0 0 12px;
}

/* ── Responsive: scroll wide tables on small screens ────────────── */
@media (max-width: 768px) {
    .docs-content-wrapper table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .docs-content-wrapper .section {
        padding: 14px 16px;
    }
}
