/* ==========================================================================
   EOWC — Export Orders for WooCommerce
   Admin Styles
   ========================================================================== */

:root {
    --eowc-primary: #3d205a;
    --eowc-primary-hover: #1d4ed8;
    --eowc-primary-light: #eff6ff;
    --eowc-success: #16a34a;
    --eowc-success-light: #f0fdf4;
    --eowc-danger: #dc2626;
    --eowc-danger-light: #fef2f2;
    --eowc-border: #e2e8f0;
    --eowc-border-focus: #93c5fd;
    --eowc-bg: #f8fafc;
    --eowc-surface: #ffffff;
    --eowc-text: #1e293b;
    --eowc-text-muted: #64748b;
    --eowc-text-subtle: #94a3b8;
    --eowc-radius: 10px;
    --eowc-radius-sm: 6px;
    --eowc-shadow: 0 1px 3px rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .04);
    --eowc-shadow-md: 0 4px 16px rgba(0, 0, 0, .08), 0 2px 4px rgba(0, 0, 0, .04);
    --eowc-transition: .18s ease;
}

/* ==========================================================================
   Header
   ========================================================================== */

.eowc-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 24px;
}

.eowc-header-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    background: var(--eowc-primary);
    border-radius: var(--eowc-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.eowc-header-icon svg {
    width: 22px;
    height: 22px;
}

.eowc-title {
    font-size: 20px !important;
    font-weight: 700 !important;
    color: var(--eowc-text) !important;
    margin: 0 0 4px !important;
    line-height: 1.2 !important;
}

.eowc-subtitle {
    font-size: 13px;
    color: var(--eowc-text-muted);
    margin: 0;
}

/* ==========================================================================
   Form & Steps
   ========================================================================== */

.eowc-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
}

.eowc-step {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.eowc-step--hidden {
    display: none !important;
}

/* ==========================================================================
   Cards
   ========================================================================== */

.eowc-card {
    background: var(--eowc-surface);
    border: 1px solid var(--eowc-border);
    border-radius: var(--eowc-radius);
    padding: 20px;
    box-shadow: var(--eowc-shadow);
}

.eowc-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.eowc-card-head h3 {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: var(--eowc-text) !important;
    margin: 0 !important;
    flex: 1;
}

.eowc-card-icon {
    width: 30px;
    height: 30px;
    background: var(--eowc-primary-light);
    border-radius: var(--eowc-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--eowc-primary);
    flex-shrink: 0;
}

.eowc-card-icon svg {
    width: 15px;
    height: 15px;
}

.eowc-card-icon--confirm {
    background: var(--eowc-success-light);
    color: var(--eowc-success);
}

.eowc-card-desc {
    font-size: 13px;
    color: var(--eowc-text-muted);
    margin: 0 0 18px !important;
    padding-left: 40px;
}

.eowc-card--confirm {
    border-color: #bbf7d0;
    background: var(--eowc-success-light);
}

/* ==========================================================================
   Fields row
   ========================================================================== */

.eowc-fields-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
}

.eowc-fields-row--radio {
    grid-template-columns: 1fr;
}

@media (max-width: 900px) {
    .eowc-fields-row {
        grid-template-columns: 1fr;
    }
}

.eowc-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.eowc-field label {
    font-size: 12px !important;
    font-weight: 600 !important;
    color: var(--eowc-text) !important;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.eowc-required-star {
    color: var(--eowc-danger);
    margin-left: 2px;
}

.eowc-input {
    height: 38px;
    padding: 0 12px;
    border: 1.5px solid var(--eowc-border);
    border-radius: var(--eowc-radius-sm);
    font-size: 13px;
    color: var(--eowc-text);
    background: var(--eowc-surface);
    transition: border-color var(--eowc-transition), box-shadow var(--eowc-transition);
    width: 100%;
    box-sizing: border-box;
}

.eowc-input:focus {
    outline: none;
    border-color: var(--eowc-border-focus);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

/* Validation error state */
.eowc-field--error .eowc-input {
    border-color: var(--eowc-danger);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, .1);
}

.eowc-field-error {
    font-size: 12px;
    color: var(--eowc-danger);
    display: none;
}

.eowc-field--error .eowc-field-error {
    display: block;
}

/* Validation banner */
.eowc-validation-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding: 10px 14px;
    background: var(--eowc-danger-light);
    border: 1px solid #fca5a5;
    border-radius: var(--eowc-radius-sm);
    font-size: 13px;
    color: var(--eowc-danger);
}

.eowc-validation-banner svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ==========================================================================
   Column selector
   ========================================================================== */

.eowc-column-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.eowc-link-btn {
    background: none;
    border: none;
    padding: 0;
    font-size: 12px;
    color: var(--eowc-primary);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.eowc-link-btn:hover {
    color: var(--eowc-primary-hover);
}

.eowc-dot-sep {
    color: var(--eowc-text-subtle);
    font-size: 12px;
}

.eowc-column-group {
    margin-bottom: 18px;
}

.eowc-column-group:last-child {
    margin-bottom: 0;
}

.eowc-column-group-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--eowc-text-muted);
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--eowc-border);
}

.eowc-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 6px;
    min-height: 36px;
}

.eowc-checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border: 1.5px solid var(--eowc-border);
    border-radius: var(--eowc-radius-sm);
    cursor: pointer;
    transition: border-color var(--eowc-transition), background var(--eowc-transition);
    user-select: none;
}

.eowc-drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 20px;
    color: var(--eowc-text-subtle);
    cursor: grab;
    flex-shrink: 0;
}

.eowc-drag-handle svg {
    width: 14px;
    height: 14px;
}

.eowc-checkbox-item.is-dragging {
    cursor: grabbing;
    box-shadow: var(--eowc-shadow-md);
    background: #fff;
    z-index: 10;
}

.eowc-checkbox-placeholder {
    min-height: 36px;
    border: 1.5px dashed var(--eowc-primary);
    border-radius: var(--eowc-radius-sm);
    background: var(--eowc-primary-light);
}

.eowc-checkbox-item:hover {
    border-color: var(--eowc-border-focus);
    background: var(--eowc-primary-light);
}

.eowc-checkbox-item.is-checked {
    border-color: var(--eowc-primary);
    background: var(--eowc-primary-light);
}

.eowc-checkbox-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.eowc-checkmark {
    width: 17px;
    height: 17px;
    border: 1.5px solid var(--eowc-border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: border-color var(--eowc-transition), background var(--eowc-transition);
    background: #fff;
}

.eowc-checkmark svg {
    width: 11px;
    height: 11px;
    stroke: #fff;
    opacity: 0;
    transition: opacity var(--eowc-transition);
}

.eowc-checkbox-item.is-checked .eowc-checkmark {
    background: var(--eowc-primary);
    border-color: var(--eowc-primary);
}

.eowc-checkbox-item.is-checked .eowc-checkmark svg {
    opacity: 1;
}

.eowc-checkbox-label {
    font-size: 12.5px;
    color: var(--eowc-text);
    line-height: 1.3;
}

/* ==========================================================================
   Confirmation summary
   ========================================================================== */

.eowc-summary-list {
    list-style: none;
    margin: 0 0 14px !important;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.eowc-summary-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    background: #fff;
    border: 1px solid #bbf7d0;
    border-radius: var(--eowc-radius-sm);
}

.eowc-summary-icon {
    color: var(--eowc-success);
    flex-shrink: 0;
    display: flex;
}

.eowc-summary-icon svg {
    width: 15px;
    height: 15px;
}

.eowc-summary-key {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--eowc-text-muted);
    width: 72px;
    flex-shrink: 0;
}

.eowc-summary-val {
    font-size: 13px;
    color: var(--eowc-text);
    font-weight: 500;
}

.eowc-column-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.eowc-tag {
    display: inline-block;
    padding: 3px 9px;
    background: #fff;
    border: 1px solid #bbf7d0;
    border-radius: 20px;
    font-size: 11.5px;
    color: var(--eowc-success);
    font-weight: 500;
}

/* ==========================================================================
   Actions
   ========================================================================== */

.eowc-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 4px;
}

.eowc-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 18px;
    height: 38px;
    border-radius: var(--eowc-radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background var(--eowc-transition), box-shadow var(--eowc-transition), transform var(--eowc-transition);
    text-decoration: none !important;
}

.eowc-btn svg {
    width: 15px;
    height: 15px;
}

.eowc-btn--primary {
    background: var(--eowc-primary);
    color: #fff !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .12);
}

.eowc-btn--primary:hover {
    background: var(--eowc-primary-hover);
    box-shadow: 0 4px 12px rgba(37, 99, 235, .3);
    transform: translateY(-1px);
    color: #fff !important;
}

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

.eowc-btn--ghost {
    background: transparent;
    color: var(--eowc-text-muted) !important;
    border: 1.5px solid var(--eowc-border);
}

.eowc-btn--ghost:hover {
    border-color: var(--eowc-primary);
    color: var(--eowc-primary) !important;
    background: var(--eowc-primary-light);
}

/* ==========================================================================
   Progress Overlay
   ========================================================================== */

.eowc-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .72);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--eowc-radius);
}

.eowc-overlay-content {
    text-align: center;
    color: #fff;
    width: 88%;
    max-width: 320px;
    padding: 32px;
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 14px;
    backdrop-filter: blur(8px);
}

.eowc-spinner {
    width: 42px;
    height: 42px;
    border: 3px solid rgba(255, 255, 255, .2);
    border-top-color: #fff;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: eowc-spin 0.8s linear infinite;
}

.eowc-progress-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.eowc-progress-track {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, .2);
    border-radius: 10px;
    overflow: hidden;
}

.eowc-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #60a5fa, #a78bfa);
    border-radius: 10px;
    transition: width 0.4s ease;
}

.eowc-progress-pct {
    font-size: 12px;
    font-weight: 700;
    color: rgba(255, 255, 255, .9);
    min-width: 36px;
    text-align: right;
}

.eowc-progress-text {
    font-size: 13px;
    color: rgba(255, 255, 255, .75);
    margin: 0 !important;
}

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

/* ==========================================================================
   Modal
   ========================================================================== */

#eowc-export-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
}

.eowc-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.eowc-modal-content {
    position: relative;
    width: 92%;
    max-width: 680px;
    max-height: 90vh;
    overflow-y: auto;
    margin: 5vh auto 0;
    background: var(--eowc-bg);
    padding: 28px;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .2), 0 4px 12px rgba(0, 0, 0, .1);
}

.eowc-close {
    position: absolute;
    right: 16px;
    top: 16px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    color: var(--eowc-text-muted);
    background: var(--eowc-border);
    line-height: 1;
    transition: background var(--eowc-transition), color var(--eowc-transition);
    z-index: 1;
}

.eowc-close:hover {
    background: #fca5a5;
    color: var(--eowc-danger);
}

/* ==========================================================================
   Wrap (settings page)
   ========================================================================== */

.eowc-export-orders {
    max-width: 860px;
    padding: 24px 0;
}


.eowc-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.eowc-radio-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    border: 1.5px solid var(--eowc-border);
    border-radius: var(--eowc-radius-sm);
    cursor: pointer;
    transition: border-color var(--eowc-transition), background var(--eowc-transition);
    user-select: none;
    background: #fff;
}

.eowc-radio-item:hover,
.eowc-radio-item input[type="radio"]:focus+.eowc-radio-check {
    border-color: var(--eowc-border-focus);
    background: var(--eowc-primary-light);
}

.eowc-radio-item input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.eowc-radio-check {
    width: 17px;
    height: 17px;
    border: 1.5px solid var(--eowc-border);
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color var(--eowc-transition), background var(--eowc-transition);
}

.eowc-radio-item input[type="radio"]:checked+.eowc-radio-check {
    background: var(--eowc-primary);
    border-color: var(--eowc-primary);
}

.eowc-radio-check svg {
    width: 11px;
    height: 11px;
    stroke: #fff;
    opacity: 0;
    transition: opacity var(--eowc-transition);
}

.eowc-radio-item input[type="radio"]:checked+.eowc-radio-check svg {
    opacity: 1;
}

.eowc-radio-label {
    font-size: 12.5px;
    color: var(--eowc-text);
}

.eowc-export-btn {
    margin: 9px !important;
}