/* 📥 Product Import Tool - Styles Modernisés */

.product-import-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
}

/* Header Actions */
.header-actions {
    margin-top: 1rem;
}

/* =================================
   TABLEAU DES BOUTIQUES MODERNISÉ
   ================================= */
.shops-list-container {
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.shops-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.shops-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
}

.shops-table-container {
    overflow-x: auto;
}

.shops-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.shops-table thead {
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.shops-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

.shops-table th.sortable:hover {
    background: #f3f4f6;
}

.shops-table th .sort-icon {
    width: 14px;
    height: 14px;
    margin-left: 0.5rem;
    opacity: 0.4;
    transition: opacity 0.2s ease;
}

.shops-table th.sorted .sort-icon {
    opacity: 1;
}

.shops-table tbody tr {
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s ease;
}

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

.shops-table td {
    padding: 1rem;
    vertical-align: middle;
}

.shop-name-cell strong {
    display: block;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.shop-name-cell .shop-url {
    color: #6b7280;
    font-size: 0.8rem;
}

.platform-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.platform-badge.shopify {
    background: #dbeafe;
    color: #1d4ed8;
}

.platform-badge.woocommerce {
    background: #fef3cd;
    color: #92400e;
}

.platform-badge.magento {
    background: #fce7f3;
    color: #be185d;
}

.platform-badge.prestashop {
    background: #ecfdf5;
    color: #065f46;
}

.platform-badge.custom {
    background: #f3f4f6;
    color: #374151;
}

/* Badges de disponibilité */
.availability-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.availability-badge.status-instock {
    background: #d1fae5;
    color: #065f46;
}

.availability-badge.status-outofstock {
    background: #fee2e2;
    color: #991b1b;
}

.availability-badge.status-unknown {
    background: #f3f4f6;
    color: #6b7280;
}

.parsing-mode {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.8rem;
    color: #6b7280;
}

.product-count {
    font-weight: 600;
}

/* Styles pour les prix des produits - Override du CSS principal */
.products-table .product-price {
    white-space: nowrap;
    font-size: 1rem !important;      /* Override main.css qui met 1.75rem */
    font-weight: 600 !important;     /* Override main.css qui met 700 */
    margin: 0 !important;            /* Override main.css qui met 1rem 0 */
}

.products-table .product-price-base {
    white-space: nowrap;
    font-size: 0.875rem !important;  /* Légèrement plus petit pour prix barré */
    font-weight: normal !important;
    margin: 0 !important;
}

.selected-for-sheets {
    text-align: center;
    color: #1f2937;
}

/* =================================
   SÉLECTEUR DE COLONNES INTÉGRÉ
   ================================= */
.column-selector-inline {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin: 1rem 0;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.column-selector-inline.visible {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.selector-header {
    margin-bottom: 1.5rem;
}

.selector-header h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
}

.selector-description {
    margin: 0;
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.5;
}

.columns-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.column-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.column-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.column-item input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
    accent-color: #3b82f6;
}

.column-item input[type="checkbox"]:checked + .column-label {
    font-weight: 600;
    color: #1e293b;
}

.column-label {
    color: #475569;
    font-size: 0.9rem;
    user-select: none;
}

.selector-settings {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.setting-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.setting-item label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.setting-item input[type="number"] {
    width: 80px;
    padding: 0.375rem 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.9rem;
}

.selector-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.selector-actions .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Animation d'apparition */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =================================
   BARRE DE PROGRESSION
   ================================= */
.progress-container {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.progress-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: #f3f4f6;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #059669);
    border-radius: 6px;
    transition: width 0.3s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: progress-shimmer 2s infinite;
}

@keyframes progress-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.progress-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
}

.stat-updated {
    color: #059669;
    font-weight: 500;
}

.stat-failed {
    color: #dc2626;
    font-weight: 500;
}

.info-box {
    background: #f0f9ff;
    border: 1px solid #0ea5e9;
    border-radius: 4px;
    padding: 0.75rem;
    margin: 1rem 0;
    font-size: 0.875rem;
}

.info-box strong {
    color: #0c4a6e;
}

.btn-link {
    background: none;
    border: none;
    color: #0ea5e9;
    text-decoration: underline;
    cursor: pointer;
    margin-left: 0.5rem;
    font-size: inherit;
}

.btn-link:hover {
    color: #0284c7;
}

.btn-small {
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
}

.btn-danger {
    background: #dc2626;
    color: white;
    border-color: #dc2626;
}

.btn-danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
}

.last-sync.has-sync {
    color: #059669;
}

.last-sync.no-sync {
    color: #9ca3af;
    font-style: italic;
}

.new-urls-count {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: #fef3cd;
    color: #92400e;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.actions-cell {
    width: 150px; /* Augmentation de la largeur pour 3 boutons */
    min-width: 150px;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    flex-wrap: nowrap; /* Évite le retour à la ligne */
}

/* S'assurer que les boutons sont visibles - Spécificité élevée */
.shops-table .action-buttons .action-btn {
    flex-shrink: 0; /* Empêche les boutons de rétrécir */
    min-width: 32px !important;
    min-height: 32px !important;
    border: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    cursor: pointer !important;
}

/* Styles spécifiques pour chaque type de bouton */
.shops-table .action-btn.view {
    background: #10b981 !important;
    color: white !important;
}

.shops-table .action-btn.edit {
    background: #3b82f6 !important;
    color: white !important;
}

.shops-table .action-btn.sync {
    background: #8b5cf6 !important;
    color: white !important;
}

.shops-table .action-btn.delete {
    background: #ef4444 !important;
    color: white !important;
}

.text-center {
    text-align: center;
}

/* =================================
   TOOLTIPS POUR BOUTONS D'ACTION
   ================================= */
.action-btn[data-tooltip] {
    position: relative;
}

.action-btn[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: #374151;
    color: white;
    padding: 0.5rem;
    border-radius: 4px;
    white-space: nowrap;
    font-size: 0.75rem;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

.action-btn[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-bottom-color: #374151;
    z-index: 1001;
    pointer-events: none;
}

/* =================================
   ANIMATIONS
   ================================= */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* =================================
   RESPONSIVE DESIGN
   ================================= */
@media (max-width: 1024px) {
    .shops-table-container {
        font-size: 0.8rem;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .platform-badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }
}

@media (max-width: 768px) {
    .shops-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .shops-table th,
    .shops-table td {
        padding: 0.5rem;
    }
    
    .shop-name-cell .shop-url {
        display: none;
    }
    
    .actions-cell {
        width: auto;
    }
}

.shops-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.shop-card {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.shop-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.shop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.shop-header h4 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.25rem;
}

.shop-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    transition: background 0.3s ease;
}

.btn-icon:hover {
    background: rgba(0, 0, 0, 0.05);
}

.shop-info {
    margin: 1rem 0;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.info-row:last-child {
    border-bottom: none;
}

.info-row .label {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.info-row .value {
    font-weight: 500;
    color: var(--text-primary);
}

.shop-footer {
    margin-top: 1rem;
}

.btn-block {
    width: 100%;
}

/* Add Shop Form */
.add-shop-container,
.configure-shop-container {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
}

/* Existing Table Styles */
.shop-card.existing-table {
    border-left: 4px solid #10b981;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.badge {
    background: #10b981;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Product Management Styles */
.manage-products-container {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
}

.products-header {
    margin-bottom: 2rem;
}

.products-header h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
}

.products-header p {
    margin: 0 0 1rem 0;
    color: var(--text-muted);
}

.products-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.products-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 500;
    white-space: nowrap;
}

.filter-group select,
.filter-group input {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.875rem;
}

/* Products Table */
.products-table-container {
    overflow-x: auto;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.products-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.products-table th,
.products-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.products-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
    position: sticky;
    top: 0;
}

.products-table tbody tr:hover {
    background: var(--bg-secondary);
}

.product-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.no-image {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: 4px;
    font-size: 1.5rem;
    color: var(--text-muted);
}

.product-title strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.product-title small {
    color: var(--text-muted);
}

.product-title a {
    color: var(--primary-color);
    text-decoration: none;
}

.product-title a:hover {
    text-decoration: underline;
}

.price {
    font-weight: 600;
    color: var(--text-primary);
}

.price.updated {
    color: #10b981;
    position: relative;
}

.price.updated::after {
    content: "✨";
    margin-left: 0.25rem;
}

.price-base {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Badge variants */
.badge.gamme-delta { background: #3b82f6; }
.badge.gamme-river { background: #06b6d4; }
.badge.gamme-wave { background: #8b5cf6; }
.badge.gamme-blade { background: #f59e0b; }

.badge.state-actif { background: #10b981; }
.badge.state-inactif { background: #6b7280; }
.badge.state-rupture { background: #ef4444; }

.product-actions {
    display: flex;
    gap: 0.5rem;
}

.product-select {
    transform: scale(1.2);
}

.empty-products {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
}

/* Steps Indicator */
.import-steps {
    display: flex;
    justify-content: center;
    margin: 2rem 0 3rem;
    gap: 2rem;
}

.step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--bg-secondary);
    border-radius: 2rem;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.step.active {
    opacity: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.step-number {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    font-weight: 600;
}

.step-label {
    font-weight: 500;
}

/* Step Content */
.step-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.step-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Configuration Form */
.config-form {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
}

.config-form h3 {
    margin-bottom: 2rem;
    color: var(--text-primary);
    font-size: 1.5rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group small {
    margin-top: 0.25rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Selectors Configuration */
.selectors-config {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.selectors-config h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

/* Analysis Results */
.analysis-results {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat-card {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* URLs Preview */
.urls-preview {
    margin-top: 2rem;
}

.urls-preview h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.urls-list {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 1rem;
    max-height: 300px;
    overflow-y: auto;
}

.url-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.url-item:last-child {
    border-bottom: none;
}

.url {
    color: var(--primary-color);
    font-family: monospace;
    font-size: 0.875rem;
    word-break: break-all;
}

.lastmod {
    color: var(--text-muted);
    font-size: 0.875rem;
    white-space: nowrap;
}

/* Test Parsing */
.test-parsing {
    margin-top: 2rem;
}

.test-result {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-top: 1rem;
}

.parsed-product h5 {
    color: #10b981;
    margin-bottom: 1rem;
}

.parsed-data > div {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.parsed-data > div:last-child {
    border-bottom: none;
}

.parsing-error h5 {
    color: #ef4444;
    margin-bottom: 0.5rem;
}

/* Import Progress */
.import-progress {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
}

.progress-bar-container {
    margin: 2rem 0;
}

.progress-bar {
    height: 30px;
    background: var(--bg-secondary);
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.progress-text {
    text-align: center;
    margin-top: 1rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* Import Stats */
.import-stats {
    display: flex;
    justify-content: space-around;
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
}

.stat-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-row .stat-label {
    font-weight: 500;
}

.stat-row .stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Import Log */
.import-log {
    margin-top: 2rem;
}

.import-log h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.log-entries {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 1rem;
    max-height: 400px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 0.875rem;
}

.log-entry {
    display: flex;
    gap: 1rem;
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.log-entry:last-child {
    border-bottom: none;
}

.log-entry.success {
    color: #10b981;
}

.log-entry.error {
    color: #ef4444;
}

.log-time {
    color: var(--text-muted);
    white-space: nowrap;
}

.log-message {
    flex: 1;
    word-break: break-word;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    animation: spin 1s linear infinite;
}

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

.loading {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
}

/* =================================
   TABLEAU DES PRODUITS MODERNISÉ
   ================================= */
.manage-products-container {
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.manage-products-container .products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.manage-products-container .products-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
}

.products-table-container {
    overflow-x: auto;
}

.products-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.products-table thead {
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.products-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

.products-table th.sortable:hover {
    background: #f3f4f6;
}

.products-table th .sort-icon {
    width: 14px;
    height: 14px;
    margin-left: 0.5rem;
    opacity: 0.4;
    transition: opacity 0.2s ease;
}

.products-table th.sorted .sort-icon {
    opacity: 1;
}

.products-table tbody tr {
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s ease;
}

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

.products-table td {
    padding: 1rem;
    vertical-align: middle;
}

.product-image-cell {
    width: 80px;
    text-align: center;
}

.product-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
}

.no-image {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border-radius: 4px;
    font-size: 1.5rem;
    color: #9ca3af;
    border: 1px solid #e5e7eb;
}

.product-name-cell strong {
    display: block;
    color: #1f2937;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.product-name-cell .product-url {
    color: #6b7280;
    font-size: 0.8rem;
}

.product-price {
    font-weight: 600;
    color: #1f2937;
}

.brand-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    background: #f3f4f6;
    color: #374151;
}

.status-badge.active {
    background: #dcfce7;
    color: #166534;
}

.status-badge.inactive {
    background: #fef2f2;
    color: #991b1b;
}

.sku-cell {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.8rem;
    color: #6b7280;
}

/* S'assurer que les boutons d'action des produits sont visibles - Spécificité élevée */
.products-table .action-buttons .action-btn {
    flex-shrink: 0;
    min-width: 32px !important;
    min-height: 32px !important;
    border: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    cursor: pointer !important;
}

/* Styles spécifiques pour chaque type de bouton d'action produit */
.products-table .action-btn.view {
    background: #10b981 !important;
    color: white !important;
}

.products-table .action-btn.edit {
    background: #3b82f6 !important;
    color: white !important;
}

.products-table .action-btn.refresh {
    background: #f59e0b !important;
    color: white !important;
}

.products-table .action-btn.delete {
    background: #ef4444 !important;
    color: white !important;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.empty-state h3 {
    margin: 1rem 0;
    color: var(--text-primary);
}

/* Responsive */
@media (max-width: 768px) {
    .import-steps {
        flex-direction: column;
        align-items: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .import-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* Animation pour le bouton de mise à jour */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Barre de progression améliorée */
#update-progress {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-top: 1rem;
}

#update-progress .progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

#update-progress .progress-track {
    background: var(--border-color);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

#progress-bar {
    background: linear-gradient(90deg, var(--primary-color, #007bff), var(--success-color, #28a745));
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

/* Animation de la barre de progression */
#progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(45deg, 
        transparent 35%, 
        rgba(255, 255, 255, 0.2) 35%, 
        rgba(255, 255, 255, 0.2) 65%, 
        transparent 65%
    );
    animation: progressShine 2s infinite;
}

@keyframes progressShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

#progress-stats {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Amélioration du bouton UPDATE désactivé */
.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

.btn:disabled:hover {
    transform: none !important;
}

/* Stabilisation du bouton METTRE À JOUR */
#update-btn {
    min-width: 180px; /* Largeur fixe pour éviter les changements de taille */
    text-align: center;
}

/* Stabilisation de la barre de progression */
#update-progress {
    position: relative;
    clear: both;
    margin-top: 1rem !important;
    width: 100% !important;
}

.products-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
}

.products-actions .btn {
    flex-shrink: 0; /* Empêche la compression */
}

/* Sélection des colonnes - Support pour éléments existants */
.columns-selection {
    margin: 1rem 0;
}

.column-category {
    margin-bottom: 2rem;
}

.column-category h4 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
}