/**
 * GGM Commerce Import/Export Styles
 */

/* Modal Overlay */
.ggmc-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.ggmc-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Container */
.ggmc-modal {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    max-width: 700px;
    width: 95%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    transform: translateY(-20px);
    transition: transform 0.3s;
}

.ggmc-modal-overlay.active .ggmc-modal {
    transform: translateY(0);
}

/* Modal Header */
.ggmc-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.ggmc-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}

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

/* Modal Body */
.ggmc-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

/* Modal Footer */
.ggmc-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Step Indicator */
.ggmc-step-indicator {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
    gap: 8px;
}

.ggmc-step {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ggmc-step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.ggmc-step.active .ggmc-step-number {
    background: #2563eb;
    color: #fff;
}

.ggmc-step.completed .ggmc-step-number {
    background: #10b981;
    color: #fff;
}

.ggmc-step-label {
    font-size: 13px;
    color: #6b7280;
}

.ggmc-step.active .ggmc-step-label {
    color: #1f2937;
    font-weight: 500;
}

.ggmc-step-connector {
    width: 40px;
    height: 2px;
    background: #e5e7eb;
    margin: 0 8px;
}

.ggmc-step.completed + .ggmc-step-connector {
    background: #10b981;
}

/* Form Elements */
.ggmc-form-group {
    margin-bottom: 20px;
}

.ggmc-form-group label {
    display: block;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
    font-size: 14px;
}

.ggmc-form-group .description {
    font-size: 13px;
    color: #6b7280;
    margin-top: 4px;
}

/* Radio Options */
.ggmc-radio-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ggmc-radio-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.ggmc-radio-option:hover {
    border-color: #d1d5db;
}

.ggmc-radio-option.selected {
    border-color: #2563eb;
    background: #eff6ff;
}

.ggmc-radio-option input[type="radio"] {
    margin-top: 2px;
}

.ggmc-radio-option-content {
    flex: 1;
}

.ggmc-radio-option-title {
    font-weight: 500;
    color: #1f2937;
    margin-bottom: 4px;
}

.ggmc-radio-option-desc {
    font-size: 13px;
    color: #6b7280;
}

/* Checkbox Options */
.ggmc-checkbox-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.ggmc-checkbox-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    font-size: 14px;
    color: #374151;
}

.ggmc-checkbox-option input[type="checkbox"] {
    margin: 0;
}

/* File Upload Area */
.ggmc-file-upload {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    background: #f9fafb;
    transition: border-color 0.2s, background 0.2s;
    cursor: pointer;
}

.ggmc-file-upload:hover {
    border-color: #2563eb;
    background: #eff6ff;
}

.ggmc-file-upload.drag-over {
    border-color: #2563eb;
    background: #dbeafe;
}

.ggmc-file-upload-icon {
    font-size: 48px;
    color: #9ca3af;
    margin-bottom: 12px;
}

.ggmc-file-upload-text {
    font-size: 15px;
    color: #1f2937;
    margin-bottom: 4px;
}

.ggmc-file-upload-hint {
    font-size: 13px;
    color: #6b7280;
}

.ggmc-file-upload input[type="file"] {
    display: none;
}

/* File Info */
.ggmc-file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f3f4f6;
    border-radius: 6px;
    margin-top: 16px;
}

.ggmc-file-info-icon {
    width: 40px;
    height: 40px;
    background: #e5e7eb;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #6b7280;
}

.ggmc-file-info-details {
    flex: 1;
}

.ggmc-file-info-name {
    font-weight: 500;
    color: #1f2937;
}

.ggmc-file-info-meta {
    font-size: 13px;
    color: #6b7280;
}

.ggmc-file-info-remove {
    color: #ef4444;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
}

/* Field Mapping Table */
.ggmc-mapping-table {
    width: 100%;
    border-collapse: collapse;
}

.ggmc-mapping-table th,
.ggmc-mapping-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.ggmc-mapping-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
    font-size: 13px;
    text-transform: uppercase;
}

.ggmc-mapping-table td {
    vertical-align: middle;
}

.ggmc-mapping-arrow {
    color: #9ca3af;
    font-size: 18px;
    text-align: center;
}

.ggmc-mapping-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
}

.ggmc-mapping-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.ggmc-mapping-status.matched {
    color: #10b981;
}

.ggmc-mapping-status.mapped {
    color: #f59e0b;
}

.ggmc-mapping-status.skipped {
    color: #9ca3af;
}

/* Preview Table */
.ggmc-preview-container {
    margin-top: 20px;
}

.ggmc-preview-title {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
}

.ggmc-preview-table-wrapper {
    overflow-x: auto;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}

.ggmc-preview-table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
    font-size: 13px;
}

.ggmc-preview-table th,
.ggmc-preview-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ggmc-preview-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #6b7280;
}

.ggmc-preview-table tr:last-child td {
    border-bottom: none;
}

/* Progress Bar */
.ggmc-progress-container {
    margin-bottom: 24px;
}

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

.ggmc-progress-fill {
    height: 100%;
    background: #2563eb;
    border-radius: 4px;
    transition: width 0.3s;
}

.ggmc-progress-text {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 14px;
    color: #6b7280;
}

/* Stats Grid */
.ggmc-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 20px;
}

.ggmc-stat-item {
    text-align: center;
    padding: 16px;
    background: #f9fafb;
    border-radius: 6px;
}

.ggmc-stat-value {
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.ggmc-stat-label {
    font-size: 13px;
    color: #6b7280;
}

.ggmc-stat-item.created .ggmc-stat-value {
    color: #10b981;
}

.ggmc-stat-item.updated .ggmc-stat-value {
    color: #2563eb;
}

.ggmc-stat-item.skipped .ggmc-stat-value {
    color: #f59e0b;
}

.ggmc-stat-item.errors .ggmc-stat-value {
    color: #ef4444;
}

/* Current Status */
.ggmc-current-status {
    text-align: center;
    padding: 16px;
    background: #f9fafb;
    border-radius: 6px;
    margin-top: 20px;
}

.ggmc-current-status-label {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 4px;
}

.ggmc-current-status-value {
    font-size: 15px;
    font-weight: 500;
    color: #1f2937;
}

/* Error List */
.ggmc-error-list {
    margin-top: 20px;
    max-height: 200px;
    overflow-y: auto;
}

.ggmc-error-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 4px;
    margin-bottom: 8px;
    font-size: 13px;
}

.ggmc-error-icon {
    color: #ef4444;
    flex-shrink: 0;
}

.ggmc-error-content {
    flex: 1;
}

.ggmc-error-row {
    font-weight: 500;
    color: #991b1b;
}

.ggmc-error-message {
    color: #dc2626;
}

/* Warning Box */
.ggmc-warning-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 6px;
    margin-top: 20px;
}

.ggmc-warning-icon {
    color: #f59e0b;
    font-size: 20px;
    flex-shrink: 0;
}

.ggmc-warning-text {
    font-size: 14px;
    color: #92400e;
}

/* Buttons */
.ggmc-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.ggmc-btn-primary {
    background: #2563eb;
    color: #fff;
}

.ggmc-btn-primary:hover {
    background: #1d4ed8;
}

.ggmc-btn-secondary {
    background: #fff;
    color: #374151;
    border: 1px solid #d1d5db;
}

.ggmc-btn-secondary:hover {
    background: #f9fafb;
}

.ggmc-btn-success {
    background: #10b981;
    color: #fff;
}

.ggmc-btn-success:hover {
    background: #059669;
}

.ggmc-btn-danger {
    background: #ef4444;
    color: #fff;
}

.ggmc-btn-danger:hover {
    background: #dc2626;
}

.ggmc-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ggmc-btn-icon {
    font-size: 16px;
}

/* Products Page Buttons */
.ggmc-import-export-buttons {
    display: flex;
    gap: 8px;
}

.ggmc-import-export-buttons .button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ggmc-import-export-buttons .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Mapping Stats */
.ggmc-mapping-stats {
    display: flex;
    gap: 20px;
    padding: 12px 16px;
    background: #f3f4f6;
    border-radius: 6px;
    margin-bottom: 20px;
}

.ggmc-mapping-stat {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ggmc-mapping-stat-value {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.ggmc-mapping-stat-label {
    font-size: 13px;
    color: #6b7280;
}

/* Save Mapping Checkbox */
.ggmc-save-mapping {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.ggmc-save-mapping input[type="checkbox"] {
    margin: 0;
}

.ggmc-save-mapping label {
    font-size: 14px;
    color: #374151;
}

/* Loading Spinner */
.ggmc-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-radius: 50%;
    border-top-color: #2563eb;
    animation: ggmc-spin 0.8s linear infinite;
}

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

/* Format Detection Badge */
.ggmc-format-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.ggmc-format-badge.ggm {
    background: #dbeafe;
    color: #1d4ed8;
}

.ggmc-format-badge.woocommerce {
    background: #fce7f3;
    color: #be185d;
}

.ggmc-format-badge.unknown {
    background: #f3f4f6;
    color: #6b7280;
}

/* Wide Modal (for export with more options) */
.ggmc-modal-wide {
    max-width: 800px;
}

/* Badge Styles */
.ggmc-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    margin-left: 8px;
    vertical-align: middle;
}

.ggmc-badge-success {
    background: #d1fae5;
    color: #065f46;
}

.ggmc-badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.ggmc-badge-info {
    background: #dbeafe;
    color: #1e40af;
}

/* Info Box */
.ggmc-info-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    margin-top: 20px;
}

.ggmc-info-box .dashicons {
    color: #2563eb;
    font-size: 20px;
    flex-shrink: 0;
}

.ggmc-info-text {
    font-size: 14px;
    color: #1e40af;
    line-height: 1.5;
}

/* Image Options Section */
.ggmc-image-options {
    border-top: 1px solid #e5e7eb;
    padding-top: 20px;
    margin-top: 20px;
}

/* Include Options (CSV format) */
.ggmc-include-options {
    border-top: 1px solid #e5e7eb;
    padding-top: 20px;
    margin-top: 20px;
}

/* JSON Import Summary */
.ggmc-json-summary {
    margin-top: 12px;
    padding: 10px 12px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 4px;
    font-size: 13px;
    color: #166534;
}

.ggmc-import-summary {
    margin-bottom: 20px;
}

.ggmc-import-summary h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.ggmc-summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.ggmc-summary-table th,
.ggmc-summary-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.ggmc-summary-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #6b7280;
    text-transform: capitalize;
}

.ggmc-summary-table td:first-child {
    text-transform: capitalize;
}

.ggmc-summary-totals {
    background: #f3f4f6;
}

/* Import Warnings */
.ggmc-import-warnings {
    margin-bottom: 20px;
    padding: 16px;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 6px;
}

.ggmc-import-warnings h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: #92400e;
}

.ggmc-warning-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 13px;
    color: #92400e;
}

.ggmc-warning-item .dashicons {
    color: #f59e0b;
    flex-shrink: 0;
}

.ggmc-more-warnings {
    font-style: italic;
    color: #b45309;
    font-size: 12px;
    margin-top: 8px;
}

/* Import Placeholders */
.ggmc-import-placeholders {
    margin-bottom: 20px;
    padding: 16px;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 6px;
}

.ggmc-import-placeholders h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 600;
    color: #92400e;
}

.ggmc-import-placeholders p {
    margin: 0 0 10px 0;
    font-size: 13px;
    color: #92400e;
}

.ggmc-import-placeholders ul {
    margin: 0;
    padding-left: 20px;
}

.ggmc-import-placeholders li {
    font-size: 13px;
    color: #92400e;
    font-family: monospace;
}

/* Import Errors */
.ggmc-import-errors {
    margin-bottom: 20px;
    padding: 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
}

.ggmc-import-errors h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: #991b1b;
}

.ggmc-import-errors .ggmc-error-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 13px;
    color: #991b1b;
}

.ggmc-import-errors .dashicons {
    color: #ef4444;
    flex-shrink: 0;
}

/* Background Import Styles */
.ggmc-background-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
}

.ggmc-background-status.pending {
    background: #f3f4f6;
    color: #6b7280;
}

.ggmc-background-status.running {
    background: #dbeafe;
    color: #1d4ed8;
}

.ggmc-background-status.running .dashicons {
    animation: ggmc-spin 1s linear infinite;
}

.ggmc-background-status.complete {
    background: #d1fae5;
    color: #065f46;
}

.ggmc-background-status.error {
    background: #fee2e2;
    color: #991b1b;
}

.ggmc-background-info {
    padding: 16px;
    background: #f9fafb;
    border-radius: 6px;
}

.ggmc-background-info p {
    margin: 0;
    font-size: 14px;
    color: #374151;
}

/* Large Spinner */
.ggmc-spinner-large {
    display: inline-block;
    width: 48px;
    height: 48px;
    border: 4px solid #e5e7eb;
    border-radius: 50%;
    border-top-color: #2563eb;
    animation: ggmc-spin 0.8s linear infinite;
}

/* Responsive */
@media (max-width: 768px) {
    .ggmc-modal {
        max-width: 100%;
        margin: 10px;
        max-height: calc(100vh - 20px);
    }

    .ggmc-modal-wide {
        max-width: 100%;
    }

    .ggmc-checkbox-group {
        grid-template-columns: 1fr;
    }

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

    .ggmc-step-label {
        display: none;
    }

    .ggmc-mapping-stats {
        flex-wrap: wrap;
    }
}
