/* B2BKing Grule Individual Editor Styles */

/* Header Section */
.b2bking_group_rule_pro_editor_header {
    padding: 0;
    margin: 0 0 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.b2bking_group_rule_pro_editor_header_title {
    display: flex;
    align-items: center;
    gap: 16px;
}

.b2bking_group_rule_pro_editor_header_icon {
    flex-shrink: 0;
    opacity: 0.6;
}

.b2bking_group_rule_pro_editor_header_text h1 {
    color: #6b7280;
    font-size: 20px;
    font-weight: 500;
    margin: 0;
    line-height: 1.2;
}

.b2bking_group_rule_pro_editor_header_subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    margin: 0;
    line-height: 1.4;
}

    .b2bking_group_rule_pro_editor_header_actions {
        display: flex;
        align-items: center;
        gap: 16px;
    }

.b2bking_group_rule_pro_editor_back_btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #f8f9fa;
    color: #6b7280;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid #e5e7eb;
}

.b2bking_group_rule_pro_editor_back_btn:hover {
    background: #e5e7eb;
    color: #374151;
    border-color: #d1d5db;
    text-decoration: none;
}

/* Header Save Button */
#b2bking_group_rule_pro_editor_save_top, #b2bking_group_rule_pro_editor_save {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 23px 5px 13px;
    background: linear-gradient(135deg, #906a1d 0%, #a67c1f 100%);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(144, 106, 29, 0.2);
    min-width: 153px;
}

#b2bking_group_rule_pro_editor_save_top:hover {
    background: linear-gradient(135deg, #7a5a17 0%, #906a1d 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(144, 106, 29, 0.3);
}

#b2bking_group_rule_pro_editor_save_top:disabled, #b2bking_group_rule_pro_editor_save:disabled {
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.5;
}

/* Main Content */
.b2bking_group_rule_pro_editor_content {
    background: #ffffff;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* Step Navigation */
.b2bking_group_rule_pro_editor_steps {
    display: flex;
    background: #ffffff;
    border-bottom: 1px solid #f0f0f0;
    padding: 0;
    margin: 0;
}

.b2bking_group_rule_pro_editor_step {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 24px 20px;
    border-right: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.b2bking_group_rule_pro_editor_step:last-child {
    border-right: none;
}

.b2bking_group_rule_pro_editor_step:hover {
    background: #fafafa;
}

.b2bking_group_rule_pro_editor_step.active {
    background: linear-gradient(135deg, #906a1d 0%, #a67c1f 100%);
    color: #ffffff;
}

.b2bking_group_rule_pro_editor_step.completed {
    background: #f8f9fa;
    color: #27ae60;
}

.b2bking_group_rule_pro_editor_step.completed .b2bking_group_rule_pro_editor_step_number {
    background: #27ae60;
    color: #ffffff;
}

.b2bking_group_rule_pro_editor_step_number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #666666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    margin-right: 16px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.b2bking_group_rule_pro_editor_step.active .b2bking_group_rule_pro_editor_step_number {
    background: #ffffff;
    color: #906a1d;
}

.b2bking_group_rule_pro_editor_step_content {
    flex: 1;
}

.b2bking_group_rule_pro_editor_step_title {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 4px 0;
    line-height: 1.2;
}

.b2bking_group_rule_pro_editor_step_description {
    font-size: 12px;
    opacity: 0.8;
    margin: 0;
    line-height: 1.3;
}

/* Form */
.b2bking_group_rule_pro_editor_form {
    padding: 0;
}

/* Section */
.b2bking_group_rule_pro_editor_section {
    border-bottom: 1px solid #f0f0f0;
}

.b2bking_group_rule_pro_editor_section:last-child {
    border-bottom: none;
}

/* Section Header */
.b2bking_group_rule_pro_editor_section_header {
    padding: 32px 40px 24px 40px;
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
}

.b2bking_group_rule_pro_editor_section_header h2 {
    color: #191821;
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 8px 0;
    line-height: 1.2;
}

.b2bking_group_rule_pro_editor_section_header p {
    color: #666666;
    font-size: 14px;
    margin: 0;
    line-height: 1.5;
}

/* Form Grid */
.b2bking_group_rule_pro_editor_form_grid {
    padding: 32px 40px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

/* Field */
.b2bking_group_rule_pro_editor_field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.b2bking_group_rule_pro_editor_field_row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Label */
.b2bking_group_rule_pro_editor_label {
    color: #191821;
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 4px;
}

.b2bking_group_rule_pro_editor_required {
    color: #e74c3c;
    font-size: 14px;
    font-weight: 600;
}

/* Input - High Specificity to Override WP Admin */
#b2bking_group_rule_pro_editor_main_container .b2bking_group_rule_pro_editor_input,
#b2bking_group_rule_pro_editor_main_container input.b2bking_group_rule_pro_editor_input {
    padding: 10px 16px !important;
    border: 2px solid #e0e0e0 !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    color: #191821 !important;
    background: #ffffff !important;
    transition: all 0.2s ease !important;
    outline: none !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

#b2bking_group_rule_pro_editor_main_container .b2bking_group_rule_pro_editor_input:focus,
#b2bking_group_rule_pro_editor_main_container input.b2bking_group_rule_pro_editor_input:focus {
    border-color: #906a1d !important;
    box-shadow: 0 0 0 3px rgba(144, 106, 29, 0.1) !important;
}

#b2bking_group_rule_pro_editor_main_container .b2bking_group_rule_pro_editor_input::placeholder,
#b2bking_group_rule_pro_editor_main_container input.b2bking_group_rule_pro_editor_input::placeholder {
    color: #999999 !important;
}

/* Select - High Specificity to Override WP Admin */
#b2bking_group_rule_pro_editor_main_container .b2bking_group_rule_pro_editor_select,
#b2bking_group_rule_pro_editor_main_container select.b2bking_group_rule_pro_editor_select {
    padding: 10px 16px !important;
    border: 2px solid #e0e0e0 !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    color: #191821 !important;
    background: #ffffff !important;
    transition: all 0.2s ease !important;
    outline: none !important;
    cursor: pointer !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

#b2bking_group_rule_pro_editor_main_container .b2bking_group_rule_pro_editor_select:focus,
#b2bking_group_rule_pro_editor_main_container select.b2bking_group_rule_pro_editor_select:focus {
    border-color: #906a1d !important;
    box-shadow: 0 0 0 3px rgba(144, 106, 29, 0.1) !important;
}

.b2bking_group_rule_pro_editor_select optgroup {
    font-weight: 600;
    color: #191821;
    background: #f8f8f8;
    padding: 8px 0;
}

.b2bking_group_rule_pro_editor_select option {
    padding: 8px 12px;
    color: #191821;
}

/* Field Description */
.b2bking_group_rule_pro_editor_field_description {
    color: #666666;
    font-size: 13px;
    line-height: 1.4;
    margin: 0;
}

/* Test Section */
.b2bking_group_rule_pro_editor_test_actions {
    padding: 0 40px 24px 40px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.b2bking_group_rule_pro_editor_test_btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #906a1d;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    align-self: flex-start;
}

.b2bking_group_rule_pro_editor_test_btn:hover {
    background: #7a5a17;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(144, 106, 29, 0.3);
}

.b2bking_group_rule_pro_editor_test_description {
    color: #666666;
    font-size: 13px;
    line-height: 1.4;
    margin: 0;
}

.b2bking_group_rule_pro_editor_test_results {
    margin: 0 40px 32px 40px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

/* Step Actions */
.b2bking_group_rule_pro_editor_step_actions {
    padding: 32px 40px;
    background: #fafafa;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f0f0f0;
}

.b2bking_group_rule_pro_editor_step_actions_left,
.b2bking_group_rule_pro_editor_step_actions_center,
.b2bking_group_rule_pro_editor_step_actions_right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.b2bking_group_rule_pro_editor_step_actions_center {
    flex: 1;
    justify-content: center;
}

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

/* Form Actions (Legacy - keeping for compatibility) */
.b2bking_group_rule_pro_editor_form_actions {
    padding: 32px 40px;
    background: #fafafa;
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    border-top: 1px solid #f0f0f0;
}

.b2bking_group_rule_pro_editor_cancel_btn {
    padding: 12px 24px;
    background: #ffffff;
    color: #666666;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.b2bking_group_rule_pro_editor_cancel_btn:hover {
    background: #f8f8f8;
    border-color: #d0d0d0;
    color: #191821;
}

.b2bking_group_rule_pro_editor_save_btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #906a1d;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.b2bking_group_rule_pro_editor_save_btn:hover {
    background: #7a5a17;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(144, 106, 29, 0.3);
}

.b2bking_group_rule_pro_editor_save_btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.b2bking_group_rule_pro_editor_prev_btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #ffffff;
    color: #666666;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.b2bking_group_rule_pro_editor_prev_btn:hover {
    background: #f8f8f8;
    border-color: #d0d0d0;
    color: #191821;
}

.b2bking_group_rule_pro_editor_next_btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #906a1d;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.b2bking_group_rule_pro_editor_next_btn:hover {
    background: #7a5a17;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(144, 106, 29, 0.3);
}

/* Message */
.b2bking_group_rule_pro_editor_message {
    position: fixed;
    top: 32px;
    right: 32px;
    z-index: 10000;
    max-width: 400px;
    animation: slideInRight 0.3s ease;
}

.b2bking_group_rule_pro_editor_message_content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border-left: 4px solid #906a1d;
}

.b2bking_group_rule_pro_editor_message_content.success {
    border-left-color: #27ae60;
}

.b2bking_group_rule_pro_editor_message_content.error {
    border-left-color: #e74c3c;
}

.b2bking_group_rule_pro_editor_message_icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.b2bking_group_rule_pro_editor_message_text {
    flex: 1;
    color: #191821;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}

.b2bking_group_rule_pro_editor_message_close {
    background: none;
    border: none;
    color: #999999;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.b2bking_group_rule_pro_editor_message_close:hover {
    background: #f0f0f0;
    color: #191821;
}

/* Save Success Notification */
.b2bking_group_rule_pro_editor_save_success_notification {
    width: 100%;
    margin-bottom: 20px;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.b2bking_group_rule_pro_editor_save_success_notification.show {
    opacity: 1;
    transform: translateY(0);
}

.b2bking_group_rule_pro_editor_save_success_notification_content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.b2bking_group_rule_pro_editor_save_success_notification_content::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(135deg, #906a1d 0%, #b8860b 100%);
}

.b2bking_group_rule_pro_editor_save_success_notification_icon {
    flex-shrink: 0;
    color: #906a1d;
    width: 20px;
    height: 20px;
}

.b2bking_group_rule_pro_editor_save_success_notification_text {
    flex: 1;
    color: #191821;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}

/* Animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .b2bking_group_rule_pro_editor_header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 0;
        margin: 0 0 16px 0;
    }
    
    .b2bking_group_rule_pro_editor_header_title {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .b2bking_group_rule_pro_editor_header_text h1 {
        font-size: 20px;
    }
    
    .b2bking_group_rule_pro_editor_header_actions {
        gap: 12px;
        flex-wrap: wrap;
    }
    
    .b2bking_group_rule_pro_editor_steps {
        flex-direction: column;
    }
    
    .b2bking_group_rule_pro_editor_step {
        border-right: none;
        border-bottom: 1px solid #f0f0f0;
        padding: 16px 20px;
    }
    
    .b2bking_group_rule_pro_editor_step:last-child {
        border-bottom: none;
    }
    
    .b2bking_group_rule_pro_editor_step_number {
        width: 28px;
        height: 28px;
        font-size: 12px;
        margin-right: 12px;
    }
    
    .b2bking_group_rule_pro_editor_step_title {
        font-size: 13px;
    }
    
    .b2bking_group_rule_pro_editor_step_description {
        font-size: 11px;
    }
    
    .b2bking_group_rule_pro_editor_section_header {
        padding: 24px 20px 20px 20px;
    }
    
    .b2bking_group_rule_pro_editor_form_grid {
        padding: 24px 20px;
        gap: 20px;
    }
    
    .b2bking_group_rule_pro_editor_field_row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .b2bking_group_rule_pro_editor_test_actions {
        padding: 0 20px 20px 20px;
    }
    
    .b2bking_group_rule_pro_editor_test_results {
        margin: 0 20px 24px 20px;
    }
    
    .b2bking_group_rule_pro_editor_step_actions {
        padding: 24px 20px;
        flex-direction: column;
        gap: 16px;
    }
    
    .b2bking_group_rule_pro_editor_step_actions_left,
    .b2bking_group_rule_pro_editor_step_actions_center,
    .b2bking_group_rule_pro_editor_step_actions_right {
        justify-content: center;
        width: 100%;
    }
    
    .b2bking_group_rule_pro_editor_form_actions {
        padding: 24px 20px;
        flex-direction: column;
    }
    
    .b2bking_group_rule_pro_editor_message {
        top: 20px;
        right: 20px;
        left: 20px;
        max-width: none;
    }
}

/* Loading States */
.b2bking_group_rule_pro_editor_loading {
    opacity: 0.6;
    pointer-events: none;
}

.b2bking_group_rule_pro_editor_loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #906a1d;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Validation States - High Specificity */
#b2bking_group_rule_pro_editor_main_container .b2bking_group_rule_pro_editor_input.error,
#b2bking_group_rule_pro_editor_main_container input.b2bking_group_rule_pro_editor_input.error,
#b2bking_group_rule_pro_editor_main_container .b2bking_group_rule_pro_editor_select.error,
#b2bking_group_rule_pro_editor_main_container select.b2bking_group_rule_pro_editor_select.error {
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1) !important;
}

#b2bking_group_rule_pro_editor_main_container .b2bking_group_rule_pro_editor_input.success,
#b2bking_group_rule_pro_editor_main_container input.b2bking_group_rule_pro_editor_input.success,
#b2bking_group_rule_pro_editor_main_container .b2bking_group_rule_pro_editor_select.success,
#b2bking_group_rule_pro_editor_main_container select.b2bking_group_rule_pro_editor_select.success {
    border-color: #e0e0e0 !important;
    box-shadow: none !important;
}

/* Test Results Styling */
.b2bking_group_rule_pro_editor_test_results h4 {
    color: #191821;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px 0;
}

.b2bking_group_rule_pro_editor_test_results .customer-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #ffffff;
}

.b2bking_group_rule_pro_editor_test_results .customer-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.b2bking_group_rule_pro_editor_test_results .customer-item:last-child {
    border-bottom: none;
}

.b2bking_group_rule_pro_editor_test_results .customer-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.b2bking_group_rule_pro_editor_test_results .customer-name {
    font-weight: 500;
    color: #191821;
    font-size: 14px;
}

.b2bking_group_rule_pro_editor_test_results .customer-email {
    color: #666666;
    font-size: 13px;
}

.b2bking_group_rule_pro_editor_test_results .customer-value {
    font-weight: 600;
    color: #906a1d;
    font-size: 14px;
}

#b2bking_group_rule_pro_editor_main_container .b2bking_group_rule_pro_editor_select,
#b2bking_group_rule_pro_editor_main_container select.b2bking_group_rule_pro_editor_select {
    width: 100% !important;
    max-width: 100% !important;
}


/* ============================================
   B2BKing Grule Individual Editor  Styles (Card-Based)
   ============================================ */

.b2bking-rule-builder {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Live Preview Bar */
.b2bking-rule-preview {
    position: fixed;
    bottom: 32px;
    right: 32px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    color: #191821;
    padding: 20px 24px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(25, 24, 33, 0.08);
    backdrop-filter: blur(10px);
    border: 2px solid #e9ecef;
    max-width: 400px;
    z-index: 1000;
}

.preview-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.preview-icon {
    font-size: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    background: rgb(108 117 125 / 6%);
    color: #6c757d;
    border-color: rgba(108, 117, 125, 0.2);
    padding: 4px 6px;
    border-radius: 10px;
    border: 1px solid rgba(108, 117, 125, 0.2);
}

.preview-icon svg {
    width: 20px;
    height: 20px;
}

.preview-text {
    font-size: 14px;
    line-height: 1.4;
    color: #6c757d;
    font-weight: 500;
}

.preview-text strong {
    color: #906a1d;
    font-weight: 600;
}

/* Cards Container */
.b2bking-cards-container {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

/* Card Styles */
.b2bking-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    overflow: hidden;
    transition: all 0.3s ease;
    margin-top: 23px;
}

.b2bking-card:first-child {
    margin-top: 0;
}

.b2bking-card:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.b2bking-card.expanded .card-body {
    display: block;
}

.b2bking-card.final-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid #e5e7eb;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
    margin-bottom: 125px;
}


.final-card-content {
    padding: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.final-card-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    flex: 1;
}

.final-card-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #906a1d 0%, #a67c1f 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(144, 106, 29, 0.3);
}

.final-card-text h3 {
    color: #191821;
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 8px 0;
    line-height: 1.2;
}

.final-card-text p {
    color: #6b7280;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

/* Card Header */
.card-header {
    padding: 20px 24px;
    background: #faf9f8;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.card-number {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #906a1d 0%, #b8860b 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.card-title-section {
    flex: 1;
}

.card-title-section h3 {
    margin: 0 0 4px 0;
    font-size: 18px;
    font-weight: 600;
    color: #191821;
}

.card-title-section p {
    margin: 0;
    font-size: 14px;
    color: #6b7280;
    line-height: 1.4;
    font-weight: 300;
}

.card-summary {
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
    background: rgb(255 255 255);
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid rgb(228 228 228);
}

/* Card Body */
.card-body {
    padding: 24px;
}

.card-body.collapsed {
    display: none;
}

/* Rule Name Input */
.b2bking-rule-name-input {
    padding: 10px 16px !important;
    border: 2px solid #e0e0e0 !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    color: #191821 !important;
    background: #ffffff !important;
    transition: all 0.2s ease !important;
    outline: none !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    font-weight: 500;
}
.b2bking-wp-7-plus .b2bking-rule-name-input{
    line-height: 2;
}
.b2bking-rule-name-input::placeholder {
    font-weight: 400;
}

.b2bking-rule-name-input:focus {
    outline: none;
    border-color: #906a1d;
    box-shadow: none !important;
}

.field-hint {
    margin: 8px 0 0 0;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.4;
}

/* Condition Builder */
.condition-builder {
    background: #fcfcfc;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e5e7eb;
}
.b2bking-wp-7-plus .condition-builder select, .b2bking-wp-7-plus .condition-builder input{
    line-height: 2 !important;
    min-height: 30px !important;
    border-radius: 3px !important;
}

.condition-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr 1.5fr;
    gap: 20px;
    align-items: end;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field-group label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin: 0;
}

.b2bking-select,
.b2bking-select-small {
    padding: 10px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    color: #191821;
    background: #ffffff;
    transition: all 0.3s ease;
}

.b2bking-select:focus,
.b2bking-select-small:focus {
    outline: none;
    border-color: #906a1d;
    box-shadow: 0 0 0 3px rgba(144, 106, 29, 0.1);
}

.b2bking-input-small,
.b2bking-input-medium {
    padding: 10px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    color: #191821;
    background: #ffffff;
    transition: all 0.3s ease;
}

.b2bking-input-small:focus,
.b2bking-input-medium:focus {
    outline: none;
    border-color: #906a1d;
    box-shadow: 0 0 0 3px rgba(144, 106, 29, 0.1);
}

.field-suffix {
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
    margin-left: 8px;
    display: inline;
}

/* Move field-suffix to appear inline with label instead of after input */
.b2bking-rule-builder .field-group:has(.field-suffix) label {
    display: flex;
    align-items: center;
    gap: 4px;
}

.b2bking-rule-builder .field-group .field-suffix {
    margin-left: 4px;
    margin-right: 0;
    order: 1;
}

.b2bking-rule-builder .field-group:has(.field-suffix) input {
    margin-top: 8px;
}

/* Fallback for browsers that don't support :has() */
.b2bking-rule-builder .field-group.period label {
    display: flex;
    align-items: center;
    gap: 4px;
}

.b2bking-rule-builder .field-group.period input {
    margin-top: 8px;
}

/* Ensure prefix elements are not affected and properly positioned */
.b2bking-rule-builder .input-with-prefix {
    position: relative;
    display: flex;
    align-items: center;
}

.b2bking-rule-builder .prefix {
    position: absolute;
    left: 12px;
    color: #6b7280;
    font-weight: 600;
    font-size: 14px;
    z-index: 1;
    top: 50%;
    transform: translateY(-50%);
}

.b2bking-rule-builder .input-with-prefix input {
    padding-left: 30px;
    margin-top: 0 !important;
}


/* Range Inputs */
.range-inputs {
    display: flex;
    align-items: center;
    gap: 12px;
}

.range-separator {
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

/* Action Grid */
.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.group-option {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.group-option:hover {
    border-color: #906a1d;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(144, 106, 29, 0.15);
}

.group-option.selected {
    border-color: #906a1d;
    background: linear-gradient(135deg, rgba(144, 106, 29, 0.05) 0%, rgba(184, 134, 11, 0.05) 100%);
}

.group-option.selected::before {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    background: #906a1d;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.group-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.group-name {
    font-size: 16px;
    font-weight: 600;
    color: #191821;
    margin-bottom: 8px;
}

.group-count {
    font-size: 14px;
    color: #6b7280;
}

/* Source Options */
.source-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.b2bking-wp-7-plus .source-options input[type="radio"]{
    background: #fff;
    border: 1px solid #8c8f94;
}
.b2bking-wp-7-plus .source-options input[type="radio"]:focus{
    outline: none !important;
    box-shadow: none !important;
}
.b2bking-wp-7-plus .source-options input[type="radio"]:checked:before{
    content: "";
    border-radius: 50%;
    width: .5rem;
    height: .5rem;
    margin: .1875rem;
    background-color: #3582c4;
    line-height: 1.14285714;
}

.source-option {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.source-option:hover {
    border-color: #906a1d;
    background: rgba(144, 106, 29, 0.02);
}

.source-option.selected {
    border-color: #906a1d;
    background: linear-gradient(135deg, rgba(144, 106, 29, 0.05) 0%, rgba(184, 134, 11, 0.05) 100%);
}

.source-option input[type="hidden"] {
    display: none;
}

.option-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.option-icon {
    width: 40px;
    height: 40px;
    background: #f3f4f6;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.source-option.selected .option-icon {
    background: #374151;
    color: #ffffff;
}

/* Fix radio alignment inside Apply To on the editor page only */
#b2bking_group_rule_pro_editor_main_container .source-options input[type="radio"] {
    margin-top: 0px;
}

.option-text {
    flex: 1;
}

.option-text strong {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #191821;
    margin-bottom: 4px;
}

.option-text span {
    font-size: 14px;
    color: #6b7280;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 16px;
    justify-content: flex-end;
    align-items: center;
}

.btn-cancel {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #f8f9fa;
    color: #6b7280;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-cancel:hover {
    background: #e5e7eb;
    color: #374151;
    border-color: #d1d5db;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    background: linear-gradient(135deg, #906a1d 0%, #a67c1f 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(144, 106, 29, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(144, 106, 29, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-icon-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    position: relative;
}

.btn-icon-container .btn-checkmark,
.btn-icon-container .btn-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.btn-loading {
    display: flex;
    align-items: center;
    gap: 8px;
}

.spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.button {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.button-secondary {
    background: #f8fafc;
    color: #6b7280;
    border: 2px solid #e5e7eb;
}

.button-secondary:hover {
    background: #f1f5f9;
    border-color: #d1d5db;
    color: #374151;
}

.button-primary {
    background: linear-gradient(135deg, #906a1d 0%, #b8860b 100%);
    color: white;
    border: 2px solid transparent;
}

.button-primary:hover {
    background: linear-gradient(135deg, #7a5a17 0%, #a0780a 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(144, 106, 29, 0.3);
}

.button-hero {
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 700;
}


/* Message Styles */
.b2bking_group_rule_pro_editor_3_message {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 400px;
}

.b2bking_group_rule_pro_editor_3_message_content {
    background: #ffffff;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 12px;
}

.b2bking_group_rule_pro_editor_3_message_icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
}

.b2bking_group_rule_pro_editor_3_message.success .b2bking_group_rule_pro_editor_3_message_icon {
    background: #10b981;
}

.b2bking_group_rule_pro_editor_3_message.error .b2bking_group_rule_pro_editor_3_message_icon {
    background: #ef4444;
}

.b2bking_group_rule_pro_editor_3_message_text {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #191821;
}

.b2bking_group_rule_pro_editor_3_message_close {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.b2bking_group_rule_pro_editor_3_message_close:hover {
    background: #f3f4f6;
    color: #374151;
}

/* Text-only styling for card-based editor header text */
.b2bking-rule-builder .b2bking_group_rule_pro_editor_header_text h1 {
    color: #61646b !important;
    font-size: 19px !important;
    font-weight: 300 !important;
    margin: 0 !important;
    line-height: 1.3 !important;
    letter-spacing: -0.01em !important;
}

.b2bking-rule-builder .b2bking_group_rule_pro_editor_header_text p {
    color: #9ca3af !important;
    font-size: 13px !important;
    margin: 0 !important;
    line-height: 1.4 !important;
    font-weight: 400 !important;
}

/* Border styling for selects and inputs in conditions area */
.b2bking-rule-builder .condition-builder select,
.b2bking-rule-builder .condition-builder input,
.b2bking-rule-builder .b2bking-select,
.b2bking-rule-builder .b2bking-select-small,
.b2bking-rule-builder .b2bking-input-small,
.b2bking-rule-builder .b2bking-input-medium {
    border: 1px solid #ccc !important;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .condition-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .action-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .b2bking-rule-preview {
        position: relative;
        bottom: auto;
        right: auto;
        margin: 32px 0;
        max-width: none;
    }
}

@media (max-width: 768px) {


    .condition-row select, .condition-row input, .condition-row .input-with-prefix, .final-card-text{
        width: 100% !important;
        max-width: 100% !important;
    }

    .b2bking-rule-builder {
        padding: 15px;
    }
    
    .b2bking_group_rule_pro_editor_header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 0;
        margin: 0 0 16px 0;
    }
    
    .b2bking_group_rule_pro_editor_header_title {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .b2bking_group_rule_pro_editor_header_text h1 {
        font-size: 20px;
    }
    
    .card-header {
        padding: 16px 20px;
    }
    
    .card-body {
        padding: 20px;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 12px;
    }
    
    .final-card-content {
        padding: 24px;
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
    }
    
    .final-card-header {
        flex-direction: column;
        text-align: center;
        gap: 12px;
        flex: none;
    }
    
    .final-card-icon {
        align-self: center;
    }
    
    .button {
        width: 100%;
        justify-content: center;
    }
    
    .range-inputs {
        flex-direction: column;
        gap: 8px;
    }
    
    .range-separator {
        text-align: center;
    }
    
    /* Mobile text styling for card-based editor header text */
    .b2bking-rule-builder .b2bking_group_rule_pro_editor_header_text h1 {
        font-size: 18px !important;
    }
}

/* Gold Border for Selected/Non-Empty Elements - Name and Conditions Only */
#b2bking_group_rule_pro_editor_main_container .b2bking-rule-name-input.has-content,
#b2bking_group_rule_pro_editor_main_container .condition-builder select.has-content,
#b2bking_group_rule_pro_editor_main_container .condition-builder input.has-content,
#b2bking_group_rule_pro_editor_main_container .b2bking-select.has-content,
#b2bking_group_rule_pro_editor_main_container .b2bking-select-small.has-content,
#b2bking_group_rule_pro_editor_main_container .b2bking-input-small.has-content,
#b2bking_group_rule_pro_editor_main_container .b2bking-input-medium.has-content {
    border-color: #cdc3ad !important;
}
