/* styles.css - Workflow Wizard Styles */

/* Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Colors */
  --bg-primary: #0a0a0f;
  --bg-secondary: #151520;
  --bg-tertiary: #1f1f2e;
  --bg-card: #1a1a28;
  --border-color: #2a2a3e;
  --text-primary: #e0e0e8;
  --text-secondary: #a0a0b0;
  --text-muted: #707080;
  --accent-primary: #6366f1;
  --accent-hover: #5558e3;
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;

  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 0.75rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;

  /* Border radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* Container */
.wizard-container {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--spacing-xl) var(--spacing-md);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.wizard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-xl);
  padding-bottom: var(--spacing-lg);
  border-bottom: 1px solid var(--border-color);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  cursor: default;
}

.logo-dot {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent-primary) 0%, #8b5cf6 100%);
  border-radius: var(--radius-md);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.brand-tag {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.back-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--accent-primary);
}

/* Main Card */
.wizard-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl);
  box-shadow: var(--shadow-lg);
  flex: 1;
  position: relative;
}

/* Progress Bar */
.progress-container {
  margin-bottom: var(--spacing-xl);
}

.progress-bar {
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: var(--spacing-sm);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary) 0%, #8b5cf6 100%);
  transition: width 0.3s ease;
  border-radius: 9999px;
}

.progress-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-align: center;
}

/* Question Section */
.question-section {
  margin-bottom: var(--spacing-xl);
}

.question-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: var(--spacing-sm);
}

.question-text {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.5;
}

/* Answer Section */
.answer-section {
  margin-bottom: var(--spacing-xl);
}

.answer-label {
  display: block;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-sm);
}

.input-group {
  display: flex;
  gap: var(--spacing-sm);
}

.answer-input {
  flex: 1;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.answer-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.answer-input::placeholder {
  color: var(--text-muted);
}

.answer-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: var(--spacing-sm);
  font-style: italic;
}

/* Buttons */
.btn-primary {
  background: var(--accent-primary);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  transition: background 0.2s, transform 0.1s;
  white-space: nowrap;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-primary:active:not(:disabled) {
  transform: scale(0.98);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.btn-secondary:hover {
  background: var(--bg-secondary);
  border-color: var(--text-muted);
}

.btn-copy {
  background: transparent;
  color: var(--accent-primary);
  border: 1px solid var(--accent-primary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-copy:hover {
  background: rgba(99, 102, 241, 0.1);
}

.btn-icon {
  font-size: 1.25rem;
  line-height: 1;
}

/* History Section */
.history-section {
  margin-bottom: var(--spacing-xl);
}

.history-toggle {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
}

.history-toggle summary {
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  list-style: none;
  user-select: none;
}

.history-toggle summary::-webkit-details-marker {
  display: none;
}

.history-toggle summary::before {
  content: '▶';
  display: inline-block;
  margin-right: var(--spacing-sm);
  transition: transform 0.2s;
}

.history-toggle[open] summary::before {
  transform: rotate(90deg);
}

.history-list {
  margin-top: var(--spacing-md);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.history-item {
  display: flex;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  background: var(--bg-card);
  border-radius: var(--radius-sm);
}

.history-number {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  background: var(--accent-primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
}

.history-content {
  flex: 1;
}

.history-question {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-xs);
}

.history-answer {
  font-size: 0.875rem;
  color: var(--text-primary);
  font-weight: 500;
}

/* Result Section */
.result-section {
  animation: fadeIn 0.3s ease;
}

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

.result-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-xl);
  padding: var(--spacing-lg);
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  border: 1px solid var(--success);
}

.result-icon {
  width: 48px;
  height: 48px;
  background: var(--success);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  flex-shrink: 0;
}

.result-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.result-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* DSL Preview */
.dsl-preview {
  margin-bottom: var(--spacing-xl);
}

.dsl-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-sm);
}

.dsl-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.dsl-code {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-primary);
  overflow-x: auto;
  max-height: 400px;
  overflow-y: auto;
}

/* Result Actions */
.result-actions {
  display: flex;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.result-actions button {
  flex: 1;
}

/* Compile Result */
.compile-result {
  margin-top: var(--spacing-lg);
  padding: var(--spacing-lg);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.compile-success {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

.compile-icon {
  width: 32px;
  height: 32px;
  background: var(--success);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.compile-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.compile-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.compile-subtitle code {
  background: var(--bg-card);
  padding: 0.125rem 0.375rem;
  border-radius: var(--radius-sm);
  font-family: monospace;
  font-size: 0.75rem;
}

.compile-json {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: var(--spacing-md);
  font-family: monospace;
  font-size: 0.75rem;
  line-height: 1.6;
  overflow-x: auto;
  max-height: 300px;
  overflow-y: auto;
}

/* Error Message */
.error-message {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--error);
  color: var(--error);
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-lg);
  font-size: 0.875rem;
}

/* Loading Overlay */
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-md);
  border-radius: var(--radius-lg);
  z-index: 100;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border-color);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.loading-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Footer */
.wizard-footer {
  margin-top: var(--spacing-xl);
  padding-top: var(--spacing-lg);
  border-top: 1px solid var(--border-color);
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Utilities */
.hidden {
  display: none !important;
}

/* Responsive */
@media (max-width: 640px) {
  .wizard-container {
    padding: var(--spacing-md);
  }

  .wizard-card {
    padding: var(--spacing-lg);
  }

  .wizard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-md);
  }

  .input-group {
    flex-direction: column;
  }

  .result-actions {
    flex-direction: column;
  }

  .question-text {
    font-size: 1.125rem;
  }

  .brand-name {
    font-size: 1.125rem;
  }
}
