/**
 * WIFO Import Feature Styles
 */

/* Dialog Overlay */
.wifo-dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.wifo-dialog-overlay.wifo-dialog-visible {
  opacity: 1;
}

/* Dialog */
.wifo-dialog {
  background: white;
  border-radius: 12px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25);
  width: 95%;
  max-width: 1400px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.wifo-dialog-visible .wifo-dialog {
  transform: translateY(0);
}

/* Dialog Header */
.wifo-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.wifo-dialog-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0;
}

.wifo-dialog-close {
  font-size: 1.5rem;
  line-height: 1;
  padding: 0.25rem 0.5rem;
}

/* Dialog Body */
.wifo-dialog-body {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  min-height: 400px;
  position: relative;
}

/* Step container positioning */
.wifo-step-preview {
  position: relative;
  min-height: 100%;
}

/* Dialog Footer */
.wifo-dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 0 0 12px 12px;
}

/* File Upload */
.wifo-upload-container {
  width: 100%;
}

.wifo-upload-input {
  display: none;
}

.wifo-upload-dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #f8fafc;
}

.wifo-upload-dropzone:hover {
  border-color: var(--color-primary, #3b82f6);
  background: #f0f9ff;
}

.wifo-upload-dropzone-active {
  border-color: var(--color-primary, #3b82f6);
  background: #dbeafe;
}

.wifo-upload-dropzone-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.wifo-upload-icon {
  margin-bottom: 1rem;
}

.wifo-upload-svg-icon {
  width: 48px;
  height: 48px;
  color: #64748b;
}

.wifo-upload-text {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.wifo-upload-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1e293b;
}

.wifo-upload-subtitle {
  color: #64748b;
}

.wifo-upload-formats {
  font-size: 0.875rem;
  color: #94a3b8;
}

.wifo-upload-info {
  margin-top: 1.5rem;
  padding: 1rem;
  background: #f1f5f9;
  border-radius: 8px;
}

.wifo-upload-info p {
  margin: 0;
  color: #64748b;
  font-size: 0.875rem;
}

/* Progress Indicator */
.wifo-progress-container {
  text-align: center;
  padding: 3rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

.wifo-progress-status {
  font-size: 1.25rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 2rem;
}

.wifo-progress-bar-container {
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 1rem;
  width: 100%;
  max-width: 400px;
  position: relative;
}

.wifo-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary, #3b82f6), #60a5fa);
  border-radius: 4px;
  transition: width 0.3s ease;
  width: 0%;
  position: relative;
}

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

.wifo-progress-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary, #3b82f6);
  font-variant-numeric: tabular-nums;
}

.wifo-progress-message {
  margin-top: 1rem;
  color: #64748b;
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
}

.wifo-progress-success .wifo-progress-bar {
  background: linear-gradient(90deg, #22c55e, #4ade80);
}

.wifo-progress-error .wifo-progress-bar {
  background: linear-gradient(90deg, #ef4444, #f87171);
}

/* Statistics Summary */
.wifo-stats-container {
  display: flex;
  gap: 0.875rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.wifo-stat-card {
  flex: 1;
  min-width: 110px;
  max-width: 160px;
  padding: 1rem 1.25rem;
  border-radius: 10px;
  text-align: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  transition: all 0.2s ease;
}

.wifo-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.wifo-stat-card-active {
  border-width: 2px;
}

.wifo-stat-card-total {
  border-color: #94a3b8;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.wifo-stat-card-valid.wifo-stat-card-active {
  border-color: #22c55e;
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.wifo-stat-card-warning.wifo-stat-card-active {
  border-color: #f59e0b;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.wifo-stat-card-invalid.wifo-stat-card-active {
  border-color: #ef4444;
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
}

.wifo-stat-card-imported.wifo-stat-card-active {
  border-color: #3b82f6;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.wifo-stat-value {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.wifo-stat-label {
  display: block;
  font-size: 0.6875rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.5rem;
  font-weight: 500;
}

/* Filter Bar */
.wifo-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  padding-bottom: 1rem;
  border-bottom: 1px solid #f1f5f9;
}

.wifo-filter-group {
  display: flex;
  gap: 3px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 10px;
}

.wifo-filter-btn {
  padding: 0.5rem 1rem;
  border: none;
  background: transparent;
  border-radius: 7px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
}

.wifo-filter-btn:hover {
  color: #1e293b;
  background: rgba(255, 255, 255, 0.5);
}

.wifo-filter-btn-active {
  background: white;
  color: var(--color-primary, #3b82f6);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  font-weight: 600;
}

.wifo-filter-search {
  padding: 0.625rem 1rem;
  padding-left: 2.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.875rem;
  width: 220px;
  transition: all 0.2s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0.75rem center;
  background-size: 18px;
}

.wifo-filter-search:focus {
  outline: none;
  border-color: var(--color-primary, #3b82f6);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.wifo-filter-search::placeholder {
  color: #94a3b8;
}

/* Preview Table */
.wifo-table-container {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: auto;
  max-height: calc(100vh - 400px);
  min-height: 300px;
  position: relative;
}

.wifo-preview-table {
  width: 100%;
  min-width: 1100px;
  border-collapse: collapse;
  font-size: 0.875rem;
  table-layout: fixed;
}

.wifo-preview-table th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  color: #475569;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
  z-index: 10;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.wifo-preview-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  vertical-align: middle;
}

.wifo-table-row {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.wifo-table-row:hover {
  background: #f8fafc;
}

.wifo-table-row:nth-child(even) {
  background: #fafbfc;
}

.wifo-table-row:nth-child(even):hover {
  background: #f1f5f9;
}

.wifo-table-row-selected {
  background: #eff6ff !important;
}

.wifo-table-row-selected:hover {
  background: #dbeafe !important;
}

/* Row status colors */
.wifo-row-valid {
  border-left: 3px solid #22c55e;
}

.wifo-row-warning {
  border-left: 3px solid #f59e0b;
  background: #fffbeb;
}

.wifo-row-invalid {
  border-left: 3px solid #ef4444;
  background: #fef2f2;
}

.wifo-row-imported {
  border-left: 3px solid #3b82f6;
  background: #eff6ff;
}

.wifo-row-failed {
  border-left: 3px solid #ef4444;
  background: #fef2f2;
}

.wifo-row-skipped {
  border-left: 3px solid #94a3b8;
  opacity: 0.6;
}

/* Status badge */
.wifo-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.375rem 0.625rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.wifo-status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.wifo-status-pending {
  background: #f1f5f9;
  color: #64748b;
}

.wifo-status-pending::before {
  background: #94a3b8;
}

.wifo-status-valid {
  background: #dcfce7;
  color: #166534;
}

.wifo-status-valid::before {
  background: #22c55e;
}

.wifo-status-warning {
  background: #fef3c7;
  color: #92400e;
}

.wifo-status-warning::before {
  background: #f59e0b;
}

.wifo-status-invalid {
  background: #fee2e2;
  color: #991b1b;
}

.wifo-status-invalid::before {
  background: #ef4444;
}

.wifo-status-imported {
  background: #dbeafe;
  color: #1e40af;
}

.wifo-status-imported::before {
  background: #3b82f6;
}

.wifo-status-failed {
  background: #fee2e2;
  color: #991b1b;
}

.wifo-status-failed::before {
  background: #ef4444;
}

.wifo-status-skipped {
  background: #f1f5f9;
  color: #64748b;
}

.wifo-status-skipped::before {
  background: #94a3b8;
}

/* Table cell styles */
.wifo-table-cell-select {
  width: 40px;
  text-align: center;
}

.wifo-table-cell-select input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--color-primary, #3b82f6);
}

.wifo-table-cell-status {
  width: 100px;
}

.wifo-table-cell-amount {
  text-align: right;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
  font-weight: 600;
  font-size: 0.875rem;
  color: #0f172a;
}

/* Negative amounts (Stornos) - red styling */
.wifo-table-cell-amount.wifo-amount-negative {
  color: #dc2626;
  font-weight: 700;
}

.wifo-table-cell-truncate {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wifo-table-cell-vermittler {
  font-weight: 500;
}

.wifo-table-cell-errors {
  min-width: 250px;
  max-width: 350px;
  padding-right: 1.5rem !important;
}

.wifo-error-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wifo-error-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 0.8125rem;
  line-height: 1.4;
  padding: 4px 8px;
  border-radius: 4px;
  background: #fef2f2;
}

.wifo-error-item-warning {
  background: #fffbeb;
}

.wifo-error-item-info {
  background: #f0f9ff;
}

.wifo-error-icon {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  margin-top: 1px;
}

.wifo-error-icon-error {
  color: #dc2626;
}

.wifo-error-icon-warning {
  color: #d97706;
}

.wifo-error-icon-info {
  color: #0284c7;
}

.wifo-error-text {
  flex: 1;
  color: #7f1d1d;
  word-break: break-word;
}

.wifo-error-item-warning .wifo-error-text {
  color: #92400e;
}

.wifo-error-item-info .wifo-error-text {
  color: #0c4a6e;
}

.wifo-error-more {
  font-size: 0.75rem;
  color: #6b7280;
  cursor: pointer;
  padding: 2px 6px;
  background: #f3f4f6;
  border-radius: 3px;
  display: inline-block;
  margin-top: 4px;
}

.wifo-error-more:hover {
  background: #e5e7eb;
  color: #374151;
}

.wifo-mapped {
  color: #16a34a;
  font-weight: 600;
}

.wifo-table-empty {
  padding: 3rem;
  text-align: center;
  color: #64748b;
  display: none;
}

/* Result Step */
.wifo-step-result {
  text-align: center;
  padding: 2rem;
}

.wifo-result-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 2rem;
}

.wifo-result-success {
  background: #dcfce7;
  color: #22c55e;
}

.wifo-result-partial {
  background: #fef3c7;
  color: #f59e0b;
}

.wifo-result-error {
  background: #fee2e2;
  color: #ef4444;
}

.wifo-result-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 0.5rem;
}

.wifo-result-message {
  color: #64748b;
  margin: 0 0 2rem;
}

.wifo-result-failed {
  color: #ef4444;
}

/* ============================================
   Import Overlay - Elegant Loading Animation
   ============================================ */
.wifo-import-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.97);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  backdrop-filter: blur(4px);
  border-radius: 12px;
}

.wifo-import-overlay.wifo-import-overlay-visible {
  opacity: 1;
  visibility: visible;
}

/* Animated Spinner */
.wifo-import-spinner {
  position: relative;
  width: 80px;
  height: 80px;
  margin-bottom: 2rem;
}

.wifo-import-spinner-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 3px solid transparent;
  border-radius: 50%;
  animation: wifo-spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.wifo-import-spinner-ring:nth-child(1) {
  border-top-color: var(--color-primary, #3b82f6);
  animation-delay: -0.45s;
}

.wifo-import-spinner-ring:nth-child(2) {
  border-top-color: #60a5fa;
  animation-delay: -0.3s;
  width: 90%;
  height: 90%;
  top: 5%;
  left: 5%;
}

.wifo-import-spinner-ring:nth-child(3) {
  border-top-color: #93c5fd;
  animation-delay: -0.15s;
  width: 80%;
  height: 80%;
  top: 10%;
  left: 10%;
}

@keyframes wifo-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Center icon */
.wifo-import-spinner-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  color: var(--color-primary, #3b82f6);
  animation: wifo-pulse 2s ease-in-out infinite;
}

@keyframes wifo-pulse {
  0%, 100% {
    opacity: 0.6;
    transform: translate(-50%, -50%) scale(0.95);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.05);
  }
}

/* Import Title */
.wifo-import-title {
  font-size: 1.375rem;
  font-weight: 600;
  color: #0f172a;
  margin: 0 0 0.5rem;
  text-align: center;
}

/* Import Status Text */
.wifo-import-status {
  font-size: 1rem;
  color: #64748b;
  margin: 0 0 2rem;
  text-align: center;
}

/* Progress Circle Container */
.wifo-import-progress-container {
  position: relative;
  width: 160px;
  height: 160px;
  margin-bottom: 1.5rem;
}

/* Circular Progress */
.wifo-import-progress-circle {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.wifo-import-progress-bg {
  fill: none;
  stroke: #e2e8f0;
  stroke-width: 8;
}

.wifo-import-progress-bar {
  fill: none;
  stroke: url(#wifo-progress-gradient);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 439.82;
  stroke-dashoffset: 439.82;
  transition: stroke-dashoffset 0.5s ease;
}

/* Progress Center Content */
.wifo-import-progress-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.wifo-import-progress-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.wifo-import-progress-label {
  font-size: 0.75rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}

/* Import Counter Stats */
.wifo-import-counters {
  display: flex;
  gap: 3rem;
  margin-top: 1.5rem;
}

.wifo-import-counter {
  text-align: center;
}

.wifo-import-counter-value {
  font-size: 1.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.wifo-import-counter-value-success {
  color: #16a34a;
}

.wifo-import-counter-value-failed {
  color: #dc2626;
}

.wifo-import-counter-value-remaining {
  color: #64748b;
}

.wifo-import-counter-label {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

/* Progress Bar Alternative (linear) */
.wifo-import-progress-linear {
  width: 300px;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.wifo-import-progress-linear-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary, #3b82f6), #60a5fa);
  border-radius: 3px;
  transition: width 0.3s ease;
  position: relative;
}

.wifo-import-progress-linear-bar::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: wifo-shimmer 1.5s infinite;
}

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

/* Detail Message */
.wifo-import-detail {
  font-size: 0.875rem;
  color: #94a3b8;
  margin-top: 0.5rem;
  font-variant-numeric: tabular-nums;
}

/* Smooth number transitions */
.wifo-import-number-animate {
  display: inline-block;
  transition: transform 0.2s ease;
}

.wifo-import-number-animate.wifo-number-change {
  animation: wifo-number-pop 0.3s ease;
}

@keyframes wifo-number-pop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
  }
  100% {
    transform: scale(1);
  }
}
