﻿/* ===== IMPORT DATA STYLES ===== */

/* Container principal pour l'import */
.import-management {
    margin: 0 auto;
    margin-top:20px;
    padding: 0;
}

/* Header de l'import */
.import-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e2e8f0;
}

.import-title {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #1e293b;
    font-size: 28px;
    font-weight: 700;
    margin: 0;
}

.import-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.import-summary {
    display: flex;
    align-items: center;
}

.summary-text {
    color: #6b7280;
    font-size: 16px;
    font-weight: 500;
}

/* Progress Steps */
.import-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
    padding: 20px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 100px;
}

.step-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
}

.step.active .step-icon {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    transform: scale(1.1);
}

.step.completed .step-icon {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.step-label {
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    transition: color 0.3s ease;
}

.step.active .step-label {
    color: #8b5cf6;
}

.step.completed .step-label {
    color: #10b981;
}

.step-connector {
    flex: 1;
    height: 2px;
    background: #e5e7eb;
    margin: 0 20px;
    transition: background 0.3s ease;
}

    .step-connector.completed {
        background: linear-gradient(135deg, #10b981, #059669);
    }

/* Contenu des étapes */
.import-content {
    background: white;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    min-height: 500px;
}

.import-step-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.step-header {
    text-align: center;
    margin-bottom: 32px;
}

    .step-header h2 {
        font-size: 24px;
        font-weight: 700;
        color: #1e293b;
        margin: 0 0 8px 0;
    }

    .step-header p {
        font-size: 16px;
        color: #6b7280;
        margin: 0;
    }

/* Sélection du type d'import */
.import-type-selection {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
}

.import-type-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
}

    .import-type-card:hover {
        border-color: #8b5cf6;
        background: #faf5ff;
    }

    .import-type-card.selected {
        border-color: #8b5cf6;
        background: linear-gradient(135deg, #faf5ff, #f3e8ff);
        box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
    }

.type-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.brands-icon {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.models-icon {
    background: linear-gradient(135deg, #10b981, #059669);
}

.combined-icon {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.type-content {
    flex: 1;
}


    .type-content p {
        font-size: 14px;
        color: #6b7280;
        margin: 0 0 12px 0;
        line-height: 1.5;
    }

.type-features {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.feature {
    font-size: 12px;
    color: #9ca3af;
}

.type-radio {
    width: 24px;
    height: 24px;
}

    .type-radio input[type="radio"] {
        width: 24px;
        height: 24px;
        cursor: pointer;
    }

/* Zone d'upload de fichier */
.file-upload-zone {
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 24px;
    position: relative;
}

    .file-upload-zone:hover {
        border-color: #8b5cf6;
        background: #faf5ff;
    }

    .file-upload-zone.has-file {
        border-style: solid;
        border-color: #10b981;
        background: #f0fdf4;
    }

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.upload-icon {
    color: #9ca3af;
}



.upload-content p {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

.supported-formats {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.format {
    background: #e5e7eb;
    color: #6b7280;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.file-input-hidden {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* Fichier sélectionné */
.file-selected {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
}

.file-icon {
    color: #10b981;
}

.file-info {
    flex: 1;
}

    .file-info h4 {
        font-size: 16px;
        font-weight: 600;
        color: #1e293b;
        margin: 0 0 4px 0;
    }

    .file-info p {
        font-size: 14px;
        color: #6b7280;
        margin: 0;
    }



/* Messages d'erreur */
.error-message {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #dc2626;
    font-size: 14px;
    margin-bottom: 16px;
}

/* Colonnes détectées */
.columns-detected {
    margin-bottom: 24px;
}

    .columns-detected h4 {
        font-size: 16px;
        font-weight: 600;
        color: #374151;
        margin-bottom: 12px;
    }

.columns-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.column-tag {
    background: #e0f2fe;
    color: #0369a1;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid #7dd3fc;
}

/* Association des marques */
.brand-association-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}



    .brand-association-card p {
        color: #6b7280;
        margin: 0 0 16px 0;
    }

.association-options {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.association-option {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

    .association-option:hover {
        border-color: #8b5cf6;
    }

    .association-option.selected {
        border-color: #8b5cf6;
        background: #faf5ff;
    }

.option-radio {
    flex-shrink: 0;
}

    .option-radio input[type="radio"] {
        width: 16px;
        height: 16px;
    }

.option-content h4 {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 4px 0;
}

.option-content p {
    font-size: 12px;
    color: #6b7280;
    margin: 0;
}

.brand-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

    .brand-selector label {
        font-size: 14px;
        font-weight: 600;
        color: #374151;
    }

.form-select {
    padding: 10px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    transition: all 0.3s ease;
    width:100%;
    max-width:300px;

}

    .form-select:focus {
        outline: none;
        border-color: #8b5cf6;
        box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
    }

.help-text {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}

/* Mapping des colonnes */
.column-mapping-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}



.mapping-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 16px;
}

.mapping-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

    .mapping-item.required {
        border-left: 4px solid #dc2626;
    }

.mapping-info {
    min-width: 200px;
}

    .mapping-info h4 {
        font-size: 14px;
        font-weight: 600;
        color: #1e293b;
        margin: 0;
        display: flex;
        align-items: center;
        gap: 4px;
    }

.required-indicator {
    color: #dc2626;
    font-weight: 700;
}

.mapping-selectors {
    display: flex;
    gap: 16px;
    flex: 1;
}

.selector-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

    .selector-group label {
        font-size: 12px;
        font-weight: 600;
        color: #6b7280;
    }

    .selector-group.fallback .form-select {
        border-color: #fbbf24;
    }

.mapping-note {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #6b7280;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: 8px 12px;
}

/* Options d'import */
.import-options-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}


.option-item {
    display: flex;
    align-items: flex-start;
}

.option-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    flex: 1;
}

.option-checkbox {
    display: none;
}

.option-checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-top: 2px;
}

.option-checkbox:checked + .option-checkmark {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    border-color: #8b5cf6;
}

.option-checkmark svg {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.option-checkbox:checked + .option-checkmark svg {
    opacity: 1;
}

.option-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.option-title {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.option-description {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.4;
}

/* Aperçu des données */
.preview-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
    justify-content: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border: 1px solid #0ea5e9;
    border-radius: 12px;
    min-width: 120px;
}

.stat-number {
    font-size: 24px;
    font-weight: 700;
    color: #0c4a6e;
}

.stat-label {
    font-size: 12px;
    color: #0369a1;
    font-weight: 500;
    text-align: center;
}

.preview-table-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
}

.table-header {
    background: #f8f9fa;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

    .table-header h4 {
        font-size: 16px;
        font-weight: 600;
        color: #1e293b;
        margin: 0;
    }

.table-container {
    overflow-x: auto;
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
}

    .preview-table th {
        background: #f8f9fa;
        padding: 12px 16px;
        text-align: left;
        font-weight: 600;
        color: #374151;
        border-bottom: 1px solid #e5e7eb;
        white-space: nowrap;
    }

    .preview-table td {
        padding: 12px 16px;
        border-bottom: 1px solid #f3f4f6;
        color: #1e293b;
        font-size: 14px;
    }

    .preview-table tr:nth-child(even) {
        background: #fafafa;
    }

.table-footer {
    padding: 12px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e5e7eb;
    text-align: center;
    color: #6b7280;
}

/* Actions des étapes */
.step-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 24px;
}





/* Responsive design */
@media (max-width: 1024px) {
    .import-steps {
        padding: 16px;
    }

    .step {
        min-width: 80px;
    }

    .step-connector {
        margin: 0 10px;
    }

    .import-type-selection {
        gap: 12px;
    }

    .import-type-card {
        padding: 16px;
    }

    .type-icon {
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 768px) {
    .import-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .import-title {
        font-size: 24px;
    }

    .import-icon {
        width: 28px;
        height: 28px;
    }

    .import-steps {
        flex-direction: column;
        gap: 16px;
    }

    .step {
        flex-direction: row;
        min-width: auto;
        width: 100%;
        justify-content: flex-start;
        gap: 12px;
    }

    .step-connector {
        display: none;
    }

    .import-content {
        padding: 24px;
    }

    .import-type-card {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }

    .association-options {
        flex-direction: column;
    }

    .mapping-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .mapping-info {
        min-width: auto;
        width: 100%;
    }

    .mapping-selectors {
        width: 100%;
        flex-direction: column;
        gap: 12px;
    }

    .preview-stats {
        flex-direction: column;
        gap: 12px;
    }

    .stat-item {
        min-width: auto;
    }
}

@media (max-width: 576px) {
    .import-management {
        padding: 0 10px;
    }

    .import-title {
        font-size: 20px;
        justify-content: center;
    }

    .import-content {
        padding: 16px;
    }

    .step-header h2 {
        font-size: 20px;
    }

    .file-upload-zone {
        padding: 20px 10px;
    }

    .step-actions {
        flex-direction: column;
        gap: 12px;
    }

    .btn-back,
    .btn-next,
    .btn-import {
        width: 100%;
        justify-content: center;
    }
}

/* Animations */
.import-type-card {
    animation: slideInUp 0.5s ease forwards;
}

    .import-type-card:nth-child(1) {
        animation-delay: 0.1s;
    }

    .import-type-card:nth-child(2) {
        animation-delay: 0.2s;
    }

    .import-type-card:nth-child(3) {
        animation-delay: 0.3s;
    }

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* États de focus */
.import-type-card:focus,
.form-select:focus,
.btn-next:focus,
.btn-back:focus,
.btn-import:focus {
    outline: 2px solid #8b5cf6;
    outline-offset: 2px;
}

.option-label:focus-within .option-checkmark {
    outline: 2px solid #8b5cf6;
    outline-offset: 2px;
}



.import-type-card.selected .type-content p {
    color: #6d28d9;
}
