/**
 * Amazon Product Sync CSS for miniOrange WooCommerce Amazon Sync Plugin
 * Premium plan feature styling for comprehensive product synchronization from Amazon
 *
 * @package    MOMCS_Sync
 * @since      1.0.0
 */

/* ==========================================================================
   Amazon Product Sync Button
   ========================================================================== */

#momcs-sync-from-amazon-btn {
    background: #ea580c;
    color: white;
    height: 34px;
    border: none;
    padding: 0px 10px;
    border-radius: 10px;
    cursor: pointer;
    margin-left: -1px;
    font-size: 11px;
    line-height: 1.4;
    text-decoration: none;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6px;
    vertical-align: middle;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(234, 88, 12, 0.3);
    white-space: nowrap;
}

#momcs-sync-from-amazon-btn:hover {
    background: #c2410c;
    color: white;
    box-shadow: 0 2px 5px rgba(194, 65, 12, 0.4);
}

#momcs-sync-from-amazon-btn:focus {
    background: #c2410c;
    color: white;
    box-shadow: 0 0 0 1px #ffffff, 0 0 0 3px #ea580c;
    outline: none;
}

#momcs-sync-from-amazon-btn:disabled {
    background: #cccccc !important;
    color: #666666 !important;
    cursor: not-allowed !important;
    opacity: 0.6;
    box-shadow: none;
}

#momcs-sync-from-amazon-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    display: block;
    margin: 0;
    padding: 0;
}

/* ==========================================================================
   Progress Card Container (momcs-psp-* = Product Sync Progress)
   ========================================================================== */

#momcs-product-sync-progress {
    margin: 0 0 20px 0;
    width: 99%;
    box-sizing: border-box;
}

/* Outer card */
.momcs-psp-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 1px 6px rgba(15, 23, 42, 0.06), 0 4px 16px rgba(15, 23, 42, 0.04);
    overflow: hidden;
}

/* ── Card Header ──────────────────────────────────────────────────── */
.momcs-psp-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: #f8f9fa;
    border-bottom: 1px solid #f0f0f0;
}

.momcs-psp-header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #fff7ed;
    border-radius: 8px;
    color: #ea580c;
    flex-shrink: 0;
}

.momcs-psp-title {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    flex: 1;
    line-height: 1.3;
}

/* Live badge */
.momcs-psp-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    color: #c2410c;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.momcs-psp-live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ea580c;
    animation: momcs-psp-pulse 1.4s ease-in-out infinite;
}

@keyframes momcs-psp-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.5; transform: scale(0.8); }
}

/* ── Card Body ────────────────────────────────────────────────────── */
.momcs-psp-body {
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Loading state */
.momcs-psp-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    font-size: 13px;
    color: #64748b;
}

.momcs-psp-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2.5px solid #e2e8f0;
    border-top-color: #ea580c;
    border-radius: 50%;
    animation: momcs-psp-spin 0.7s linear infinite;
    flex-shrink: 0;
}

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

/* ── Channel Row ──────────────────────────────────────────────────── */
.momcs-psp-channel {
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 14px;
    transition: border-color 0.2s ease;
}

.momcs-psp-channel[data-status="processing"] {
    border-color: #fed7aa;
    background: #fffbf7;
}

.momcs-psp-channel[data-status="completed"] {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.momcs-psp-channel[data-status="error"],
.momcs-psp-channel[data-status="failed"] {
    border-color: #fecaca;
    background: #fef2f2;
}

.momcs-psp-channel[data-status="paused"] {
    border-color: #fed7aa;
    background: #fffbf7;
}

.momcs-psp-channel[data-status="queued"] {
    border-color: #bae6fd;
    background: #f0f9ff;
}

.momcs-psp-channel-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.momcs-psp-channel-icon {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.momcs-psp-channel-name {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Status icon colors */
.momcs-psp-status-icon { display: block; }
.momcs-psp-status-icon.status-completed  { color: #16a34a; }
.momcs-psp-status-icon.status-processing { color: #ea580c; }
.momcs-psp-status-icon.status-paused     { color: #d97706; }
.momcs-psp-status-icon.status-queued     { color: #0284c7; }
.momcs-psp-status-icon.status-error      { color: #dc2626; }
.momcs-psp-status-icon.status-default    { color: #94a3b8; }

/* Spinning animation for processing icon */
.momcs-psp-spin {
    animation: momcs-psp-spin 0.9s linear infinite;
}

/* Percentage */
.momcs-psp-pct {
    font-size: 12px;
    font-weight: 700;
    color: #ea580c;
    min-width: 36px;
    text-align: right;
    flex-shrink: 0;
}

.momcs-psp-channel[data-status="completed"] .momcs-psp-pct { color: #16a34a; }
.momcs-psp-channel[data-status="error"]     .momcs-psp-pct,
.momcs-psp-channel[data-status="failed"]    .momcs-psp-pct { color: #dc2626; }

/* Status badges */
.momcs-psp-status-badge,
.momcs-psp-overall-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.momcs-psp-status-badge.badge-processing,
.momcs-psp-overall-badge.badge-processing {
    background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa;
}
.momcs-psp-status-badge.badge-completed,
.momcs-psp-overall-badge.badge-completed {
    background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0;
}
.momcs-psp-status-badge.badge-paused,
.momcs-psp-overall-badge.badge-paused {
    background: #fefce8; color: #a16207; border: 1px solid #fef08a;
}
.momcs-psp-status-badge.badge-error,
.momcs-psp-status-badge.badge-failed,
.momcs-psp-overall-badge.badge-error,
.momcs-psp-overall-badge.badge-failed {
    background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca;
}
.momcs-psp-status-badge.badge-queued,
.momcs-psp-overall-badge.badge-queued {
    background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe;
}
.momcs-psp-status-badge.badge-stopped,
.momcs-psp-overall-badge.badge-stopped {
    background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0;
}

/* Progress bar */
.momcs-psp-bar-track {
    width: 100%;
    height: 6px;
    background: #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
}

.momcs-psp-bar-fill {
    height: 100%;
    background: #ea580c;
    border-radius: 6px;
    transition: width 0.4s ease-in-out;
    min-width: 3px;
}

.momcs-psp-channel[data-status="completed"] .momcs-psp-bar-fill { background: #16a34a; }
.momcs-psp-channel[data-status="error"]     .momcs-psp-bar-fill,
.momcs-psp-channel[data-status="failed"]    .momcs-psp-bar-fill { background: #dc2626; }
.momcs-psp-channel[data-status="paused"]    .momcs-psp-bar-fill { background: #d97706; }
.momcs-psp-channel[data-status="queued"]    .momcs-psp-bar-fill { background: #0284c7; }

/* Animated stripe for processing */
.momcs-psp-channel[data-status="processing"] .momcs-psp-bar-fill {
    background: linear-gradient(90deg, #ea580c 0%, #f97316 50%, #ea580c 100%);
    background-size: 200% 100%;
    animation: momcs-psp-bar-shimmer 1.6s linear infinite;
}

@keyframes momcs-psp-bar-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Meta chips below the bar */
.momcs-psp-channel-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.momcs-psp-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    font-size: 11px;
    color: #64748b;
}

/* ── Alert messages (error / success) ────────────────────────────── */
.momcs-psp-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 0;
}

.momcs-psp-alert p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
}

.momcs-psp-alert-icon {
    flex-shrink: 0;
    margin-top: 1px;
}

.momcs-psp-alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.momcs-psp-alert-error .momcs-psp-alert-icon { color: #dc2626; }

.momcs-psp-alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.momcs-psp-alert-success .momcs-psp-alert-icon { color: #16a34a; }

/* ── Controls row ─────────────────────────────────────────────────── */
.momcs-psp-controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 18px;
    border-top: 1px solid #f0f0f0;
    background: #f8f9fa;
}

.momcs-psp-btn-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.momcs-psp-footer-meta {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: #94a3b8;
}

/* ==========================================================================
   Control Buttons
   ========================================================================== */

.momcs-product-sync-controls {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
}

.momcs-product-pause-btn,
.momcs-product-resume-btn,
.momcs-product-stop-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 16px;
    height: 34px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    vertical-align: middle;
    border: 1.5px solid transparent;
    transition: all 0.15s ease;
    white-space: nowrap;
}

/* Pause — solid orange */
.momcs-product-pause-btn {
    background: #ea580c;
    color: #ffffff;
    border-color: #ea580c;
}

.momcs-product-pause-btn:hover,
.momcs-product-pause-btn:focus {
    background: #c2410c;
    border-color: #c2410c;
    color: #ffffff;
    outline: none;
}

/* Resume — solid green (positive re-start action) */
.momcs-product-resume-btn {
    background: #16a34a;
    color: #ffffff;
    border-color: #16a34a;
}

.momcs-product-resume-btn:hover,
.momcs-product-resume-btn:focus {
    background: #15803d;
    border-color: #15803d;
    color: #ffffff;
    outline: none;
}

/* Stop — orange outline (destructive but consistent with theme) */
.momcs-product-stop-btn {
    background: transparent;
    color: #ea580c;
    border-color: #ea580c;
}

.momcs-product-stop-btn:hover,
.momcs-product-stop-btn:focus {
    background: #fff7ed;
    border-color: #c2410c;
    color: #c2410c;
    outline: none;
}

/* Disabled/Loading state */
.momcs-product-pause-btn:disabled,
.momcs-product-resume-btn:disabled,
.momcs-product-stop-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media screen and (max-width: 782px) {
    #momcs-sync-from-amazon-btn {
        margin: 10px 0;
        width: 100%;
        justify-content: center;
    }

    .momcs-psp-channel-row {
        flex-wrap: wrap;
    }

    .momcs-psp-controls-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .momcs-psp-btn-group {
        width: 100%;
    }

    .momcs-product-pause-btn,
    .momcs-product-resume-btn,
    .momcs-product-stop-btn {
        flex: 1;
        justify-content: center;
    }
}

