:global {

    :root {
        --give-primary-color: #86b785;
    }

    .post-type-give_forms #wpbody {
        -webkit-font-smoothing: antialiased;
        box-sizing: border-box;

        & > a {
            text-decoration: underline;
        }
    }

    .post-type-give_forms #wpbody-content {
        box-sizing: border-box;
    }

    .post-type-give_forms #wpbody::after {
        all: revert;
    }

    .give-visually-hidden {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border-width: 0;
    }

    #wpcontent {
        padding: 0;
    }
}

.page {
    background-color: var(--givewp-neutral-25);
    box-sizing: border-box;
    color: var(--givewp-neutral-900);
    display: flex;
    flex-direction: column;
    font-family: Inter, system-ui, sans-serif;
    font-size: 1rem;
    gap: var(--givewp-spacing-4);

    *,
    ::before,
    ::after {
        box-sizing: inherit;
    }
}

.pageHeader {
    align-items: center;
    background-color: var(--givewp-shades-white);
    border-bottom: 1px solid var(--givewp-neutral-100);
    display: flex;
    flex-wrap: wrap;
    gap: var(--givewp-spacing-4);
    justify-content: space-between;
    padding: var(--givewp-spacing-7) var(--givewp-spacing-6);
    position: sticky;
    top: 2rem;
    z-index: 1000;

    & > * {
        flex-shrink: 0;
    }

    + :global(.wp-header-end) + :global(.give-notice) {
        margin: 0 var(--givewp-spacing-6);
    }

    .testModeBadge {
        align-items: center;
        background: var(--givewp-orange-400);
        border-radius: var(--givewp-rounded-full);
        border: 1px solid var(--statusBadgeBorderColor);
        color: var(--givewp-shades-white);
        display: flex;
        font-size: 0.75rem;
        font-weight: 600;
        gap: var(--givewp-spacing-1);
        justify-content: center;
        padding: var(--givewp-spacing-1) var(--givewp-spacing-3);
        text-align: center;
        text-transform: uppercase;
    }
}

.pageHeader,
.pageContent {
    .primaryActionButton,
    .secondaryActionButton {
        display: flex;
        align-items: center;
        border-radius: var(--givewp-rounded-4);
        font-size: 0.875rem;
        font-weight: 500;
        line-height: 1.43;
        text-align: center;
        padding: var(--givewp-spacing-2) var(--givewp-spacing-4);

        svg {
            margin: 3px 0 0 8px !important;
        }
    }

    .secondaryActionButton {
        color: var(--givewp-neutral-900);
        background-color: var(--givewp-neutral-100);
        border-color: var(--givewp-neutral-100);

        &:hover {
            background-color: var(--givewp-neutral-200);
            border-color: var(--givewp-neutral-200);
            color: var(--givewp-neutral-900);
        }
    }
}

.searchContainer {
    display: flex;
    gap: var(--givewp-spacing-2);
}

.filtersRow {
    align-items: center;
    background-color: var(--givewp-neutral-50);
    display: flex;
    height: 3.25rem;
    justify-content: space-between;
    margin-inline: var(--givewp-spacing-6);
    padding: var(--givewp-spacing-2) {
        left: var(--givewp-spacing-6);
    }
}

.flexRow {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--givewp-spacing-2);
    flex-wrap: wrap;
}

.flexRow:not(:first-child) {
    flex: 1;
    justify-content: flex-end;
}

ul[role='document'] + .flexRow,
ul[role='document'] + .flexRow + .flexRow {
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    gap: var(--givewp-spacing-2);
    margin-bottom: var(--givewp-spacing-4);

    select {
        min-width: 100%;
        height: 48px;
        padding: 0 var(--givewp-spacing-4);
        font-size: 1rem;
    }
}

ul[role='document'] + .flexRow {
    margin: var(--givewp-spacing-6) 0;
}

.justifyContentEnd {
    flex: 1;
    justify-content: flex-end;
}

.pageTitle {
    color: var(--givewp-neutral-900);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.5;
    margin: 0;
}

.pageContent {
    background-color: var(--givewp-shades-white);
    display: flex;
    flex-direction: column;
    gap: var(--givewp-spacing-2);
    margin-inline: var(--givewp-spacing-6);
    padding: var(--givewp-spacing-6);
}

.pageActions {
    align-items: center;
    column-gap: 2rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    width: 100%;

    & > * {
        flex-shrink: 0;
    }
}

.alignEnd {
    justify-content: flex-end;
}

.button:is(:global(.button)) {
    border-radius: 0.125rem;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.25rem;
    padding: 0.5rem 1rem;
}

.buttonSecondary:is(:global(.button)) {
    background-color: #fff;

    &:hover {
        background-color: #f6f7f7;
    }
}

.addCampaignFormButton {
    $depth: 0px 1px 0px rgba(0, 0, 0, 0.25);

    background-color: var(--givewp-neutral-100);
    border-radius: 0.25rem;
    border: none;
    color: var(--givewp-neutral-900);
    font-family: 'Inter';
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    block-size: 2.5rem;
    padding: 0.5rem 1rem;
    transition-property: filter, color, outline;
    transition-duration: 180ms;
    transition-timing-function: ease-in;
    cursor: pointer;
    width: fit-content;
    margin-bottom: 0.5rem;

    &:is(a) {
        text-decoration: none;
    }

    &:is(:hover, :active, :focus) {
        background-color: var(--givewp-neutral-200);
        color: var(--givewp-neutral-900);
    }

    &:active {
        filter: contrast(90%);
    }

    &:focus {
        box-shadow: $depth;
        outline: 0.125rem solid #2271B1;
        outline-offset: 0.25em;
    }
}

.addFormButton {
    $depth: 0px 1px 0px rgba(0, 0, 0, 0.25);

    background-color: #f7f7f7;
    border: 1px solid #ddd;
    border-radius: 0.1875rem;
    box-shadow: $depth;
    color: #888;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    block-size: 2.5rem;
    padding-inline: 1rem;
    transition-property: filter, color, outline;
    transition-duration: 180ms;
    transition-timing-function: ease-in;
    cursor: pointer;

    &:is(a) {
        text-decoration: none;
    }

    &:is(:hover, :active, :focus) {
        color: #777;
    }

    &:hover {
        filter: contrast(110%);
    }

    &:active {
        filter: contrast(90%);
    }

    &:focus {
        box-shadow: $depth;
        outline: 0.125rem solid var(--give-primary-color);
        outline-offset: 0.25em;
    }
}

.tryNewFormBuilderBtnContainer {
    position: absolute;
    left: 50%;
    transform: translate(-50%, 0);
}

.defaultFormPill {
    position: absolute;
    bottom: -.75rem;
    left: 0;
    background: var(--givewp-neutral-200);
    width: fit-content;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 1px 0 26px 16.7px;
    padding: 2px 10px;
    border-radius: 12px;
    transition: opacity 150ms ease-in-out, visibility 150ms ease-in-out;
    font-size: 0.75rem;
}

.migratedForm {
    display: flex;
    align-items: center;

    .tooltipContainer {
        position: absolute;
        left: -.55rem;
        display: flex;
        align-items: center;
        z-index: 2;

        svg {
            fill: #3A21D9;
        }
    }

    .tooltip {
        display: none;
        width: 230px;
        bottom: 25px;
        left: -10px;
    }

    .tooltip::after {
        top: 100%;
        left: 14px;
    }

    .tooltipContainer:hover .tooltip {
        display: unset;
    }
}

.upgradedForm {
    width: max(7.5rem, 120px);
    position: relative;

    .tooltip {
        width: 18rem;
        bottom: calc(100% + 10px);
        right: 0;
    }

    .tooltip::after {
        top: 100%;
        right: 55px;
    }

    .tooltipContainer {
        position: relative;
    }
}

.migratedForm,
.upgradedForm {
    .tooltip {
        position: absolute;
        background-color: #19661c;
        color: #fff;
        padding: 1rem;
        border-radius: 4px;
        box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.05);
        font-size: 0.75rem;
        font-weight: 500;
    }

    .tooltip::after {
        content: " ";
        position: absolute;
        border-width: 5px;
        border-style: solid;
        border-color: #19661c transparent transparent transparent;
    }

    .link {
        cursor: pointer;
        margin-top: 2rem;
        margin-bottom: -0.4rem;
        font-weight: bold;
        float: right;
    }
}

.filtersContainer {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    align-items: center;
    justify-content: flex-start;
}

.container,
.overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

.container {
    z-index: 9999;
    display: flex;
    opacity: 1;
    animation: appear 180ms ease-in 0s 1;
    font-family: 'Open Sans', sans-serif;

    &[aria-hidden='true'] {
        display: none;
        opacity: 0;
    }
}

@keyframes appear {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

.overlay {
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    background-color: rgba(0, 0, 0, 0.25);
}

#modalTitle {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.6;
    color: var(--givewp-neutral-900);
    margin: 0;
    padding: var(--givewp-spacing-4) var(--givewp-spacing-6);
    border-top-left-radius: var(--givewp-rounded-8);
    border-top-right-radius: var(--givewp-rounded-8);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.dialog {
    margin: auto;
    z-index: 2;
    position: relative;
    background: var(--givewp-shades-white);
    border-radius: var(--givewp-rounded-8);
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.05);
    width: 35rem;


    & ul {
        display: flex;
        flex-direction: column;
        gap: var(--givewp-spacing-2);
        max-height: 40vh;
        margin: 0;
        overflow-y: auto;
        overscroll-behavior-y: contain;
    }

    & li {
        font-weight: 500;
        display: flex;
        align-items: center;
        gap: var(--givewp-spacing-2);

        span {
            display: flex;
            gap: var(--givewp-spacing-2);
        }
    }

    &.danger {
        #confirm {
            background-color: var(--givewp-red-500);
            border: 1px solid var(--givewp-red-500);

            &:hover {
                background-color: var(--givewp-red-400);
            }
        }
    }
}

.modalContent {
    padding: var(--givewp-spacing-6);
    border-radius: 0 0 6px 6px;

    p {
        margin: 0 0 var(--givewp-spacing-3);
        font-size: 1rem;
    }
}

.modalContent > * {
    font-size: 1rem;
    font-weight: 500;
    font-stretch: normal;
    font-style: normal;
    letter-spacing: normal;
    text-align: left;
    color: var(--givewp-neutral-700);
}

.gutter {
    display: flex;
    flex-direction: row;
    justify-content: space-evenly;
    gap: var(--givewp-spacing-6);
    width: 100%;
    border-bottom-left-radius: var(--givewp-rounded-8);
    border-bottom-right-radius: var(--givewp-rounded-8);
    box-sizing: border-box !important;
    padding: 0 var(--givewp-spacing-6) var(--givewp-spacing-6);
    overflow: hidden;
}

#cancel,
#confirm {
    flex-grow: 1;
    border-radius: var(--givewp-rounded-8);
    padding: var(--givewp-spacing-4) var(--givewp-spacing-8);
    font-size: 1rem;
    font-weight: 500;
    font-stretch: normal;
    font-style: normal;
    line-height: 1.5;
    letter-spacing: normal;
    text-align: center;
    transition: all 0.15s;
    cursor: pointer;

    &:active {
        border-color: rgba(170 170 170);
        box-shadow: inset 0px 0px 3px rgba(170 170 170 / 0.8);
    }
}

#cancel {
    background-color: inherit;
    border: solid 1px var(--givewp-neutral-300);
    color: var(--givewp-neutral-900);


    &:hover {
        background-color: var(--givewp-neutral-50);
    }
}

#confirm {
    background: #2271b1;
    border: 1px solid #2271b1;
    color: var(--givewp-shades-white);

    &:hover {
        background-color: #135e96;
    }
}


@media (prefers-reduced-motion: reduce) {
    .container {
        animation: none;
    }
}
