.givewp-form-title {
    margin-left: var(--givewp-spacing-4);

    .components-base-control__field {
        margin-bottom: 0;
        position: relative;
        width: 20rem;

        @media (max-width: 1279px) {
            display: none;
        }

        &:hover {
            input {
                border-color: var(--wp-admin-theme-color);
            }

            label {
                color: var(--wp-admin-theme-color);
            }
        }

        input {
            border-color: var(--givewp-gray-10);
            font-size: 0.875rem;
            height: 2.25rem;
            padding: var(--givewp-spacing-2) var(--givewp-spacing-9) var(--givewp-spacing-2) var(--givewp-spacing-4);
            max-width: 100%;
        }

        label {
            display: flex;
            margin: 0;
            position: absolute;
            right: var(--givewp-spacing-4);
            top: 50%;
            translate: 0 -50%;
        }
    }
}

.givewp-header-campaign-overview {
    background-color: #fafafa !important;
    display: flex;
    gap: 0.2rem;
    width: fit-content;
    white-space: nowrap;
    height: 60px;
    align-items: center;
    margin-left: -1rem;
    padding: 0 1.2rem 0 0.8rem;
    color: #0e0e0e;
    font-size: 0.8125rem;
    font-weight: 500;

    a {
        color: #0e0e0e;
        text-decoration: none;

        &:hover {
            text-decoration: underline;
        }
    }
}

.givewp-header-tabs {
    display: flex;
    height: 3.75rem;
    justify-content: center;
}

.givewp-header-tabs__tab {
    border-radius: 0;
    font-size: 1rem;
    height: 3.25rem;
    justify-content: center;
    line-height: 1.5rem;
    margin: 0.25rem 0;
    min-width: 5.5rem;
    padding: var(--givewp-spacing-3) var(--givewp-spacing-4);

    &:hover {
        background-color: var(--givewp-gray-5);
        color: var(--wp-components-color-foreground, #1e1e1e);
    }

    &.is-active {
        background-color: transparent;
        border-bottom: 0.25rem solid var(--wp-admin-theme-color);
        height: 3.5rem;
        color: var(--wp-admin-theme-color);
        font-weight: 600;
    }
}

.components-toolbar__control.components-button {
    width: 100px;
}

.components-form-toggle.is-checked .components-form-toggle__track {
    background-color: var(--wp-admin-theme-color);
}

/**
 * Fixes an issue with inspector select controls covering selected option.
 */
.components-select-control__input {
    font-weight: normal;
}

.components-button {
    &.has-icon {
        padding: 0 6px;

        svg {
            transition: transform 0.2s cubic-bezier(0.165, 0.84, 0.44, 1);
        }

        &.is-pressed {
            &.rotate-icon {
                svg {
                    transform: rotate(45deg);
                }
            }
        }
    }
}

/**
 * Remove outline from popover
 */

.components-popover__content {
    outline: 0 !important;
}

/**
 * Set spacing between field sub-components, ie label and input
 */
.components-base-control:not(.components-search-control) {
    width: 100%;
}

/** ------------------------------- */

/**
 * @todo The suffix isn't being displayed properly.
 */

.components-input-control__suffix {
    display: none;
}

.components-panel__row:first-of-type {
    margin-top: 0.5rem;
}


// Add border around template color setting popovers.
.block-editor-panel-color-gradient-settings__dropdown-content,
.components-color-palette__custom-color-dropdown-content {
    .components-popover__content,
    .components-color-picker {
        border: 1px solid var(--givewp-gray-40);
    }
}

.block-editor-panel-color-gradient-settings__dropdown-content .components-popover__content {
    // Move popover color panel out from underneath custom sidebar.
    margin-right: var(--givewp-sidebar-width) !important;

    // Remove fieldset border.
    .block-editor-color-gradient-control__fieldset {
        border: 0;
    }
}

.components-color-palette__custom-color-dropdown-content .components-popover__content {
    // Move popover color picker to not cover popover color panel.
    margin-left: -115%;

    // Prevent scrollbar in popover color picker.
    .components-color-picker .components-h-stack {
        width: auto;
    }
}

.components-modal__screen-overlay {
    z-index: 9999999999;

    &--givewpwp-custom-css {
        background-color: transparent;
    }
}

.components-modal__header {
    box-shadow: inset 0 -1px 0 0 #ddd;
}

.components-modal__header-heading {
    top: 1rem !important;
    font-size: 1rem !important;
    line-height: 1.5 !important;
    margin-top: -0.2rem !important;
}

.components-modal__header {
    height: 3.5rem !important;
    padding: 16px 32px 8px !important;
}

.components-modal__content {
    margin-top: 3.25rem;

}

/*
Add border bottom to tabs, while removing body top border.
This creates a consistent separator between the tabs and the rest of the sidebar.
*/
.components-tab-panel__tabs {
    border-bottom: 1px solid #e0e0e0;
}

.givewp-sidebar-dropdown-content .components-popover__content {
    border: 1px solid var(--givewp-gray-40);
}

.components-popover.components-dropdown__content {
    z-index: 99999999;
}

.givewp-panel-body--summary {
    .givewp-form-slug {
        display: flex;
        width: 100%;

        span {
            background-color: var(--givewp-grey-5);
            border-radius: 2px 0 0 2px;
            border: solid 1px var(--givewp-grey-500);
            flex: 0 0 auto;
            line-height: 1rem;
            max-width: 50%;
            overflow: hidden;
            padding: 0.375rem var(--givewp-spacing-2);
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        input {
            border-radius: 0 2px 2px 0;
            margin-left: -1px;
            height: 100%;
        }
    }

    .components-panel__body-title {
        margin-bottom: 0;
    }

    .components-panel__row {
        margin-top: var(--givewp-spacing-4);
    }

    .components-base-control {
        &__field {
            height: 100%;
        }

        &__help {
            margin-bottom: 0;
        }
    }
}

.components-editor-notices__snackbar {
    position: fixed;
    right: 0;
    bottom: 20px;
    padding-left: 16px;
    padding-right: 16px;
}

.givewp-donation-level-control .components-base-control,
.givewp-donation-level-control .components-base-control__field {
    margin-bottom: 0;
}

.components-base-control.components-checkbox-control {
    margin: 5px 0;
}

.give-billing-period-control {
    .components-flex {
        display: flex;
        gap: 4px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .components-radio-control__option {
        flex: 1;
        text-align: center;

        input {
            display: none;

            & + label {
                cursor: pointer;
                display: block;
                padding: 12px 8px;
                border-radius: 2px;
                font-weight: 500;
                font-size: 16px;
                line-height: 16px;
                background-color: var(--givewp-gray-20);
                width: 100%;
            }

            &:checked + label {
                // (Maybe) Differentiate the selected billing period.
            }
        }
    }
}

.give-billing-period-control .components-radio-control__input[type='radio']:checked + label {
    background-color: var(--givewp-gray-60);
    color: var(--givewp-shades-white);
}

.components-button.is-secondary {
    &:hover {
        background-color: rgba(var(--wp-admin-theme-color--rgb), .04);
    }
}

.givewp-form-settings {
    display: flex;
    gap: var(--givewp-spacing-10);
    padding: 1.5rem;

    &__menu {
        height: calc(100vh - 7rem);
        position: sticky;
        overflow: hidden;
        width: 17.5rem;
        top: 1.5rem;

        > ul {
            position: relative;
            margin: 0;
            transition: translate 0.1s linear;
        }

        &__item {
            margin: 0;

            ul {
                left: 100%;
                position: absolute;
                top: 0;
                width: 100%;
            }

            button {
                align-items: center;
                background: none;
                border: 0;
                color: var(--wp-components-color-foreground, var(--givewp-grey-900));
                display: flex;
                justify-content: space-between;
                line-height: 1.125rem;
                padding: var(--givewp-spacing-3) var(--givewp-spacing-4);
                text-align: left;
                width: 100%;

                &:hover {
                    background-color: var(--givewp-grey-5);
                    cursor: pointer;
                }

                svg {
                    fill: var(--givewp-grey-500);
                }
            }

            &--is-active {
                > button {
                    background-color: var(--givewp-grey-25);
                    font-weight: 600;
                }
            }

            &--has-children {
                > button {
                }
            }
        }

        &__back-button:is(button) {
            font-weight: 600;
            gap: var(--givewp-spacing-2);
            justify-content: start;
            padding-left: var(--givewp-spacing-2);

            svg {
                fill: currentColor;
            }
        }

        @for $i from 1 through 5 {
            &__page-#{$i} {
                translate: -#{($i - 1) * 100%} 0;
            }
        }
    }

    &__content {
        flex: 1;
        padding-top: var(--givewp-spacing-2);
        position: relative;

        .interface-interface-skeleton__content & {
            .components-panel__row {
                margin-top: var(--givewp-spacing-6);

                &:first-child {
                    margin-top: 0;
                }
            }

            .components-base-control,
            .components-input-control, {
                &__label {
                    color: var(--givewp-grey-900);
                    font-size: 0.8125rem !important;
                    font-weight: 400 !important;
                    line-height: 1.1375rem;
                }

                &__help {
                    margin-bottom: 0;
                }

                .components-select-control,
                .components-text-control {
                    &__input {
                        font-size: 0.8125rem !important;
                        height: auto !important;
                        line-height: 1rem;
                        padding: var(--givewp-spacing-3);
                        border-radius: 0.125rem;
                        color: var(--givewp-grey-900);
                    }
                }

                &.components-toggle-control {
                    .components-h-stack {
                        gap: 1rem;
                    }

                    .components-toggle-control__label {
                        color: var(--givewp-grey-900);
                    }

                    .components-base-control__help {
                        margin-left: 3.25rem;
                    }
                }
            }
        }

        .givewp-form-slug {
            display: flex;
            width: 100%;

            span {
                background-color: var(--givewp-grey-5);
                border-radius: 2px 0 0 2px;
                border: solid 1px var(--givewp-grey-500);
                flex: 0 0 auto;
                line-height: 1rem;
                max-width: 50%;
                overflow: hidden;
                padding: var(--givewp-spacing-3);
                text-overflow: ellipsis;
                white-space: nowrap;
            }

            input {
                border-radius: 0 2px 2px 0;
                margin-left: -1px;
            }
        }
    }
}

/* Ensure that the link editor modal from the ClassicEditor component will be visible. */
#wp-link-backdrop,
#wp-link-wrap {
    z-index: 9999999999 !important;
}
