/* === PPT Toolkit — Wizard Layout & Navigation === */

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background: #F5F6FA;
  min-height: 100vh;
}

/* Header */
.app-header {
  background: var(--primary);
  color: var(--dark-text);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.app-header h1 { font-size: 20px; font-weight: 700; }
.app-header .badge { font-size: 12px; opacity: 0.7; }

/* Progress bar */
.progress-bar {
  display: flex;
  justify-content: center;
  gap: 0;
  padding: 24px 40px;
  background: white;
  border-bottom: 1px solid #E2E8F0;
  flex-wrap: wrap;
}
.step-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #94A3B8;
  font-size: 14px;
  cursor: pointer;
  padding: 0 16px;
  transition: color 0.2s;
  user-select: none;
}
.step-indicator .step-num {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #E2E8F0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
  flex-shrink: 0;
}
.step-indicator.active { color: var(--accent); }
.step-indicator.active .step-num { background: var(--accent); color: white; }
.step-indicator.done { color: var(--primary); }
.step-indicator.done .step-num { background: var(--primary); color: white; }
.step-arrow { color: #CBD5E1; margin: 0 4px; }

/* Main content */
.main-content {
  max-width: 1100px;
  margin: 32px auto;
  padding: 0 24px;
}

.step-panel {
  display: none;
  background: white;
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.step-panel.active { display: block; }
.step-panel h2 {
  font-family: var(--font-title);
  font-size: 24px;
  margin-bottom: 8px;
}
.step-desc {
  color: #64748B;
  margin-bottom: 32px;
  font-size: 15px;
}

/* Navigation buttons */
.step-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid #E2E8F0;
}
.btn {
  padding: 12px 32px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  font-family: var(--font-body);
}
.btn-primary {
  background: var(--accent);
  color: white;
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-primary:disabled { background: #CBD5E1; cursor: not-allowed; }
.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid #E2E8F0;
}
.btn-secondary:hover { background: var(--light-bg); }
.btn-ghost {
  background: transparent;
  color: var(--accent);
  padding: 8px 16px;
  border: none;
  cursor: pointer;
  font-size: 14px;
}
.btn-ghost:hover { text-decoration: underline; }

/* AI helper button */
.input-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.input-row input, .input-row textarea {
  flex: 1;
}
.btn-ai {
  flex-shrink: 0;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 2px dashed var(--accent);
  background: white;
  color: var(--accent);
  transition: all 0.2s;
  white-space: nowrap;
  font-family: var(--font-body);
}
.btn-ai:hover { background: var(--light-bg); border-style: solid; }
.btn-ai:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-ai-disabled {
  border-color: #CBD5E1;
  color: #94A3B8;
  cursor: help;
}

/* AI model download progress */
.ai-progress-bar {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}
.ai-progress-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: #BFDBFE;
  transition: width 0.5s;
  width: 0%;
}
.ai-progress-text {
  position: relative;
  z-index: 1;
  font-size: 13px;
  color: #1E40AF;
}

/* Scene cards */
.scene-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.scene-card {
  border: 2px solid #E2E8F0;
  border-radius: 12px;
  padding: 24px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.scene-card:hover { border-color: var(--accent); box-shadow: 0 4px 12px rgba(0,0,0,0.08); transform: translateY(-2px); }
.scene-card.selected { border-color: var(--accent); background: var(--light-bg); }
.scene-card .scene-icon { font-size: 40px; margin-bottom: 12px; }
.scene-card .scene-name { font-size: 17px; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.scene-card .scene-desc { font-size: 13px; color: #64748B; line-height: 1.5; }

/* Form fields */
.form-group { margin-bottom: 20px; }
.form-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--text);
}
.form-group label .required-star { color: #EF4444; }
.form-group label .hint-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #E2E8F0;
  font-size: 11px;
  cursor: help;
  color: #64748B;
  font-weight: 700;
}
.form-group input, .form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  font-size: 14px;
  font-family: var(--font-body);
  transition: border-color 0.2s;
  background: #FAFBFC;
  color: var(--text);
}
.form-group input:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(74,144,217,0.1);
}
.form-group textarea { min-height: 100px; resize: vertical; }
.form-group input.error, .form-group textarea.error { border-color: #EF4444; background: #FFF5F5; }
.form-group .field-hint { font-size: 12px; color: #94A3B8; margin-top: 4px; }
.form-group .error-msg { font-size: 12px; color: #EF4444; margin-top: 4px; display: none; }
.form-group.has-error .error-msg { display: block; }
.form-group.has-error input, .form-group.has-error textarea { border-color: #EF4444; background: #FFF5F5; }

/* Hint tooltip */
.hint-popup {
  position: fixed;
  background: #1E293B;
  color: white;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  max-width: 280px;
  line-height: 1.5;
  z-index: 1000;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}
.hint-popup.show { opacity: 1; }

/* Example panel */
.example-panel {
  margin-top: 16px;
  padding: 16px;
  background: #FFFDE7;
  border-radius: 8px;
  border: 1px solid #FDE68A;
  display: none;
}
.example-panel.show { display: block; }
.example-panel h4 { font-size: 13px; color: #92400E; margin-bottom: 8px; }
.example-panel pre {
  font-size: 13px;
  white-space: pre-wrap;
  color: #78350F;
  font-family: var(--font-body);
  line-height: 1.6;
}

/* KV list fields */
.kv-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.kv-row input { flex: 1; }
.btn-icon {
  width: 32px; height: 32px;
  border-radius: 6px;
  border: 1px solid #E2E8F0;
  background: white;
  cursor: pointer;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  color: #94A3B8;
}
.btn-icon:hover { background: #FEE2E2; border-color: #FCA5A5; color: #EF4444; }

/* Style picker sections */
.style-section { margin-bottom: 28px; }
.style-section h3 { font-size: 16px; margin-bottom: 12px; color: var(--text); }
.style-grid { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.color-swatch {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.color-swatch:hover { transform: scale(1.2); }
.color-swatch.selected { border-color: var(--text); box-shadow: 0 0 0 2px white, 0 0 0 4px var(--text); }

.font-option, .shape-option, .density-option {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  border: 1px solid #E2E8F0;
  cursor: pointer;
  background: white;
  transition: all 0.15s;
  white-space: nowrap;
  color: var(--text);
}
.font-option:hover, .shape-option:hover, .density-option:hover { border-color: var(--accent); }
.font-option.selected, .shape-option.selected, .density-option.selected {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* Mini style preview */
.live-preview-card {
  margin-top: 24px;
  padding: 20px;
  background: var(--light-bg);
  border-radius: 12px;
}
.live-preview-card h4 { font-size: 14px; margin-bottom: 12px; color: #64748B; }
.mini-slide {
  background: var(--bg);
  border-radius: var(--corner-radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: all 0.3s;
}
.mini-accent {
  width: 60px; height: 4px;
  background: var(--accent);
  margin-bottom: 16px;
  border-radius: 2px;
}
.mini-title {
  font-family: var(--font-title);
  font-size: 22px;
  color: var(--text);
  margin-bottom: 8px;
}
.mini-body {
  font-family: var(--font-body);
  font-size: 14px;
  color: #64748B;
  line-height: 1.6;
}

/* Export panel */
.export-panel { text-align: center; padding: 40px 20px; }
.export-panel .check-icon { font-size: 64px; margin-bottom: 16px; }
.export-panel h2 { font-size: 24px; margin-bottom: 8px; }
.export-panel p { color: #64748B; margin-bottom: 24px; line-height: 1.6; }

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 40px; height: 40px;
  border: 3px solid #E2E8F0;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Pulse animation for AI button */
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(74,144,217,0.4); }
  50% { box-shadow: 0 0 0 12px rgba(74,144,217,0); }
}

/* Responsive */
@media (max-width: 768px) {
  .scene-grid { grid-template-columns: 1fr; }
  .step-indicator span:not(.step-num) { display: none; }
  .step-panel { padding: 24px; }
}
