/* WPSL CSV Manager Styles */

/* Legacy v2 tab styling */
#wpsl-tabs {
    margin: 15px 0 25px 0;
}

/* Wrap layout */
#wpsl-csv-wrap {
    max-width: 100%;
    margin: 0 auto;
}

#wpsl-csv-wrap .wpsl-csv-upload .wpsl-info {
    position: relative;
}

body:not(.wpsl-v3) #wpsl-csv-wrap {
    padding: 20px 0 0 0;
}

/* V3 postbox styling - matches WPSL core postbox pattern */
.wpsl-v3 #wpsl-csv-wrap .postbox {
    width: 100%;
    background: #fff;
    margin: 0;
    border: none;
    border-radius: 3px;
}

.wpsl-v3 #wpbody-content section h3 {
    position: relative;
    font-size: 14px;
    padding: 10px 20px;
    margin: 0;
    line-height: 1.4;
    border-bottom: 1px solid #ccc;
}

/* V2 fallback - apply similar styling manually */
body:not(.wpsl-v3) #wpsl-csv-wrap .postbox {
    background: #fff;
    border: 1px solid #ccd0d4;
    box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
    margin: 0;
}

body:not(.wpsl-v3) #wpsl-csv-wrap .postbox h3 {
    font-size: 14px;
    padding: 8px 12px;
    margin: 0;
    line-height: 1.4;
    border-bottom: 1px solid #ccd0d4;
}

body:not(.wpsl-v3) #wpsl-csv-wrap .postbox .inside {
    padding: 0 12px 12px;
    margin: 11px 0;
}

/* Import form */
/* .wpsl-v3 #wpsl-csv-wrap .wpsl-info {
    position: relative;
} */

.wpsl-v3 #wpsl-csv-wrap .wpsl-force-flex {
    display: flex;
    align-items: center;
}

.wpsl-v3 #wpsl-csv-wrap .wpsl-force-flex label:first-child {
    position: relative;
    flex: 0 0 19%;
    padding-inline-end: 0;
}

#wpsl-import em,
.wpsl-csv-upload em {
    display: block;
    margin-top: 5px;
}

#wpsl-import label,
.wpsl-csv-upload label {
    font-weight: normal;
}

#wpsl-import th,
.wpsl-csv-upload th {
    padding-right: 20px;
}

#wpsl-import.wpsl-select-file th,
.wpsl-csv-upload .form-table th {
    width: 160px;
}

/* Error message */
.wpsl-csv-error {
    background-color: #fcf0f1;
    border-left: 4px solid #d63638;
    padding: 12px;
    margin: 16px 0;
    border-radius: 3px;
}

.wpsl-csv-error p {
    margin: 0;
    color: #3c434a;
    font-size: 13px;
}

/* Drop zone upload */
.wpsl-csv-drop-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    border: 2px dashed #D1D5DB;
    border-radius: 12px;
    background-color: #F9FAFB;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    margin: 16px 0 6px 0;
}

.wpsl-csv-drop-zone:hover,
.wpsl-csv-drop-zone.dragover {
    border-color: #2271b1;
    background-color: #f0f6fc;
}

.wpsl-csv-drop-icon {
    color: #2271b1;
    margin-bottom: 16px;
}

.wpsl-csv-drop-title {
    font-weight: 600;
    color: #1d2327;
    margin-bottom: 8px;
    font-size: 14px;
}

.wpsl-csv-drop-subtitle {
    font-size: 13px;
    color: #6B7280;
}

.wpsl-csv-hidden-input {
    display: none;
}

/* File feedback */
.wpsl-csv-file-feedback {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 16px 0;
    padding: 12px 16px;
    background-color: #F0FDF4;
    border: 1px solid #BBF7D0;
    border-radius: 8px;
    color: #166534;
    font-size: 13px;
    font-weight: 500;
}

.wpsl-csv-file-feedback.wpsl-hide {
    display: none;
}

.wpsl-csv-continue-wrap {
    margin-bottom: 0;
}

.wpsl-csv-remove-btn {
    background: none;
    border: none;
    color: #166534;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.wpsl-csv-remove-btn:hover {
    color: #14532D;
}

/* Upload progress bar */
.wpsl-csv-upload-progress {
    margin: 0;
}

.wpsl-csv-upload-progress.wpsl-hide {
    display: none;
}

.wpsl-csv-progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

#wpsl-csv-progress-text {
    font-size: 13px;
    color: #374151;
}

.wpsl-csv-progress-bar-wrap {
    width: 100%;
    position: relative;
}

.wpsl-csv-progress-bar-wrap .wpsl-csv-progress-percentage {
    position: absolute;
    top: -24px;
    right: 0;
    font-weight: 600;
    color: #333;
}

.wpsl-csv-max-size {
    margin: 0;
    color: #6B7280;
    font-size: 13px;
}

.wpsl-v3 .wpsl-csv-max-size {
    text-align: right;
}

/* Disabled state for primary buttons */
#wpsl-csv-continue-btn.button-primary:disabled,
#wpsl-csv-continue-btn.button-primary[disabled],
#wpsl-csv-start-import.button-primary:disabled,
#wpsl-csv-start-import.button-primary[disabled] {
    background: #1e5a8a !important;
    border-color: #1e5a8a !important;
    color: rgba(255, 255, 255, 0.7) !important;
    text-shadow: none !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    opacity: 1 !important;
}

/* Duplicate check option */
.wpsl-csv-dup-option {
    margin: 16px 0;
}

.wpsl-csv-dup-option > label {
    display: block;
    font-size: 13px;
    margin-bottom: 5px;
}

.wpsl-csv-dup-handling {
    margin: 12px 0;
}

.wpsl-csv-dup-handling.wpsl-hide {
    display: none;
}

/* Export / match fields table */
/* v3: Full width table */
.wpsl-v3 #wpsl-csv-import-form table,
.wpsl-v3 #wpsl-csv-fields table,
.wpsl-v3 .wpsl-csv-table {
    width: 100%;
}

/* v2: Custom margins and full width */
body:not(.wpsl-v3) #wpsl-csv-fields table,
body:not(.wpsl-v3) #wpsl-csv-fields-form table,
body:not(.wpsl-v3) .wpsl-csv-table {
    width: 100%;
    margin-top: 18px;
    margin-left: -2px;
}

body:not(.wpsl-v3) #wpsl-csv-fields th,
body:not(.wpsl-v3) #wpsl-csv-fields-form th {
    text-align: left;
}

body:not(.wpsl-v3) #wpsl-csv-fields select,
body:not(.wpsl-v3) #wpsl-csv-fields-form select {
    height: 28px;
    margin-top: 1px;
}

/* Geocode errors */
.wpsl-geocode-errors {
    padding-left: 2px;
}

.wpsl-geocode-errors li {
    margin-bottom: 15px;
}

/* Field mapping */
#wpsl-csv-import-form #excerpt {
    margin: 0;
    height: auto;
    width: auto;
}

.wpsl-csv-field-sml,
.wpsl-mapping-field-sml {
    width: 150px;
}

.wpsl-v3 .wpsl-csv-field-sml,
.wpsl-v3 .wpsl-mapping-field-sml {
    text-align: left;
    padding: 10px;
}

body:not(.wpsl-v3) #wpsl-csv-fields th,
body:not(.wpsl-v3) #wpsl-csv-fields-form th {
    padding-bottom: 7px;
}

body:not(.wpsl-v3) #wpsl-csv-fields-form td:first-child {
    width: 150px;
}

body:not(.wpsl-v3) #wpsl-csv-fields-form td.wpsl-csv-value {
    white-space: nowrap;
}

/* Generic CSV table styling */
.wpsl-csv-table,
.wpsl-csv-mapping-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}

.wpsl-csv-table thead th,
.wpsl-csv-mapping-table thead th {
    text-align: left;
    padding: 10px 8px;
    border-bottom: 1px solid #E5E7EB;
    font-weight: 600;
    color: #374151;
    font-size: 13px;
}

.wpsl-csv-table tbody tr,
.wpsl-csv-mapping-table tbody tr {
    border-bottom: 1px solid #F3F4F6;
}

.wpsl-csv-table tbody tr:hover,
.wpsl-csv-mapping-table tbody tr:hover {
    background-color: #F9FAFB;
}

.wpsl-csv-table tbody td,
.wpsl-csv-mapping-table tbody td {
    padding: 12px 8px;
    font-size: 13px;
    color: #374151;
}

.wpsl-csv-table select,
.wpsl-csv-mapping-table select {
    width: 100% !important;
    max-width: 200px;
    height: 32px;
    padding: 4px 8px;
    border: 1px solid #D1D5DB;
    border-radius: 4px;
    font-size: 13px;
}

.wpsl-csv-table select:focus,
.wpsl-csv-mapping-table select:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.wpsl-csv-match-fields {
    margin-top: 24px;
}

.wpsl-csv-match-fields .inside {
    padding: 20px;
}

.wpsl-import-btn {
    margin: 20px 0 0 0;
}

.wpsl-import-btn .wpsl-preloader {
    vertical-align: middle;
    margin: -3px 0 0 7px !important;
}

body:not(.wpsl-v3) #wpsl-csv-fields #excerpt,
body:not(.wpsl-v3) #wpsl-csv-fields select,
body:not(.wpsl-v3) #wpsl-csv-fields-form #excerpt,
body:not(.wpsl-v3) #wpsl-csv-fields-form select {
    width: 115px;
}

.wpsl-csv-export .wpsl-csv-table thead tr th:first-child,
.wpsl-csv-export .wpsl-csv-table tbody td:first-child {
    width: 25%;
}

/* Error log table */
.wpsl-csv-error-details {
    margin-top: 15px;
}

.wpsl-csv-error-log-wrap {
    margin: 10px 0;
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 3px;
}

.wpsl-csv-error-log {
    width: 100%;
    border-collapse: collapse;
}

.wpsl-csv-error-log thead {
    position: sticky;
    top: 0;
    background: #f0f0f1;
    z-index: 1;
}

.wpsl-csv-error-log th {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
    font-weight: 600;
}

.wpsl-csv-error-log td {
    padding: 8px 12px;
    border-bottom: 1px solid #e0e0e0;
    text-align: left;
    vertical-align: top;
}

.wpsl-csv-error-log tbody tr:first-child td {
    border-top: none;
}

.wpsl-csv-error-log tbody tr:last-child td {
    border-bottom: none;
}

.wpsl-csv-error-log td:first-child {
    white-space: nowrap;
}

.wpsl-csv-error-log tbody tr:nth-child(odd) {
    background: #f9f9f9;
}

.wpsl-csv-error-log tbody tr:nth-child(even) {
    background: #fff;
}

.wpsl-csv-error-type {
    display: inline-block;
    padding: 2px 6px;
    background: #d63638;
    color: #fff;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    margin-right: 6px;
}

.wpsl-csv-error-name {
    font-weight: 600;
    color: #1d2327;
}

.wpsl-csv-error-reason {
    margin-top: 4px;
    color: #50575e;
    display: block;
    font-weight: normal;
}

/* Import settings (step 3) */
.wpsl-csv-import-settings {
    margin-top: 24px;
}

.wpsl-csv-import-settings .inside {
    padding: 20px;
}

.wpsl-csv-batch-setting {
    margin: 16px 0 20px;
}

.wpsl-csv-batch-setting input.small-text {
    width: 100px;
    text-align: left;
}

.wpsl-csv-specified-records {
    margin: 16px 0 0;
}

.wpsl-csv-specified-input {
    margin: 8px 0 0;
}

.wpsl-csv-specified-input input.regular-text {
    width: 320px;
}