#wpbody-content > *:not(#wprm-settings),
#wpfooter {
    display: none;
}

#update-nag,
.update-nag,
.updated,
.error,
.is-dismissible {
    display: none;
}

.rtl {
    #wprm-settings-menu {
        .wprm-settings-menu-group {
            .wprm-settings-icon {
                margin-right: 0;
                margin-left: 2px;
            }
        }
    }
    
    #wprm-settings-container {
        .wprm-setting-required {
            border-radius: 3px;
            margin-left: 0;
        }
    }

    .wprm-settings-scroll-to-top {
        left: 20px;
        right: initial;
    }
}

#wprm-settings-buttons {
    margin-bottom: 20px;
}

#wprm-settings-menu,
.wprm-settings-group {
    background-color: white;
    border-radius: 5px;

    .wprm-settings-menu-group,
    .wprm-settings-subgroup, {
        padding: 6px;
        border-bottom: 1px solid #ddd;

        &:last-child {
            border-bottom: none;
        }
    }
}

#wprm-settings-menu {
    .wprm-settings-menu-header {
        padding: 10px;
        padding-bottom: 5px;
        text-align: center;
        font-weight: 300;
        font-size: 1.2em;
    }

    .wprm-settings-menu-group {
        display: block;
        text-decoration: none;
        color: #444;
        cursor: pointer;

        &:first-child {
            border-top-left-radius: 5px;
            border-top-right-radius: 5px;
        }
        &:last-child {
            border-bottom-left-radius: 5px;
            border-bottom-right-radius: 5px;
        }
        &.active {
            background-color: #ddd;
            font-weight: bold;
        }

        .wprm-settings-noicon {
            display: inline-block;
            width: 18px;
        }
        .wprm-settings-icon {
            vertical-align: middle;
            margin-right: 2px;
            position: relative;
            top: 1px;

            svg {
                fill: #ddd;
            }
        }
    }

}

#wprm-settings-menu-search-message {
    background-color: white;
    border-radius: 5px;
    padding: 10px;
    text-align: left;
    color: #666;
    font-size: 14px;

    a {
        color: #2271b1;
        text-decoration: none;
        cursor: pointer;

        &:hover {
            color: #135e96;
            text-decoration: underline;
        }
    }
}

#wprm-settings-menu.wprm-settings-menu-search {
    .wprm-settings-search-summary,
    .wprm-settings-search-footer {
        padding: 0 10px 10px 10px;
        font-size: 12px;
        color: #666;
        text-align: center;
    }

    .wprm-settings-search-footer {
        border-top: 1px solid #ddd;
        padding-top: 10px;
    }

    .wprm-settings-search-footer a {
        color: #2271b1;
        text-decoration: none;

        &:hover {
            color: #135e96;
            text-decoration: underline;
        }
    }

    .wprm-settings-search-group + .wprm-settings-search-group {
        border-top: 1px solid #ddd;
    }

    .wprm-settings-search-group-button,
    .wprm-settings-search-subgroup-button,
    .wprm-settings-search-item {
        display: flex;
        width: 100%;
        border: none;
        background: transparent;
        cursor: pointer;
        text-align: left;
        color: #444;
    }

    .wprm-settings-search-group-button,
    .wprm-settings-search-subgroup-button {
        align-items: center;
        gap: 6px;
        font-weight: 600;
        padding: 10px;

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

    .wprm-settings-search-group-button {
        .wprm-settings-icon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }

        svg {
            fill: #ddd;
        }
    }

    .wprm-settings-search-subgroups,
    .wprm-settings-search-items {
        border-top: 1px solid #eee;
    }

    .wprm-settings-search-subgroup {
        background-color: #fafafa;
    }

    .wprm-settings-search-subgroup + .wprm-settings-search-subgroup {
        border-top: 1px solid #eee;
    }

    .wprm-settings-search-subgroup-button {
        padding-left: 20px;
        font-weight: 500;
    }

    .wprm-settings-search-item {
        padding: 8px 10px 8px 28px;
        font-size: 13px;

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

    #wprm-settings-menu-search-message {
        border-radius: 0;
        padding-top: 0;
    }
}

#wprm-settings-buttons {

    background-color: white;
    border-radius: 5px;
    padding-bottom: 6px;

    .wprm-settings-changes-wrapper {
        display: flex;
        flex-wrap: nowrap;
        padding: 6px;
        gap: 6px;

        > * {
            flex: 1 1 0;
            min-width: 0;
        }

        .wprm-settings-changes-save-wrapper,
        .wprm-settings-changes-summary-wrapper {
            display: flex;

            > button {
                width: 100%;
                margin: 0;
            }
        }
    }

    .wprm-settings-search-wrapper {
        position: relative;
        margin: 0 6px;
    }

    #wprm-settings-search {
        display: block;
        width: 100%;
        margin: 0;
        padding-right: 30px;
        border: 1px solid #ddd;
        border-radius: 3px;
        font-size: 14px;
        box-sizing: border-box;

        &:focus {
            outline: none;
            border-color: #2271b1;
            box-shadow: 0 0 0 1px #2271b1;
        }
    }

    .wprm-settings-search-clear {
        position: absolute;
        right: 8px;
        top: 50%;
        transform: translateY(-50%);
        background: transparent;
        border: none;
        font-size: 20px;
        line-height: 1;
        color: #666;
        cursor: pointer;
        padding: 0;
        width: 20px;
        height: 20px;
        display: flex;
        align-items: center;
        justify-content: center;

        &:hover {
            color: #000;
        }
    }

    .wprm-settings-search-indicator {
        margin: 8px 10px 0 10px;
        padding: 8px;
        background-color: #fff3cd;
        border: 1px solid #ffc107;
        border-radius: 3px;
        color: #856404;
        font-size: 12px;
        text-align: center;
    }
}

#wprm-settings-menu.wprm-settings-menu-changed {
    .wprm-settings-changed-back {
        padding: 10px 10px 0 10px;
        font-size: 12px;

        a {
            color: #2271b1;
            text-decoration: none;

            &:hover {
                color: #135e96;
                text-decoration: underline;
            }
        }
    }

    .wprm-settings-changed-actions {
        padding: 0 10px 10px 10px;
        border-bottom: 1px solid #ddd;

        .button {
            width: 100%;
            margin: 0;
        }
    }

    .wprm-settings-changed-actions-bottom {
        padding-top: 10px;
        border-top: 1px solid #ddd;
        border-bottom: none;
    }

    .wprm-settings-changed-list {
        .wprm-settings-changed-item-row:last-child {
            border-bottom: none;
        }
    }

    .wprm-settings-changed-item-row {
        display: flex;
        gap: 6px;
        align-items: flex-start;
        padding: 8px 10px;
        border-bottom: 1px solid #ddd;

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

    .wprm-settings-changed-item {
        display: block;
        flex: 1 1 auto;
        min-width: 0;
        padding: 0;
        background: transparent;
        border: none;
        text-align: left;
        cursor: pointer;
    }

    .wprm-settings-changed-item-cancel {
        flex: 0 0 auto;
        margin: 0;
        padding: 0;
        background: transparent;
        border: none;
        cursor: pointer;
        color: #666;

        &:hover {
            color: #2271b1;
        }
    }

    .wprm-settings-changed-item-cancel-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 24px;
        height: 24px;

        .wprm-settings-icon {
            display: flex;
            align-items: center;
            justify-content: center;
        }

        svg {
            width: 16px;
            height: 16px;
        }

        svg g,
        svg path,
        svg polyline,
        svg line,
        svg circle {
            fill: none;
            stroke: currentColor;
        }
    }

    .wprm-settings-changed-item-name,
    .wprm-settings-changed-item-context,
    .wprm-settings-changed-item-badge {
        display: block;
    }

    .wprm-settings-changed-item-name {
        color: #444;
        font-weight: 600;
    }

    .wprm-settings-changed-item-context {
        margin-top: 2px;
        color: #666;
        font-size: 12px;
    }

    .wprm-settings-changed-item-badge {
        margin-top: 6px;
        color: #856404;
        font-size: 11px;
        font-weight: 600;
        text-transform: uppercase;
    }
}

#wprm-settings-container {
    .wprm-settings-group {
        padding-bottom: 25px;
        margin-bottom: 25px;

        & > .wprm-setting-documentation,
        & > .wprm-settings-group-container {
            padding: 25px;
            padding-bottom: 0;
        }
    }

    .wprm-setting-required {
        background-color: darkred;
        color: white;

        padding: 3px 5px;
        margin-left: -10px;
        margin-right: 5px;

        border-radius: 3px;
        border-top-left-radius: 0;
        border-bottom-left-radius: 0;

        text-decoration: none;
        font-weight: normal;
        font-size: 0.8em;
    }

    .wprm-settings-group > .wprm-setting-required {
        display: block;
        font-size: 1.2em;
        border-radius: 3px;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        padding: 6px 10px;
        margin: 0;
    }

    .wprm-settings-group-name,
    .wprm-settings-subgroup-name {
        text-align: center;
    }
    .wprm-settings-group-name {
        padding: 20px 10px 0 10px;
        padding-bottom: 0;
        margin: 5px 0;
        font-size: 1.8em;
        font-weight: 400;
    }
    .wprm-settings-subgroup-name {
        margin: 5px 0 15px 0;
        font-size: 1.6em;
        font-weight: 300;
    }

    .wprm-settings-group-description {
        padding: 10px 25px 0 25px;
    }

    .wprm-settings-group-description,
    .wprm-settings-subgroup-description {
        font-style: italic;
    }

    .wprm-settings-subgroup-description + .wprm-settings-group-container,
    .wprm-settings-subgroup-description + .wprm-setting-documentation + .wprm-settings-group-container {
        margin-top: 20px;
    }

    .wprm-setting-container {
        margin-bottom: 25px;

        &:last-child {
            margin-bottom: 0;
        }

        .wprm-setting-label {
            display: block;
            font-weight: bold;
        }
        .wprm-setting-description {
            display: block;
            font-style: italic;
            margin-top: 2px;
        }
        .wprm-setting-input-container {
            margin-top: 5px;

            input {
                &[type=text],
                &[type=email],
                &[type=number] {
                    width: 100%;
                }
            }
        }
    }
}

.wprm-settings-scroll-to-top {
    background-color: #444;
    border-radius: 100%;
    
    position: fixed;
    bottom: 20px;
    right: 20px;

    width: 30px;
    height: 30px;
    text-align: center;

    .wprm-settings-icon {
        position: relative;
        top: 7px;

        path {
            fill: white;
            stroke: white;
        }
    }
}

.wprm-settings-error {
    color: darkred;
    font-weight: bold;
}

// Search highlighting
mark {
    background-color: #ffeb3b;
    padding: 2px 0;
    color: inherit;
}

@media screen and (min-width: 783px) {
    .rtl {
        #wprm-settings-container {
            margin-right: 225px;
            margin-left: 0;
    
            .wprm-settings-subgroup-name {
                text-align: right;
            }

            .wprm-setting-required {
                margin-right: 5px;
                margin-left: 0;
            }
    
            .wprm-setting-label-container {
                margin-left: 5%;
                margin-right: 0;
            }
        }
    }

    #wprm-settings-sidebar {
        position: fixed;
        width: 200px;
        height: 100%;
        max-height: calc(100% - 50px);
        display: flex;
        flex-direction: column;
    }

    #wprm-settings-menu {
        flex: 1;
        height: 100%;
        overflow-y: scroll;
    }

    #wprm-settings-container {
        margin-left: 225px;
        padding-bottom: 70%;

        .wprm-settings-subgroup-name {
            text-align: left;
        }

        .wprm-settings-subgroup {
            padding: 25px;
            padding-top: 10px;

            &:last-child {
                padding-bottom: 0;
            }
        }

        .wprm-setting-required {
            margin-left: -25px;
        }

        .wprm-setting-label-container,
        .wprm-setting-input-container {
            vertical-align: top;
        }

        .wprm-setting-label-container {
            display: inline-block;
            width: 45%;
            margin-right: 5%;
        }
        .wprm-setting-input-container {
            display: inline-block;
            width: 50%;
        }
    }

    .wprm-settings-scroll-to-top {
        display: none;
    }
}

@media screen and (min-width: 1024px) {
    .rtl {
        #wprm-settings-container {
            margin-right: 275px;
            margin-left: 0;
        }
    }
    #wprm-settings-sidebar {
        width: 250px;
    }

    #wprm-settings-container {
        margin-left: 275px;
    }
}
