/* Multi-Rules Interface Styles */

.catc-rules-section {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    margin: 20px 0;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

.catc-rules-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #dcdcde;
}

.catc-rules-header h2 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
}

.catc-rules-header h2 .dashicons {
    color: #2271b1;
    line-height: 1;
    vertical-align: middle;
}

.catc-add-rule {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.catc-add-rule .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 1;
    vertical-align: middle;
}

/* No Rules State */
.catc-no-rules {
    text-align: center;
    padding: 60px 20px;
    color: #646970;
}

.catc-no-rules .dashicons {
    font-size: 64px;
    width: 64px;
    height: 64px;
    color: #c3c4c7;
    margin-bottom: 15px;
    line-height: 1;
    vertical-align: middle;
}

.catc-no-rules p {
    margin: 0;
    font-size: 15px;
}

/* Rule Item */
.catc-rule-item {
    border-bottom: 1px solid #dcdcde;
    transition: background-color 0.2s;
}

.catc-rule-item:last-child {
    border-bottom: none;
}

.catc-rule-item:hover {
    background-color: #f6f7f7;
}

.catc-rule-item.collapsed .catc-rule-content {
    display: none;
}

.catc-rule-item.collapsed .catc-rule-toggle-content .dashicons {
    transform: rotate(-90deg);
}

/* Rule Header */
.catc-rule-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    cursor: pointer;
    user-select: none;
}

.catc-rule-handle {
    cursor: move;
    color: #c3c4c7;
    flex-shrink: 0;
}

.catc-rule-handle:hover {
    color: #2271b1;
}

.catc-rule-title-section {
    flex: 1;
    min-width: 0;
}

.catc-rule-title-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.catc-rule-name-input {
    width: 100%;
    max-width: 400px;
    font-size: 15px;
    font-weight: 600;
    padding: 5px 10px;
}

.catc-rule-name-collapsed {
    display: none;
}

.catc-rule-name-display {
    font-size: 15px;
    font-weight: 600;
    color: #1d2327;
}

.catc-unsaved-indicator {
    color: #d63638;
    font-size: 12px;
    font-weight: normal;
    white-space: nowrap;
}

.catc-rule-item.collapsed .catc-rule-name-input {
    display: none;
}

.catc-rule-item.collapsed .catc-rule-name-collapsed {
    display: inline;
}

/* Rule Actions */
.catc-rule-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.catc-rule-toggle {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.catc-rule-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.catc-rule-toggle .catc-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 20px;
}

.catc-rule-toggle .catc-toggle-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.catc-rule-toggle input:checked + .catc-toggle-slider {
    background-color: #2271b1;
}

.catc-rule-toggle input:checked + .catc-toggle-slider:before {
    transform: translateX(20px);
}

.catc-rule-duplicate,
.catc-rule-delete,
.catc-rule-toggle-content {
    padding: 4px 8px;
    min-width: auto;
    height: auto;
    border: none;
    background: transparent;
    cursor: pointer;
}

.catc-rule-duplicate:hover,
.catc-rule-delete:hover,
.catc-rule-toggle-content:hover {
    background: #f0f0f1;
}

.catc-rule-delete:hover {
    color: #d63638;
}

.catc-rule-duplicate .dashicons,
.catc-rule-delete .dashicons,
.catc-rule-toggle-content .dashicons {
    width: 20px;
    height: 20px;
    font-size: 20px;
    line-height: 1;
    vertical-align: middle;
}

.catc-rule-delete:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.catc-rule-delete:disabled .dashicons-update {
    animation: spin 1s linear infinite;
}

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

.catc-rule-toggle-content .dashicons {
    transition: transform 0.2s;
}

/* Rule Content */
.catc-rule-content {
    padding: 0 20px 20px 20px;
    border-top: 1px solid #f0f0f1;
}

.catc-rule-step {
    margin-bottom: 20px;
}

.catc-rule-step:last-child {
    margin-bottom: 0;
}

.catc-rule-step .catc-step-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: #f6f7f7;
    border-radius: 4px;
    margin-bottom: 15px;
}

.catc-rule-step .catc-step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #2271b1;
    color: #fff;
    border-radius: 50%;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.catc-rule-step .catc-step-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #1d2327;
}

.catc-rule-step .catc-step-description {
    margin: 5px 0 0 0;
    font-size: 12px;
    color: #646970;
    font-style: italic;
    font-weight: normal;
}

.catc-rule-step .catc-step-content {
    padding: 0 15px;
}

/* Empty State Small */
.catc-empty-state-small {
    padding: 20px;
    background: #f6f7f7;
    border: 1px dashed #c3c4c7;
    border-radius: 4px;
    text-align: center;
    margin-bottom: 10px;
}

.catc-empty-state-small p {
    margin: 0;
    color: #646970;
    font-size: 13px;
    font-style: italic;
}

/* Scope Options in Rules */
.catc-rule-step .catc-scope-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.catc-rule-step .catc-radio-card-content {
    padding: 15px 10px;
}

.catc-rule-step .catc-radio-card-content .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    margin-bottom: 5px;
    line-height: 1;
    vertical-align: middle;
}

.catc-rule-step .catc-radio-card-content strong {
    font-size: 13px;
}

.catc-rule-step .catc-radio-card-content p {
    display: none;
}

/* Selector Boxes */
.catc-selector-box {
    margin-top: 15px;
}

.catc-selector-box .catc-field-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #1d2327;
    margin-bottom: 10px;
    font-size: 14px;
}

.catc-selector-box .catc-field-label .dashicons {
    color: #2271b1;
    font-size: 18px;
    width: 18px;
    height: 18px;
    line-height: 1;
    vertical-align: middle;
}

.catc-pro-badge-small {
    background: #1d2327;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 8px;
}

.catc-selector-box .select2-container {
    width: 100% !important;
    max-width: 500px;
}

.catc-selector-box .description {
    margin-top: 8px;
    color: #646970;
    font-size: 13px;
    display: flex;
    align-items: flex-start;
    gap: 5px;
}

.catc-selector-box .description .dashicons {
    color: #2271b1;
    flex-shrink: 0;
    margin-top: 2px;
    line-height: 1;
    vertical-align: middle;
}

/* Condition Pro Notice */
.catc-condition-pro-notice {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
    color: #646970;
    font-size: 12px;
}

.catc-condition-pro-notice .dashicons {
    color: #2271b1;
    font-size: 14px;
    width: 14px;
    height: 14px;
    line-height: 1;
    vertical-align: middle;
}

.catc-condition-pro-notice small {
    margin: 0;
    font-style: italic;
}

/* Condition Search Container */
.catc-condition-search-container {
    width: 100%;
    position: relative;
}

/* Select2 in conditions - ensure proper width */
.catcConditionSearch + .select2-container {
    width: 100% !important;
}

/* Contextual Help Box */
.catc-contextual-help {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    padding: 15px;
    background: #f0f6fc;
    border: 1px solid #c3c4c7;
    border-left: 4px solid #2271b1;
    border-radius: 4px;
}

.catc-help-icon {
    flex-shrink: 0;
}

.catc-help-icon .dashicons {
    color: #2271b1;
    font-size: 20px;
    width: 20px;
    height: 20px;
    line-height: 1;
    vertical-align: middle;
}

.catc-help-content {
    flex: 1;
}

.catc-help-content strong {
    display: block;
    margin-bottom: 8px;
    color: #1d2327;
    font-size: 14px;
}

.catc-help-content p {
    margin: 0 0 12px 0;
    color: #646970;
    font-size: 13px;
    line-height: 1.5;
}

.catc-help-examples {
    background: #fff;
    padding: 10px;
    border-radius: 3px;
    border: 1px solid #dcdcde;
}

.catc-help-example {
    font-size: 12px;
    color: #646970;
    line-height: 1.4;
}

.catc-help-example strong {
    display: inline;
    margin: 0;
    color: #2271b1;
    font-size: 12px;
}

/* Responsive for scope options */
@media (max-width: 1200px) {
    .catc-rule-step .catc-scope-options {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 782px) {
    .catc-rule-step .catc-scope-options {
        grid-template-columns: 1fr;
    }
}

/* Sortable Placeholder */
.catc-rule-placeholder {
    background: #f0f6fc;
    border: 2px dashed #2271b1;
    height: 60px;
    margin-bottom: 1px;
}

/* Disabled Rule */
.catc-rule-item.disabled {
    opacity: 0.6;
}

.catc-rule-item.disabled .catc-rule-header {
    background: #f6f7f7;
}


/* Improved Action Cards */
.catc-actions-wrapper-improved {
    margin-top: 10px;
}

.catc-action-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.catc-action-card {
    position: relative;
    display: block;
    cursor: pointer;
}

.catc-action-card input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.catc-action-card-content {
    border: 2px solid #dcdcde;
    border-radius: 4px;
    padding: 20px 15px;
    text-align: center;
    transition: all 0.2s;
    background: #fff;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.catc-action-card-content .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    color: #646970;
    margin-bottom: 10px;
    line-height: 1;
    vertical-align: middle;
}

.catc-action-card-content strong {
    display: block;
    margin-bottom: 8px;
    color: #1d2327;
    font-size: 14px;
}

.catc-action-card-content p {
    margin: 0;
    font-size: 12px;
    color: #646970;
    line-height: 1.4;
}

.catc-action-card input:checked + .catc-action-card-content,
.catc-action-card.active .catc-action-card-content {
    border-color: #2271b1;
    background: #f0f6fc;
    box-shadow: 0 0 0 1px #2271b1;
}

.catc-action-card input:checked + .catc-action-card-content .dashicons,
.catc-action-card.active .catc-action-card-content .dashicons {
    color: #2271b1;
}

.catc-action-card:hover .catc-action-card-content {
    border-color: #2271b1;
}

/* Action Fields */
.catc-action-fields {
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    padding: 20px;
    display: none; /* Hidden by default */
}

.catc-action-fields.has-selection {
    display: block; /* Show when an action is selected */
}

.catc-action-field {
    /* Removed animation for cleaner UI */
}

.catc-field-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #1d2327;
    margin-bottom: 10px;
    font-size: 14px;
}

.catc-field-label .dashicons {
    color: #2271b1;
    font-size: 18px;
    width: 18px;
    height: 18px;
    line-height: 1;
    vertical-align: middle;
}

.catc-text-input {
    width: 100%;
    max-width: 500px;
    padding: 8px 12px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 14px;
}

.catc-editor-textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 8px 12px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
}

.catc-editor-textarea:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}

.catc-action-field[data-action="replace"] .wp-editor-container,
.catc-action-field[data-action="replace"] .wp-editor-wrap {
    width: 100%;
    max-width: 100%;
}

.catc-text-input:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}

.catc-action-field .description {
    margin-top: 8px;
    color: #646970;
    font-size: 13px;
    display: flex;
    align-items: flex-start;
    gap: 5px;
}

.catc-action-field .description .dashicons {
    color: #2271b1;
    flex-shrink: 0;
    margin-top: 2px;
    line-height: 1;
    vertical-align: middle;
}

.catc-action-field .description code {
    background: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
}

/* Action Info Box */
.catc-action-info {
    padding: 0;
}

.catc-info-box {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    border-left: 4px solid #2271b1;
}

.catc-info-box .dashicons {
    color: #2271b1;
    font-size: 24px;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    margin-top: 2px;
    line-height: 1;
    vertical-align: middle;
}

.catc-info-box strong {
    display: block;
    margin-bottom: 5px;
    color: #1d2327;
}

.catc-info-box p {
    margin: 0;
    color: #646970;
    font-size: 13px;
    line-height: 1.5;
}

/* Responsive */
@media (max-width: 782px) {
    .catc-action-cards {
        grid-template-columns: 1fr;
    }
    
    .catc-action-card-content {
        min-height: auto;
        padding: 15px;
    }
}


/* WooCommerce Help Tips */
.catc-step-header .woocommerce-help-tip {
    margin-left: 5px;
    vertical-align: middle;
}

/* Step Headers */
.catc-step-header h4 {
    display: flex;
    align-items: center;
    gap: 5px;
}

.catc-step-description {
    color: #646970;
    font-size: 13px;
    margin: 5px 0 0 0;
    font-style: italic;
}

/* Field Labels with Icons */
.catc-field-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
    margin-bottom: 8px;
}

.catc-field-label .dashicons {
    color: #2271b1;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.catc-field-label .woocommerce-help-tip {
    margin-left: auto;
}

/* Description Text */
p.description {
    display: flex;
    align-items: flex-start;
    gap: 5px;
    color: #646970;
    font-size: 13px;
    margin-top: 8px;
}

p.description .dashicons {
    color: #2271b1;
    font-size: 16px;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-top: 2px;
}



/* Rule Summary (shown when collapsed) */
.catc-rule-summary {
    font-size: 13px;
    color: #646970;
    margin-top: 4px;
    display: none; /* Hidden when expanded */
}

.catc-rule-item.collapsed .catc-rule-summary {
    display: block;
}

.catc-rule-title-wrapper {
    position: relative;
}

/* Hide summary when rule is expanded */
.catc-rule-item:not(.collapsed) .catc-rule-summary {
    display: none;
}


/* Toggle saved feedback */
.catc-toggle-saved {
    animation: catc-pulse-green 0.5s ease-in-out;
}

@keyframes catc-pulse-green {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

/* Disabled rule styling */
.catc-rule-disabled {
    opacity: 0.6;
}

.catc-rule-disabled .catc-rule-header {
    background-color: #f6f7f7;
}

/* Rollback Button */
.catc-rollback-button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.catc-rollback-button .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 1;
}

/* =============================================
   Help Tab Styles
   ============================================= */

.catc-help-wrap {
    max-width: 960px;
    margin-top: 20px;
}

.catc-help-intro {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

.catc-help-icon {
    font-size: 40px;
    width: 40px;
    height: 40px;
    color: #2271b1;
    flex-shrink: 0;
}

.catc-help-intro h2 {
    margin: 0 0 4px;
    font-size: 20px;
}

.catc-help-intro p {
    margin: 0;
    color: #646970;
}

.catc-help-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.catc-help-card {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 24px;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.catc-help-card--pro {
    border-color: #2271b1;
    background: #f0f6fc;
}

.catc-help-card-icon {
    font-size: 28px;
    width: 28px;
    height: 28px;
    color: #2271b1;
}

.catc-help-card h3 {
    margin: 0;
    font-size: 15px;
}

.catc-help-card p {
    margin: 0;
    color: #646970;
    font-size: 13px;
    flex: 1;
}

.catc-help-card .button {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.catc-help-upgrade-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #2271b1;
    color: #fff;
    border-radius: 4px;
    padding: 20px 24px;
}

.catc-help-upgrade-banner .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.catc-help-upgrade-banner strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}

.catc-help-upgrade-banner p {
    margin: 0;
    font-size: 13px;
    opacity: .9;
}

.catc-help-upgrade-banner .button-primary {
    margin-left: auto;
    flex-shrink: 0;
    background: #fff;
    color: #2271b1;
    border-color: #fff;
    font-weight: 600;
}

.catc-help-upgrade-banner .button-primary:hover {
    background: #f0f6fc;
    border-color: #f0f6fc;
    color: #135e96;
}

/* Improved Admin UI Styles */

.catc-settings-wrap {
    max-width: 1200px;
}

/* Plugin Version */
.catc-settings-wrap h1 .catc-version {
    font-size: 14px;
    font-weight: 400;
    color: #646970;
    margin-left: 8px;
}

/* Tab Navigation */
.catc-settings-wrap .nav-tab-wrapper {
    margin: 20px 0 0 0;
    border-bottom: 1px solid #c3c4c7;
}

.catc-settings-wrap .nav-tab {
    font-size: 14px;
    padding: 10px 15px;
}

/* Intro Box */
.catc-intro-box {
    background: #fff;
    border-left: 4px solid #2271b1;
    padding: 15px 20px;
    margin: 20px 0;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

.catc-intro-box p {
    margin: 0;
    font-size: 14px;
    color: #50575e;
}

/* Toggle Switch */
.catc-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.catc-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.catc-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.catc-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.catc-toggle input:checked + .catc-toggle-slider {
    background-color: #2271b1;
}

.catc-toggle input:checked + .catc-toggle-slider:before {
    transform: translateX(26px);
}

/* Rule Builder */
.catc-rule-builder {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    margin: 20px 0;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

.catc-section-title {
    margin: 0;
    padding: 20px;
    border-bottom: 1px solid #dcdcde;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.catc-section-title .dashicons {
    color: #2271b1;
    line-height: 1;
    vertical-align: middle;
}

/* Steps */
.catc-step {
    border-bottom: 1px solid #f0f0f1;
}

.catc-step:last-child {
    border-bottom: none;
}

.catc-step-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: #f6f7f7;
}

.catc-step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #2271b1;
    color: #fff;
    border-radius: 50%;
    font-weight: 600;
    font-size: 16px;
    flex-shrink: 0;
}

.catc-step-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1d2327;
}

.catc-step-content {
    padding: 20px;
}

.catc-step-description {
    color: #646970;
    margin: 0 0 20px 0;
    font-size: 14px;
}

/* Radio Cards */
.catc-scope-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.catc-radio-card {
    position: relative;
    display: block;
    cursor: pointer;
}

.catc-radio-card input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.catc-radio-card-content {
    border: 2px solid #dcdcde;
    border-radius: 4px;
    padding: 20px;
    text-align: center;
    transition: all 0.2s;
    background: #fff;
}

.catc-radio-card-content .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    color: #646970;
    margin-bottom: 10px;
    line-height: 1;
    vertical-align: middle;
}

.catc-radio-card-content strong {
    display: block;
    margin-bottom: 5px;
    color: #1d2327;
}

.catc-radio-card-content p {
    margin: 0;
    font-size: 13px;
    color: #646970;
}

.catc-radio-card input:checked + .catc-radio-card-content,
.catc-radio-card.active .catc-radio-card-content {
    border-color: #2271b1;
    background: #f0f6fc;
}

.catc-radio-card input:checked + .catc-radio-card-content .dashicons,
.catc-radio-card.active .catc-radio-card-content .dashicons {
    color: #2271b1;
}

.catc-radio-card:hover .catc-radio-card-content {
    border-color: #2271b1;
}

/* Selector Box */
.catc-selector-box {
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    padding: 15px;
    margin-top: 15px;
}

.catc-selector-box label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: #1d2327;
}

.catc-selector-box .description {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
    color: #646970;
}

.catc-selector-box .dashicons-info {
    color: #2271b1;
    line-height: 1;
    vertical-align: middle;
}

/* Empty State */
.catc-empty-state {
    text-align: center;
    padding: 40px 20px;
    background: #f6f7f7;
    border: 2px dashed #c3c4c7;
    border-radius: 4px;
    margin-bottom: 15px;
}

.catc-empty-state .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #c3c4c7;
    margin-bottom: 10px;
    line-height: 1;
    vertical-align: middle;
}

.catc-empty-state p {
    margin: 0;
    color: #646970;
    font-style: italic;
}

/* Examples Section */
.catc-examples-section {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 20px;
    margin: 20px 0;
}

.catc-examples-section h2 {
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #1d2327;
}

.catc-examples-section h2 .dashicons {
    color: #f0b849;
    line-height: 1;
    vertical-align: middle;
}

.catc-examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.catc-example-card {
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    padding: 20px;
}

.catc-example-card h4 {
    margin-top: 0;
    color: #1d2327;
}

.catc-example-card p {
    color: #646970;
    font-size: 14px;
}

.catc-example-setup {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #dcdcde;
}

.catc-example-setup strong {
    display: block;
    margin-bottom: 10px;
    color: #1d2327;
}

.catc-example-setup ol {
    margin: 0;
    padding-left: 20px;
}

.catc-example-setup li {
    font-size: 13px;
    color: #646970;
    margin-bottom: 5px;
}

/* Buttons */
.catcAddConditionGroup {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.catcAddConditionGroup .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 1;
    vertical-align: middle;
}

/* Condition Groups in new UI */
.catc-step-content .catcConditionGroup {
    margin-bottom: 15px;
}


/* Pro Feature Styles */
.catc-pro-badge {
    display: inline-block;
    background: #7e7e7e;
    color: #fff;
    padding: 0px 5px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 600;
    margin-left: 6px;
    vertical-align: middle;
    text-transform: uppercase;
}

.catc-pro-feature {
    position: relative;
    opacity: 0.6;
    cursor: not-allowed;
}

.catc-action-card.catc-pro-feature:hover {
    border-color: #dcdcde;
    box-shadow: none;
}

.catc-action-card.catc-pro-feature input[type="radio"]:disabled {
    cursor: not-allowed;
}

.catc-action-field.catc-pro-feature {
    position: relative;
}

.catc-pro-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 4px;
}

.catc-pro-message {
    text-align: center;
    padding: 40px 20px;
    max-width: 400px;
}

.catc-pro-message .dashicons {
    color: #646970;
    margin-bottom: 15px;
}

.catc-pro-message h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #1d2327;
}

.catc-pro-message p {
    margin: 0 0 20px 0;
    color: #50575e;
    line-height: 1.6;
}

.catc-pro-message .button-primary {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
}

.catc-pro-message .button-primary:hover,
.catc-pro-message .button-primary:focus {
    background: #135e96;
    border-color: #135e96;
    color: #fff;
}

/* Disabled pro conditions in select */
select option:disabled {
    color: #999;
    font-style: italic;
}

/* Pro feature in field labels */
.catc-field-label .catc-pro-badge {
    font-size: 10px;
    padding: 1px 6px;
}

/* Pro badge in rules header */
.catc-rules-header .catc-pro-badge {
    font-size: 11px;
    padding: 3px 8px;
    margin-left: 8px;
}

/* Pro badge in buttons */
.button .catc-pro-badge {
    margin-left: 5px;
    font-size: 10px;
    padding: 2px 6px;
}


/* Pro Upgrade Sidebar */
.catc-pro-sidebar {
    background: white;
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,.04);
    position: sticky;
    top: 32px;
    max-width: 280px;
    overflow: hidden;
}

.catc-pro-sidebar-header {
    background: #4e4647;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 24px 20px;
    text-align: center;
    color: #fff;
}

.catc-pro-badge-large {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.25);
    padding: 8px 16px;
    border-radius: 20px;
    margin-bottom: 12px;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.5px;
}

.catc-pro-badge-large .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: #ffd700;
}

.catc-pro-sidebar-header h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
}

.catc-pro-sidebar-header .catc-pro-tagline {
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.95);
    text-align: center;
}

.catc-pro-sidebar-content {
    padding: 24px 20px;
    background: #fff;
}

.catc-pro-features-list {
    margin: 0 0 20px 0;
}

.catc-pro-feature-item {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    align-items: flex-start;
}

.catc-pro-feature-item:last-child {
    margin-bottom: 0;
}

.catc-pro-feature-item .dashicons {
    color: #80cd91;
    font-size: 20px;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 1px;
}

.catc-pro-feature-item strong {
    display: block;
    font-size: 13px;
    color: #1d2327;
    margin-bottom: 3px;
    font-weight: 600;
}

.catc-pro-feature-item p {
    margin: 0;
    font-size: 12px;
    color: #646970;
    line-height: 1.5;
}

.catc-upgrade-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    background: #80cd91;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 700;
    transition: all 0.3s ease;
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.catc-upgrade-button:hover,
.catc-upgrade-button:focus {

    color: #fff;
    transform: translateY(-2px);
}

.catc-upgrade-button .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.catc-upgrade-button:hover .dashicons {
    transform: translateX(3px);
}

.catc-pro-guarantee {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
    color: #646970;
    font-size: 12px;
}

.catc-pro-guarantee .dashicons {
    color: #80cd91;
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.catc-pro-guarantee p {
    margin: 0;
    font-weight: 500;
}

/* Settings page layout with sidebar */
.catc-settings-with-sidebar {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    flex-wrap: nowrap;
}

.catc-settings-main {
    flex: 1;
    min-width: 0;
    order: 1;
    overflow: visible; /* Allow content to flow naturally */
}

.catc-settings-main form {
    width: 100%;
    max-width: 100%;
}

.catc-settings-main .form-table,
.catc-settings-main .catc-section {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
}

.catc-settings-sidebar {
    flex-shrink: 0;
    width: 280px;
    order: 2; /* Sidebar on the right */
}

/* Only stack on very small screens */
@media screen and (max-width: 1024px) {
    .catc-settings-with-sidebar {
        flex-direction: column;
    }
    
    .catc-settings-sidebar {
        width: 100%;
        max-width: 100%;
        order: 0; /* Move to top on mobile */
    }
    
    .catc-pro-sidebar {
        position: static;
        max-width: 100%;
    }
}


/* Fix condition groups overflow with sidebar */
.catc-settings-with-sidebar .catcConditionGroup,
.catc-settings-with-sidebar .catc-step-content {
    max-width: 100%;
    overflow-x: auto;
}

.catc-settings-with-sidebar .catcCondition {
    max-width: 100%;
    flex-wrap: nowrap; /* Keep items on one line */
    gap: 8px; /* Add consistent spacing */
}

/* Condition layout improvements */
.catcCondition {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
    flex-wrap: nowrap; /* Prevent wrapping */
    min-width: 0; /* Allow shrinking */
}

.catcCondition > div {
    padding-right: 0; /* Remove padding since we use gap */
    min-width: 0; /* Allow shrinking */
}

/* Condition select (first field) - flexible */
.catcCondition > div:nth-child(1) {
    flex: 0 1 auto; /* Can shrink but has natural width */
    min-width: 120px; /* Minimum to remain usable */
}

.catcCondition > div:nth-child(1) select {
    width: 100%;
    min-width: 120px;
}

/* Operator select (second field) - flexible */
.catcCondition > div:nth-child(2) {
    flex: 0 1 auto; /* Can shrink but has natural width */
    min-width: 80px; /* Minimum to remain usable */
}

.catcCondition > div:nth-child(2) select {
    width: 100%;
    min-width: 80px;
}

/* Value field (third field) - takes remaining space */
.catcCondition > div:nth-child(3) {
    flex: 1 1 auto; /* Grows and shrinks, takes remaining space */
    min-width: 150px; /* Minimum width */
}

.catcCondition > div:nth-child(3) select{
    width: 100%;
}
/* Select2 container in conditions */
.catcCondition .select2-container {
    width: 100% !important;
    max-width: none !important;
}

/* Action buttons (And/Delete) - always visible */
.catcCondition > div:nth-child(4),
.catcCondition > div:nth-child(5) {
    flex: 0 0 auto; /* Never shrink, never grow */
    min-width: auto; /* Natural button width */
}

/* Ensure buttons are always visible */
.catcCondition > div:nth-child(4) button,
.catcCondition > div:nth-child(5) button {
    white-space: nowrap;
    min-width: 40px; /* Minimum button width */
}

/* Remove the fixed max-width from search containers */
.catc-settings-with-sidebar select.catcConditionSearch {
    max-width: none;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .catcCondition > div:nth-child(1) {
        min-width: 100px;
    }
    
    .catcCondition > div:nth-child(2) {
        min-width: 70px;
    }
    
    .catcCondition > div:nth-child(3) {
        min-width: 120px;
    }
}

@media (max-width: 782px) {
    .catcCondition {
        flex-wrap: wrap; /* Allow wrapping on very small screens */
        gap: 5px;
    }
    
    .catcCondition > div:nth-child(1),
    .catcCondition > div:nth-child(2) {
        flex: 1 1 auto;
        min-width: 80px;
    }
    
    .catcCondition > div:nth-child(3) {
        flex: 1 1 100%;
        min-width: 100px;
    }
    
    .catcCondition > div:nth-child(4),
    .catcCondition > div:nth-child(5) {
        flex: 0 0 auto;
    }
}

/* Ensure rules list doesn't overflow */
.catc-settings-with-sidebar .catc-rules-list {
    max-width: 100%;
    overflow: visible;
}

.catc-settings-with-sidebar .catc-rule-item {
    max-width: 100%;
}

/* Range Operator Fields */
.catc-value-field-wrapper {
    display: inline-block;
}

.catc-value-range {
    display: flex;
    align-items: center;
    gap: 8px;
}

.catc-value-range input {
    width: 120px;
}

.catc-range-separator {
    color: #646970;
    font-weight: 500;
    padding: 0 4px;
}

.catc-value-min,
.catc-value-max {
    flex: 1;
}

/* Ensure single value field has proper width */
.catc-value-single {
    width: 250px;
}
