/* Synchronization page specific styles */


.unifiedsmb-sync-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.unifiedsmb-sync-card {
    background-color: var(--usmb-white);
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    border-left: 4px solid var(--usmb-blue);
}

.unifiedsmb-sync-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.unifiedsmb-sync-card-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--usmb-light-grey);
}

.unifiedsmb-sync-card-icon {
    background-color: var(--usmb-light-blue);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.unifiedsmb-sync-card-icon .dashicons {
    color: var(--usmb-blue);
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.unifiedsmb-sync-card h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--usmb-dark-grey);
}

.unifiedsmb-sync-card-content {
    padding: 16px 20px;
    min-height: 80px;
}

.unifiedsmb-sync-card-content p {
    margin: 0;
    color: var(--usmb-dark-grey);
    font-size: 14px;
}

.unifiedsmb-sync-card-action {
    padding: 0 20px 16px;
}

.unifiedsmb-sync-settings-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    padding: 4px;
    background: none;
    border: none;
    border-radius: 4px;
    color: var(--usmb-dark-grey);
    cursor: pointer;
}

.unifiedsmb-sync-settings-button:hover,
.unifiedsmb-sync-settings-button:focus {
    color: var(--usmb-blue);
    background-color: var(--usmb-light-blue);
}

/* Synchronization settings */
.unifiedsmb-sync-settings {
    margin-top: 32px;
    padding: 32px;
    background-color: var(--usmb-white);
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.unifiedsmb-switch-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
}

/* Sync fields modal */
.unifiedsmb-sync-fields-list {
    margin: 16px 0 0;
}

.unifiedsmb-sync-fields-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0;
    padding: 10px 0;
    border-bottom: 1px solid var(--usmb-light-grey);
}

.unifiedsmb-sync-fields-item:last-child {
    border-bottom: none;
}

.unifiedsmb-sync-fields-item .unifiedsmb-switch {
    flex-shrink: 0;
}

/* Attribute sub-sections */
.unifiedsmb-sync-fields-heading {
    margin: 12px 0 0;
    font-weight: 600;
}

.unifiedsmb-sync-fields-heading:first-child {
    margin-top: 0;
}

.unifiedsmb-sync-fields-heading + .unifiedsmb-sync-fields-item {
    padding-top: 4px;
}

.unifiedsmb-sync-fields-item:has(+ .unifiedsmb-sync-fields-heading) {
    border-bottom: none;
}

.unifiedsmb-sync-fields-status:empty {
    display: none;
}

.unifiedsmb-sync-fields-status.is-error {
    color: var(--usmb-red);
}

/* Only the field list scrolls; overlay and page stay put. */
.unifiedsmb-sync-fields-modal-open {
    overflow: hidden;
}

#unifiedsmb-sync-fields-modal {
    overflow: hidden;
    overscroll-behavior: contain;
}

/* Same size for every sync type, centered in the viewport. */
#unifiedsmb-sync-fields-modal .unifiedsmb-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    display: flex;
    flex-direction: column;
    width: 600px;
    max-width: calc(100% - 32px);
    height: min(560px, calc(100vh - 64px));
    margin: 0;
    transform: translate(-50%, -50%);
    animation: unifiedsmbSyncFieldsModalIn 0.3s;
}

@keyframes unifiedsmbSyncFieldsModalIn {
    from {opacity: 0; transform: translate(-50%, calc(-50% - 20px));}
    to {opacity: 1; transform: translate(-50%, -50%);}
}

#unifiedsmb-sync-fields-form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

#unifiedsmb-sync-fields-modal .unifiedsmb-modal-body {
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.unifiedsmb-sync-button {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--usmb-blue) !important;
    border-color: var(--usmb-blue) !important;
    color: var(--usmb-white) !important;
}

.unifiedsmb-sync-button:hover {
    background-color: var(--usmb-dark-blue) !important;
    border-color: var(--usmb-dark-blue) !important;
}

.unifiedsmb-sync-button .dashicons {
    margin-right: 6px;
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.unifiedsmb-sync-history h2 {
    display: flex;
    align-items: center;
    color: var(--usmb-blue);
    font-size: 16px;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--usmb-light-grey);
}

.unifiedsmb-sync-history h2 .dashicons {
    margin-right: 8px;
    color: var(--usmb-blue);
}

/* Responsive adjustments */
@media (max-width: 782px) {    
    .unifiedsmb-sync-grid {
        grid-template-columns: 1fr;
    }

    .unifiedsmb-sync-settings {
        padding: 24px;
    }
}

/* Sync type badges */
.unifiedsmb-sync-type-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
}

.unifiedsmb-sync-type-everything { background-color: var(--usmb-light-blue); color: var(--usmb-blue); }
.unifiedsmb-sync-type-products { background-color: var(--usmb-light-green); color: var(--usmb-green); }
.unifiedsmb-sync-type-categories { background-color: var(--usmb-light-orange); color: var(--usmb-orange); }
.unifiedsmb-sync-type-attributes { background-color: #f3e5f5; color: #7b1fa2; }
.unifiedsmb-sync-type-brands { background-color: #e8f5e8; color: #2e7d32; }
.unifiedsmb-sync-type-stock { background-color: #fff3e0; color: #ef6c00; }

/* Status indicators with icons */
.unifiedsmb-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.unifiedsmb-status .dashicons {
    font-size: 12px;
    width: 12px;
    height: 12px;
}

.unifiedsmb-status-success {
    background-color: var(--usmb-light-green);
    color: var(--usmb-green);
}

.unifiedsmb-status-error {
    background-color: var(--usmb-light-red);
    color: var(--usmb-red);
}

.unifiedsmb-status-warning {
    background-color: var(--usmb-light-orange);
    color: var(--usmb-orange);
}

.unifiedsmb-status-info {
    background-color: var(--usmb-light-blue);
    color: var(--usmb-blue);
}

/* Sync history actions */
.unifiedsmb-sync-history-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Table improvements */
.unifiedsmb-sync-history .unifiedsmb-table th:nth-child(1) { width: 120px; }
.unifiedsmb-sync-history .unifiedsmb-table th:nth-child(2) { width: 100px; }
.unifiedsmb-sync-history .unifiedsmb-table th:nth-child(3) { width: 80px; }
.unifiedsmb-sync-history .unifiedsmb-table th:nth-child(4) { width: 80px; }
.unifiedsmb-sync-history .unifiedsmb-table th:nth-child(5) { width: 100px; }
.unifiedsmb-sync-history .unifiedsmb-table th:nth-child(6) { width: 100px; }
.unifiedsmb-sync-history .unifiedsmb-table th:nth-child(7) { width: auto; }
/* Sync in progress banner */
.unifiedsmb-sync-in-progress-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--usmb-light-orange);
    border-left: 4px solid var(--usmb-orange);
    border-radius: 4px;
    padding: 14px 20px;
    margin-bottom: 24px;
    font-size: 14px;
    color: var(--usmb-orange);
}

.unifiedsmb-sync-banner-icon {
    font-size: 20px;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.unifiedsmb-sync-banner-text {
    flex-grow: 1;
}
