// AutoUpdateFileChromatic
@use "uswds-core" as *;
@use "uswds_custom_theme" as *;
@use "alternate" as *;

// USWDS identifier

.prime-identifier {
    background-color: #f0f0f0;
    color: #1b1b1b;
}

.prime-identifier .prime-identifier__domain {
    color: #565c65;
}

.prime-identifier .prime-identifier__disclaimer a:link,
.prime-identifier .prime-identifier__disclaimer a:visited,
.prime-identifier .prime-identifier__disclaimer a:active {
    color: #1b1b1b;
}

.prime-identifier .prime-identifier__disclaimer a:hover {
    color: #71767a;
}

// Link visited color overrides
.rs-header-mark:visited {
    color: #1b1b1b;
}
.usa-link .usa-link:visited {
    .usa-button {
        color: white;
    }
    .usa-button .usa-button--outline {
        color: inherit;
    }
}

.prime-user-account {
    font-size: 0.88rem;
    vertical-align: middle;
    line-height: 1.25rem;
}

// RS HERO - INDEX PAGES

.rs-hero__index {
    border-bottom: 1px solid color("base-lighter");
    padding-top: units(3);
    padding-bottom: units(4);
    margin-bottom: units(6);

    h1,
    h2 {
        margin-top: 0;
        margin-bottom: 0;
        padding: 0;
    }

    h2 {
        color: color("gray-cool-50");
        font-size: size("sans", "xl");
    }

    .heading-alt {
        font-size: size("sans", "xl");
        @include u-text("bold");
        margin-top: 0;
        margin-bottom: 0;
        padding: 0;

        span {
            color: color("gray-cool-50");
        }
    }
}

@media (max-width: $tablet) {
    .rs-hero__index {
        padding-top: 0;

        h1,
        h2 {
            line-height: line-height("heading", 2);
        }
    }
}

// Tables

.prime-table {
    width: 100%;
}

.prime-table thead th {
    border-bottom: 2px solid;
}

.prime-table tbody td,
.prime-table tbody th {
    border-color: #dfe1e2;
}

h3 img[src*="svg"] {
    vertical-align: text-top;
    margin-right: 5px;
    float: left;
}

/// actions
.rb-container {
    margin: auto;
    display: block;
    position: relative;
}

.rb-container ul.rb {
    margin: 0 0;
    padding: 0;
    display: inline-block;
}

.rb-container ul.rb li {
    list-style: none;
    margin: auto;
    min-height: 50px;
    border-left: 1px dashed #000;
    padding: 0 0 20px 30px;
    position: relative;
}

.rb-container ul.rb li:last-child {
    border-left: 0;
}

.rb-container ul.rb li::before {
    position: absolute;
    left: -10px;
    content: " ";
    border: 8px solid rgba(0, 0, 0, 1);
    border-radius: 500%;
    background: #000000;
    height: 20px;
    width: 20px;
}

ul.rb li .timestamp {
    position: relative;
    font-weight: bold;
}

// Page styles
// Content pages for documentation, support, etc

.rs-documentation {
    h1,
    h2,
    h3,
    h4,
    h5,
    h6,
    p,
    ul,
    ol,
    .usa-alert,
    blockquote {
        @include u-measure(6);
    }

    h1 {
        margin: 0;
    }

    h2 {
        font-size: size("sans", "lg");
        @include u-text("normal");
        color: color("base");
    }

    section {
        border-top: 1px solid color("base-lighter");
        margin-top: units(4);
        padding-top: units(3);
    }

    h3 {
        margin-top: 0;
        font-size: size("sans", "lg");
    }

    blockquote {
        background-color: color("base-lightest");
        padding: units(1) units(3);
        margin: units(3) 0 units(3) 0;
        width: inherit;
    }
}

.rs-documentation__values {
    code {
        display: inline-block;
        padding-left: units(1);
        padding-right: units(1);
        border-radius: 2px;
        @include u-bg("gray-5");
        @include u-text("gray-90");
    }

    .value-list {
        list-style: none;
        margin: 0;
        padding: 0;

        li {
            margin: 0 0 units(1) 0;
        }
    }
}

.rs-blockquote__documentation {
    @include u-bg("base-lightest");
    @include u-padding-x(3);
    @include u-padding-y(1);
    @include u-margin(0);
}

.rs-process-list__documentation {
    img {
        display: block;
        max-width: 15rem;
        @include u-border(1px, "base-lighter");
        margin-top: units(4);
    }
}

// Where we're live

.rs-livestate-two-column {
    list-style: unset;
    overflow: hidden;
    column-count: 2;
    column-gap: 1.25em;
}

.rs-livestate-two-column > * {
    list-style: unset;
    display: inline-block;
    width: 80%;
    padding-bottom: 0.5em;
}

// Forms

/* tweak toaster notifications - other variables can be found by search node_modules for `--toastify-toast-width`  */
:root {
    --toastify-toast-width: 600px;
    --rs-compare-modal-width: 87em;
    --rs-compare-modal-height: 45em;
    --rs-zindex-top: 999;
}

.rs-spinner {
    display: inline-flex;
    align-items: center;
    justify-content: left;

    .rs-spinner-fullpage {
        justify-content: center;
        height: calc(100vh - 230px);
    }

    .rs-spinner-tiny {
        zoom: 0.2;
        display: inline-flex;
        align-content: center;
    }
}

.usa-modal-wrapper {
    &.is-visible {
        z-index: var(--rs-zindex-top); // default is 99999, want toast over top.
    }
}

.rs-compare-modal {
    max-width: calc(var(--rs-compare-modal-width));
    height: var(--rs-compare-modal-height + 12em);
    .usa-modal__main {
        width: 100%;
        max-width: 90em;
        padding: 0;
    }
    .usa-modal__content {
        padding: 1em;
    }
    .usa-modal__heading {
        margin: 0;
    }
    .usa-modal__close {
        margin: 0;
        position: absolute;
        top: 0;
    }
}

.rs-editable-compare-container {
    max-width: calc(var(--rs-compare-modal-width) - 2em);
    height: calc(var(--rs-compare-modal-height) - 12em);
    display: flex;
    position: relative;
}

/* both left and right sides need to look the same */
.rs-editable-compare-base {
    width: 100%;
    height: calc(var(--rs-compare-modal-height) - 14em);
    overflow: auto;
    margin: 0.5em;
    line-height: 1.5em;
    white-space: pre-wrap;
    tab-size: 2;
    font-family: monospace;
    font-size: 105%;
    color: black;
    background-color: rgba(0, 0, 0, 0); /* show the highlight behind it */
}

/* just the right side (has two child divs overlapping aligned) */
.rs-editable-stacked-container {
    display: grid; /* positioning the background and edit on top of each other */
    grid-template-areas: "inner-div";
    place-items: center;
    width: 50%;
    -webkit-text-size-adjust: none;
}

.rs-editable-compare-background {
    grid-area: inner-div;
    color: transparent; /* hide font we only want background colors */
    border: 2px rgba(0, 0, 0, 0) solid; /* takes up same exact same space, just invisible */

    // enable these to debug alignment.
    // color: rgba(255,0,0,0.5); /* hide font we only want background colors */
    // border: 2px rgba(255,0,0,0.5) solid;    /* takes up same exact same space, just invisible */
    width: 100%;
    z-index: 2;
    pointer-events: none;
    mark,
    s {
        color: transparent;
    }
}

.differ-marks {
    mark {
        border-radius: 3px;
        background-color: rgba(
            255,
            200,
            0,
            0.25
        ); /* transparent allows nested tags to be darker */
    }
    /* the `<s>` tag is used for errors, technically it's strikethrough but shouldn't used for that.
       alternate could be `<var>`?  `<del>` and `<ins>` have paragraph issues
     */
    s {
        text-decoration: none; /* not required, but adding makes it clear we're not using strikethrough */
        border-radius: 3px;
        background-color: rgba(
            255,
            0,
            0,
            0.25
        ); /* transparent allows nested tags to be darker */
    }
}

/* just the left side */
.rs-editable-compare-static {
    grid-area: inner-div;
    border: 2px #8d8d8dff solid;
    width: 100%;
    z-index: 3;
}

.rs-editable-compare-edit {
    grid-area: inner-div;
    border: 2px #0087ff solid;
    width: 100%;
    z-index: 3;
}

.rs-alert-toast {
    z-index: var(--rs-zindex-top + 1);
}

.rs-resend-modal {
    max-width: 80vw;
    max-height: 50em;
    height: 90vh;
    overflow-y: auto;

    .usa-modal__main {
        max-width: revert;
        padding: 2.25em 0.5em 1.25em 0.5em;
    }
    .usa-modal__content {
        padding: 2.5em;
    }
    .usa-modal__heading {
        font-weight: bold;
        font-size: larger;
        color: color("base-darker");
    }
    .usa-modal__close {
        margin: 0;
        position: absolute;
        top: 0;
    }
    .rs-resend-textarea {
        height: 14em;
        overflow-y: scroll;
    }
    .rs-resend-textarea-2x {
        height: 28em;
        overflow-y: scroll;
    }
    .rs-resend-textarea-boarder {
        border: color("base-dark") 1px solid;
    }
    .rs-resend-label {
        font-weight: bolder;
    }
}

.rs-resendmarker {
    font-size: large;
    cursor: default;
}

// combined from parts from /node_modules/@fortawesome/fontawesome-svg-core/styles.css
.rs-fa-right-left-icon {
    color: #005ea2;
    overflow: visible !important;
    zoom: 0.5;
}

.rs-input {
    word-break: break-all;
    max-width: 100vw;
}

.rs-full-width-form {
    max-width: 100%;
    .usa-file-input {
        max-width: 100%;
    }

    label {
        max-width: 100%;
    }
}

.rs-wordbreak-force {
    word-break: break-word;
    overflow-wrap: break-word;
}

.fixed-tooltip {
    background: transparent;
    color: #005ea2;
    font-size: large;
    padding: 0;
}

.fixed-tooltip:hover {
    background: transparent;
    color: #005ea2;
}

.flex-justify-between {
    justify-content: space-between;
}

.rs-sortable-header:hover {
    cursor: pointer;
}

pre {
    background: rgba(201, 201, 201, 0.47);
    color: black;
    white-space: pre-wrap;
    padding: 1.33rem;
    border-radius: 1rem;
}

.rs-pagination-no-button {
    @include u-bg("white");
    cursor: pointer;
}

.rs-pagination-arrow-button {
    align-items: center;
    display: inline-flex;
}

/* used by the receiver dashboard
    SEE diagrams in AdminRecieverDashboard to understand layout */
.rs-admindash-component {
    display: contents;
    border-bottom: #5d5d52 1px solid;

    .perreceiver-row {
        flex-wrap: nowrap;
        width: 100%;
        border-top: #5d5d52 1px solid;
        padding-top: 2px;

        .title-column {
            width: 12em;
            min-width: 12em;
            height: 5em;
            overflow: hidden;

            .title-text {
                flex-wrap: nowrap;
                text-overflow: ellipsis;
                font-weight: bolder;
                font-size: small;
                line-height: 150%;
                min-height: 4.5em;
                background-color: white;
                margin: 0.25em;
                padding: 0.5em;
            }
        }

        .week-column {
            flex-wrap: nowrap;
            padding-left: 3px;
            padding-right: 3px;

            .perday-component {
                width: 8em;
                height: 5em;
                flex-wrap: nowrap;
                padding-left: 0.25em;
                padding-right: 0;
                overflow: hidden;

                .title-row {
                    flex-wrap: nowrap;
                    font-size: smaller;
                    font-weight: bold;
                    background-color: white;
                    margin: 6px;
                }

                .slices-row {
                    display: grid;
                    height: 3em;

                    .slice {
                        border-radius: 0.5em;
                        border: solid 0.05em #2f2f2f;
                        cursor: pointer; /* success-undefined removes */
                    }
                }

                .slices-row-12 {
                    /** https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-columns **/
                    grid-template-columns: repeat(13, 7.4%);
                }

                .slices-row-4 {
                    grid-template-columns: repeat(4, 24%);
                }
            }
        }

        .horizontal-scroll {
            scroll-margin: 0;
            overflow-x: scroll; // auto;
            overflow-y: clip;
            width: 100%;
        }

        .success-undefined {
            background-color: rgb(190, 190, 190);
            cursor: default !important;
        }

        .success-all {
            /* color bind friendly */
            background-color: var(--toastify-color-success);
        }

        .failure-all {
            background-color: var(--toastify-color-error);
        }

        .success-mixed {
            background: repeating-linear-gradient(
                45deg,
                #ffffff,
                var(--toastify-color-success) 10px,
                #ffffff 10px,
                var(--toastify-color-error) 30px
            );
        }

        .success-result-hidden {
            opacity: 30%;
        }
    }

    /* this is added to slice cells when an error search is done and a cell doesn't match */
    .is-hidden {
        display: none;
        cursor: none;
    }
}

.rs-admindash-modal {
    /* these are based on the width and height available */
    max-width: 90vw;
    height: 90vh;
    overflow-y: auto;

    .usa-modal__main {
        width: 100%;
        max-width: 90vw;
        padding: 0;
    }

    .rs-admindash-modal-container {
        .modal-info-title {
            font-size: larger;
            font-weight: bolder;
            background-color: #2e2e2e;
            color: white;
            padding: 7px;
        }

        .modal-info-title-resend {
            background-color: var(--toastify-color-success);
        }

        .modal-info-row {
            flex-wrap: nowrap;
        }

        .modal-info-label {
            width: 25em;
            font-weight: bolder;
            color: #2e2e2e;
            text-align: right;
            padding: 0.2em;
        }

        .modal-info-value {
            width: 120em;
            padding: 0.2em;
        }

        .success-all {
            color: var(--toastify-color-success);
        }

        .failure-all {
            color: var(--toastify-color-error);
        }
    }
}

.rs-admindash-warn-font {
    color: var(--toastify-color-error);
    font-weight: bold;
}

/* for dashboards, unbounded width is a nice feature */
.rs-container-unbounded {
    max-width: fit-content !important;
}

.rs-maxwidth-vw80 {
    max-width: 80vw;
}

.rs-no-padding {
    padding: 0;
}

.rs-mono-font {
    font-family: monospace;
}

.rs-cursor-arrow {
    cursor: pointer;
}

.rs-revision-history {
    width: max-content;
    min-width: 60vw;
    .rs-static-compare-base {
        @extend .rs-editable-compare-base;
        margin: 0;
        height: calc(var(--rs-compare-modal-height) - 11em);
    }
    .rs-list-diffs-container {
        height: 25em;
        color: white;
        .rs-accord-list-row {
            .rs-accord {
                overflow-x: hidden;
            }

            .rs-list-diffs-items {
                width: 50%;
                height: 25em;
                overflow-y: scroll;
                overflow-x: clip;
                border-width: 1px;
                border-style: solid;
                border-color: #005ea2;

                .rs-accord-row-selected {
                    background-color: #005ea2;
                    color: white;
                    font-weight: bolder;
                }
            }

            /** controlled by the headingLevel prop **/
            h5 {
                font-size: 0.8em;
            }
        }
    }
}

.rs-table-column-minwidth {
    min-width: 12rem;
}

.rs-width-100 {
    width: 100%;
}

.rs-max-width-100-important {
    max-width: 100% !important;
}

.rs-margin-top-auto-important {
    margin-top: auto !important;
}

/**
 * Allows automatic counter numbers in process-list style
 */
@mixin numbered($counter) {
    &::before {
        @include u-flex("row", "align-center", "justify-center");
        $half-of-font-size: -0.4rem;
        @include u-circle($theme-process-list-counter-size);
        background-color: color($theme-process-list-counter-background-color);
        border: units($theme-process-list-counter-border-width) solid
            color($theme-process-list-counter-border-color);
        box-shadow: 0 0 0 units($theme-process-list-counter-gap-width)
            color($theme-process-list-counter-gap-color);
        color: color($theme-process-list-counter-text-color);
        content: counter($counter, decimal);
        counter-increment: $counter;
        display: inline-flex;
        font-family: family($theme-process-list-counter-font-family);
        font-size: size(
            $theme-process-list-counter-font-family,
            $theme-process-list-counter-font-size
        );
        font-weight: font-weight("bold");
        height: units($theme-process-list-counter-size);
        line-height: lh($theme-process-list-counter-font-family, 1);
        width: units($theme-process-list-counter-size);
        margin: $half-of-font-size 18px 0 0;
    }
}

html {
    counter-reset: h2;
}

h2.rs-numbered {
    @include numbered(h2);
}

.faq-wrapper {
    .heading {
        h3 {
            padding-bottom: 20px;
            color: #71767a;
            font-weight: 500;
        }
    }

    section {
        margin-top: 30px;
        border-top: 1px solid #dfe1e2;
    }

    h3 {
        font-size: 22px;
    }

    h4 {
        margin-top: 40px;
    }
}

main {
    @include u-display("flex");
    @include u-flex("justify");
    @include u-flex("align-start");
    @include grid-container;
}

.rs-style {
    /*
    * CMS-type pages use a smaller default width
    */
    &--content {
        main,
        .grid-container {
            @include grid-container("desktop-lg");
        }

        main {
            // Smaller font for content alerts
            .usa-alert {
                @include u-font-size("sans", "xs");
            }
        }
    }

    /*
    * Full-width pages currently designed to be flush between the
    * viewport and page's header/main/footer grid
    */
    &--full-width {
        main {
            @include grid-container("full");
            @include u-padding(0);
            @include grid-gap(0);

            /*
            * Make flush across all screen sizes
            */
            @media screen and (min-width: 0) {
                & {
                    @include u-padding(0, !important);
                }
            }

            // Undo specific subtitle coloring
            .rs-subtitle {
                color: unset;
            }
        }

        #site-header {
            margin-bottom: unset;
        }
    }
}

.rs-subtitle,
.usa-prose .rs-subtitle {
    @include u-font("sans", "lg");
    @include u-color("base");
    @include u-margin-top(4);
    @include u-margin-bottom(0);

    & + * {
        @include u-margin-top(8);
    }
}

.rs-bg-grid {
    background-image: url("/assets/img/home/grid.png");
    background-size: contain;
    background-position: right center;
    background-repeat: no-repeat;

    @media (max-width: $tablet) {
        background-image: none;
    }
}

.rs-back-to-top {
    display: block;
}

.rs-text-align-center {
    text-align: center;
}

.rs-column-3 {
    > ul,
    > ol {
        column-count: 3;
    }
}
