/* Product Sync Page - Professional Styling with Plugin Theme Colors */

/* Main Layout */
.ptmpgb-admin-wrap {
    background: #f9fafb;
    min-height: 100vh;
    margin-left: -20px;
}

/* Header - Using Plugin Theme Color #2271b1 */
.ptmpgb-admin-wrap .ptmpgb-header {
    background: #2271b1 !important;
    color: white !important;
    padding: 24px 32px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.ptmpgb-admin-wrap .ptmpgb-header * {
    color: white !important;
}

.ptmpgb-admin-wrap .ptmpgb-header .ptmpgb-title {
    color: white !important;
}

.ptmpgb-admin-wrap .ptmpgb-header .ptmpgb-subtitle {
    color: white !important;
    opacity: 0.9;
}

.ptmpgb-title {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.ptmpgb-subtitle {
    font-size: 14px;
    opacity: 0.9;
    margin: 0;
}

/* Cards */
.ptmpgb-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin: 16px 32px;
    border: 1px solid #e0e0e0;
}

.ptmpgb-card-header-modern {
    background: #f6f7f7;
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.ptmpgb-admin-wrap .ptmpgb-card-icon {
    width: 40px;
    height: 40px;
    background: #2271b1 !important;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white !important;
    font-size: 20px;
}

.ptmpgb-card-header-modern h2 {
    font-size: 18px;
    font-weight: 600;
    color: #1d2327;
    margin: 0;
}

.ptmpgb-card-subtitle {
    color: #646970;
    font-size: 13px;
    margin: 4px 0 0 0;
}

/* Auto Sync Section */
.ptmpgb-auto-sync-modern-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
}

.ptmpgb-auto-sync-modern-icon-wrap {
    width: 48px;
    height: 48px;
    background: #00a32a;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.ptmpgb-auto-sync-modern-copy h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1d2327;
    margin: 0 0 4px 0;
}

.ptmpgb-auto-sync-modern-copy p {
    color: #646970;
    margin: 0;
    font-size: 13px;
}

.ptmpgb-auto-sync-modern-pill {
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: auto;
}

.ptmpgb-auto-sync-modern-pill.is-on {
    background: #d5e8d4;
    color: #00a32a;
}

.ptmpgb-auto-sync-modern-pill.is-off {
    background: #f0f0f1;
    color: #646970;
}

/* Toggle Switch */
.ptmpgb-auto-sync-modern-toggle-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 20px 24px;
    cursor: pointer;
}

.ptmpgb-auto-sync-modern-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.ptmpgb-auto-sync-modern-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.ptmpgb-auto-sync-modern-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #8c8f94;
    transition: 0.3s;
    border-radius: 24px;
}

.ptmpgb-auto-sync-modern-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    transition: 0.3s;
    border-radius: 50%;
}

.ptmpgb-admin-wrap input:checked + .ptmpgb-auto-sync-modern-slider {
    background: #2271b1 !important;
}

input:checked + .ptmpgb-auto-sync-modern-slider:before {
    transform: translateX(20px);
}

.ptmpgb-auto-sync-modern-toggle-copy strong {
    display: block;
    color: #1d2327;
    font-size: 14px;
    margin-bottom: 4px;
}

.ptmpgb-auto-sync-modern-toggle-copy small {
    color: #646970;
    font-size: 13px;
    line-height: 1.4;
}

/* Grid Layout */
.ptmpgb-auto-sync-modern-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 20px 24px;
    background: #f6f7f7;
}

.ptmpgb-auto-sync-modern-panel {
    background: white;
    padding: 16px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.ptmpgb-auto-sync-modern-panel h4 {
    color: #1d2327;
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 12px 0;
}

.ptmpgb-auto-sync-modern-panel ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ptmpgb-auto-sync-modern-panel li {
    padding: 6px 0;
    color: #646970;
    font-size: 13px;
    line-height: 1.4;
    border-bottom: 1px solid #f0f0f1;
}

.ptmpgb-auto-sync-modern-panel li:last-child {
    border-bottom: none;
}

.ptmpgb-auto-sync-modern-panel li strong {
    color: #1d2327;
}

.ptmpgb-auto-sync-modern-note {
    background: #f0f6fc;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 12px;
    margin-top: 12px;
    color: #1d2327;
    font-size: 12px;
}

/* Buttons */
.ptmpgb-auto-sync-modern-actions {
    padding: 20px 24px;
    border-top: 1px solid #e0e0e0;
    background: #f6f7f7;
}

.ptmpgb-admin-wrap .ptmpgb-save-btn-modern {
    background: #2271b1 !important;
    color: white !important;
    border: none !important;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}

.ptmpgb-admin-wrap .ptmpgb-save-btn-modern:hover {
    background: #135e96 !important;
    color: white !important;
}

.ptmpgb-admin-wrap .ptmpgb-save-btn-modern:focus {
    background: #135e96 !important;
    color: white !important;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.3);
}

.ptmpgb-save-btn-modern:disabled {
    background: #8c8f94;
    cursor: not-allowed;
}

/* Product Management */
.ptmpgb-product-mgmt-toolbar {
    display: flex;
    gap: 8px;
    padding: 16px 24px;
    background: #f6f7f7;
    border-bottom: 1px solid #e0e0e0;
}

.ptmpgb-product-mgmt-chip {
    background: #f0f0f1;
    color: #646970;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ptmpgb-product-mgmt-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 12px;
}

.ptmpgb-product-mgmt-table-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1d2327;
    margin: 0;
}

.ptmpgb-product-mgmt-refresh {
    background: #f6f7f7;
    border: 1px solid #c3c4c7;
    color: #646970;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ptmpgb-product-mgmt-refresh:hover {
    background: #f0f0f1;
}

/* Column Controls */
.ptmpgb-product-mgmt-columns {
    padding: 12px 24px;
    background: #f6f7f7;
    border-bottom: 1px solid #e0e0e0;
}

.ptmpgb-product-mgmt-columns h4 {
    font-size: 13px;
    font-weight: 600;
    color: #1d2327;
    margin: 0 0 8px 0;
}

.column-dropdown-wrapper {
    position: relative;
    display: inline-block;
}

.column-dropdown-btn {
    background: white;
    border: 1px solid #c3c4c7;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #646970;
}

.column-dropdown-btn:hover {
    background: #f6f7f7;
}

.column-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 1000;
    min-width: 180px;
    max-height: 240px;
    overflow-y: auto;
    margin-top: 2px;
}

.column-dropdown-menu label {
    display: block;
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f1;
    font-size: 13px;
    color: #646970;
}

.column-dropdown-menu label:hover {
    background: #f6f7f7;
}

.select-all-option {
    font-weight: 600;
    background: #f6f7f7 !important;
}

/* Products Table */
.wc-sync-table-container {
    padding: 0 24px 20px;
    overflow-x: auto;
}

.wc-sync-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.wc-sync-table th {
    background: #f6f7f7;
    color: #1d2327;
    padding: 12px 8px;
    font-weight: 600;
    font-size: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.wc-sync-table td {
    padding: 8px;
    border-bottom: 1px solid #f0f0f1;
    font-size: 12px;
    color: #646970;
}

.wc-sync-table tbody tr:hover {
    background: #f6f7f7;
}

.product-checkbox, #select-all {
    transform: scale(1.1);
}

.product-image {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 4px;
}

.product-name {
    font-weight: 500;
    color: #1d2327;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-id {
    font-family: monospace;
    color: #646970;
    background: #f0f0f1;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
}

.product-sku {
    font-family: monospace;
    font-size: 11px;
    background: #f0f6fc;
    color: #2271b1;
    padding: 2px 6px;
    border-radius: 3px;
}

.product-status {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.product-status.publish {
    background: #d5e8d4;
    color: #00a32a;
}

.product-status.draft {
    background: #f0f0f1;
    color: #646970;
}

.product-status.private {
    background: #f0f6fc;
    color: #2271b1;
}

.product-price {
    font-weight: 500;
    color: #00a32a;
}

/* Consent Section */
.ptmpgb-product-mgmt-consent {
    padding: 20px 24px;
    background: #f6f7f7;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
}

.ptmpgb-consent-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    padding: 12px;
    background: white;
    border-radius: 4px;
    border: 1px solid #c3c4c7;
}

.ptmpgb-consent-checkbox-input {
    transform: scale(1.2);
    margin: 0;
}

.ptmpgb-consent-text strong {
    display: block;
    color: #1d2327;
    font-size: 14px;
    margin-bottom: 4px;
}

.ptmpgb-consent-text small {
    color: #646970;
    line-height: 1.4;
    font-size: 13px;
}

/* Footer Actions */
.ptmpgb-product-mgmt-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: #f6f7f7;
    border-top: 1px solid #e0e0e0;
}

#send-selected {
    background: #00a32a;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

#send-selected:hover:not(:disabled) {
    background: #008a20;
}

#send-selected:disabled {
    background: #8c8f94;
    cursor: not-allowed;
}

.selected-count {
    color: #646970;
    font-size: 13px;
    font-weight: 500;
    background: white;
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid #c3c4c7;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 1s linear infinite;
}

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

/* Notifications */
.ptmpgb-notification {
    position: relative;
    padding: 12px 40px 12px 16px;
    margin: 16px 32px;
    border-radius: 4px;
    border-left: 4px solid;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.ptmpgb-notification-success {
    border-left-color: #00a32a;
    background: #f0f6fc;
    color: #1d2327;
}

.ptmpgb-notification-error {
    border-left-color: #d63638;
    background: #fcf0f1;
    color: #1d2327;
}

.ptmpgb-notification-info {
    border-left-color: #2271b1;
    background: #f0f6fc;
    color: #1d2327;
}

.ptmpgb-notification-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
}

.ptmpgb-notification-close:hover {
    opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .ptmpgb-auto-sync-modern-grid {
        grid-template-columns: 1fr;
    }
    
    .ptmpgb-product-mgmt-footer {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    #send-selected {
        justify-content: center;
    }
}

/* Additional Plugin Theme Color Overrides */
.ptmpgb-admin-wrap .ptmpgb-wc-sync-connect-btn {
    background: #2271b1 !important;
    color: white !important;
    border: none !important;
}

.ptmpgb-admin-wrap .ptmpgb-wc-sync-connect-btn:hover {
    background: #135e96 !important;
    color: white !important;
}

/* Keep the overlay behind the button text in admin overrides */
.ptmpgb-admin-wrap .ptmpgb-wc-sync-connect-btn {
    position: relative !important;
}
.ptmpgb-admin-wrap .ptmpgb-wc-sync-connect-btn::before {
    z-index: 1 !important;
}
.ptmpgb-admin-wrap .ptmpgb-wc-sync-connect-btn,
.ptmpgb-admin-wrap .ptmpgb-wc-sync-connect-btn .dashicons {
    position: relative !important;
    z-index: 2 !important;
}

/* Explicitly keep text/icon white on hover/focus/active in admin overrides */
.ptmpgb-admin-wrap .ptmpgb-wc-sync-connect-btn:hover,
.ptmpgb-admin-wrap .ptmpgb-wc-sync-connect-btn:focus,
.ptmpgb-admin-wrap .ptmpgb-wc-sync-connect-btn:active {
    color: #ffffff !important;
    background: #135e96 !important;
    border-color: #135e96 !important;
}
.ptmpgb-admin-wrap .ptmpgb-wc-sync-connect-btn:hover .dashicons,
.ptmpgb-admin-wrap .ptmpgb-wc-sync-connect-btn:focus .dashicons,
.ptmpgb-admin-wrap .ptmpgb-wc-sync-connect-btn:active .dashicons {
    color: #ffffff !important;
}

.ptmpgb-admin-wrap .ptmpgb-auto-sync-modern-icon-wrap {
    background: #2271b1 !important;
    color: white !important;
}

.ptmpgb-admin-wrap .ptmpgb-product-mgmt-refresh:hover {
    background: #f0f0f1;
    border-color: #2271b1;
}

.ptmpgb-admin-wrap .column-dropdown-btn:hover {
    background: #f6f7f7;
    border-color: #2271b1;
}

/* Ensure all primary buttons use plugin theme color */
.ptmpgb-admin-wrap button[type="submit"],
.ptmpgb-admin-wrap .button-primary,
.ptmpgb-admin-wrap .ptmpgb-btn-primary {
    background: #2271b1 !important;
    border-color: #2271b1 !important;
    color: white !important;
}

.ptmpgb-admin-wrap button[type="submit"]:hover,
.ptmpgb-admin-wrap .button-primary:hover,
.ptmpgb-admin-wrap .ptmpgb-btn-primary:hover {
    background: #135e96 !important;
    border-color: #135e96 !important;
    color: white !important;
}