/* Swagger UI 5 (swagger-ui-5/swagger-ui.css) in the look of the former Swagger UI 2 endpoints page */

#swagger-ui-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px 40px;
    box-sizing: border-box;
}
#swagger-ui-container .swagger-ui .wrapper {
    max-width: none;
    padding: 0;
}

.swagger-ui,
.swagger-ui .info .title,
.swagger-ui .opblock-tag,
.swagger-ui .opblock .opblock-summary-description,
.swagger-ui .opblock .opblock-section-header h4,
.swagger-ui .opblock .opblock-section-header > label,
.swagger-ui .opblock-description-wrapper p,
.swagger-ui .opblock-external-docs-wrapper p,
.swagger-ui .opblock-title_normal p,
.swagger-ui .parameter__name,
.swagger-ui .response-col_status,
.swagger-ui .response-col_links,
.swagger-ui table thead tr td,
.swagger-ui table thead tr th,
.swagger-ui .tab li,
.swagger-ui .btn,
.swagger-ui .dialog-ux .modal-ux-header h3,
.swagger-ui .dialog-ux .modal-ux-content h4,
.swagger-ui .dialog-ux .modal-ux-content p,
.swagger-ui .scopes h2,
.swagger-ui .auth-container h4,
.swagger-ui label,
.swagger-ui .markdown p,
.swagger-ui .renderedMarkdown p,
.swagger-ui .model-title,
.swagger-ui section.models h4 {
    font-family: Arial, Helvetica, sans-serif;
    color: #343434;
}

/* header: "Endpoints list:" like before, version badges and base url as the former footer line */
.swagger-ui .info {
    margin: 40px 0 30px;
}
.swagger-ui .info hgroup.main {
    margin: 0;
}
.swagger-ui .info .title {
    font-size: 25px;
    font-weight: 700;
}
.swagger-ui .info .title small {
    display: none;
}
.swagger-ui .info .base-url {
    margin: 10px 0 0;
    padding: 0;
    background: none;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    color: #999;
}
.swagger-ui .info .description:empty,
.swagger-ui .info .description .markdown:empty {
    display: none;
}

/* the Authorize button is in the page navigation; the container stays rendered, it holds the authorization dialog */
.swagger-ui .scheme-container {
    margin: 0;
    padding: 0;
    background: none;
    box-shadow: none;
}
.swagger-ui .scheme-container .schemes > .schemes-server-container,
.swagger-ui .scheme-container .schemes .auth-wrapper > .btn.authorize {
    display: none;
}

/* tags (former resources) */
.swagger-ui .opblock-tag {
    padding: 8px 0;
    font-size: 18.7px;
    font-weight: 700;
    color: #999;
    border-bottom: 1px solid #ddd;
}
.swagger-ui .opblock-tag:hover {
    background: none;
    color: #343434;
}
.swagger-ui .opblock-tag-section.is-open .opblock-tag {
    color: #343434;
}
.swagger-ui .opblock-tag small {
    font-size: 13px;
    font-weight: 400;
    color: #999;
}
.swagger-ui .opblock-tag svg {
    fill: #999;
}

/* operations: square corners and the former method colours */
.swagger-ui .opblock {
    margin: 0 0 6px;
    border-radius: 0;
    box-shadow: none;
}
.swagger-ui .opblock .opblock-summary {
    padding: 0;
}
.swagger-ui .opblock .opblock-summary-method {
    min-width: 70px;
    padding: 9px 0;
    border-radius: 0;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 11px;
    font-weight: 400;
    text-shadow: none;
}
.swagger-ui .opblock .opblock-summary-path,
.swagger-ui .opblock .opblock-summary-path__deprecated {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15.8px;
    font-weight: 400;
    color: #000;
}
.swagger-ui .opblock .opblock-summary-description {
    flex: 1;
    font-size: 13px;
    text-align: right;
}
.swagger-ui .opblock .opblock-summary-path-description-wrapper {
    flex: 1;
    padding: 0 10px;
}
.swagger-ui .opblock .opblock-section-header {
    box-shadow: none;
}

.swagger-ui .opblock.opblock-get { background: #e7f0f7; border-color: #c3d9ec; }
.swagger-ui .opblock.opblock-get .opblock-summary { border-color: #c3d9ec; }
.swagger-ui .opblock.opblock-get .opblock-summary-method { background: #0f6ab4; }
.swagger-ui .opblock.opblock-get .tab-header .tab-item.active h4 span:after { background: #0f6ab4; }

.swagger-ui .opblock.opblock-post { background: #e7f6ec; border-color: #c3e8d1; }
.swagger-ui .opblock.opblock-post .opblock-summary { border-color: #c3e8d1; }
.swagger-ui .opblock.opblock-post .opblock-summary-method { background: #10a54a; }
.swagger-ui .opblock.opblock-post .tab-header .tab-item.active h4 span:after { background: #10a54a; }

.swagger-ui .opblock.opblock-put { background: #f9f2e9; border-color: #f0e0ca; }
.swagger-ui .opblock.opblock-put .opblock-summary { border-color: #f0e0ca; }
.swagger-ui .opblock.opblock-put .opblock-summary-method { background: #c5862b; }
.swagger-ui .opblock.opblock-put .tab-header .tab-item.active h4 span:after { background: #c5862b; }

.swagger-ui .opblock.opblock-patch { background: #fce9e3; border-color: #f5d5c3; }
.swagger-ui .opblock.opblock-patch .opblock-summary { border-color: #f5d5c3; }
.swagger-ui .opblock.opblock-patch .opblock-summary-method { background: #d38042; }
.swagger-ui .opblock.opblock-patch .tab-header .tab-item.active h4 span:after { background: #d38042; }

.swagger-ui .opblock.opblock-delete { background: #f5e8e8; border-color: #e8c6c7; }
.swagger-ui .opblock.opblock-delete .opblock-summary { border-color: #e8c6c7; }
.swagger-ui .opblock.opblock-delete .opblock-summary-method { background: #a41e22; }
.swagger-ui .opblock.opblock-delete .tab-header .tab-item.active h4 span:after { background: #a41e22; }

/* buttons in the brand green of the navigation */
.swagger-ui .btn {
    border-radius: 0;
    box-shadow: none;
}
.swagger-ui .btn.authorize,
.swagger-ui .btn.execute {
    background: #00803f;
    border-color: #00803f;
    color: #fff;
}
.swagger-ui .btn.authorize svg {
    fill: #fff;
}
.swagger-ui .authorization__btn svg {
    fill: #999;
}
.swagger-ui .authorization__btn.locked svg {
    fill: #00803f;
}

/* authorization dialog above the sticky page navigation */
.swagger-ui .dialog-ux {
    z-index: 10000;
}
.swagger-ui .dialog-ux .modal-ux {
    border-radius: 0;
}

/* authorization dialog in the look of the former Swagger UI 2 one (docsAuthPopupPlugin in docsEndpoints.phtml):
   title, intro, plain scope list, Authorize/Close - the OAuth2 technical details stay out.
   Values from the former css/screen.css (.api-popup-dialog-wrapper, .api-popup-scopes, ...) */
.swagger-ui .dialog-ux.docs-auth-dialog {
    overflow-y: auto;
}
.swagger-ui .docs-auth-dialog .backdrop-ux {
    position: fixed;
    background: rgba(128, 128, 128, .2);
}
/* half the window wide, 150px from the top, the page (here the dialog layer) scrolls - no inner scrollbar */
.swagger-ui .dialog-ux.docs-auth-dialog .modal-ux {
    position: absolute;
    top: 150px;
    left: 50%;
    width: 50%;
    min-width: 0;
    max-width: none;
    max-height: none;
    margin: 0 0 40px -25%;
    padding: 20px;
    overflow: visible;
    box-sizing: content-box;
    transform: none;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-shadow: none;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    color: #777;
}
.swagger-ui .docs-auth-dialog .docs-auth-title {
    margin: 0;
    padding: 10px 0;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 24px;
    line-height: 24px;
    font-weight: 400;
    color: #777;
}
.swagger-ui .docs-auth-dialog .docs-auth-intro {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 11.7px;
    line-height: 1.5;
    color: #333;
}
.swagger-ui .docs-auth-dialog .modal-ux-content {
    max-height: none;
    padding: 0;
    overflow: visible;
}
.swagger-ui .docs-auth-dialog .modal-ux-content .scope-def,
.swagger-ui .docs-auth-dialog .auth-container h4,
.swagger-ui .docs-auth-dialog .auth-container h5,
.swagger-ui .docs-auth-dialog .auth-container h4 ~ p,
.swagger-ui .docs-auth-dialog .auth-container h4 ~ .wrapper,
.swagger-ui .docs-auth-dialog .auth-container .scopes h2,
.swagger-ui .docs-auth-dialog .scopes .checkbox .item {
    display: none;
}
.swagger-ui .docs-auth-dialog .auth-container {
    margin: 0;
    padding: 0;
    border: 0;
}
.swagger-ui .docs-auth-dialog .auth-container h6 {
    margin: 10px 0 0;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    color: #00803f;
}
.swagger-ui .docs-auth-dialog .scopes {
    margin: 0;
    padding: 10px 20px;
}
.swagger-ui .docs-auth-dialog .scopes .wrapper {
    padding: 0;
}
.swagger-ui .docs-auth-dialog .scopes .checkbox {
    display: flex;
    align-items: flex-start;
    margin: 0;
    padding: 5px 0;
    line-height: 20px;
}
.swagger-ui .docs-auth-dialog .scopes .checkbox input[type=checkbox] {
    display: inline-block;
    position: relative;
    top: 2px;
    flex: none;
    margin: 3px 3px 3px 4px;
}
.swagger-ui .docs-auth-dialog .scopes .checkbox label {
    display: block;
    margin: 0;
    cursor: pointer;
}
.swagger-ui .docs-auth-dialog .scopes .checkbox p {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 11.7px;
    line-height: 20px;
    font-weight: 400;
    font-style: normal;
    color: #777;
}
/* the former description sat 20px in from the checkbox, a bit left of the scope name
   (swagger-ui.css sets margin: 0 !important on these paragraphs) */
.swagger-ui .docs-auth-dialog .scopes .checkbox p.description {
    position: relative;
    left: -6px;
    padding-left: 0;
    font-style: italic;
}
.swagger-ui .docs-auth-dialog .auth-btn-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 0;
}
/* a line between Authorize and the closing button */
.swagger-ui .docs-auth-dialog .auth-btn-wrapper::after {
    content: "";
    order: 1;
    align-self: stretch;
    border-top: 1px solid #ccc;
}
.swagger-ui .docs-auth-dialog .auth-btn-wrapper .btn.modal-btn {
    order: 0;
    align-items: center;
    height: 30px;
    min-width: 0;
    margin: 0;
    padding: 1px 6px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13.33px;
    font-weight: 400;
    background: #efefef;
    border: 1px solid #767676;
    border-radius: 2px;
    color: #000;
}
.swagger-ui .docs-auth-dialog .auth-btn-wrapper .btn.modal-btn:hover {
    background: #e5e5e5;
}
.swagger-ui .docs-auth-dialog .auth-btn-wrapper .btn.btn-done {
    order: 2;
}

/* phones: operation summary wraps instead of overflowing */
@media (max-width: 767px) {
    #swagger-ui-container {
        padding: 0 16px 40px;
    }
    .swagger-ui .info {
        margin: 24px 0 20px;
    }
    .swagger-ui .opblock .opblock-summary {
        flex-wrap: wrap;
    }
    .swagger-ui .opblock .opblock-summary-path-description-wrapper {
        flex-wrap: wrap;
        flex: 1 1 calc(100% - 140px);
        min-width: 0;
        padding: 6px 10px 6px 0;
    }
    .swagger-ui .opblock .opblock-summary-path {
        flex-shrink: 1;
        max-width: 100%;
        font-size: 14px;
        word-break: break-all;
    }
    .swagger-ui .opblock .opblock-summary-description {
        flex: 1 1 100%;
        text-align: left;
    }
    .swagger-ui .opblock-body .table-container,
    .swagger-ui .opblock-body .responses-inner {
        padding: 10px;
    }
    .swagger-ui .opblock-body .parameters-col_description input,
    .swagger-ui .opblock-body .parameters-col_description select,
    .swagger-ui .opblock-body .parameters-col_description textarea {
        max-width: 100%;
        min-width: 0;
        width: 100%;
    }
    .swagger-ui .dialog-ux .modal-ux {
        width: calc(100% - 32px);
        min-width: 0;
    }
    .swagger-ui .dialog-ux.docs-auth-dialog .modal-ux {
        top: 16px;
        left: 16px;
        width: auto;
        right: 16px;
        margin: 0 0 16px;
    }
}
