/* Legacy sidebar layout (Style 4B: Left Accent) */
.cmbsqf-settings-layout {
    display: flex;
    gap: 24px;
    margin-top: 20px;
}

.cmbsqf-sidebar-nav {
    flex: 0 0 240px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    align-self: flex-start;
}

.cmbsqf-sidebar-menu {
    margin: 0;
    padding: 0;
    list-style: none;
}

.cmbsqf-sidebar-item {
    margin: 0;
    border-bottom: 1px solid #f3f4f6;
}

.cmbsqf-sidebar-item:last-child {
    border-bottom: none;
}

.cmbsqf-sidebar-link {
    display: flex;
    flex-direction: row;
    gap: 6px;
    padding: 14px 20px;
    color: #6b7280;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.cmbsqf-sidebar-link:hover {
    background-color: #f9fafb;
    color: #2271b1;
    border-left-color: #93c5fd;
    padding-left: 24px;
}

/* Fix focus outline on tabs */
.cmbsqf-sidebar-link:focus {
    outline: none;
}

.cmbsqf-sidebar-link:focus-visible {
    background-color: #f9fafb;
    box-shadow: inset 0 0 0 2px #bfdbfe;
}

/* All WP List Tables - Shared Column Widths */
.wp-list-table.widefat .column-cb {
    width: 40px;
}

.wp-list-table.widefat .column-id {
    width: 60px;
}

/* Entries Table Column Widths (Entries page) */
.wp-list-table.widefat .column-name {
    width: 180px;
}

.wp-list-table.widefat .column-email {
    width: 200px;
}

.wp-list-table.widefat .column-date {
    width: 160px;
}

.wp-list-table.widefat .column-notified {
    width: 70px;
    text-align: center;
}

.wp-list-table.widefat .column-privacy {
    width: 140px;
}

/* Message column is flexible - takes remaining space */

/* Forms Table Column Widths (All Forms page) - Overrides above for forms */
.wp-list-table.widefat .column-form_name {
    width: auto;
    /* Flexible - takes remaining space */
}

.wp-list-table.widefat .column-entries {
    width: 80px;
    text-align: center;
}

.wp-list-table.widefat .column-shortcode {
    width: 225px;
}

/* Form name column flexible - specific selector avoids conflict with entries */


.cmbsqf-sidebar-item.active .cmbsqf-sidebar-link {
    background-color: #eff6ff;
    color: #1e40af;
    font-weight: 600;
    border-left-color: #2271b1;
    border-left-width: 4px;
    padding-left: 20px;
}

.cmbsqf-sidebar-item.active .cmbsqf-sidebar-link:hover {
    background-color: #dbeafe;
    color: #1e3a8a;
    padding-left: 20px;
}

.cmbsqf-sidebar-label {
    letter-spacing: -0.01em;
}

.cmbsqf-sidebar-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: currentColor;
}

.cmbsqf-sidebar-icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.cmbsqf-sidebar-description {
    color: #50575e;
    font-size: 12px;
}

.cmbsqf-settings-content {
    flex: 1;
    min-width: 0;
    padding: 0 20px 20px 20px;
    border-left: 4px solid #2271b1;
}

.cmbsqf-settings-content header {
    margin-bottom: 16px;
}

.cmbsqf-settings-content h2 {
    font-weight: bold;
}

.cmbsqf-placeholder {
    padding: 20px;
    background: #f6f7f7;
    border-radius: 4px;
}

/* Ensure settings layout uses same styles */
.cmbsqf-settings__tab-description {
    margin-top: 0;
}

@media screen and (max-width: 782px) {
    .cmbsqf-sidebar-layout {
        flex-direction: column;
    }

    .cmbsqf-sidebar-nav {
        flex: 0 0 auto;
        width: 100%;
    }

    .cmbsqf-sidebar-link:hover {
        padding-left: 20px;
    }
}

/* Forms List Table Styles */
.cmbsqf-copy-shortcode {
    transition: transform 0.2s ease;
}

.cmbsqf-copy-shortcode svg {
    color: #646970;
    transition: color 0.2s ease;
}

.cmbsqf-copy-shortcode:hover svg {
    color: #2271b1;
}

.cmbsqf-copy-shortcode.copied .cmbsqf-icon-copy {
    display: none;
}

.cmbsqf-copy-shortcode.copied .cmbsqf-icon-check {
    display: inline-block !important;
    animation: checkPulse 0.3s ease;
}

@keyframes checkPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

.cmbsqf-delete-form {
    color: #b32d2e;
}

.cmbsqf-delete-form:hover {
    color: #d63638;
}

.cmbsqf-rename-form {
    color: #2271b1;
}

.cmbsqf-rename-form:hover {
    color: #135e96;
}

/* Form Fields Compact Table */
.cmb-sf-fields-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border: 1px solid #dcdcde;
    border-radius: 0;
}

.cmb-sf-fields-table thead {
    background: #f6f7f7;
    border-bottom: 1px solid #dcdcde;
}

.cmb-sf-fields-table thead th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    color: #1d2327;
    vertical-align: middle;
    border-bottom: 1px solid #dcdcde;
}

.cmb-sf-fields-table thead th:nth-child(2),
.cmb-sf-fields-table thead th:nth-child(3) {
    text-align: center;
    width: 110px;
}

.cmb-sf-fields-table thead th:first-child {
    width: 180px;
}

.cmb-sf-fields-table tbody tr {
    border-bottom: 1px solid #dcdcde;
    transition: background-color 0.1s ease;
}

.cmb-sf-fields-table tbody tr:last-child {
    border-bottom: none;
}

.cmb-sf-fields-table tbody tr:hover {
    background-color: #f6f7f7;
}

.cmb-sf-fields-table tbody td {
    padding: 12px 16px;
    vertical-align: middle;
}

.cmb-sf-field-name {
    font-weight: 500;
    color: #1d2327;
    font-size: 14px;
}

.cmb-sf-field-name>span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.cmb-sf-field-icon {
    display: inline-flex;
    align-items: center;
    color: #50575e;
    flex-shrink: 0;
}

.cmb-sf-field-icon svg {
    display: block;
}

.cmb-sf-field-toggle {
    text-align: center;
    vertical-align: middle;
}

.cmb-sf-field-label input[type="text"] {
    width: 100%;
    max-width: 100%;
    margin: 0;
    font-size: 14px;
}

/* Toggle Switch Component */
.cmb-sf-toggle {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    cursor: pointer;
}

.cmb-sf-toggle input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.cmb-sf-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: all 0.3s ease;
    border-radius: 22px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.cmb-sf-toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: all 0.3s ease;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.cmb-sf-toggle input[type="checkbox"]:checked+.cmb-sf-toggle-slider {
    background-color: #2563eb;
}

.cmb-sf-toggle input[type="checkbox"]:focus+.cmb-sf-toggle-slider {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.cmb-sf-toggle input[type="checkbox"]:checked+.cmb-sf-toggle-slider:before {
    transform: translateX(18px);
}

.cmb-sf-toggle:hover .cmb-sf-toggle-slider {
    background-color: #94a3b8;
}

.cmb-sf-toggle input[type="checkbox"]:checked:hover+.cmb-sf-toggle-slider {
    background-color: #1d4ed8;
}

/* Responsive Design */
@media (max-width: 782px) {

    .cmb-sf-fields-table thead th,
    .cmb-sf-fields-table tbody td {
        padding: 10px 12px;
        font-size: 13px;
    }

    .cmb-sf-fields-table thead th:first-child {
        width: 140px;
    }

    .cmb-sf-fields-table thead th:nth-child(2),
    .cmb-sf-fields-table thead th:nth-child(3) {
        width: 90px;
    }

    .cmb-sf-toggle {
        width: 36px;
        height: 20px;
    }

    .cmb-sf-toggle-slider:before {
        height: 14px;
        width: 14px;
        left: 3px;
        bottom: 3px;
    }

    .cmb-sf-toggle input[type="checkbox"]:checked+.cmb-sf-toggle-slider:before {
        transform: translateX(16px);
    }
}

@media (max-width: 600px) {

    .cmb-sf-fields-table thead th:nth-child(2),
    .cmb-sf-fields-table thead th:nth-child(3) {
        width: 70px;
    }

    .cmb-sf-toggle {
        width: 34px;
        height: 18px;
    }

    .cmb-sf-toggle-slider:before {
        height: 12px;
        width: 12px;
    }

    .cmb-sf-toggle input[type="checkbox"]:checked+.cmb-sf-toggle-slider:before {
        transform: translateX(16px);
    }
}

/* Form Settings Header */
.cmbsqf-header-nav {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.cmbsqf-header-toggle {
    margin-left: 15px;
    font-size: 14px;
    color: #8c8f94;
}

.cmbsqf-header-toggle a {
    text-decoration: none;
    color: #2271b1;
}

.cmbsqf-header-toggle strong {
    color: #2271b1;
}

/* Entries Action Buttons */
.cmbsqf-entries-actions {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cmbsqf-entries-actions .dashicons {
    margin-top: 3px;
}

.cmbsqf-header-title {
    margin-bottom: 20px;
}

.cmbsqf-form-badge {
    background: #f9fafb;
    color: #4b5563;
    border: 1px solid #e5e7eb;
    font-size: 14px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 3px;
    margin-left: 10px;
    vertical-align: middle;
}

/* SPA-Style Tabs */
.cmbsqf-tab-content {
    display: none;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

.cmbsqf-tab-content.active {
    display: block;
    opacity: 1;
}

/* Override Box Styles */
.cmbsqf-override-section {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.cmbsqf-override-label {
    display: flex;
    align-items: center;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 8px;
}

.cmbsqf-override-checkbox {
    margin-right: 10px;
}

.cmbsqf-override-text {
    color: #1d2327;
}

.cmbsqf-override-description {
    margin: 0 0 0 32px;
    color: #646970;
}

/* Utility Classes */
.cmbsqf-warning-text {
    color: #d63638;
}

.cmbsqf-status-enabled {
    color: #00a32a;
}

.cmbsqf-status-disabled {
    color: #d63638;
}

.cmbsqf-section-divider {
    margin: 30px 0;
}

.cmbsqf-blocklist-sources {
    margin-top: 10px;
}

.cmbsqf-blocklist-item {
    margin-bottom: 8px;
}

.cmbsqf-readonly-url {
    background-color: #f0f0f1;
}

.cmbsqf-mt-10 {
    margin-top: 10px;
}

/* Code Example Blocks */
.cmbsqf-code-example {
    background: #f5f5f5;
    padding: 10px;
    border-radius: 4px;
    font-size: 0.9em;
    overflow-x: auto;
}

/* Examples Details/Summary */
.cmbsqf-examples-details {
    margin-top: 8px;
}

.cmbsqf-examples-summary {
    cursor: pointer;
    font-weight: 600;
    color: #2271b1;
}

.cmbsqf-examples-content {
    margin-top: 10px;
}

/* Styling Section */
.cmbsqf-template-select {
    max-width: 300px;
}

.cmbsqf-template-btn {
    margin-left: 8px;
}

.cmbsqf-css-editor {
    font-family: Consolas, Monaco, monospace;
    font-size: 13px;
}

/* Fields Section */
.cmbsqf-fields-table {
    margin-top: 20px;
}

.cmbsqf-fields-note {
    margin-top: 15px;
}

/* Test Email Result Boxes */
.cmbsqf-test-email-success {
    padding: 12px;
    border-radius: 4px;
    background: #dcfce7;
    border-left: 4px solid #22c55e;
    position: relative;
    font-size: inherit;
}

.cmbsqf-test-email-success strong {
    color: #166534;
}

.cmbsqf-test-email-success p {
    margin: 8px 0 0 0;
}

.cmbsqf-test-email-error {
    padding: 12px;
    border-radius: 4px;
    background: #fee2e2;
    border-left: 4px solid #ef4444;
    position: relative;
    font-size: inherit;
}

.cmbsqf-test-email-error strong {
    color: #991b1b;
}

.cmbsqf-test-email-error p {
    margin: 8px 0 0 0;
}

.cmbsqf-test-email-error-details {
    font-size: 0.9em;
    opacity: 0.9;
}

/* Test Email Debug Log */
.cmbsqf-test-email-debug-wrapper {
    margin-top: 15px;
}

.cmbsqf-test-email-debug-log {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 12px;
    border-radius: 3px;
    overflow-x: auto;
    font-family: Consolas, Monaco, monospace;
    font-size: 12px;
    margin-top: 10px;
    max-height: 300px;
    max-width: 100%;
    box-sizing: border-box;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.cmbsqf-test-email-copy-btn {
    margin-top: 10px;
}

/* Blocklist Management */
.cmbsqf-sources-list {
    border: 1px solid #dcdcde;
    border-radius: 4px;
    background: #fff;
    margin-bottom: 15px;
}

.cmbsqf-source-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f1;
    min-width: 0;
    flex-wrap: wrap;
    /* Allow wrapping for status */
}

.cmbsqf-source-item:last-child {
    border-bottom: none;
}

/* Source Status Badge */
.cmbsqf-source-status {
    margin-top: 8px;
    padding: 8px 12px;
    font-size: 12px;
    border-radius: 4px;
    display: block;
    /* Full width */
    width: 100%;
    font-weight: 500;
    order: 3;
    /* Force to bottom */
}

.cmbsqf-source-item:hover {
    background: #f6f7f7;
}

.cmbsqf-source-info.active {
    background: #dcdcde;
    color: #135e96;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
    border-color: #c3c4c7;
}

.cmbsqf-source-url {
    font-size: 11px;
    color: #3c434a;
    word-break: break-word;
    overflow-wrap: break-word;
    margin-right: 15px;
    flex: 1;
    min-width: 0;
}

.cmbsqf-source-actions {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}

.cmbsqf-source-actions .button-small {
    padding: 0 5px 1px;
    min-height: 24px;
    line-height: 22px;
}

.cmbsqf-source-actions .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

/* Status Indicators in Info Panel */
.cmbsqf-status-success {
    color: #00a32a;
}

.cmbsqf-status-error {
    color: #d63638;
}

.cmbsqf-status-pending {
    color: #646970;
}

/* Popular Sources Dropdown */
.cmbsqf-examples-details {
    margin-top: 15px;
}

.cmbsqf-examples-summary {
    padding: 0;
    cursor: pointer;
    user-select: none;
    font-weight: 500;
    color: #2271b1;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cmbsqf-examples-summary:hover {
    color: #135e96;
}

.cmbsqf-examples-summary::-webkit-details-marker {
    display: none;
}

.cmbsqf-examples-summary::before {
    content: "▸";
    display: inline-block;
    transition: transform 0.2s;
    font-size: 14px;
}

.cmbsqf-examples-details[open] .cmbsqf-examples-summary::before {
    transform: rotate(90deg);
}

.cmbsqf-examples-content {
    padding: 0 16px 16px 16px;
    border-top: 1px solid #f0f0f1;
    background: #f9f9f9;
}

/* Code Examples - Minimalist styling */
.cmbsqf-code-example {
    display: block;
    background: #f0f0f1;
    border: 1px solid #c3c4c7;
    border-left: 4px solid #72aee6;
    padding: 8px 12px;
    margin: 5px 0 20px 0;
    font-family: Consolas, Monaco, monospace;
    font-size: 11px;
    /* Smaller font size as requested */
    color: #2c3338;
    word-break: break-all;
    user-select: all;
}

.cmbsqf-code-example:last-child {
    margin-bottom: 0;
}

/* Source Status Badge */
.cmbsqf-source-status {
    margin-top: 8px;
    padding: 8px 12px;
    font-size: 12px;
    border-radius: 4px;
    display: block;
    width: 100%;
    font-weight: 500;
    order: 3;
}

.cmbsqf-source-status.cmbsqf-status-pending {
    background: #f0f0f1;
    color: #646970;
    border-left: 3px solid #dcdcde;
}

.cmbsqf-source-status.cmbsqf-status-success {
    background: #edfaef;
    color: #00a32a;
    border-left: 3px solid #00a32a;
}

.cmbsqf-source-status.cmbsqf-status-error {
    background: #fcf0f1;
    color: #d63638;
    border-left: 3px solid #d63638;
}

/* Delivery Status Bullets */
.cmbsqf-delivery-bullet {
    font-size: 20px;
    line-height: 1;
    cursor: help;
}

.cmbsqf-delivery-sent {
    color: #46b450;
}

.cmbsqf-delivery-failed {
    color: #dc3232;
}

.cmbsqf-delivery-na {
    color: #999;
}




/* Hide toggle targets by default (JavaScript will show them if needed) */
[data-toggle-target] {
    display: none;
}

/* Spacing for settings sections */
.cmbsqf-settings-spacer th,
.cmbsqf-settings-spacer td {
    padding-top: 50px !important;
    border-top: 1px solid #f0f0f1;
}

/* ===========================================================================
   BULK RESULTS MODAL
   =========================================================================== */

.cmbsqf-results-modal .cmbsqf-results-container {
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
}

.cmbsqf-results-body {
    padding: 24px !important;
}

.results-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.summary-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-radius: 8px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
}

.summary-box .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
}

.summary-box div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.summary-box strong {
    font-size: 24px;
    font-weight: 600;
    line-height: 1;
}

.summary-box span {
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.success-box {
    background: #ecfdf5;
    border-color: #6ee7b7;
}

.success-box .dashicons {
    color: #059669;
}

.success-box strong {
    color: #047857;
}

.failure-box {
    background: #fef2f2;
    border-color: #fca5a5;
}

.failure-box .dashicons {
    color: #dc2626;
}

.failure-box strong {
    color: #b91c1c;
}

.total-box {
    background: #eff6ff;
    border-color: #93c5fd;
}

.total-box .dashicons {
    color: #2563eb;
}

.total-box strong {
    color: #1d4ed8;
}

.results-section {
    margin-bottom: 24px;
}

.results-section h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.results-section h3 .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
    padding: 4px;
}

.result-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 13px;
}

.result-item.success {
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #166534;
}

.result-item.success .dashicons {
    color: #16a34a;
    flex-shrink: 0;
}

.result-item.failure {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #7f1d1d;
}

.result-item.failure .dashicons {
    color: #dc2626;
    flex-shrink: 0;
    margin-top: 2px;
}

.result-item.failure div {
    flex: 1;
}

.result-item.failure strong {
    display: block;
    margin-bottom: 4px;
    color: #991b1b;
}

.result-item.failure .error-message {
    margin: 0;
    font-size: 12px;
    color: #b91c1c;
    background: #fee2e2;
    padding: 6px 8px;
    border-radius: 4px;
    border-left: 3px solid #dc2626;
}

.cmbsqf-copy-report-btn .dashicons {
    margin-right: 4px;
}