/* ==========================================================================
   ELITE CSV IMPORTER CSS
   Glassmorphism, Drag & Drop, Wizards
   ========================================================================== */

/* Layout & Globals */
.csv-container { margin-left: 20px; padding: 32px; min-height: 100vh; color: #ffffff; font-family: 'Inter', sans-serif; position: relative; overflow-x: hidden; display: flex; flex-direction: column; }
.csv-content-wrapper { flex-grow: 1; display: flex; flex-direction: column; position: relative; }

/* Utilities */
.hidden { display: none !important; opacity: 0; pointer-events: none; }
.m-0 { margin: 0; } .mx-auto { margin-left: auto; margin-right: auto; } .my-16 { margin-top: 16px; margin-bottom: 16px; } .my-32 { margin-top: 32px; margin-bottom: 32px; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.mb-4 { margin-bottom: 4px; } .mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; } .mb-32 { margin-bottom: 32px; }
.p-0 { padding: 0 !important; } .p-16 { padding: 16px; } .p-24 { padding: 24px; } .pt-8 { padding-top: 8px; } .pt-16 { padding-top: 16px; } .pt-24 { padding-top: 24px; } .pb-8 { padding-bottom: 8px; } .pb-16 { padding-bottom: 16px; } .pb-24 { padding-bottom: 24px; }
.py-32 { padding-top: 32px; padding-bottom: 32px; }
.border-top { border-top: 1px solid rgba(255,255,255,0.1); } .border-bottom { border-bottom: 1px solid rgba(255,255,255,0.1); }
.text-xs { font-size: 0.75rem; } .text-sm { font-size: 0.85rem; } .text-muted { color: rgba(255,255,255,0.6); } .w-full { width: 100%; } .text-center { text-align: center; } .text-right { text-align: right; } .text-left { text-align: left; }
.uppercase { text-transform: uppercase; } .letter-spacing { letter-spacing: 1px; } .font-bold { font-weight: 700; } .tabular-nums { font-variant-numeric: tabular-nums; }
.flex-between { display: flex; justify-content: space-between; align-items: center; } .flex-align-center { display: flex; align-items: center; } .align-start { align-items: flex-start; } .align-end { align-items: flex-end; } .flex-end { display: flex; justify-content: flex-end; } .justify-center { justify-content: center; } .gap-4 { gap: 4px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .flex-grow { flex-grow: 1; min-height: 0; } .flex-shrink-0 { flex-shrink: 0; }

/* Palette */
.text-purple { color: #c084fc; } .text-cyan { color: #06b6d4; } .text-gold { color: #fbbf24; } .text-red { color: #ef5350; } .text-green { color: #22c55e; } .text-orange { color: #fb923c; } .text-white { color: #ffffff; }
.bg-purple { background: #c084fc; color: #000; } .bg-cyan { background: #06b6d4; color: #000; } .bg-gold { background: #fbbf24; color: #000; } .bg-green { background: #22c55e; color: #000; } .bg-red { background: #ef5350; color: #fff; } .bg-dark { background: rgba(0,0,0,0.5); }
.border-cyan { border: 1px solid rgba(6,182,212,0.4); } .border-green { border: 1px solid rgba(34,197,94,0.4); } .border-purple { border: 1px solid rgba(192,132,252,0.4); } .border-red { border: 1px solid rgba(239,83,80,0.4); } .border-gold { border: 1px solid rgba(251,191,36,0.4); } .border-orange { border: 1px solid rgba(249,115,22,0.4); }
.bg-green-glow { background: radial-gradient(circle at center, rgba(34,197,94,0.15), rgba(0,0,0,0.4)); box-shadow: 0 0 40px rgba(34,197,94,0.1); }

/* Animations */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }
@keyframes popIn { 0% { transform: scale(0.9); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes pulseGlow { 0% { box-shadow: 0 0 0 0 rgba(6,182,212,0.4); } 70% { box-shadow: 0 0 0 20px rgba(6,182,212,0); } 100% { box-shadow: 0 0 0 0 rgba(6,182,212,0); } }
@keyframes spinSlow { 100% { transform: rotate(360deg); } }

.fade-in { animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.pulse-btn { animation: pulseGlow 2s infinite; border-radius: 12px; }
.pulse-glow { animation: pulseGlow 2s infinite; border-radius: 50%; }
.spinning-slow { animation: spinSlow 3s linear infinite; }

/* Cards & Buttons */
.csv-card { background: rgba(255,255,255,0.02); backdrop-filter: blur(24px) saturate(180%); border: 1px solid rgba(255,255,255,0.05); border-radius: 24px; padding: 24px; transition: all 0.4s; }

.csv-btn { padding: 10px 20px; border-radius: 12px; font-weight: 700; font-size: 0.85rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: all 0.3s; border: none; text-transform: uppercase; font-family: inherit; }
.csv-btn--primary { background: linear-gradient(135deg, #a855f7, #7e22ce); color: white; box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3); }
.csv-btn--primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(168, 85, 247, 0.5); }
.csv-btn--primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; background: rgba(255,255,255,0.1); }
.csv-btn--secondary { background: rgba(255,255,255,0.05); color: white; border: 1px solid rgba(255,255,255,0.1); }
.csv-btn--secondary:hover:not(:disabled) { background: rgba(255,255,255,0.1); border-color: #c084fc; color: #c084fc; }
.csv-btn-icon { background: transparent; border: none; color: rgba(255,255,255,0.6); cursor: pointer; transition: 0.2s; font-size: 1.2rem; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; }
.csv-btn-icon:hover { color: white; background: rgba(255,255,255,0.1); transform: scale(1.05); }
.csv-btn-icon-small { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: white; width: 32px; height: 32px; border-radius: 8px; cursor: pointer; transition: 0.3s; display: flex; align-items: center; justify-content: center; }
.csv-btn-icon-small:hover { background: rgba(192,132,252,0.2); color: #c084fc; border-color: #c084fc; }
.csv-btn-text { background: transparent; border: none; color: rgba(255,255,255,0.6); cursor: pointer; transition: 0.2s; font-size: 0.85rem; font-weight: 700; padding: 0; display: inline-flex; align-items: center; gap: 6px; }
.csv-btn-text:hover { color: #fff; }

.csv-input, .csv-select { width: 100%; padding: 10px 14px; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1); color: white; border-radius: 8px; transition: 0.3s; font-family: inherit; font-size: 0.85rem; outline: none; }
.csv-input:focus, .csv-select:focus { border-color: #c084fc; box-shadow: 0 0 0 2px rgba(192,132,252,0.2); }
.csv-badge { font-size: 0.65rem; padding: 4px 8px; border-radius: 6px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; display: inline-flex; align-items: center; gap: 4px; }
.csv-alert { padding: 12px 16px; border-radius: 8px; font-size: 0.85rem; font-weight: 600; display: flex; align-items: center; gap: 12px; animation: popIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

/* Header & Steps Bar */
.csv-header { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 24px; flex-shrink: 0; }
.csv-header__title { font-size: 2.2rem; font-weight: 800; margin: 0 0 8px 0; letter-spacing: 1px; }
.csv-header__subtitle { color: #c084fc; margin: 0; font-size: 1rem; }

.csv-steps-bar { display: flex; align-items: center; justify-content: space-between; background: rgba(0,0,0,0.3); padding: 16px 24px; border-radius: 16px; border: 1px solid rgba(255,255,255,0.05); }
.csv-step { display: flex; flex-direction: column; align-items: center; gap: 8px; opacity: 0.4; transition: 0.3s; position: relative; }
.csv-step.active { opacity: 1; }
.csv-step.active .s-ico { background: rgba(6,182,212,0.2); color: #06b6d4; border-color: #06b6d4; box-shadow: 0 0 15px rgba(6,182,212,0.3); }
.csv-step.active .s-txt { color: #fff; font-weight: 700; }
.csv-step.done { opacity: 1; cursor: pointer; }
.csv-step.done .s-ico { background: rgba(34,197,94,0.2); color: #22c55e; border-color: #22c55e; }
.csv-step.done .s-txt { color: #22c55e; }
.s-ico { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,0.05); border: 2px solid rgba(255,255,255,0.1); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; transition: 0.3s; }
.s-txt { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; transition: 0.3s; }
.csv-step-line { flex-grow: 1; height: 2px; background: rgba(255,255,255,0.1); margin: 0 16px; position: relative; top: -10px; }
.csv-wizard-step { animation: fadeInUp 0.4s forwards; display: flex; flex-direction: column; flex-grow: 1; }

/* Step 1: Upload */
.csv-dropzone { border: 2px dashed rgba(6,182,212,0.4); border-radius: 24px; height: 320px; background: rgba(6,182,212,0.05); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.3s; position: relative; overflow: hidden; }
.csv-dropzone:hover, .csv-dropzone.dragover { border-color: #06b6d4; background: rgba(6,182,212,0.15); transform: scale(1.02); }
.dz-content { text-align: center; pointer-events: none; }
.dz-icon { font-size: 4rem; display: inline-block; }

/* Step 2: Detect */
.csv-file-info-bar { background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.05); padding: 16px 24px; border-radius: 12px; display: flex; justify-content: space-between; align-items: center; }

/* Step 3: Map */
.csv-mapping-grid { display: flex; flex-direction: column; gap: 12px; max-height: 45vh; overflow-y: auto; padding-right: 8px; }
.csv-map-row { display: grid; grid-template-columns: 1fr 40px 1.5fr; gap: 16px; align-items: center; background: rgba(0,0,0,0.2); padding: 12px 16px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.05); transition: 0.2s; }
.csv-map-row:hover { background: rgba(255,255,255,0.05); border-color: rgba(192,132,252,0.3); }
.csv-map-row.is-mapped { border-left: 4px solid #22c55e; }
.csv-map-row.is-error { border-left: 4px solid #ef5350; background: rgba(239,83,80,0.05); }

.m-target { font-weight: 700; font-size: 0.9rem; display: flex; align-items: center; gap: 8px; }
.m-req { color: #ef5350; }
.m-arrow { color: rgba(255,255,255,0.3); text-align: center; font-size: 1.2rem; }
.m-source { font-size: 0.85rem; }

/* Step 4: Preview */
.csv-preview-summary { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; background: rgba(0,0,0,0.3); padding: 16px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.05); }
.p-stat { display: flex; flex-direction: column; text-align: center; }
.p-stat .val { font-size: 1.5rem; font-weight: 800; tabular-nums: tabular-nums; }
.p-stat .lbl { font-size: 0.65rem; text-transform: uppercase; color: rgba(255,255,255,0.5); margin-top: 4px; }

.csv-filter-chips { display: flex; gap: 8px; }
.csv-filter-chips button { background: rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.1); color: rgba(255,255,255,0.6); padding: 4px 12px; border-radius: 16px; font-size: 0.75rem; font-weight: 700; cursor: pointer; transition: 0.2s; text-transform: uppercase; }
.csv-filter-chips button:hover { color: white; background: rgba(255,255,255,0.1); }
.csv-filter-chips button.active { background: rgba(192,132,252,0.2); color: #c084fc; border-color: rgba(192,132,252,0.4); }

.csv-errors-list { display: flex; flex-direction: column; gap: 8px; max-height: 150px; overflow-y: auto; }
.csv-err-item { font-size: 0.8rem; background: rgba(239,83,80,0.1); border-left: 2px solid #ef5350; padding: 8px 12px; border-radius: 4px; color: #ffcdd2; }

/* Table */
.csv-table-wrap { overflow-x: auto; flex-grow: 1; background: rgba(0,0,0,0.2); border-radius: 12px; border: 1px solid rgba(255,255,255,0.05); }
.csv-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; white-space: nowrap; }
.csv-table th { text-align: left; padding: 10px 16px; border-bottom: 2px solid rgba(255,255,255,0.1); color: rgba(255,255,255,0.5); text-transform: uppercase; font-size: 0.7rem; font-weight: 700; background: rgba(14,12,18,0.9); position: sticky; top: 0; z-index: 10; }
.csv-table td { padding: 10px 16px; border-bottom: 1px solid rgba(255,255,255,0.05); font-variant-numeric: tabular-nums; }
.csv-table tr:hover td { background: rgba(255,255,255,0.03); }
.tr-err td { background: rgba(239,83,80,0.1); }
.tr-err:hover td { background: rgba(239,83,80,0.15); }
.tr-dup td { background: rgba(251,191,36,0.1); color: rgba(255,255,255,0.6); }

/* Step 5: Importing & Result */
.csv-giant-icon { font-size: 5rem; display: inline-block; }
.csv-progress-bar { width: 100%; max-width: 400px; height: 8px; background: rgba(255,255,255,0.1); border-radius: 4px; overflow: hidden; margin: 0 auto; }
.csv-progress-fill { height: 100%; border-radius: 4px; transition: width 0.2s linear; }
.csv-log-box { width: 100%; max-width: 500px; height: 150px; background: #000; border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; padding: 12px; font-family: monospace; font-size: 0.75rem; color: rgba(255,255,255,0.6); overflow-y: auto; }
.log-item { margin-bottom: 4px; }
.log-ok { color: #22c55e; } .log-err { color: #ef5350; } .log-skip { color: #fbbf24; }

.csv-stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.csv-stat-box { background: rgba(0,0,0,0.3); padding: 16px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.05); display: flex; flex-direction: column; align-items: center; }
.csv-stat-box .lbl { font-size: 0.7rem; color: rgba(255,255,255,0.5); text-transform: uppercase; margin-bottom: 4px; }
.csv-stat-box .val { font-size: 1.5rem; font-weight: 800; tabular-nums: tabular-nums; }

/* Modals */
.csv-modal { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.csv-modal__overlay { position: absolute; width: 100%; height: 100%; background: rgba(0,0,0,0.8); backdrop-filter: blur(8px); }
.csv-modal__content { position: relative; background: #0d0b12; border: 1px solid rgba(255,255,255,0.1); border-radius: 24px; width: 90%; max-height: 90vh; overflow-y: auto; padding: 32px; box-shadow: 0 20px 50px rgba(0,0,0,0.5); animation: popIn 0.3s cubic-bezier(0.16,1,0.3,1) forwards; }
.csv-modal__close { position: absolute; top: 24px; right: 24px; background: none; border: none; color: rgba(255,255,255,0.5); font-size: 1.5rem; cursor: pointer; transition: 0.3s; z-index: 10; }
.csv-modal__close:hover { color: white; }