/* ─── Base fixes ─────────────────────────────────────────── */
html .rainbow .close {
    color: inherit !important;
    float: none !important;
    font-family: inherit !important;
    font-size: 14px;
    font-weight: normal !important;
    opacity: 1 !important;
    text-shadow: inherit !important;
}

pre { min-height: 80px; }
.language-name { display: none; }

/* ─── Copy button ─────────────────────────────────────────── */
html .clipboard-copy {
    top: 10px;
    background: #EB8008 !important;
    border-radius: 3px;
}
html .clipboard-copy:hover { opacity: 0.85; }

/* ─── Body & layout ───────────────────────────────────────── */
body {
    background: #f0f4f9 !important;
    padding-bottom: 0 !important;
}

.sidebar-boxed ~ main .main-content {
    padding-right: 0 !important;
    padding-left: 0 !important;
}

/* Neutralise Bootstrap .row bleed so all section rows start at the same left edge as .try-it-section */
.main-content .row { margin-left: 0 !important; margin-right: 0 !important; }

.main-content {
    padding: 0 !important;
    font-size: 16px;
    line-height: 27px;
}

.main-content > section {
    padding-bottom: 0 !important;
    border-bottom: 3px solid #e0e7f2;
}

/* ─── Left content sections ───────────────────────────────── */
.leftSection {
    background: #ffffff;
    padding: 50px 80px 50px 80px !important;
    border-right: 1px solid #e0e7f2;
}

/* Compact header bar for collapsible Getting Started sections */
.sec-heading-row {
    background: #ffffff;
    padding: 14px 80px !important;
    border-right: 1px solid #e0e7f2;
}

/* ─── Section headings ────────────────────────────────────── */
h2 {
    color: #1C4084;
    font-weight: 700;
    padding-bottom: 10px;
    border-bottom: 3px solid #EB8008;
    margin-bottom: 20px;
}

/* ─── Promo section headers (Interactive Form, Request…) ──── */
.promo.small-icon.left {
    margin-bottom: 12px;
    margin-top: 10px;
}
.promo.small-icon.left h3 {
    color: #1C4084;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    margin: 0;
}
.promo.small-icon.left .fa {
    color: #EB8008 !important;
    margin-right: 6px;
}

/* ─── Links ───────────────────────────────────────────────── */
a, a:focus { color: #1C4084; }
a:hover { color: #EB8008; text-decoration: underline; }

/* ─── Intro code block (fixed top margin for intro only) ──── */
.codeBlock-intro {
    margin-top: 250px;
    background-color: #272822 !important;
    border-radius: 4px;
    color: #f8f8f2 !important;
}

/* ─── Inline code/xml panels (no top margin) ─────────────── */
.codeBlock-inline {
    margin-top: 0;
    background-color: #272822 !important;
    border: 1px solid #3d3d2f;
    border-radius: 4px;
    color: #f8f8f2 !important;
    text-shadow: none;
}

/* Reset any inherited light-theme colors inside dark panels */
.codeBlock-inline code,
.codeBlock-intro code {
    color: inherit;
    background: transparent !important;
    border: none;
    font-family: Consolas, 'Liberation Mono', Courier, monospace;
}

.xml {
    background-color: #272822 !important;
    text-shadow: none;
    color: #f8f8f2 !important;
}

/* ─── Form panel ──────────────────────────────────────────── */
.form-panel {
    background: #f7f9fc;
    border: 1px solid #ccd6e8;
    border-radius: 6px;
    padding: 18px 12px 8px 12px;
    margin-bottom: 12px;
}

.field-row {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 5px;
}

.field-cell {
    flex: 0 0 50%;
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 4px 8px;
    min-height: 40px;
    box-sizing: border-box;
}

.field-cell label {
    flex: 0 0 auto;
    width: 140px;
    height: 30px;           /* match input height exactly */
    display: flex;
    align-items: center;    /* vertically center text + button within the 30px */
    justify-content: flex-end;
    padding-right: 8px;
    margin: 0 !important;
    font-size: 13px;
    font-weight: 600;
    color: #1C4084;
    white-space: nowrap;
    box-sizing: border-box;
    overflow: hidden;
    cursor: default;
}

/* Lookup icon button inside the label */
.btn-lookup {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    margin-left: 4px;
    padding: 0;
    border: 1px solid #b0bfce;
    border-radius: 3px;
    background: #e8eef7;
    color: #1C4084;
    cursor: pointer;
    font-size: 10px;
    line-height: 1;
    transition: background 0.15s, color 0.15s;
}
.btn-lookup:hover {
    background: #1C4084;
    color: #ffffff;
    border-color: #1C4084;
}

.req-star {
    color: #d32f2f;
    font-weight: 700;
    margin-left: 2px;
    font-size: 13px;
    line-height: 1;
}

.field-cell .form-control {
    flex: 1 1 auto;
    min-width: 0;
    height: 30px !important;
    padding: 4px 8px;
    font-size: 13px;
    border-radius: 4px;
    border: 1px solid #b0bfce;
    background: #ffffff;
    color: #333;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    display: block;
}

.field-cell .form-control:focus {
    border-color: #1C4084;
    outline: none;
    box-shadow: 0 0 0 2px rgba(28, 64, 132, 0.18);
}

.field-cell select.form-control { height: 30px !important; }

/* ─── Complex field groups (Rooms etc.) ───────────────────── */
.complex-fieldset {
    border: 2px solid #ccd6e8;
    border-radius: 6px;
    padding: 10px 14px 8px 14px;
    margin: 6px 0 10px 0;
    background: #eef3fa;
}

.complex-fieldset legend {
    font-size: 13px;
    color: #1C4084;
    font-weight: 700;
    width: auto;
    padding: 0 8px;
    margin-bottom: 4px;
    border: none;
    letter-spacing: 0.4px;
}

/* ─── Generate button ─────────────────────────────────────── */
.generate-row {
    text-align: center;
    padding: 14px 0 8px 0;
}

.btn-generate {
    background: #EB8008;
    border-color: #c96d00;
    color: #ffffff;
    min-width: 220px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.4px;
    border-radius: 4px;
    padding: 8px 28px;
    text-transform: uppercase;
}

.btn-generate:hover,
.btn-generate:focus {
    background: #c96d00;
    border-color: #a85a00;
    color: #ffffff;
}

/* ─── Schema table ────────────────────────────────────────── */
.pp-info {
    padding: 10px 20px;
    border: 1px solid #ccd6e8;
    background-color: #f7f9fc;
    border-radius: 4px;
}

/* Light pre — scoped away from dark panels */
html pre:not(.codeBlock-inline):not(.codeBlock-intro) {
    font-family: Consolas, 'Liberation Mono', Courier, monospace;
    color: #333;
    background: #f7f9fc;
    border-radius: 3px;
    border: 1px solid #dde3ec;
    padding: 20px;
}

html code {
    font-family: Consolas, 'Liberation Mono', Courier, monospace;
    border-radius: 3px;
}

/* ─── Navbar environment badge ────────────────────────────── */
#nav-env-item > a {
    cursor: default !important;
    pointer-events: none;
    background: rgba(235, 128, 8, 0.14) !important;
    color: #EB8008 !important;
    border-radius: 4px;
    font-size: 11px !important;
    font-weight: 700 !important;
    letter-spacing: 0.4px;
    padding: 6px 12px !important;
    margin-top: 8px;
}

/* ─── Sidebar ─────────────────────────────────────────────── */
/* Push sidebar below the sticky header */
.sidebar-boxed { top: 50px !important; height: calc(100vh - 50px) !important; }
/* Make header span full viewport width, covering the sidebar column */
.sidebar-boxed ~ .site-header { padding-left: 0 !important; }

.sidebar-dark {
    background: #0f2248 !important;
}


/* ─── Table styling ───────────────────────────────────────── */
.tableGeneral {
    border-collapse: separate;
    font-size: 14px;
    width: 100%;
    border-radius: 4px;
    border-spacing: 0;
}

.tdStyle {
    box-sizing: border-box;
    position: relative;
    vertical-align: top;
    line-height: 21px;
    white-space: nowrap;
    font-size: 0.929em;
    border-left: 2px solid #ccd6e8;
    padding: 10px 10px 10px 0;
}

.varName { color: #1C4084; font-family: "Courier New", monospace; margin-right: 10px; }
.varType { color: #6c8cbf; font-size: 13px; }
.requiredField { color: #EB8008; font-size: 0.85em; font-weight: 600; margin-left: 16px; }
.varAsBlock {
    font-size: 12px;
    background: rgba(28, 64, 132, 0.06);
    color: #1C4084;
    border: 1px solid rgba(28, 64, 132, 0.15);
    border-radius: 2px;
    padding: 0 5px;
    margin: 0 3px;
    font-family: "Courier New", monospace;
}
.restriction-code {
    font-size: 12px;
    background: rgba(235, 128, 8, 0.07);
    color: #a05c00;
    border: 1px solid rgba(235, 128, 8, 0.2);
    border-radius: 2px;
    padding: 0 5px;
    margin: 0 3px;
}

/* ─── Schema parameter table ──────────────────────────────── */
.schema-table-wrap { overflow-x: auto; margin-bottom: 4px; }
.schema-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-bottom: 16px;
}
.schema-table thead th {
    background: #1C4084;
    color: #fff;
    padding: 9px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    white-space: nowrap;
}
.schema-table tbody td {
    padding: 7px 12px;
    border-bottom: 1px solid #e0e7f2;
    vertical-align: top;
    line-height: 1.55;
}
.schema-table tbody tr:hover td { background: #f4f7fc; }

.param-name {
    font-family: "Courier New", monospace;
    font-weight: 700;
    color: #1C4084;
    font-size: 12px;
}
.tree-arrow { color: #9db5d5; margin-right: 2px; font-style: normal; }

.type-badge {
    display: inline-block;
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 3px;
    font-family: "Courier New", monospace;
    font-weight: 700;
    white-space: nowrap;
}
.array-mark { font-size: 10px; color: #6c8cbf; margin-left: 2px; font-family: monospace; }
.type-string  { background: #e8f0fe; color: #1a56a0; }
.type-date    { background: #e6f4ea; color: #1a6830; }
.type-boolean { background: #fff3e0; color: #b94900; }
.type-number  { background: #f3e5f5; color: #7b1fa2; }
.type-enum    { background: #fff8e1; color: #b45f00; }
.type-other   { background: #eceff1; color: #546e7a; }

.badge-req {
    display: inline-block;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 3px;
    background: rgba(235, 128, 8, 0.1);
    color: #b85c00;
    border: 1px solid rgba(235, 128, 8, 0.3);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.badge-opt {
    display: inline-block;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 3px;
    background: #f0f4f8;
    color: #607d8b;
    border: 1px solid #ccd6e8;
}
.badge-attr {
    display: inline-block;
    font-size: 10px;
    padding: 0 4px;
    border-radius: 2px;
    background: #e8eaf6;
    color: #3949ab;
    border: 1px solid rgba(57, 73, 171, 0.2);
    margin-left: 3px;
}
.enum-code {
    background: #fff8e1;
    color: #7d5a00;
    font-family: "Courier New", monospace;
    font-size: 11px;
    border: 1px solid rgba(235, 128, 8, 0.2);
    border-radius: 2px;
    padding: 0 4px;
}
.val-code {
    background: rgba(28, 64, 132, 0.06);
    color: #1C4084;
    font-family: "Courier New", monospace;
    font-size: 11px;
    border: 1px solid rgba(28, 64, 132, 0.15);
    border-radius: 2px;
    padding: 0 4px;
}
.constraint-comment { color: #546e7a; font-size: 12px; font-style: italic; }
.no-constraint { color: #bbb; }
.loading-msg { color: #9db5d5; font-style: italic; font-size: 13px; }
.constraints-cell { max-width: 340px; }

/* ─── XSD download links ──────────────────────────────────── */
.xsd-links { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 10px; }
.xsd-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #1C4084;
    background: #eef3fa;
    border: 1px solid #ccd6e8;
    border-radius: 4px;
    padding: 6px 14px;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.xsd-link:hover { background: #EB8008; border-color: #c96d00; color: #fff; text-decoration: none; }
.xsd-link .fa { font-size: 12px; }

/* ─── Service endpoint line ───────────────────────────────── */
.svc-endpoint { font-size: 13px; margin-top: -6px; color: #546e7a; }
.endpoint-url {
    font-family: "Courier New", monospace;
    font-size: 12px;
    word-break: break-all;
}

/* ─── Right panel — generic (kept for any non-try-it uses) ─── */
.right-panel {
    background: #272822;
    padding: 0 20px 24px 20px;
}
.right-panel h3 { color: #a8b8cc !important; }
.right-panel .fa { color: #EB8008 !important; }
.right-panel pre.codeBlock-inline.rp-pre {
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    border: none;
    min-height: 220px;
    overflow: auto;
    padding: 15px;
}

/* ─── Try-it section: pure flexbox, no Bootstrap cols ──────── */
.try-it-section {
    display: flex;
    align-items: stretch;
    width: 100%;
    padding-top: 20px;
    padding-right: 80px;
    box-sizing: border-box;
    background: #ffffff;
}

.try-it-form-col {
    flex: 7 1 0%;
    min-width: 0;
    background: #ffffff;
    padding: 0 60px 28px;
    border-right: 1px solid #e0e7f2;
    box-sizing: border-box;
}
.try-it-form-col .promo.small-icon.left { margin-top: 0 !important; }

.try-it-code-col {
    flex: 5 1 0%;
    min-width: 0;
    background: #272822;
    padding: 0 20px 28px;
    box-sizing: border-box;
}
.try-it-code-col .promo.small-icon.left { margin-top: 0 !important; }
.try-it-code-col h3 { color: #a8b8cc !important; }
.try-it-code-col .fa { color: #EB8008 !important; }
.try-it-code-col pre.codeBlock-inline.rp-pre {
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    border: none;
    min-height: 220px;
    overflow: auto;
    padding: 15px;
}

/* ─── Collapsible schema accordion ───────────────────────── */
.schema-accordion {
    border: 1px solid #d4dff0;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 16px;
}
.schema-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: #eef3fa;
    border: none;
    border-bottom: 1px solid #d4dff0;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #1C4084;
    text-align: left;
    transition: background 0.15s;
    outline: none;
}
.schema-toggle-btn:hover { background: #dce8f6; }
.schema-toggle-btn.is-open { background: #dce8f6; border-bottom-color: #b8ccec; }
.schema-toggle-left { display: flex; align-items: center; gap: 8px; }
.schema-toggle-count {
    font-size: 11px;
    font-weight: 400;
    color: #6c8cbf;
    margin-left: 4px;
}
.schema-chevron {
    font-size: 11px;
    color: #6c8cbf;
    transition: transform 0.2s ease;
    display: inline-block;
}
.schema-toggle-btn.is-open .schema-chevron { transform: rotate(180deg); }
.schema-body { display: none; }
.schema-body .schema-table-wrap { margin-bottom: 0; }
.schema-body .schema-table { margin-bottom: 0; }

/* ─── Response wrap ───────────────────────────────────────── */
.resp-wrap {
    background: #fff;
    padding: 20px 80px 28px 80px;
    border-top: 1px solid #e0e7f2;
}

/* ─── Responsive breakpoints ──────────────────────────────── */
@media (max-width: 1199px) {
    .leftSection        { padding: 36px 44px !important; }
    .sec-heading-row    { padding: 12px 44px !important; }
    .try-it-section     { padding-right: 44px; }
    .try-it-form-col    { padding: 0 44px 24px; }
    .resp-wrap          { padding: 20px 44px; }
}

@media (max-width: 991px) {
    .leftSection        { padding: 24px 24px !important; }
    .sec-heading-row    { padding: 10px 24px !important; }
    .resp-wrap          { padding: 20px 24px; }
    .codeBlock-intro    { margin-top: 20px; }
    .right-panel        { padding: 0 16px 20px 16px; }
    .constraints-cell   { max-width: none; }

    /* Stack try-it section vertically on tablet */
    .try-it-section     { flex-direction: column; padding-top: 16px; padding-right: 24px; }
    .try-it-form-col    { flex: 0 0 100%; padding: 0 24px 24px; border-right: none; border-bottom: 1px solid #3d3d2f; }
    .try-it-code-col    { flex: 0 0 100%; padding: 0 16px 24px; }
}

@media (max-width: 767px) {
    .leftSection        { padding: 16px 14px !important; }
    .sec-heading-row    { padding: 8px 14px !important; }
    .resp-wrap          { padding: 14px 14px; }
    .try-it-section     { padding-top: 12px; padding-right: 14px; }
    .try-it-form-col    { padding: 0 14px 16px; }
    .try-it-code-col    { padding: 0 12px 16px; }
    /* Each field takes full row width on narrow screens */
    .field-cell         { flex: 0 0 100%; }
    .field-cell label   { width: 120px; }
    .right-panel        { padding: 0 12px 16px 12px; }
    .schema-table thead th,
    .schema-table tbody td { padding: 6px 8px; }
    /* Prevent horizontal overflow */
    pre, .codeBlock-inline { max-width: 100%; overflow-x: auto; }
}

/* ─── Professional refinements ──────────────────────────────── */
.site-header { box-shadow: 0 2px 8px rgba(0,0,0,0.18); position: sticky; top: 0; z-index: 1000; }
.navbar-default { margin-bottom: 0; border-radius: 0; border: none; border-bottom: 3px solid #EB8008 !important; }
.navbar-default .navbar-nav > li > a { color: rgba(255,255,255,0.85); font-size: 13px; font-weight: 500; letter-spacing: 0.3px; padding: 14px 18px; transition: color 0.15s, background 0.15s; }
.navbar-default .navbar-nav > li > a:hover, .navbar-default .navbar-nav > li.active > a { color: #fff; background: rgba(255,255,255,0.1); }
.navbar-default .navbar-brand { padding: 8px 15px 8px 20px; }
.navbar-default .navbar-brand img { max-height: 44px; height: auto; max-width: 180px; object-fit: contain; }
.sidebar-dark .sidebar-brand { display: none; }
.sidebar-brand img { max-height: 44px; height: auto; max-width: 150px; object-fit: contain; }

/* ─── Sidebar scrollbar ──────────────────────────────────── */
.sidebar { scrollbar-width: thin; scrollbar-color: #2a5298 #0f2248; }
.sidebar::-webkit-scrollbar { width: 5px; }
.sidebar::-webkit-scrollbar-track { background: #0f2248; }
.sidebar::-webkit-scrollbar-thumb { background: #2a5298; border-radius: 3px; }
h2 { font-size: 22px; letter-spacing: -0.2px; scroll-margin-top: 70px; }

/* ─── Collapsible content sections ──────────────────────── */
.sec-toggle { cursor: pointer; user-select: none; display: flex; align-items: center; gap: 10px; }
.sec-toggle:hover { color: #1C4084; }
.sec-toggle-icon { font-size: 13px; color: #EB8008; transition: transform 0.25s ease; flex-shrink: 0; }
.sec-toggle[aria-expanded="true"] .sec-toggle-icon { transform: rotate(90deg); }
.schema-table thead th { font-size: 10.5px; letter-spacing: 0.8px; }
.form-panel { box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.btn-generate { letter-spacing: 0.8px; box-shadow: 0 2px 4px rgba(235,128,8,0.25); transition: all 0.15s; }
.btn-generate:hover { box-shadow: 0 4px 8px rgba(235,128,8,0.35); transform: translateY(-1px); }
.resp-wrap { box-shadow: 0 -1px 0 #e0e7f2; }
section { transition: none; }

/* ─── Boolean flags row (3-col inside optional group) ──────── */
.bool-flags-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px 0; margin: 0; }
.bool-flags-grid .field-cell { flex: unset; padding: 3px 8px; }
.bool-flags-grid .field-cell label { min-width: 100px; font-size: 12px; }
.optional-group-toggle { background: none; border: none; color: #1C4084; font-size: 12px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; padding: 8px 0 4px 0; cursor: pointer; display: flex; align-items: center; gap: 6px; width: 100%; text-align: left; }
.optional-group-toggle .fa { color: #EB8008; font-size: 11px; transition: transform 0.2s; }
.optional-group-toggle.is-open .fa { transform: rotate(90deg); }
.optional-group-body { display: none; }
.optional-group-body.is-open { display: block; }
