/**
 * ============================================
 * IMPORT LOGEMENT - STYLES
 * ============================================
 */

:root {
    /* Couleurs principales */
    --primary: #2D3748;
    --primary-light: #3a4861;
    --primary-dark: #1e232c;
    --secondary: #10b981;
    --secondary-light: #15d0a5;
    --secondary-dark: #068063;

    /* Couleurs sémantiques */
    --success: #10b981;
    --success-light: #34d399;
    --success-bg: #bff3d8;
    --warning: #f59e0b;
    --warning-light: #fbbf24;
    --warning-bg: #fef3c7;
    --danger: #ef4444;
    --danger-light: #f87171;
    --danger-dark: #b0152c;
    --danger-bg: #fee2e2;
    --info: #3b82f6;
    --info-light: #60a5fa;
    --info-bg: #dbeafe;

    /* Couleurs neutres */
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --bg-gray: #f1f5f9;
    --text-dark: #2D3748;
    --text-gray: #64748b;
    --text-light: #94a3b8;
    --border: #e2e8f0;
    --border-dark: #cbd5e1;

    /* Dimensions */
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --border-radius-sm: 4px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    min-height: 100vh;
}

/* ============================================
   HEADER
   ============================================ */
.import-header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: var(--shadow-sm);
}

.import-header .btn-back {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    color: var(--text-gray);
    cursor: pointer;
    font-size: 0.875rem;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.import-header .btn-back:hover {
    background: var(--bg-gray);
    color: var(--text-dark);
    border-color: var(--border-dark);
}

.import-header h1 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
}

/* ============================================
   CONTAINER
   ============================================ */
.import-container {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

/* ============================================
   LAYOUT 2 COLONNES
   ============================================ */
.import-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.5rem;
    align-items: start;
}

.import-layout-main {
    min-width: 0;
}

.import-layout-sidebar {
    position: sticky;
    top: 80px;
}

/* ============================================
   CARD
   ============================================ */
.import-card {
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.import-card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.import-card-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.import-card-header p {
    color: var(--text-gray);
    font-size: 0.875rem;
    margin-top: 0.375rem;
}

.import-card-body {
    padding: 1.5rem;
}

/* ============================================
   TABS
   ============================================ */
.import-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.import-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    background: var(--bg-white);
    color: var(--text-gray);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.import-tab:hover {
    background: var(--bg-gray);
    border-color: var(--border-dark);
}

.import-tab.active {
    border-color: var(--secondary);
    background: var(--success-bg);
    color: var(--secondary-dark);
    font-weight: 500;
}

.import-tab .material-symbols-rounded {
    font-size: 20px;
}

/* ============================================
   PANELS
   ============================================ */
.import-panel {
    display: none;
}

.import-panel.active {
    display: block;
}

/* ============================================
   TEXTAREA
   ============================================ */
.import-textarea {
    width: 100%;
    min-height: 250px;
    padding: 0.875rem;
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    font-family: 'Courier New', 'Fira Code', monospace;
    font-size: 0.8125rem;
    resize: vertical;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--bg-light);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.import-textarea:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
    background: var(--bg-white);
}

.import-textarea::placeholder {
    color: var(--text-light);
}

/* ============================================
   DROPZONE
   ============================================ */
.import-dropzone {
    border: 2px dashed var(--border-dark);
    border-radius: var(--border-radius-lg);
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: var(--text-gray);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.import-dropzone:hover,
.import-dropzone.dragover {
    border-color: var(--secondary);
    background: rgba(16, 185, 129, 0.04);
}

.import-dropzone .material-symbols-rounded {
    font-size: 48px;
    color: var(--text-light);
    margin-bottom: 0.75rem;
    display: block;
}

.import-dropzone p {
    margin-bottom: 0.375rem;
}

.import-dropzone .text-sm {
    font-size: 0.8125rem;
}

.import-dropzone .btn-browse {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    background: var(--bg-white);
    border: 1px solid var(--border-dark);
    border-radius: var(--border-radius);
    color: var(--text-dark);
    font-size: 0.875rem;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: all var(--transition-fast);
}

.import-dropzone .btn-browse:hover {
    background: var(--bg-gray);
    border-color: var(--secondary);
}

/* ============================================
   FILE INFO
   ============================================ */
.import-file-info {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.875rem;
    background: var(--success-bg);
    border: 1px solid var(--success-light);
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    color: var(--secondary-dark);
    margin-top: 1rem;
}

.import-file-info .material-symbols-rounded {
    font-size: 20px;
    color: var(--secondary);
}

.import-file-info .file-name {
    flex: 1;
    font-weight: 500;
}

.import-file-info .file-size {
    color: var(--text-gray);
    font-size: 0.8125rem;
}

.import-file-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: none;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-gray);
    transition: all var(--transition-fast);
}

.import-file-remove:hover {
    background: rgba(0,0,0,0.1);
    color: var(--danger);
}

/* ============================================
   VALIDATION
   ============================================ */
.import-validation {
    margin-top: 1rem;
}

.import-errors,
.import-warnings {
    padding: 0.875rem;
    border-radius: var(--border-radius);
    margin-bottom: 0.625rem;
    font-size: 0.8125rem;
    line-height: 1.5;
}

.import-errors {
    background: var(--danger-bg);
    border: 1px solid var(--danger-light);
    color: var(--danger-dark);
}

.import-warnings {
    background: var(--warning-bg);
    border: 1px solid var(--warning-light);
    color: #92400e;
}

.import-errors strong,
.import-warnings strong {
    display: block;
    margin-bottom: 0.375rem;
}

.import-errors ul,
.import-warnings ul {
    margin: 0;
    padding-left: 1.25rem;
}

.import-errors li,
.import-warnings li {
    margin-bottom: 0.25rem;
}

/* ============================================
   ACTIONS
   ============================================ */
.import-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.import-actions-left {
    display: flex;
    gap: 0.25rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all var(--transition-fast);
    text-decoration: none;
    font-family: inherit;
}

.btn-primary {
    background: var(--secondary);
    color: white;
}

.btn-primary:hover {
    background: var(--secondary-dark);
    box-shadow: var(--shadow-sm);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-text {
    background: none;
    color: var(--text-gray);
    padding: 0.5rem 0.75rem;
}

.btn-text:hover {
    color: var(--text-dark);
    background: var(--bg-gray);
}

.btn-secondary-outline {
    background: var(--bg-white);
    color: var(--text-dark);
    border: 1px solid var(--border-dark);
}

.btn-secondary-outline:hover {
    background: var(--bg-gray);
    border-color: var(--primary);
}

/* ============================================
   PREVIEW
   ============================================ */
.import-preview {
    display: none;
}

.import-preview.active {
    display: block;
}

.import-preview-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    background: var(--info-bg);
    border: 1px solid var(--info-light);
    border-radius: var(--border-radius);
    margin-bottom: 1.25rem;
    color: #1e40af;
    font-size: 0.875rem;
}

.import-preview-section {
    margin-bottom: 1rem;
}

.import-preview-section h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-dark);
}

.import-preview-section h4 .badge {
    background: var(--secondary);
    color: white;
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    font-weight: 500;
}

.import-preview-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.import-preview-list li {
    padding: 0.5rem 0.875rem;
    background: var(--bg-gray);
    border-radius: var(--border-radius-sm);
    margin-bottom: 0.25rem;
    font-size: 0.8125rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.import-preview-list li .detail {
    color: var(--text-gray);
    font-size: 0.75rem;
}

.import-preview-empty {
    color: var(--text-light);
    font-size: 0.8125rem;
    font-style: italic;
    padding: 0.5rem 0;
}

/* ============================================
   RESULT TABLE (import masse)
   ============================================ */
.import-result-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.import-result-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.import-result-table th {
    background: var(--bg-gray);
    color: var(--text-gray);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.5rem 0.625rem;
    text-align: left;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.import-result-table td {
    padding: 0.5rem 0.625rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-dark);
}

.import-result-table .import-row-num {
    color: var(--text-light);
    font-weight: 500;
    width: 30px;
    text-align: center;
}

.import-result-table tr.import-row-success td {
    background: rgba(16, 185, 129, 0.06);
}

.import-result-table tr.import-row-success td:first-child::before {
    content: '\e86c'; /* check_circle */
    font-family: 'Material Symbols Rounded';
    color: var(--secondary);
    font-size: 14px;
    margin-right: 0.25rem;
}

.import-result-table tr.import-row-error td {
    background: rgba(239, 68, 68, 0.06);
}

.import-result-table tr.import-row-error td:first-child::before {
    content: '\e000'; /* error */
    font-family: 'Material Symbols Rounded';
    color: var(--danger);
    font-size: 14px;
    margin-right: 0.25rem;
}

/* ============================================
   PROGRESS BAR
   ============================================ */
.import-progress {
    margin: 1rem 0;
    padding: 0.875rem;
    background: var(--bg-gray);
    border-radius: var(--border-radius);
}

.import-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.8125rem;
    color: var(--text-gray);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.import-progress-bar {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.import-progress-fill {
    height: 100%;
    background: var(--secondary);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* ============================================
   RESULTS SUMMARY
   ============================================ */
.import-results-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 1rem 0;
}

.import-result-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 500;
}

.import-result-item .material-symbols-rounded {
    font-size: 20px;
}

.import-result-success {
    background: var(--success-bg);
    color: var(--secondary-dark);
}

.import-result-error {
    background: var(--danger-bg);
    color: var(--danger-dark);
}

/* ============================================
   GUIDE (sidebar)
   ============================================ */
.import-guide .import-card-body {
    padding: 1.25rem;
}

.import-guide-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.import-guide-step {
    display: flex;
    gap: 0.75rem;
}

.import-guide-step-number {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--secondary);
    color: white;
    font-size: 0.8125rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
}

.import-guide-step-content h4 {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.import-guide-step-content p {
    font-size: 0.75rem;
    color: var(--text-gray);
    line-height: 1.5;
}

.import-guide-step-content p a {
    color: var(--secondary-dark);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.import-guide-step-content p a:hover {
    color: var(--secondary);
}

.import-guide-step-content code {
    background: var(--bg-gray);
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-size: 0.6875rem;
}

.import-guide-info {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding: 0.75rem;
    background: var(--info-bg);
    border: 1px solid var(--info-light);
    border-radius: var(--border-radius);
    font-size: 0.75rem;
    color: #1e40af;
    line-height: 1.5;
}

.import-guide-info .material-symbols-rounded {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ============================================
   TOAST
   ============================================ */
.import-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 0.875rem 1.5rem;
    border-radius: var(--border-radius);
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-lg);
    max-width: 90vw;
    text-align: center;
}

.import-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.import-toast.success {
    background: var(--secondary-dark);
}

.import-toast.error {
    background: var(--danger);
}

.import-toast.warning {
    background: #d97706;
}

/* ============================================
   HELPERS
   ============================================ */
.hidden {
    display: none !important;
}

.text-gray {
    color: var(--text-gray);
}

.text-sm {
    font-size: 0.8125rem;
}

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

.mt-1 {
    margin-top: 0.5rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
    .import-layout {
        grid-template-columns: 1fr;
    }

    .import-layout-sidebar {
        position: static;
        order: -1;
    }
}

@media (max-width: 768px) {
    .import-container {
        margin: 1rem auto;
        padding: 0 1rem;
    }

    .import-header {
        padding: 0.875rem 1rem;
    }

    .import-header h1 {
        font-size: 1.125rem;
    }

    .import-tabs {
        flex-direction: column;
    }

    .import-textarea {
        min-height: 200px;
        font-size: 0.75rem;
    }

    .import-dropzone {
        padding: 1.5rem 1rem;
    }

    .import-actions {
        flex-direction: column-reverse;
        gap: 0.75rem;
    }

    .import-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .import-actions-left {
        width: 100%;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .import-actions-left .btn {
        flex: 1;
        min-width: 0;
    }
}
