.nf-condition {
    border: 1px solid #aaa;
    margin-top: 20px;
}
.nf-condition-header {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nf-condition-drag-handle {
    cursor: move;
    .nf-drag-condition {
        color: #666;
        font-size: 18px;
        &:hover {
            color: #2BAAE7;
        }
    }
}

.nf-condition-label-input {
    flex: 1;
    min-width: 150px;
    .nf-condition-label-field {
        width: 100%;
        padding: 5px 8px;
        border: 1px solid #ddd;
        border-radius: 3px;
        font-size: 13px;
        &:focus {
            border-color: #2BAAE7;
            outline: none;
            box-shadow: 0 0 3px rgba(43, 170, 231, 0.3);
        }
    }
}

.nf-condition-when-text {
    margin-bottom: 10px;
}

.nf-condition-placeholder {
    border: 4px solid #84CC1E;
    background: #84CC1E;
    height: 8px !important;
    margin: 8px 0 -4px 0;
}

/* Free-floating drag visual feedback */
.ui-sortable-helper {
    opacity: 0.5 !important;
    z-index: 99999 !important;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.nf-first-when-container {
    background: #D3D3D3;
    padding: 10px;
    &::after {
        clear: both;
        content: "";
        display: block;
    }
    .nf-select,
    .nf-input {
        input {
        }
    }
}
.nf-when-controls {
    float: right;
    display: flex;
    gap: 12px;
}

/* Icon button reset and focus styles for accessibility - scoped to .nf-condition */
.nf-condition .nf-icon-btn {
    background: none;
    border: none;
    padding: 4px;
    border-radius: 3px;
    cursor: pointer;
    line-height: 1;

    &:focus {
        outline: 2px solid #2BAAE7;
        outline-offset: 2px;
    }

    &:focus:not(:focus-visible) {
        outline: none;
    }

    &:focus-visible {
        outline: 2px solid #2BAAE7;
        outline-offset: 2px;
    }

    .fa {
        color: #2BAAE7;
        font-size: 22px;
    }

    &.nf-remove-condition .fa,
    &.nf-remove-when .fa,
    &.nf-remove-then .fa,
    &.nf-remove-else .fa {
        color: red;
    }
}
.nf-when-container,
.nf-then-container,
.nf-else-container {
    &::after {
        clear: both;
        content: "";
        display: block;
    }
    .nf-one-fourth {
        .fa {
            font-size: 22px;
            padding-top: 15px;
        }
        &:first-child {
            width: 7.5%;
        }
    }
}
.nf-when-container {
    background: #D3D3D3;
    padding: 0 10px 10px;
    .nf-one-fourth {
        width: 23%;
    }
    .nf-when {
        &::after {
            clear: both;
            content: "";
            display: block;
        }
    }
}
.nf-then-container {
    background: #fefefe;
    padding: 10px;
    .nf-one-fourth {
        width: 30.5%;
        &:first-child {
            padding-left: 12px;
        }
    }
    .nf-then {
        &::after {
            clear: both;
            content: "";
            display: block;
        }
    }
}
.nf-else-container {
    background: #ddd;
    padding: 10px;
    .nf-one-fourth {
        width: 30.5%;
        &:first-child {
            padding-left: 12px;
        }
    }
    .nf-else {
        &::after {
            clear: both;
            content: "";
            display: block;
        }
    }
}
.nf-add-when,
.nf-add-then,
.nf-add-else {
    color: #2BAAE7;
    cursor: pointer;
    font-size: 22px;
    margin-bottom: 5px;
    padding-left: 12px;
}
.nf-remove-then,
.nf-remove-else,
.nf-remove-when {
    color: red;
    cursor: pointer;
}


.nf-one-fourth {
    float: left;
    margin-bottom: 15px;
    padding: 0 2%;
    width: 25%;
    &::after {
        clear: both;
        content: "";
        display: block;
    }
}

.nf-condition.actions {
    .nf-when-container {
        padding: 20px;
    }
    .nf-one-third {
        width: 40%;
        &:nth-child(2) {
            width: 20%;
        }
        &.action-when-label {
            padding-top: 16px;
            text-align: center;
            text-transform: uppercase;
            font-weight: bold;
        }
    }
    .nf-one-fourth {
        width: 30.8%;
        &:first-child {
            width: 7.5%;
        }
    }
    .nf-when {
        &::after {
            clear: both;
            content: "";
            display: block;
        }
    }
}
