/**
 * ScanningStep Styles
 * 
 * Enhanced scanning/migrating progress display with animations and better visualization.
 */

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

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

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

@keyframes fadeInSlide {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.Root {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 24px;
  animation: slideInUp 300ms ease-out;
}

.Header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 4px;

  svg {
    width: 28px;
    height: 28px;
    color: var(--theme-color-primary);
    animation: spin 1.5s linear infinite;
    filter: drop-shadow(0 0 8px rgba(66, 135, 245, 0.3));
  }

  h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--theme-color-fg-highlight);
    margin: 0;
  }

  p {
    font-size: 14px;
    color: var(--theme-color-fg-default);
    margin: 4px 0 0 0;
  }
}

.ProgressSection {
  padding: 24px;
  background: linear-gradient(135deg, var(--theme-color-bg-3) 0%, var(--theme-color-bg-2) 100%);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--theme-color-bg-2);
}

.ProgressHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;

  h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--theme-color-fg-highlight);
    margin: 0;
  }

  span {
    font-size: 16px;
    font-weight: 700;
    color: var(--theme-color-primary);
    font-variant-numeric: tabular-nums;
  }
}

.ProgressBar {
  height: 12px;
  background-color: var(--theme-color-bg-1);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);

  &::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.2), transparent);
    pointer-events: none;
  }
}

.ProgressFill {
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--theme-color-primary) 0%,
    rgba(66, 135, 245, 0.8) 50%,
    var(--theme-color-primary) 100%
  );
  background-size: 200% 100%;
  border-radius: 6px;
  transition: width 400ms ease-out;
  animation: shimmer 2s linear infinite;
  position: relative;

  &::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 20px;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.4));
    border-radius: 0 6px 6px 0;
  }
}

.CurrentFile {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--theme-color-fg-default);
  animation: pulse 1.5s ease-in-out infinite;

  svg {
    width: 14px;
    height: 14px;
    color: var(--theme-color-primary);
  }

  span {
    font-family: monospace;
    color: var(--theme-color-fg-highlight);
  }
}

.StatsGrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 20px;
}

.StatCard {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
  background-color: var(--theme-color-bg-4);
  border-radius: 8px;
  border: 1px solid var(--theme-color-bg-2);
  transition: all 200ms ease-in-out;

  &:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  }
}

.StatIcon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  color: var(--theme-color-primary);

  svg {
    width: 20px;
    height: 20px;
  }
}

.StatValue {
  font-size: 24px;
  font-weight: 700;
  color: var(--theme-color-fg-highlight);
  line-height: 1;
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}

.StatLabel {
  font-size: 11px;
  color: var(--theme-color-fg-default);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.ActivityLog {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: var(--theme-color-bg-3);
  border-radius: 8px;
  overflow: hidden;
}

.ActivityHeader {
  padding: 12px 16px;
  border-bottom: 1px solid var(--theme-color-bg-2);
  display: flex;
  align-items: center;
  gap: 8px;
}

.ActivityList {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  max-height: 200px;
}

.ActivityItem {
  display: flex;
  gap: 8px;
  padding: 6px 8px;
  font-size: 12px;
  border-radius: 4px;
  animation: fadeIn 0.2s ease;

  &.is-info {
    color: var(--theme-color-secondary-as-fg);
  }

  &.is-success {
    color: var(--theme-color-success);
  }

  &.is-warning {
    color: var(--theme-color-warning);
  }

  &.is-error {
    color: var(--theme-color-danger);
  }
}

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

.ActivityTime {
  color: var(--theme-color-secondary-as-fg);
  font-family: monospace;
  flex-shrink: 0;
}

.ActivityMessage {
  flex: 1;
}

.EmptyActivity {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100px;
  color: var(--theme-color-secondary-as-fg);
}

.InfoBox {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  background-color: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 8px;

  svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--theme-color-primary);
  }
}
