/**
 * MigratingStep Styles
 *
 * Enhanced AI-assisted migration progress display with beautiful budget tracking and decision panels.
 */

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

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

@keyframes budgetPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.7);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(251, 191, 36, 0);
  }
}

.Root {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 20px;
  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;
  }
}

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

/* Budget Section */
.BudgetSection {
  padding: 20px;
  background: linear-gradient(135deg, var(--theme-color-bg-3) 0%, var(--theme-color-bg-2) 100%);
  border-radius: 12px;
  border: 2px solid var(--theme-color-bg-2);
  transition: all 300ms ease-in-out;

  &.is-warning {
    border-color: var(--theme-color-warning);
    animation: budgetPulse 2s ease-in-out infinite;
  }
}

.BudgetHeader {
  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;
    display: flex;
    align-items: center;
    gap: 8px;

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

  .BudgetAmount {
    font-size: 18px;
    font-weight: 700;
    color: var(--theme-color-primary);
    font-variant-numeric: tabular-nums;

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

.BudgetBar {
  height: 10px;
  background-color: var(--theme-color-bg-1);
  border-radius: 5px;
  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;
  }
}

.BudgetFill {
  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: 5px;
  transition: width 400ms ease-out, background 300ms ease-in-out;
  animation: shimmer 2s linear infinite;
  position: relative;

  &.is-warning {
    background: linear-gradient(
      90deg,
      var(--theme-color-warning) 0%,
      rgba(251, 191, 36, 0.8) 50%,
      var(--theme-color-warning) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 2s linear infinite;
  }

  &::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 5px 5px 0;
  }
}

.BudgetWarning {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 12px;
  background-color: rgba(251, 191, 36, 0.15);
  border-radius: 6px;
  font-size: 12px;
  color: var(--theme-color-warning);

  svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
  }
}

/* Progress Section */
.ProgressSection {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ProgressBar {
  height: 8px;
  background-color: var(--theme-color-bg-3);
  border-radius: 4px;
  overflow: hidden;
}

.ProgressFill {
  height: 100%;
  background-color: var(--theme-color-primary);
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* Current Component */
.CurrentComponent {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background-color: var(--theme-color-bg-3);
  border-radius: 8px;
  border: 1px solid var(--theme-color-primary);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    border-color: var(--theme-color-primary);
    background-color: var(--theme-color-bg-3);
  }
  50% {
    border-color: rgba(59, 130, 246, 0.5);
    background-color: rgba(59, 130, 246, 0.05);
  }
}

/* Log Section */
.LogSection {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
}

.LogEntries {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.LogEntry {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 12px;
  background-color: var(--theme-color-bg-3);
  border-radius: 6px;
  font-size: 13px;
  animation: slideIn 0.2s ease;

  svg {
    margin-top: 2px;
    flex-shrink: 0;
  }

  &.is-info {
    border-left: 3px solid var(--theme-color-secondary-as-fg);

    svg {
      color: var(--theme-color-secondary-as-fg);
    }
  }

  &.is-success {
    border-left: 3px solid var(--theme-color-success);

    svg {
      color: var(--theme-color-success);
    }
  }

  &.is-warning {
    border-left: 3px solid var(--theme-color-warning);

    svg {
      color: var(--theme-color-warning);
    }
  }

  &.is-error {
    border-left: 3px solid var(--theme-color-danger);

    svg {
      color: var(--theme-color-danger);
    }
  }
}

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

.LogContent {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* AI Decision Panel */
.DecisionPanel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background-color: var(--theme-color-bg-3);
  border: 2px solid var(--theme-color-warning);
  border-radius: 8px;
  animation: slideDown 0.3s ease;
}

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

.DecisionHeader {
  display: flex;
  align-items: center;
  gap: 12px;

  svg {
    color: var(--theme-color-warning);
    flex-shrink: 0;
  }
}

.AttemptHistory {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  background-color: var(--theme-color-bg-2);
  border-radius: 6px;
}

.AttemptEntry {
  display: flex;
  gap: 4px;
  font-size: 13px;
}

.DecisionOptions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

/* Actions */
.Actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--theme-color-bg-2);
}

/* Dialog Overlay */
.DialogOverlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
