/* =========================================
   LEGACY RULE UI (UNCHANGED)
========================================= */

.selected-roles,
.tag-label {
    padding: 0 8px;
}


.role-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    background: #eef2f6;
    border-radius: 16px;
    padding: 4px 8px;
    margin: 4px 4px 0 0;
    font-size: 13px;
}

.tag-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.role-remove,
.tag-remove {
    border: 0;
    background: transparent;
    cursor: pointer;
}

.mjf-rule-invalid {
    background: #fff5f5;
    outline: 1px solid #ff4d4d;
}

.mjf-rule-error {
    font-size: 12px;
    margin-top: 6px;
}

.mjf_wp_subscribe_checkbox {
    margin-bottom: 16px;
}

/* =========================================
   ADMIN WRAPPER (MINIMAL)
========================================= */

.mjf_wp_mc_admin_wrap {
    padding: 0;
}

.mjf_wp_mc_title {
    font-size: 22px;
    margin: 16px 0;
}

.mjf_wp_mc_section_title {
    font-size: 15px;
    margin: 16px 0 10px;
}

/* =========================================
   TABS (keep WP native look)
========================================= */

.mjf_wp_mc_tabs {
    margin-bottom: 16px;
}

/* =========================================
   FORM BUILDER (NO VISUAL SKINNING)
========================================= */

.mjf_wp_mc_form_builder {
    max-width: 800px;
}

/* =========================================
   FIELD SYSTEM (structure only)
========================================= */

.mjf_wp_mc_field {
    margin-bottom: 14px;
}

/* labels inherit WP admin styles */
.mjf_wp_mc_label {
    display: block;
    margin-bottom: 4px;
}

/* =========================================
   INPUTS (light touch only)
========================================= */

.mjf_wp_mc_input,
.mjf_wp_mc_select,
.mjf_wp_mc_textarea {
    width: 100%;
    box-sizing: border-box;
}

/* keep WP focus styling */
.mjf_wp_mc_input:focus,
.mjf_wp_mc_select:focus,
.mjf_wp_mc_textarea:focus {
    outline: none;
}

/* =========================================
   FIRST / LAST NAME ROW
========================================= */

.mjf_wp_mc_field--row {
    display: flex;
    gap: 12px;
}

.mjf_wp_mc_col {
    flex: 1;
}

/* mobile stack */
@media (max-width: 600px) {
    .mjf_wp_mc_field--row {
        flex-direction: column;
    }
}

/* =========================================
   CHECKBOXES (minimal spacing only)
========================================= */

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

/* =========================================
   FORM MESSAGE (keep subtle)
========================================= */

.mjf_wp_mc_form_message {
    margin-bottom: 12px;
}

/* =========================================
   BUTTONS (DO NOT override WP look heavily)
========================================= */

.mjf_wp_mc_button {
    /* intentionally minimal */
}

.mjf_wp_mc_button_small {
    font-size: 12px;
}

/* =========================================
   TABLE (inherit WP styling)
========================================= */

.mjf_wp_mc_table {
    width: 100%;
}

/* =========================================
   EMPTY STATE (very subtle)
========================================= */

.mjf_wp_mc_empty {
    opacity: 0.8;
}

.mjf-mc-form-cont{
    display:flex;
    justify-content: center;
}

.mjf-mc-form{
    max-width:550px;
}

.mjf-mc-form .mjf_wp_mc_button{
    background-color:white;
    color:black;
}


/*Rules UI */

.mjf-rules-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
}

#mjf-rules-table {
    width: 100%;
    table-layout: fixed;
}

#mjf-rules-table th,
#mjf-rules-table td {
    white-space: normal;
    word-break: break-word;
    vertical-align: top;
}

#mjf-rules-table select,
#mjf-rules-table input[type="text"] {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}


.mjf-rule-row.is-disabled {
    opacity: 0.5;
}


.mjf-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

/* hide native checkbox */
.mjf-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* track */
.mjf-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #c3c4c7; /* WP grey */
    transition: .2s;
    border-radius: 34px;
}

/* knob */
.mjf-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    top: 3px;
    background-color: white;
    transition: .2s;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* ON state */
.mjf-switch input:checked + .mjf-slider {
    background-color: #2271b1; /* WP admin blue */
}

/* move knob */
.mjf-switch input:checked + .mjf-slider:before {
    transform: translateX(20px);
}

/* focus accessibility */
.mjf-switch input:focus + .mjf-slider {
    box-shadow: 0 0 0 2px rgba(34,113,177,0.3);
}


/*manual sync modal*/
.mjf-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
}

.mjf-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
}

.mjf-modal__box {
    position: relative;
    background: #fff;
    max-width: 500px;
    margin: 10% auto;
    padding: 20px;
    border-radius: 6px;
    z-index: 2;
}


/*manual sync progress*/
.mjf-sync-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 6px;
    border: 2px solid #ccc;
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: mjf-spin 0.8s linear infinite;
    vertical-align: middle;
}

@keyframes mjf-spin {
    to { transform: rotate(360deg); }
}




/* ==================================================
   MJF MAILCHIMP — ROLE / AUDIENCE MAPPING
================================================== */

.mjf_wp_mc_admin_mappings {
    width: 100%;
    max-width: 650px;
    table-layout: fixed;
    border-collapse: collapse;
    margin-top: 40px;
}

.mjf_wp_mc_admin_mappings th,
.mjf_wp_mc_admin_mappings td {
    vertical-align: middle;
    padding: 12px 14px;
}

.mjf_wp_mc_admin_mappings th:first-child,
.mjf_wp_mc_admin_mappings td:first-child {
    width: 40%;
}

.mjf_wp_mc_admin_mappings th:last-child,
.mjf_wp_mc_admin_mappings td:last-child {
    width: 60%;
}

.mjf_wp_mc_admin_mappings select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* ==================================================
   MOBILE
================================================== */

@media screen and (max-width: 782px) {

    .mjf_wp_mc_admin_mappings {
        display: table !important;
        width: 100% !important;
        table-layout: fixed;
    }

    .mjf_wp_mc_admin_mappings thead {
        display: table-header-group !important;
    }

    .mjf_wp_mc_admin_mappings tbody {
        display: table-row-group !important;
    }

    .mjf_wp_mc_admin_mappings tr {
        display: table-row !important;
    }

    .mjf_wp_mc_admin_mappings th,
    .mjf_wp_mc_admin_mappings td {
        display: table-cell !important;
        box-sizing: border-box;
        padding: 10px 8px !important;
        vertical-align: middle;
    }

    .mjf_wp_mc_admin_mappings th {
        font-size: 13px;
        line-height: 1.3;
    }

    .mjf_wp_mc_admin_mappings td {
        font-size: 13px;
    }

    .mjf_wp_mc_admin_mappings td strong {
        font-size: 13px;
        line-height: 1.3;
    }

    .mjf_wp_mc_admin_mappings td small {
        font-size: 11px;
        overflow-wrap: anywhere;
    }

    .mjf_wp_mc_admin_mappings select {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        font-size: 13px !important;
    }
}

/* ==================================================
   SMALL MOBILE
================================================== */

@media screen and (max-width: 400px) {

    .mjf_wp_mc_admin_mappings th,
    .mjf_wp_mc_admin_mappings td {
        padding: 8px 5px !important;
    }

    .mjf_wp_mc_admin_mappings th {
        font-size: 11px;
    }

    .mjf_wp_mc_admin_mappings td strong {
        font-size: 12px;
    }
}