/* EDI Spec Library (/specs/...): library index and per-transaction spec pages */

.spec-page {
    padding: 2rem 0 3rem;
}

.page-header .container {
    position: relative;
    z-index: 1;
}

.page-header .btn-outline-light {
    border: 1px solid rgba(255, 255, 255, 0.75);
}

.page-header .btn-outline-light:hover {
    color: #4550E6;
}

.spec-page h1 {
    margin: 0.25rem 0 0.75rem;
    font-size: 1.75rem;
    font-weight: 700;
}

.spec-page h2 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-size: 1.375rem;
}

.spec-lead {
    max-width: 960px;
    font-size: 1rem;
}

.spec-breadcrumb {
    margin-bottom: 0.5rem;
    padding: 0;
    font-size: 0.8125rem;
    background-color: transparent;
}

/* ---------- Library index ---------- */
.spec-index-intro {
    max-width: 960px;
}

.spec-section {
    padding-top: 1rem;
    scroll-margin-top: 80px;
}

.spec-filter {
    max-width: 360px;
    margin-bottom: 1rem;
}

.spec-table td {
    vertical-align: middle;
}

.spec-table td:first-child code {
    white-space: nowrap;
}

.spec-versions {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.5rem 1.5rem;
    font-size: 0.875rem;
}

.spec-versions dt {
    font-weight: 600;
    color: #252930;
}

.spec-versions dd {
    margin: 0;
}

.spec-formats {
    margin-bottom: 1rem;
}

.spec-formats > div {
    margin-bottom: 1.5rem;
}

.spec-formats h2 {
    margin-top: 0;
}

.spec-card {
    height: 100%;
    padding: 1.5rem;
    background-color: #fff;
    border: 1px solid #e7e9ed;
    border-radius: 0.75rem;
}

.spec-page .spec-card h2,
.spec-page .spec-card h3 {
    margin: 0 0 0.75rem;
    font-size: 1.0625rem;
}

/* A full-width band between the main content and the FAQ or structure */
.spec-band {
    margin-top: 3rem;
    padding: 3rem 0;
    background-color: #f8f9fc;
    border-top: 1px solid #e7e9ed;
    border-bottom: 1px solid #e7e9ed;
    scroll-margin-top: 80px;
}

.spec-page .spec-band h2 {
    margin-top: 0;
}

.spec-page .spec-band .container > * + h2 {
    margin-top: 1rem;
}

.spec-band .container > :last-child {
    margin-bottom: 0;
}

.spec-uses > div {
    margin-bottom: 1.5rem;
}

.spec-band-main {
    margin-bottom: 1.5rem;
}

.spec-band-main ol {
    margin-bottom: 0;
    padding-left: 1.25rem;
}

.spec-band-main li {
    margin-bottom: 0.5rem;
}

.spec-cta .btn {
    margin: 0 0.5rem 0.5rem 0;
}

.openedi-diagram {
    margin: 2rem 0;
}

.openedi-diagram-scroll {
    overflow-x: auto;
}

.openedi-diagram img {
    display: block;
    width: 100%;
    min-width: 600px;
    height: auto;
}

.openedi-diagram figcaption {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: #747f94;
    text-align: center;
}

.spec-cta .btn-primary {
    color: #fff;
}

.spec-search {
    position: relative;
    text-align: left;
}

.spec-search-results {
    position: absolute;
    z-index: 10;
    left: 0;
    right: 0;
    max-height: 420px;
    margin-top: 0.25rem;
    overflow-y: auto;
    background-color: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.15);
}

.spec-search-results a {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: #252930;
    border-bottom: 1px solid #f1f2f8;
}

.spec-search-results a:hover,
.spec-search-results a:focus {
    text-decoration: none;
    background-color: #f5f6fe;
}

.spec-search-results strong {
    flex: 0 0 auto;
    min-width: 4.5rem;
    color: #4550E6;
}

.spec-search-title {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.spec-search-version {
    flex: 0 0 auto;
    font-size: 0.75rem;
    color: #8392a5;
}

.spec-search-note {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    color: #8392a5;
}

.spec-standard {
    padding: 1.25rem 0;
    border-top: 1px solid #e7e9ed;
    scroll-margin-top: 80px;
}

.spec-standard h3 {
    margin-bottom: 0.25rem;
    font-size: 1.125rem;
}

.spec-standard h3 small {
    margin-left: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 400;
    color: #8392a5;
}

.spec-standard p {
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}

.spec-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 1rem;
    padding: 0;
    list-style: none;
}

.spec-chips a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #4550E6;
    background-color: #f5f6fe;
    border: 1px solid #dee1fc;
    border-radius: 1rem;
}

.spec-chips a:hover,
.spec-chips a.active {
    text-decoration: none;
    color: #fff;
    background-color: #4550E6;
    border-color: #4550E6;
}

.spec-chips a span {
    font-size: 0.6875rem;
    font-weight: 400;
    opacity: 0.75;
}

.spec-note {
    font-size: 0.875rem;
    color: #5d6778;
}

.spec-license {
    margin: 1rem 0;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    color: #5d6778;
    border-left: 3px solid #d3d9e2;
    background: #f7f9fb;
}

.spec-badge {
    padding: 0.1rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: 0.25rem;
}

.spec-badge.page {
    color: #0f6b3d;
    background-color: #dff5e9;
}

.spec-badge.viewer {
    color: #5d6778;
    background-color: #eef0f4;
}

.spec-example {
    max-height: 520px;
    padding: 1rem;
    overflow: auto;
    font-size: 0.8125rem;
    background-color: #f5f6fe;
    border-radius: 0.5rem;
}

.spec-example code {
    padding: 0;
    background: transparent;
}

.spec-links {
    columns: 2;
    max-width: 640px;
}

@media (max-width: 767.98px) {
    .spec-versions {
        grid-template-columns: 1fr;
    }

    .spec-versions dd {
        margin-bottom: 0.75rem;
    }
}

/* ---------- Spec viewer (shared with the EdiNation Spec Builder) ---------- */
.edn-spec-app {
    margin: 1.5rem 0 1rem;
    border: 1px solid #e7e9ed;
    border-radius: 0.75rem;
    overflow: hidden;
}

.edn-spec-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.75rem 1rem 0;
    background-color: #f8f9fc;
    border-bottom: 1px solid #e7e9ed;
}

.edn-spec-toolbar .nav-tabs {
    border-bottom: 0;
}

.edn-spec-toolbar .nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: #5d6778;
    background-color: transparent;
}

.edn-spec-toolbar .nav-link.active {
    color: #4550E6;
    background-color: #fff;
}

.edn-spec-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
}

.edn-spec-actions .btn-primary {
    color: #fff;
}

.edn-spec-status {
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 1rem;
}

.edn-spec-status.standard {
    color: #0f6b3d;
    background-color: #dff5e9;
}

.edn-spec-message {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    border-bottom: 1px solid #e7e9ed;
}

.edn-spec-message.info {
    color: #5d6778;
}

.edn-spec-message.error {
    color: #b42318;
    background-color: #fdeeee;
    white-space: pre-wrap;
}

.edn-spec-editor {
    display: flex;
    min-height: 560px;
}

.edn-spec-tree {
    flex: 1 1 60%;
    max-height: 640px;
    padding: 0.5rem 0;
    overflow: auto;
    border-right: 1px solid #e7e9ed;
}

.edn-spec-side {
    flex: 1 1 40%;
    max-height: 640px;
    padding: 1rem;
    overflow: auto;
}

.edn-tree-list {
    margin: 0;
    padding-left: 1rem;
    list-style: none;
}

.edn-spec-tree > .edn-tree-list {
    padding-left: 0.25rem;
}

.edn-tree-list li {
    margin: 0;
}

.edn-tree-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.15rem 0.5rem;
    font-size: 0.8125rem;
    line-height: 1.5;
    white-space: nowrap;
    cursor: pointer;
    border-radius: 0.25rem;
}

.edn-tree-row:hover {
    background-color: #f1f2f8;
}

.edn-tree-row.selected {
    background-color: #e5e7fd;
}

.edn-tree-toggle {
    flex: 0 0 0.75rem;
    color: #8392a5;
}

.edn-tree-id {
    flex: 0 0 auto;
    min-width: 3.25rem;
    font-family: SFMono-Regular, Menlo, Consolas, monospace;
    font-weight: 600;
    color: #252930;
}

.edn-kind-loop .edn-tree-id {
    color: #4550E6;
}

.edn-kind-group .edn-tree-id {
    color: #8392a5;
}

.edn-kind-element .edn-tree-id,
.edn-kind-codes .edn-tree-id,
.edn-kind-composite .edn-tree-id {
    font-weight: 400;
}

.edn-tree-label {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #5d6778;
}

.edn-tree-badge {
    flex: 0 0 auto;
    padding: 0 0.4rem;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: 0.25rem;
}

.edn-tree-badge.m {
    color: #4550E6;
    background-color: #e5e7fd;
}

.edn-tree-badge.o {
    color: #5d6778;
    background-color: #eef0f4;
}

.edn-props-title {
    margin: 0 0 0.25rem;
    font-family: SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 1rem;
}

.edn-props-title span {
    font-family: Poppins, sans-serif;
    font-weight: 400;
    color: #5d6778;
}

.edn-props-meta,
.edn-props-empty {
    margin-bottom: 0.75rem;
    font-size: 0.8125rem;
    color: #8392a5;
}

.edn-props-list {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.25rem 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.8125rem;
}

.edn-props-list dt {
    font-weight: 600;
    color: #252930;
}

.edn-props-list dd {
    margin: 0;
    color: #5d6778;
}

.edn-props-codes {
    font-family: SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.75rem;
    color: #5d6778;
    word-break: break-word;
}

.edn-spec-pane-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    font-size: 0.8125rem;
}

.edn-spec-pane-bar .btn {
    flex: 0 0 auto;
}

.edn-spec-code {
    height: 560px;
    border-top: 1px solid #e7e9ed;
}

.edn-spec-outline td {
    font-size: 0.8125rem;
}

.edn-spec-outline .edn-spec-loop td {
    font-weight: 600;
    color: #252930;
    background-color: #f8f9fc;
}

/* Generate classes from OpenEDI */
#generate-classes {
    scroll-margin-top: 90px;
}

.edn-codegen {
    margin: 1rem 0 2rem;
    border: 1px solid #e7e9ed;
    border-radius: 0.75rem;
    background-color: #fff;
}

.edn-codegen-langs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e7e9ed;
}

.edn-codegen-langs .btn {
    color: #5d6778;
    background-color: #f5f6fe;
    border-radius: 1rem;
    padding: 0.2rem 0.875rem;
}

.edn-codegen-langs .btn.active,
.edn-codegen-langs .btn:hover {
    color: #fff;
    background-color: #4550E6;
}

.edn-codegen-body {
    padding: 1rem;
}

.edn-codegen-tool {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.edn-codegen-block {
    position: relative;
    margin-bottom: 1rem;
}

.edn-codegen-block pre {
    margin: 0;
    padding: 0.75rem 3rem 0.75rem 1rem;
    background-color: #f8f9fc;
    border: 1px solid #e7e9ed;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    white-space: pre;
    overflow-x: auto;
}

.edn-codegen-block pre code {
    padding: 0;
    background: none;
    color: #252930;
}

.edn-codegen-copy {
    position: absolute;
    top: 0.375rem;
    right: 0.375rem;
}

.edn-codegen-more {
    margin: 0;
    font-size: 0.8125rem;
    color: #8392a5;
}

@media (max-width: 767.98px) {
    .edn-spec-editor {
        flex-direction: column;
    }

    .edn-spec-tree {
        max-height: 420px;
        border-right: 0;
        border-bottom: 1px solid #e7e9ed;
    }
}
