/**
 * Modern Cost of Goods Manager Styles
 * Clean, efficient interface for managing product costs
 * 
 * @package Alpha Insights
 * @version 4.9.0
 */

/* Container */
.wpd-cogs-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 0px;
    margin-bottom: 50px; /* Add space for WordPress footer */
}

/* Header */
.wpd-cogs-header {
    padding: 24px;
}

.wpd-cogs-container .wpd-cogs-title {
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 8px 0;
}

.wpd-cogs-subtitle {
    color: #6b7280;
    font-size: 14px;
    margin: 0;
}

#wpfooter {
    display: none;
}

/* Stats Cards */
.wpd-cogs-stats {
    display: none; /* Hidden by default */
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    padding: 20px 24px;
    background: #f9fafb;
}

.wpd-cogs-stats.visible {
    display: grid;
}

.wpd-cogs-stat-card {
    background: #fff;
    padding: 16px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.wpd-cogs-stat-label {
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.wpd-cogs-stat-value {
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
}

/* Filters */
.wpd-cogs-filters {
    padding: 20px 24px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}

.wpd-cogs-filters-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1fr auto;
    gap: 12px;
    align-items: end;
}

.wpd-cogs-filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wpd-cogs-filter-label {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

.wpd-cogs-filter,
#wpd-cogs-search,
#wpd-cogs-per-page {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.wpd-cogs-filter:focus,
#wpd-cogs-search:focus,
#wpd-cogs-per-page:focus {
    outline: none;
    border-color: #03abee;
    box-shadow: 0 0 0 3px rgba(3, 171, 238, 0.1);
}

/* Unsaved Changes Indicator (subtle banner) */
#wpd-cogs-unsaved-banner {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    background: #e0f2fe; /* Light blue to match changed rows */
    border-top: 3px solid #03abee; /* Blue to match theme */
    padding: 12px 24px;
    font-size: 13px;
    color: #0c4a6e; /* Darker blue for text */
    display: none;
    z-index: 998;
    animation: wpd-cogs-slide-up 0.3s ease;
    margin: 0;
}

#wpd-cogs-unsaved-banner .dashicons {
    color: #03abee; /* Blue to match theme */
    margin-right: 4px;
}

@keyframes wpd-cogs-slide-up {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Floating Buttons Container */
#wpd-cogs-floating-buttons {
    position: fixed;
    bottom: 30px; /* Default to bottom when no banner */
    right: 30px;
    z-index: 999;
    display: flex;
    gap: 12px;
    align-items: center;
    transition: bottom 0.3s ease;
}

/* Shift up when unsaved banner is visible */
body:has(#wpd-cogs-unsaved-banner:visible) #wpd-cogs-floating-buttons,
#wpd-cogs-floating-buttons.with-banner {
    bottom: 70px;
}

/* Floating Bulk Edit Button */
#wpd-cogs-bulk-edit-btn {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: wpd-cogs-slide-in 0.3s ease;
}

#wpd-cogs-bulk-edit-btn .dashicons {
    margin-right: 4px;
}

/* Floating Cancel Button */
#wpd-cogs-floating-cancel {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: wpd-cogs-slide-in 0.3s ease;
}

#wpd-cogs-floating-cancel .dashicons {
    margin-right: 4px;
}

/* Floating Save Button */
#wpd-cogs-floating-save {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: wpd-cogs-slide-in 0.3s ease;
}

#wpd-cogs-floating-save .dashicons {
    margin-right: 4px;
}

#wpd-cogs-floating-save .wpd-cogs-change-count {
    margin-left: 4px;
    opacity: 0.9;
}

@keyframes wpd-cogs-slide-in {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Table Container */
.wpd-cogs-table-container {
    padding: 0;
}

.wpd-cogs-table-wrapper {
    overflow-x: auto;
    border-top: 1px solid #e5e7eb;
}

/* Table */
.wpd-cogs-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

/* Checkbox Column */
.wpd-cogs-checkbox-col {
    width: 40px;
    text-align: center !important;
}

.wpd-cogs-checkbox-col input[type="checkbox"],
.wpd-cogs-row-checkbox {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.wpd-cogs-table thead {
    background: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
}

.wpd-cogs-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.wpd-cogs-sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 24px;
}

.wpd-cogs-sortable::after {
    content: '⇅';
    position: absolute;
    right: 8px;
    opacity: 0.3;
}

.wpd-cogs-sortable:hover::after {
    opacity: 0.6;
}

.wpd-cogs-sortable.asc::after {
    content: '↑';
    opacity: 1;
    color: #03abee;
}

.wpd-cogs-sortable.desc::after {
    content: '↓';
    opacity: 1;
    color: #03abee;
}

.wpd-cogs-table tbody tr {
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.15s ease;
}

.wpd-cogs-table tbody tr:hover {
    background: #f9fafb;
}

/* Highlight entire row when it has unsaved changes */
.wpd-cogs-table tbody tr.wpd-cogs-row-changed {
    background: #e0f2fe; /* Light blue background */
    border-left: 3px solid #03abee; /* Blue left border accent */
}

.wpd-cogs-table tbody tr.wpd-cogs-row-changed:hover {
    background: #bae6fd; /* Slightly darker blue on hover */
}

/* Remove the yellow background for products without cost - not helpful */

.wpd-cogs-table td {
    padding: 24px 20px;
    font-size: 14px;
    color: #1f2937;
    vertical-align: middle;
}

/* Header Styling */
.wpd-cogs-header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.wpd-cogs-header-content > div:first-child {
    flex: 1;
}

.wpd-cogs-header-buttons {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    margin-top: 8px;
}

#wpd-cogs-help-btn .dashicons,
#wpd-cogs-stats-btn .dashicons {
    margin-right: 5px;
}

/* Product Column with Image */
.wpd-cogs-product {
    min-width: 200px;
    max-width: 250px;
}

.wpd-cogs-product-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wpd-cogs-product-image {
    flex-shrink: 0;
}

.wpd-cogs-product-image img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
}

.wpd-cogs-no-image {
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border-radius: 4px;
    font-size: 28px;
}

.wpd-cogs-product-info {
    flex: 1;
    min-width: 0; /* Allow text truncation */
}

.wpd-cogs-product-name {
    font-weight: 500;
    color: #1f2937;
    margin-bottom: 4px;
}

.wpd-cogs-product-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.wpd-cogs-sku {
    font-size: 12px;
    color: #6b7280;
    font-family: monospace;
}

.wpd-cogs-type {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    background: #e5e7eb;
    color: #374151;
    text-transform: capitalize;
}

.wpd-cogs-type.simple {
    background: #dbeafe;
    color: #1e40af;
}

.wpd-cogs-type.variable {
    background: #fce7f3;
    color: #9f1239;
}

.wpd-cogs-type.variation {
    background: #f3e8ff;
    color: #6b21a8;
}

/* Cost Input */
.wpd-cogs-cost-cell {
    min-width: 140px;
    vertical-align: middle;
}

.wpd-cogs-cost-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wpd-cogs-cost-input-wrapper {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    overflow: hidden;
    background: #fff;
    vertical-align: middle;
    max-width: 145px;
}

.wpd-cogs-default-text {
    font-size: 11px;
    color: #9ca3af;
    font-style: italic;
    margin-top: 2px;
}

.wpd-cogs-currency {
    display: flex;
    align-items: center;
    padding: 8px;
    color: #6b7280;
    font-size: 14px;
    border-right: 1px solid #d1d5db;
    background: #f9fafb;
}

.wpd-cogs-cost-input {
    width: 100%;
    padding: 8px 12px;
    border: none !important;
    box-shadow: none !important;
    font-size: 14px;
    font-weight: 600; /* Make actual values bold */
    transition: all 0.2s ease;
    background: transparent !important;
    outline: none !important;
}

/* Full width input in modals */
.wpd-cogs-modal .wpd-cogs-cost-input {
    width: 100%;
    flex: 1;
}

.wpd-cogs-cost-input::placeholder {
    font-weight: 400; /* Make placeholders normal weight */
    opacity: 0.5; /* Make placeholders lighter */
    color: #9ca3af; /* Lighter gray color */
}

.wpd-cogs-cost-input-wrapper:focus-within {
    border-color: #03abee;
    box-shadow: 0 0 0 3px rgba(3, 171, 238, 0.1);
}

.wpd-cogs-cost-input-wrapper:has(.wpd-cogs-cost-input.wpd-cogs-changed) {
    border-color: #03abee;
    border-width: 2px;
}

.wpd-cogs-cost-input-wrapper:has(.wpd-cogs-cost-input.wpd-cogs-saved) {
    border-color: #10b981;
    background: #ecfdf5;
}

.wpd-cogs-cost-input-wrapper:has(.wpd-cogs-cost-input.wpd-cogs-error) {
    border-color: #ef4444;
    background: #fef2f2;
}

.wpd-cogs-save-indicator {
    position: absolute;
    right: 8px;
    color: #10b981;
    font-size: 16px;
    font-weight: bold;
}

/* Margin & Profit */
.wpd-cogs-margin,
.wpd-cogs-profit {
    font-weight: 500;
}

.wpd-cogs-margin.positive {
    color: #059669;
}

.wpd-cogs-profit.positive {
    color: #059669;
}

.wpd-cogs-profit.negative {
    color: #dc2626;
}

/* Stock */
.wpd-cogs-stock {
    text-align: center;
}

.wpd-cogs-stock-qty {
    font-weight: 600;
    color: #1f2937;
    display: block;
    margin-bottom: 4px;
}

.wpd-cogs-stock-status {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    text-transform: capitalize;
}

.wpd-cogs-stock.in-stock .wpd-cogs-stock-status {
    background: #d1fae5;
    color: #065f46;
}

.wpd-cogs-stock.out-of-stock .wpd-cogs-stock-status {
    background: #fee2e2;
    color: #991b1b;
}

/* Actions */
.wpd-cogs-actions {
    text-align: center;
    width: 60px;
}

.wpd-cogs-edit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    color: #6b7280;
    transition: all 0.2s ease;
    text-decoration: none;
}

.wpd-cogs-edit-btn:hover {
    background: #f3f4f6;
    color: #03abee;
}

/* Pagination */
.wpd-cogs-pagination {
    padding: 20px;
    border-top: 1px solid #e5e7eb;
}

.wpd-cogs-pagination-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wpd-cogs-pagination-info {
    color: #6b7280;
    font-size: 14px;
}

.wpd-cogs-pagination-buttons {
    display: flex;
    gap: 8px;
}

.wpd-cogs-page-btn {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    background: #fff;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wpd-cogs-page-btn:hover {
    background: #f9fafb;
    border-color: #03abee;
}

.wpd-cogs-page-btn.active {
    background: #03abee;
    color: #fff;
    border-color: #03abee;
}

.wpd-cogs-page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Empty State */
.wpd-cogs-empty,
.wpd-cogs-loading {
    text-align: center;
    padding: 48px 24px;
    color: #6b7280;
    font-size: 14px;
}

/* Progress Overlay */
.wpd-cogs-progress-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
}

.wpd-cogs-progress-content {
    background: #fff;
    padding: 32px;
    border-radius: 8px;
    min-width: 320px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.wpd-cogs-progress-text {
    font-size: 16px;
    font-weight: 500;
    color: #1f2937;
    margin-bottom: 16px;
    text-align: center;
}

.wpd-cogs-progress-bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.wpd-cogs-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #03abee, #0390c7);
    transition: width 0.3s ease;
}

/* Toolbar */
.wpd-cogs-toolbar {
    padding: 16px 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wpd-cogs-toolbar-left {
    display: flex;
    gap: 20px;
    align-items: center;
}

.wpd-cogs-toolbar-right {
    display: flex;
    gap: 12px;
}

.wpd-cogs-pagination-info {
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
}

/* Help Modal Styles */
.wpd-cogs-help-modal-content {
    max-width: 900px;
    max-height: 85vh;
}

.wpd-cogs-help-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 24px;
}

.wpd-cogs-help-tab {
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: #64748b;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.wpd-cogs-help-tab:hover {
    color: #2563eb;
    background: #f1f5f9;
}

.wpd-cogs-help-tab.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

.wpd-cogs-help-content {
    max-height: 500px;
    overflow-y: auto;
    padding-right: 10px;
}

.wpd-cogs-help-panel {
    display: none;
}

.wpd-cogs-help-panel.active {
    display: block;
}

.wpd-cogs-help-panel h3 {
    margin-top: 0;
    margin-bottom: 16px;
    color: #1f2937;
    font-size: 20px;
    font-weight: 600;
}

.wpd-cogs-help-panel h4 {
    margin-top: 20px;
    margin-bottom: 12px;
    color: #374151;
    font-size: 16px;
    font-weight: 600;
}

.wpd-cogs-help-panel p {
    margin-bottom: 16px;
    line-height: 1.6;
    color: #4b5563;
}

.wpd-cogs-help-panel ul,
.wpd-cogs-help-panel ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

.wpd-cogs-help-panel li {
    margin-bottom: 8px;
    line-height: 1.6;
    color: #4b5563;
}

.wpd-cogs-help-panel li strong {
    color: #138fdd;
}

.wpd-cogs-help-hierarchy {
    margin: 24px 0;
}

.wpd-cogs-help-level {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    padding: 16px;
    background: #f0f9ff;
    border-radius: 8px;
    border-left: 4px solid #138fdd;
}

.wpd-cogs-help-level-number {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #138fdd;
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
}

.wpd-cogs-help-level-content {
    flex: 1;
}

.wpd-cogs-help-level-content h4 {
    margin-top: 0;
    margin-bottom: 8px;
    color: #1f2937;
    font-weight: 600;
}

.wpd-cogs-help-level-content p {
    margin-bottom: 0;
    color: #4b5563;
}

.wpd-cogs-help-setting {
    margin-top: 12px;
    padding: 12px;
    background: white;
    border: 2px solid #bae6fd;
    border-radius: 6px;
}

.wpd-cogs-help-setting strong {
    color: #138fdd;
}

.wpd-cogs-help-setting a {
    color: #138fdd;
    text-decoration: none;
    font-weight: 500;
}

.wpd-cogs-help-setting a:hover {
    color: #0c6fb8;
    text-decoration: underline;
}

.wpd-cogs-help-note {
    margin-top: 20px;
    padding: 16px;
    background: #eff6ff;
    border-left: 4px solid #138fdd;
    border-radius: 6px;
    border: 2px solid #bae6fd;
    border-left: 4px solid #138fdd;
}

.wpd-cogs-help-note strong {
    color: #138fdd;
}

/* Responsive */
@media (max-width: 1024px) {
    .wpd-cogs-filters-grid {
        grid-template-columns: 1fr 1fr;
    }

    .wpd-cogs-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .wpd-cogs-filters-grid {
        grid-template-columns: 1fr;
    }

    .wpd-cogs-stats {
        grid-template-columns: 1fr;
    }

    .wpd-cogs-pagination-wrapper {
        flex-direction: column;
        gap: 12px;
    }

    .wpd-cogs-toolbar {
        flex-direction: column;
        gap: 12px;
    }

    .wpd-cogs-toolbar-left,
    .wpd-cogs-toolbar-right {
        width: 100%;
    }

    .wpd-cogs-table th,
    .wpd-cogs-table td {
        padding: 8px;
        font-size: 12px;
    }

    .wpd-cogs-product-image {
        display: none;
    }

    .wpd-cogs-product {
        min-width: 150px;
    }
}

/* Loading Animation */
@keyframes wpd-cogs-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.wpd-cogs-loading {
    animation: wpd-cogs-pulse 1.5s ease-in-out infinite;
}

/* ==================== IMPORT MODAL ==================== */

.wpd-cogs-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wpd-cogs-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
}

.wpd-cogs-modal-content {
    position: relative;
    background: #fff;
    border-radius: 8px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
    animation: wpd-cogs-modal-in 0.3s ease;
}

@keyframes wpd-cogs-modal-in {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.wpd-cogs-modal-header {
    padding: 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wpd-cogs-modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
}

/* Help modal specific header styling */
#wpd-cogs-help-modal .wpd-cogs-modal-header {
    background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
    border-bottom: 2px solid #bae6fd;
}

#wpd-cogs-help-modal .wpd-cogs-modal-header h2 {
    color: #138fdd;
}

.wpd-cogs-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.wpd-cogs-modal-close:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.wpd-cogs-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.wpd-cogs-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.wpd-cogs-import-step h3 {
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

/* Special styling for Import Complete heading */
#wpd-cogs-import-step-4 h3 {
    color: #138fdd;
    font-size: 22px;
    margin-bottom: 24px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

#wpd-cogs-import-step-4 h3::before {
    content: "✓";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #138fdd;
    color: white;
    border-radius: 50%;
    font-size: 18px;
    font-weight: bold;
}

.wpd-cogs-import-step p {
    margin: 0 0 20px 0;
    color: #6b7280;
}

.wpd-cogs-file-upload {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.wpd-cogs-file-name {
    color: #6b7280;
    font-size: 14px;
}

/* CSV Preview Table */
.wpd-cogs-preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-top: 12px;
}

.wpd-cogs-preview-table th,
.wpd-cogs-preview-table td {
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    text-align: left;
}

.wpd-cogs-preview-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
}

.wpd-cogs-preview-table td {
    color: #6b7280;
}

/* Mapping Form */
.wpd-cogs-mapping-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.wpd-cogs-form-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 30px;
}

.wpd-cogs-form-row label {
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.wpd-cogs-form-row select,
.wpd-cogs-form-row input[type="text"] {
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
}

.wpd-cogs-form-row input[type="checkbox"] {
    margin-right: 8px;
}

/* Import Progress */
.wpd-cogs-import-progress {
    text-align: center;
    padding: 32px 0;
}

.wpd-cogs-import-progress .wpd-cogs-progress-text {
    font-size: 16px;
    font-weight: 500;
    color: #1f2937;
    margin-bottom: 16px;
}

.wpd-cogs-import-progress .wpd-cogs-progress-bar {
    height: 12px;
    background: #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 12px;
}

.wpd-cogs-import-progress .wpd-cogs-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #03abee, #0390c7);
    transition: width 0.3s ease;
}

.wpd-cogs-import-progress .wpd-cogs-progress-numbers {
    font-size: 14px;
    color: #6b7280;
}

/* Import Results */
.wpd-cogs-import-results {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin: 24px 0;
}

.wpd-cogs-result-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 16px 12px;
    background: #ffffff;
    border-radius: 8px;
    border: 2px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.wpd-cogs-result-stat:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-color: #138fdd;
}

/* Remove colored backgrounds and borders - all boxes look the same */
.wpd-cogs-result-stat.success,
.wpd-cogs-result-stat.warning,
.wpd-cogs-result-stat.wpd-error {
    background: #ffffff;
    border-color: #e5e7eb;
}

.wpd-cogs-result-stat.success:hover,
.wpd-cogs-result-stat.warning:hover,
.wpd-cogs-result-stat.wpd-error:hover {
    border-color: #138fdd;
    background: #ffffff;
}

.wpd-cogs-result-number {
    display: block;
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    color: #1f2937;
}

/* All numbers use the same blue color */
.wpd-cogs-result-stat .wpd-cogs-result-number,
.wpd-cogs-result-stat.success .wpd-cogs-result-number,
.wpd-cogs-result-stat.warning .wpd-cogs-result-number,
.wpd-cogs-result-stat.wpd-error .wpd-cogs-result-number {
    color: #138fdd;
}

.wpd-cogs-result-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
    line-height: 1.4;
}

/* Error List */
#wpd-cogs-import-errors {
    margin-top: 24px;
    padding: 20px;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-left: 4px solid #f59e0b;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

#wpd-cogs-import-errors h4 {
    margin: 0 0 16px 0;
    color: #1f2937;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

#wpd-cogs-import-errors h4::before {
    content: "⚠";
    font-size: 18px;
    color: #f59e0b;
}

.wpd-cogs-error-list {
    margin: 0;
    padding: 12px 16px;
    max-height: 250px;
    overflow-y: auto;
    background: #f9fafb;
    border-radius: 4px;
    list-style-position: inside;
}

.wpd-cogs-error-list li {
    color: #374151;
    font-size: 13px;
    margin-bottom: 8px;
    padding: 6px 8px;
    background: #ffffff;
    border-radius: 3px;
    list-style: none;
}

/* Import Log */
#wpd-cogs-import-log {
    margin-top: 24px;
    padding: 20px;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

#wpd-cogs-import-log h4 {
    margin: 0 0 16px 0;
    color: #1f2937;
    font-size: 15px;
    font-weight: 600;
}

.wpd-cogs-log-list {
    margin: 0;
    padding: 0;
    max-height: 350px;
    overflow-y: auto;
}

.wpd-cogs-log-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    margin-bottom: 8px;
    background: #f9fafb;
    border-radius: 6px;
    border-left: 3px solid #e5e7eb;
    transition: all 0.2s ease;
}

.wpd-cogs-log-item:hover {
    background: #f3f4f6;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.wpd-cogs-log-item.success {
    border-left-color: #10b981;
}

.wpd-cogs-log-item.skipped {
    border-left-color: #f59e0b;
}

.wpd-cogs-log-item.wpd-error {
    border-left-color: #ef4444;
}

.wpd-cogs-log-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
    font-size: 14px;
    font-weight: bold;
    margin-top: 2px;
}

.wpd-cogs-log-icon.success {
    background: #d1fae5;
    color: #059669;
}

.wpd-cogs-log-icon.skipped {
    background: #fef3c7;
    color: #d97706;
}

.wpd-cogs-log-icon.wpd-error {
    background: #fee2e2;
    color: #dc2626;
}

.wpd-cogs-log-content {
    flex: 1;
    min-width: 0;
}

.wpd-cogs-log-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.wpd-cogs-log-row {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    white-space: nowrap;
}

.wpd-cogs-log-identifier {
    font-size: 12px;
    font-weight: 600;
    color: #138fdd;
    font-family: monospace;
    background: #eff6ff;
    padding: 2px 8px;
    border-radius: 4px;
}

.wpd-cogs-log-message {
    font-size: 13px;
    color: #374151;
    line-height: 1.5;
    word-break: break-word;
}

.wpd-cogs-log-empty {
    padding: 24px;
    text-align: center;
    color: #059669;
    font-size: 14px;
    font-weight: 500;
    background: #f0fdf4;
    border-radius: 6px;
    border: 2px dashed #86efac;
}

/* Bulk Edit Preview */
.wpd-cogs-bulk-preview {
    margin-top: 20px;
    padding: 16px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 4px;
}

.wpd-cogs-bulk-preview h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #0c4a6e;
}

.wpd-cogs-bulk-preview-info {
    color: #0369a1;
    font-size: 14px;
}

/* Migration Modal Styles */
.wpd-cogs-migrate-content {
    padding: 20px;
}

.wpd-cogs-migrate-selector {
    margin-bottom: 25px;
}

.wpd-cogs-migrate-selector label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1e293b;
}

.wpd-cogs-migrate-selector select {
    width: 100%;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 14px;
}

.wpd-cogs-migrate-info {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
}

.wpd-cogs-migrate-info-title {
    font-weight: 600;
    color: #0c4a6e;
    margin-bottom: 8px;
}

.wpd-cogs-migrate-info-text {
    color: #0369a1;
    font-size: 14px;
    margin-bottom: 5px;
}

.wpd-cogs-migrate-warning {
    background: #fef3c7;
    border: 1px solid #fbbf24;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
}

.wpd-cogs-migrate-warning-title {
    font-weight: 600;
    color: #92400e;
    margin-bottom: 8px;
}

.wpd-cogs-migrate-samples {
    margin-top: 15px;
}

.wpd-cogs-migrate-samples table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.wpd-cogs-migrate-samples th,
.wpd-cogs-migrate-samples td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    font-size: 13px;
}

.wpd-cogs-migrate-samples th {
    background: #f1f5f9;
    font-weight: 600;
    color: #475569;
}

.wpd-cogs-migrate-option {
    margin-bottom: 15px;
}

.wpd-cogs-migrate-option label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
}

.wpd-cogs-migrate-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.wpd-cogs-migrate-progress {
    margin-top: 20px;
}

.wpd-cogs-migrate-progress-bar {
    width: 100%;
    height: 30px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.wpd-cogs-migrate-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #2563eb);
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 12px;
}

.wpd-cogs-migrate-status {
    color: #475569;
    font-size: 14px;
    text-align: center;
}

.wpd-cogs-migrate-results {
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 6px;
    padding: 15px;
    margin-top: 15px;
}

.wpd-cogs-migrate-results-title {
    font-weight: 600;
    color: #166534;
    margin-bottom: 10px;
}

.wpd-cogs-migrate-results-item {
    color: #15803d;
    font-size: 14px;
    margin-bottom: 5px;
}

.wpd-cogs-migrate-errors {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    padding: 15px;
    margin-top: 15px;
    max-height: 200px;
    overflow-y: auto;
}

.wpd-cogs-migrate-errors-title {
    font-weight: 600;
    color: #991b1b;
    margin-bottom: 10px;
}

.wpd-cogs-migrate-error-item {
    color: #dc2626;
    font-size: 13px;
    margin-bottom: 5px;
}

/* Responsive */
@media (max-width: 768px) {
    .wpd-cogs-modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .wpd-cogs-import-results {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .wpd-cogs-result-stat {
        padding: 14px 10px;
    }

    .wpd-cogs-result-number {
        font-size: 24px;
        margin-bottom: 6px;
    }

    .wpd-cogs-result-label {
        font-size: 11px;
    }

    #wpd-cogs-floating-buttons {
        flex-direction: column-reverse;
        bottom: 60px;
        right: 20px;
        gap: 8px;
    }
}

/* Mobile screens */
@media (max-width: 600px) {
    .wpd-cogs-import-results {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .wpd-cogs-result-stat {
        padding: 14px 10px;
    }

    .wpd-cogs-result-number {
        font-size: 24px;
    }

    .wpd-cogs-result-label {
        font-size: 11px;
    }
}
button#wpd-cogs-import-modal-close {
    font-size: 24px;
    padding: 10px;
    line-height: inherit;
}