/*----------  Gifts allowed  ----------*/

.dgfw-gifts-allowed-section {
    input.dgfw-category-gifts-allowed {
        width: 4em;
    }
}

/*----------  Criteria  ----------*/

.dgfw-category-criteria {
    position: relative;
    padding: 2em;
    border: 1px solid $light-gray-border;
    background: $light-gray-bg;
    text-align: center;

    .dgfw-category-description {
        margin-bottom: 2em;
    }
}

.dgfw-criteria {
    position: relative;
    padding: 2em 2em 0;
    margin-top: -4px;
    border: 4px solid $light-gray-border;
    transition: all 0.35s, opacity 0.5s;
    height: auto;
    opacity: 1;

    &.invisible {
        height: 0;
        opacity: 0;
        padding: 0;
        margin: 0;
        border: none;
    }

    &.and {
        border-style: solid;
    }

    &.or {
        border-style: dashed;
    }

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

    &.or > .dgfw-criteria.or,
    &.and > .dgfw-criteria.and {
        margin: -4px -2em 0;
        border-right: none;
        border-left: none;


        .dgfw-subcriteria-add {
            bottom: 2em;
        }
    }

    &.highlight {
        &,
        .dgfw-criteria-description,
        .dgfw-subcriteria-add {
            background: $highlight-red;
        }
    }
}

.dgfw-criteria-description {
    position: relative;
    top: -3em;
    width: 7%;
    min-width: 4em;
    margin: 0 auto;
    background: $light-gray-bg;
    transition: all 0.35s;
}

.dgfw-step-description {

    &.has-help {
        cursor: help;

        &:after {
            display: inline-block;
            color: blue;
            font-size: 1.4em;
            font-family: dashicons;
            content: "\f223";
        }
    }

}

.dgfw-step-help,
.dgfw-step-note {
    display: none;

    width: 100%;
    max-width: 500px;
    margin: 0 auto 2em auto;
    padding: 1em;
    line-height: 1.8;
    text-align: left;
}

.dgfw-step-note {
    display: block;
}

.dgfw-choose-type-container {
    text-align: center;
}

.dgfw-criteria-step-list-container {
    position: relative;
    height: 200px;
    overflow: hidden;
    transition: all 0.35s;
}

.dgfw-criteria-step-list {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    transition: all 0.35s, opacity 0.15s;
    opacity: 1;
    z-index: 1;

    &:nth-child(2) {
        top: 100%;
        bottom: -100%;
        opacity: 0;
        z-index: 0;
    }

    .transition > & {
        top: -100%;
        bottom: 100%;
        opacity: 0;
        z-index: 0;
    }

    .transition > &:nth-child(2) {
        top: 0;
        bottom: 0;
        opacity: 1;
        z-index: 1;
    }


    & > .dgfw-criteria-step {
        position: absolute;
        left: 100%;
        right: -100%;
        top: 0;
        bottom: 0;
        width: 100%;
        text-align: center;
        opacity: 0;
        transition: all 0.25s, opacity 0.15s;

        z-index: 0;


        &.step-current {
            @extend .dgfw-current-step;
        }

        &.step-prev {
            @extend .dgfw-prev-step;
        }
    }
}

.dgfw-current-step {
    left: 0;
    right: 0;
    opacity: 1;
    z-index: 2;
}

.dgfw-prev-step {
    left: -100%;
    right: 100%;
    z-index: 1;
}

.dgfw-criteria-nav {
    padding-bottom: 2em;
    opacity: 1;
    height: 40px;
    transition: all 0.35s, opacity 0.15s;

    &.invisible {
        opacity: 0;
        height: 0;
    }

    @media screen and (max-width: 1023px) {
        padding-bottom: 6em;
    }
}

.dgfw-subcriteria-add {
    position: relative;
    bottom: 1em;
    width: 30%;
    min-width: 5em;
    margin: 0 auto;
    background: $light-gray-bg;
    transition: all 0.35s;

    .and > &, .or > & {
        width: 10%;
        min-width: 8em;
    }
}

.button {
    &.dgfw-button {
        min-width: 6em;
    }

    &.dgfw-add-conditions {
        &:before {
            color: green;
        }
    }

    &.dgfw-add-and {
        &:before {
            color: orange;
        }
    }

    &.dgfw-add-or {
        &:before {
            color: blue;
        }
    }
}

.dgfw-criteria-input-container {
    text-align: left;
    margin-bottom: 0.5em;

    .dgfw-label {
        display: inline-block;
        float: left;
        clear: left;
        width: 50%;
        padding: 0.4em 1em 0.4em;
        text-align: right;
        box-sizing: border-box;
    }

    &.dgfw-criteria-terms-currency-select-container {
        margin-bottom: 1em;
    }
}

.dgfw-terms-advanced-options {
    .dgfw-label {
        width: auto;
    }
}

.dgfw-amount,
.dgfw-items {
    display: inline-block;
    max-width: 5em;
    margin-left: 0;
}

.dgfw-currency {
    display: inline-block;
    padding: 3px 5px 3px;
    background: $light-gray-bg;
    border: 1px solid $light-gray-border;

    &.left {
        border-right: none;
    }

    &.right {
        border-left: none;
    }
}

.dgfw-select-posts,
.dgfw-select-users {
    position: relative;
    height: 180px;
    padding: 10px 5%
}

.dgfw-select-posts-container-page,
.dgfw-select-users-container-page {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
}

.dgfw-posts-select-post,
.dgfw-users-select-user {
    display: inline-block;
    box-sizing: border-box;
    width: 31%;
    margin: 1%;
    max-width: 180px;
    background: #ffffff;
    outline: 2px solid #e8e8e8;
    padding: 110px 5px 0;
    position: relative;
    text-align: center;
    cursor: pointer;
    vertical-align: top;
    transition: all 0.25s;

    @media screen and (min-width: 1024px) {
        width: 18%;
        margin: 1%;
        max-width: 180px;
    }

    .dgfw-posts-select-post-img,
    .dgfw-users-select-user-img {
        position: absolute;
        top: 10px;
        height: 100px;
        right: 10px;
        left: 10px;
        background-position: center;
        background-size: cover;
        transition: all 0.25s;

        &:after {
            position: absolute;
            top: 0;
            bottom: 0;
            right: 0;
            left: 0;
            color: white;
            content: "\f147";
            text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
            display: inline-block;
            height: 100%;
            font-size: 32px;
            line-height: 250%;
            font-family: dashicons;
            text-decoration: none;
            font-weight: 400;
            font-style: normal;
            vertical-align: top;
            text-align: center;
            opacity: 0;
            transition: all 0.25s;
        }
    }

    .dgfw-posts-select-post-title,
    .dgfw-users-select-user-name {
        font-weight: normal;
        line-height: 1.5em;
        min-height: 3em;
    }

    &.selected {
       outline: 3px dotted #d8d8d8;
        background: white;

        .dgfw-posts-select-post-img,
        .dgfw-users-select-user-img {

            &:after {
                opacity: 1;
                font-size: 73px;
                line-height: 120%;
                background: rgba(0,0,0,0.6);
            }

        }

        .dgfw-posts-select-post-title,
        .dgfw-users-select-user-name {
            font-weight: bold;
        }
    }


}


.dgfw-select-posts,
.dgfw-select-users {
    position: relative;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    transition: all 0.35s, opacity 0.15s;
    opacity: 1;
    z-index: 1;


    > .dgfw-select-posts-container-page,
    > .dgfw-select-users-container-page {
        position: absolute;
        left: 100%;
        right: -100%;
        top: 0;
        bottom: 0;
        width: 100%;
        text-align: center;
        opacity: 0;
        transition: all 0.25s, opacity 0.15s;

        z-index: 0;


        &.page-current {
            @extend .dgfw-current-step;
        }

        &.page-prev {
            @extend .dgfw-prev-step;
        }
    }
}

.dgfw-select-posts-nav,
.dgfw-select-users-nav {
    text-align: center;
    vertical-align: middle;
    margin-bottom: 1em;
    line-height: 32px;
}

.dgfw-select-posts-nav-status,
.dgfw-select-users-nav-status {
    margin: 0 2em;
}

.dgfw-select-posts-nav-status-number,
.dgfw-select-users-nav-status-number {
    font-weight: bold;
}

.dgfw-selected-posts,
.dgfw-selected-users,
.dgfw-advanced-posts {
    text-align: center;
    overflow: hidden;
    position: relative;
    height: auto;
    transition: all 0.25s;

    &.invisible {
        height: 0;
    }
}

.dgfw-posts-selected-post,
.dgfw-users-selected-user,
.dgfw-posts-advanced-post {
    display: inline-block;
    position: relative;
    top: 0;
    box-sizing: border-box;
    padding: 10px 30px 10px 60px;
    margin: 0 1em 1em 0;
    height: 50px;
    width: auto;
    background: white;
    outline: 1px solid #e8e8e8;
    overflow: hidden;
    opacity: 1;

    transition: all 0.25s;

    &.invisible {
        opacity: 0;
        top: 100%;
        height: 0;
        padding: 0;
        margin: 0;
    }

    .dgfw-posts-select-post-title,
    .dgfw-users-select-user-name {
        margin: 0;
        font-weight: normal;
        line-height: 30px;
    }

    .dgfw-posts-select-post-img,
    .dgfw-users-select-user-img {
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        width: 50px;
        height: 50px;
        background-position: center;
        background-size: cover;
    }

    .dgfw-posts-selected-remove,
    .dgfw-users-selected-remove {
        position: absolute;
        top: 15px;
        right: 3px;
        cursor: pointer;
        color: red;
    }
}

.dgfw-posts-advanced-post {
    display: block;
    width: 50%;
    height: 50px;
    margin: 0 auto 1em;
    text-align: left;

    .dgfw-posts-select-post-title,
    .dgfw-posts-advanced-min-items {
        display: inline-block;
        margin-right: 1em;
        vertical-align: middle;
    }

    .dgfw-posts-select-post-title {
        max-width: calc(100% - 5em);
        max-height: 30px;
        overflow: hidden;
    }

    .dgfw-posts-advanced-min-items {
        text-align: right;
    }

    .dgfw-posts-advanced-min-items {
        width: 4em !important;
        float: right;
        margin: 0 !important;

        padding: {
            top: 5px;
            bottom: 5px;
        }

        height: 30px;
        line-height: 20px;

    }

    .dgfw-posts-select-post-img {
        height: 50px;
    }

    .dgfw-posts-selected-remove {
        top: 15px;
    }
}

.dgfw-terms-advanced-term {
    width: 90%;
    padding-left: 10px;
    height: auto;

    .dgfw-posts-select-post-title {
        width: 40%;
        margin-right: 0;
        vertical-align: top;
        font-weight: bold;
    }

    .dgfw-terms-advanced-options {
        display: inline-block;
        width: 60%;
        text-align: right;
    }

    .dgfw-terms-advanced-min-amount,
    .dgfw-terms-advanced-min-items {
        display: inline-block;
        width: auto;
        min-width: 220px;

        .dgfw-label {
            padding-right: 0;
        }
    }
}


.dgfw-checkbox-group-wrapper {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;

    .dgfw-roles-select,
    .dgfw-terms-select {
        margin-bottom: 1px;
        padding: 10px;
        background: white;
        box-shadow: 1px 1px 5px rgba(0,0,0,0.1);
    }

    .dgfw-roles-select-checkbox,
    .dgfw-terms-select-checkbox {
        margin-right: 0.5em;
        vertical-align: text-bottom;
    }
}

.dgfw-criteria-period-container {
    text-align: center;

    label {
        display: inline-block;
        margin: 0 0.5em;
    }

    .dgfw-label-date {
        min-width: 80px;
        text-align: right;
    }
}

.dgfw-criteria-remove {
    position: absolute;
    top: 1em;
    right: 1em;
    border: none;
    background: none;
    width: 32px;
    height: 32px;
    padding: 0;
    margin: 0;
    line-height: 32px;
    overflow: hidden;
    cursor: pointer;
    color: $light-gray-text;
    transition: all 0.25s;
    font-size: 18px;

    &:before {
        display: inline-block;
        width: 32px;
        height: 32px;
        line-height: 32px;
        text-align: center;
    }

    &:hover {
        color: red;
    }
}

#edittag {
    max-width: none !important;
}