/**
 * Wizard Component - 玻璃态设计风格
 * 设置向导样式
 * 更新: 2026-01-16 - 增强步骤指示器和过渡动画
 */

/* ===== 向导遮罩层 - 玻璃态 ===== */
.wizard-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--background);
  backdrop-filter: blur(var(--overlay-blur, 4px));
  -webkit-backdrop-filter: blur(var(--overlay-blur, 4px));
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: wizardOverlayIn 0.4s ease-out;
}

@keyframes wizardOverlayIn {
  from { 
    opacity: 0;
    backdrop-filter: blur(0);
  }
  to { 
    opacity: 1;
    backdrop-filter: blur(var(--overlay-blur, 4px));
  }
}

/* ===== 向导容器 - 玻璃态 ===== */
.wizard-container {
  width: 100%;
  max-width: 40rem;
  background: var(--glass-bg, rgba(255, 255, 255, 0.03));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 1rem;
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1));
  box-shadow: var(--shadow-glass, 0 8px 32px rgba(0, 0, 0, 0.4));
  overflow: hidden;
  animation: wizardContainerIn 0.5s var(--ease-out-back, cubic-bezier(0.34, 1.56, 0.64, 1));
}

@keyframes wizardContainerIn {
  from { 
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to { 
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ===== 向导头部 - 玻璃态 ===== */
.wizard-header {
  padding: 2rem 2rem 1.5rem;
  text-align: center;
  border-bottom: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1));
  background: var(--glass-bg, rgba(255, 255, 255, 0.02));
}

.wizard-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--foreground);
  margin: 0 0 0.5rem;
  animation: fadeInDown 0.5s ease-out 0.1s both;
}

.wizard-subtitle {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin: 0;
  animation: fadeInDown 0.5s ease-out 0.2s both;
}

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

/* ===== 步骤指示器 - 玻璃态增强 ===== */
.wizard-steps {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.25rem 2rem;
  background: var(--glass-bg, rgba(255, 255, 255, 0.02));
  border-bottom: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1));
}

.wizard-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 1.25rem;
  background: var(--glass-bg, rgba(255, 255, 255, 0.03));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1));
  transition: all 0.3s var(--ease-smooth, cubic-bezier(0.25, 0.46, 0.45, 0.94));
  cursor: default;
}

.wizard-step.clickable {
  cursor: pointer;
}

.wizard-step.clickable:hover {
  background: var(--glass-bg-hover, rgba(255, 255, 255, 0.08));
  border-color: var(--glass-border-hover, rgba(255, 255, 255, 0.2));
  transform: translateY(-2px);
}

.wizard-step.active {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.wizard-step.completed {
  background: var(--success-bg, hsl(142 76% 36% / 0.2));
  border-color: var(--success-border, hsl(142 76% 36% / 0.3));
}

.step-number {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--glass-bg-hover, rgba(255, 255, 255, 0.08));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted-foreground);
  transition: all 0.3s ease;
}

.wizard-step.active .step-number {
  background: var(--foreground);
  color: var(--background);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.3);
}

.wizard-step.completed .step-number {
  background: var(--success);
  color: white;
  box-shadow: 0 0 12px hsl(142 76% 36% / 0.4);
}

.step-label {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  transition: color 0.2s ease;
}

.wizard-step.active .step-label {
  color: var(--foreground);
}

.wizard-step.completed .step-label {
  color: var(--success-text, hsl(142 76% 60%));
}

/* 步骤完成勾选图标动画 */
.wizard-step.completed .step-number::after {
  content: '✓';
  font-size: 0.625rem;
  animation: checkIn 0.3s var(--ease-out-back, cubic-bezier(0.34, 1.56, 0.64, 1));
}

@keyframes checkIn {
  from {
    transform: scale(0);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* ===== 步骤内容区 - 增强过渡 ===== */
.wizard-content {
  padding: 0;
  position: relative;
  overflow: hidden;
}

.wizard-step-content {
  display: none;
  padding: 2rem;
  animation: wizardStepIn 0.4s var(--ease-smooth, cubic-bezier(0.25, 0.46, 0.45, 0.94)) both;
}

.wizard-step-content.active {
  display: block;
}

/* 向前切换动画 (进入下一步) */
@keyframes wizardStepIn {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* 向后切换动画 (返回上一步) */
.wizard-step-content.prev-active {
  animation: wizardStepInReverse 0.4s var(--ease-smooth, cubic-bezier(0.25, 0.46, 0.45, 0.94)) both;
}

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

/* 淡入缩放效果 (用于最后完成步骤) */
.wizard-step-content.complete-step {
  animation: wizardCompleteIn 0.5s var(--ease-out-back, cubic-bezier(0.34, 1.56, 0.64, 1)) both;
}

@keyframes wizardCompleteIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.step-header {
  margin-bottom: 1.5rem;
  animation: fadeInUp 0.4s ease-out 0.1s both;
}

.step-header h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--foreground);
  margin: 0 0 0.5rem;
}

.step-header p {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin: 0;
}

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

/* ===== 需求列表 - 玻璃态 ===== */
.requirements-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.requirement-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--glass-bg, rgba(255, 255, 255, 0.03));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--radius);
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1));
  transition: all 0.3s var(--ease-smooth, cubic-bezier(0.25, 0.46, 0.45, 0.94));
}

.requirement-item:hover {
  background: var(--glass-bg-hover, rgba(255, 255, 255, 0.06));
  transform: translateY(-2px);
}

.requirement-item.critical {
  border-left: 3px solid var(--destructive);
  background: var(--error-bg, hsl(0 84% 60% / 0.1));
}

.requirement-item.recommended {
  border-left: 3px solid var(--warning);
  background: var(--warning-bg, hsl(38 92% 50% / 0.1));
}

.requirement-item.installed,
.requirement-item.configured {
  border-left: 3px solid var(--success);
  background: var(--success-bg, hsl(142 76% 36% / 0.1));
}

.requirement-icon {
  font-size: 1.5rem;
  width: 2rem;
  text-align: center;
  transition: transform 0.3s ease;
}

.requirement-item:hover .requirement-icon {
  transform: scale(1.1);
}

.requirement-info {
  flex: 1;
}

.requirement-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
  margin-bottom: 0.125rem;
}

.requirement-status {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

/* ===== 安装指南 - 玻璃态 ===== */
.install-guide {
  margin-bottom: 1.5rem;
}

.install-status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--glass-bg, rgba(255, 255, 255, 0.03));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1));
  border-radius: var(--radius);
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.install-status .status-icon {
  font-size: 1.5rem;
  transition: transform 0.3s ease;
}

.install-status .status-text {
  font-size: 0.875rem;
  color: var(--foreground);
}

.install-status.success {
  background: var(--success-bg, hsl(142 76% 36% / 0.15));
  border: 1px solid var(--success-border, hsl(142 76% 36% / 0.3));
  box-shadow: 0 0 20px hsl(142 76% 36% / 0.15);
}

.install-status.success .status-text {
  color: var(--success-text, hsl(142 76% 60%));
}

.install-status.success .status-icon {
  animation: checkBounce 0.5s var(--ease-out-back, cubic-bezier(0.34, 1.56, 0.64, 1));
}

@keyframes checkBounce {
  0% { transform: scale(0); }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.install-methods {
  margin-bottom: 1rem;
}

.install-method {
  padding: 0.75rem 1rem;
  background: var(--glass-bg, rgba(255, 255, 255, 0.03));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: all 0.2s var(--ease-smooth, cubic-bezier(0.25, 0.46, 0.45, 0.94));
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1));
}

.install-method:hover {
  border-color: rgba(255, 255, 255, 0.25);
  background: var(--glass-bg-hover, rgba(255, 255, 255, 0.06));
  transform: translateY(-2px);
}

.install-method.selected {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

.install-method-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
}

.install-command-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: #1e1e1e;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 1rem;
}

.install-command-box code {
  flex: 1;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.8125rem;
  color: var(--success);
  word-break: break-all;
  user-select: text;
}

.install-command-box .btn-copy {
  padding: 0.375rem 0.75rem;
  background: var(--accent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all var(--transition-fast, 150ms);
  font-size: 0.8125rem;
  position: static;
  transform: none;
}

.install-command-box .btn-copy:hover {
  background: var(--muted);
  color: var(--foreground);
}

.install-command-box .btn-copy.copied {
  background: hsl(142 76% 36% / 0.2);
  border-color: var(--success);
  color: var(--success);
}

.install-links {
  display: flex;
  gap: 0.75rem;
}

.install-links .btn-link {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted-foreground);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all var(--transition-fast, 150ms);
}

.install-links .btn-link:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ===== API 配置表单 ===== */
.api-config-form {
  margin-bottom: 1.5rem;
}

.api-config-status {
  font-size: 0.8125rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-top: 0.5rem;
}

.api-config-status.error {
  background: hsl(0 84% 60% / 0.1);
  color: var(--destructive);
}

.api-config-status.success {
  background: hsl(142 76% 36% / 0.1);
  color: var(--success);
}

/* ===== 完成页 - 增强动画 ===== */
.complete-header {
  text-align: center;
  animation: completeHeaderIn 0.6s var(--ease-out-back, cubic-bezier(0.34, 1.56, 0.64, 1)) both;
}

@keyframes completeHeaderIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.complete-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: completeIconIn 0.8s var(--ease-out-back, cubic-bezier(0.34, 1.56, 0.64, 1)) 0.2s both;
}

@keyframes completeIconIn {
  0% {
    opacity: 0;
    transform: scale(0) rotate(-180deg);
  }
  60% {
    transform: scale(1.2) rotate(10deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

.complete-icon svg {
  width: 4rem;
  height: 4rem;
  stroke: var(--success);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  filter: drop-shadow(0 0 20px hsl(142 76% 36% / 0.4));
}

.config-summary {
  background: var(--glass-bg, rgba(255, 255, 255, 0.03));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1));
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  animation: fadeInUp 0.5s ease-out 0.3s both;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1));
  transition: background 0.2s ease;
}

.summary-item:hover {
  background: var(--glass-bg-hover, rgba(255, 255, 255, 0.03));
  margin: 0 -0.5rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  border-radius: var(--radius-sm);
}

.summary-item:last-child {
  border-bottom: none;
}

.summary-label {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
}

.summary-value {
  font-size: 0.8125rem;
  color: var(--foreground);
  font-weight: 500;
}

.summary-value.success {
  color: var(--success-text, hsl(142 76% 60%));
}

/* ===== 步骤操作按钮 ===== */
.step-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.step-actions.center {
  justify-content: center;
}

.step-actions .btn-primary {
  padding: 0.75rem 1.5rem;
}

.step-actions .btn-primary.btn-large {
  padding: 1rem 3rem;
  font-size: 1rem;
}

.step-actions .btn-secondary {
  padding: 0.75rem 1.5rem;
}

/* ===== 设置向导入口 ===== */
.env-wizard-entry {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.env-wizard-entry .btn-secondary-sm {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.env-wizard-entry .setting-hint {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

/* ===== Loader 动画 ===== */
.icon-loader svg {
  animation: spin 1s linear infinite;
}

/* ===== 浅色主题样式 - 颜色反转 ===== */

/* 向导容器 - 浅色主题 */
body:not(.dark) .wizard-container {
  background: var(--glass-bg, rgba(255, 255, 255, 0.95));
  border: 1px solid var(--glass-border, rgba(0, 0, 0, 0.1));
  box-shadow: var(--shadow-glass, 0 8px 32px rgba(0, 0, 0, 0.15));
}

/* 向导头部 - 浅色主题 */
body:not(.dark) .wizard-header {
  border-bottom: 1px solid var(--glass-border, rgba(0, 0, 0, 0.1));
  background: var(--glass-bg, rgba(0, 0, 0, 0.02));
}

/* 步骤指示器 - 浅色主题 */
body:not(.dark) .wizard-steps {
  background: var(--glass-bg, rgba(0, 0, 0, 0.02));
  border-bottom: 1px solid var(--glass-border, rgba(0, 0, 0, 0.1));
}

body:not(.dark) .wizard-step {
  background: var(--glass-bg, rgba(0, 0, 0, 0.03));
  border: 1px solid var(--glass-border, rgba(0, 0, 0, 0.1));
}

body:not(.dark) .wizard-step.clickable:hover {
  background: var(--glass-bg-hover, rgba(0, 0, 0, 0.08));
  border-color: var(--glass-border-hover, rgba(0, 0, 0, 0.2));
}

body:not(.dark) .wizard-step.active {
  background: rgba(0, 0, 0, 0.1);
  border-color: rgba(0, 0, 0, 0.25);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

body:not(.dark) .step-number {
  background: var(--glass-bg-hover, rgba(0, 0, 0, 0.08));
}

body:not(.dark) .wizard-step.active .step-number {
  background: var(--foreground);
  color: var(--background);
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.3);
}

/* 需求列表 - 浅色主题 */
body:not(.dark) .requirement-item {
  background: var(--glass-bg, rgba(0, 0, 0, 0.03));
  border: 1px solid var(--glass-border, rgba(0, 0, 0, 0.1));
}

body:not(.dark) .requirement-item:hover {
  background: var(--glass-bg-hover, rgba(0, 0, 0, 0.06));
}

/* 安装指南 - 浅色主题 */
body:not(.dark) .install-status {
  background: var(--glass-bg, rgba(0, 0, 0, 0.03));
  border: 1px solid var(--glass-border, rgba(0, 0, 0, 0.1));
}

body:not(.dark) .install-method {
  background: var(--glass-bg, rgba(0, 0, 0, 0.03));
  border: 1px solid var(--glass-border, rgba(0, 0, 0, 0.1));
}

body:not(.dark) .install-method:hover {
  border-color: rgba(0, 0, 0, 0.25);
  background: var(--glass-bg-hover, rgba(0, 0, 0, 0.06));
}

body:not(.dark) .install-method.selected {
  border-color: rgba(0, 0, 0, 0.3);
  background: rgba(0, 0, 0, 0.1);
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
}

/* 配置摘要 - 浅色主题 */
body:not(.dark) .config-summary {
  background: var(--glass-bg, rgba(0, 0, 0, 0.03));
  border: 1px solid var(--glass-border, rgba(0, 0, 0, 0.1));
}

body:not(.dark) .summary-item {
  border-bottom: 1px solid var(--glass-border, rgba(0, 0, 0, 0.1));
}

body:not(.dark) .summary-item:hover {
  background: var(--glass-bg-hover, rgba(0, 0, 0, 0.03));
}
