/* ============================================
   Wix UCP Flow Wizard - Styles
   Same dark theme as console
   ============================================ */

/* CSS Variables - Same as console */
:root {
  --bg-primary: #0a0e14;
  --bg-secondary: #0d1117;
  --bg-tertiary: #161b22;
  --bg-elevated: #1c2128;
  --bg-hover: #21262d;
  
  --accent-primary: #39d353;
  --accent-secondary: #238636;
  --accent-glow: rgba(57, 211, 83, 0.15);
  --accent-dim: rgba(57, 211, 83, 0.4);
  
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #484f58;
  --text-inverse: #0a0e14;
  
  --status-success: #39d353;
  --status-error: #f85149;
  --status-warning: #d29922;
  --status-info: #58a6ff;
  
  --border-default: #30363d;
  --border-subtle: #21262d;
  --border-accent: var(--accent-primary);
  
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px var(--accent-glow);
}

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

html {
  font-size: 14px;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
}

/* App Layout */
.app {
  display: grid;
  grid-template-rows: auto auto 1fr;
  grid-template-columns: 1fr 300px;
  min-height: 100vh;
  max-width: 1600px;
  margin: 0 auto;
}

@media (max-width: 1024px) {
  .app {
    grid-template-columns: 1fr;
  }
  
  .api-log {
    display: none;
  }
}

/* ============================================
   Header
   ============================================ */
.header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-default);
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.back-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

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

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.logo-icon {
  font-size: 1.5rem;
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-primary), #7ee787);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================
   Progress Bar
   ============================================ */
.progress-container {
  grid-column: 1 / -1;
  padding: var(--space-lg);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-default);
}

.progress-bar {
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: var(--space-lg);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-secondary), var(--accent-primary));
  width: 0%;
  transition: width 0.5s ease;
}

.steps-indicator {
  display: flex;
  justify-content: space-between;
  max-width: 800px;
  margin: 0 auto;
}

.step-dot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  opacity: 0.4;
  transition: opacity 0.3s;
}

.step-dot.active,
.step-dot.completed {
  opacity: 1;
}

.step-number {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-default);
  border-radius: 50%;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.3s;
}

.step-dot.active .step-number {
  background: var(--accent-secondary);
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

.step-dot.completed .step-number {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: var(--text-inverse);
}

.step-dot.completed .step-number::after {
  content: '✓';
}

.step-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.step-dot.active .step-label {
  color: var(--accent-primary);
}

/* ============================================
   Main Content
   ============================================ */
.main {
  padding: var(--space-lg);
  overflow-y: auto;
}

/* Step Panels */
.step-panel {
  display: none;
  animation: fadeIn 0.3s ease;
}

.step-panel.active {
  display: block;
}

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

.step-header {
  margin-bottom: var(--space-lg);
  text-align: center;
}

.step-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.step-description {
  color: var(--text-secondary);
}

.step-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.step-actions {
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
}

/* ============================================
   Form Elements
   ============================================ */
.input {
  width: 100%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--text-primary);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input:hover {
  border-color: var(--text-muted);
}

.input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group {
  margin-bottom: var(--space-md);
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.form-group.full-width {
  grid-column: 1 / -1;
}

@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
}

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

.btn-primary {
  background: var(--accent-secondary);
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-primary);
  color: var(--text-inverse);
  box-shadow: var(--shadow-glow);
}

.btn-secondary {
  background: var(--bg-tertiary);
  border-color: var(--border-default);
  color: var(--text-primary);
}

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

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.btn-success {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: var(--text-inverse);
}

.btn-success:hover:not(:disabled) {
  background: #2ea043;
  box-shadow: var(--shadow-glow);
}

.btn-lg {
  padding: var(--space-md) var(--space-lg);
  font-size: 1rem;
}

.btn-sm {
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.75rem;
}

/* ============================================
   Search Box
   ============================================ */
.search-box {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.search-box .input {
  flex: 1;
}

/* ============================================
   Products Grid
   ============================================ */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-md);
}

.product-card {
  background: var(--bg-tertiary);
  border: 2px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  cursor: pointer;
  transition: all 0.2s;
}

.product-card:hover {
  border-color: var(--accent-dim);
  transform: translateY(-2px);
}

.product-card.selected {
  border-color: var(--accent-primary);
  background: var(--accent-glow);
}

.product-image {
  width: 100%;
  aspect-ratio: 1;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  overflow: hidden;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-name {
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: var(--space-xs);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-price {
  color: var(--accent-primary);
  font-weight: 600;
  font-family: var(--font-mono);
}

.product-stock {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.product-stock.in-stock {
  color: var(--status-success);
}

.loading-placeholder {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--space-xl);
  color: var(--text-muted);
}

/* ============================================
   Cart Summary
   ============================================ */
.cart-summary {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
}

.cart-item {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border-subtle);
}

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

.cart-item-image {
  width: 60px;
  height: 60px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.cart-item-details {
  flex: 1;
}

.cart-item-name {
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.cart-item-price {
  color: var(--accent-primary);
  font-family: var(--font-mono);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  padding-top: var(--space-md);
  margin-top: var(--space-md);
  border-top: 1px solid var(--border-default);
  font-weight: 600;
}

.cart-total-amount {
  color: var(--accent-primary);
  font-family: var(--font-mono);
  font-size: 1.25rem;
}

/* ============================================
   Shipping Options
   ============================================ */
.shipping-options {
  margin-top: var(--space-lg);
}

.shipping-options h4 {
  margin-bottom: var(--space-md);
  color: var(--text-secondary);
}

.shipping-option {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-tertiary);
  border: 2px solid var(--border-default);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.shipping-option:hover {
  border-color: var(--accent-dim);
}

.shipping-option.selected {
  border-color: var(--accent-primary);
  background: var(--accent-glow);
}

.shipping-option input {
  display: none;
}

.shipping-radio {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-default);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shipping-option.selected .shipping-radio {
  border-color: var(--accent-primary);
}

.shipping-option.selected .shipping-radio::after {
  content: '';
  width: 10px;
  height: 10px;
  background: var(--accent-primary);
  border-radius: 50%;
}

.shipping-details {
  flex: 1;
}

.shipping-name {
  font-weight: 600;
}

.shipping-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.shipping-price {
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--accent-primary);
}

/* ============================================
   Order Review
   ============================================ */
.order-review {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
}

.order-section {
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border-subtle);
}

.order-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.order-section h4 {
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-transform: uppercase;
  margin-bottom: var(--space-sm);
}

.order-line {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--space-xs);
}

.order-line.total {
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-default);
}

.order-line.total .order-value {
  color: var(--accent-primary);
}

.order-value {
  font-family: var(--font-mono);
}

/* ============================================
   Payment Info
   ============================================ */
.payment-info {
  margin-top: var(--space-lg);
  text-align: center;
}

.mock-payment-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--status-info);
  border-radius: var(--radius-md);
  color: var(--status-info);
  font-weight: 500;
}

.payment-note {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-top: var(--space-sm);
}

/* ============================================
   Success / Confirmation
   ============================================ */
.success-icon {
  width: 80px;
  height: 80px;
  background: var(--accent-primary);
  color: var(--text-inverse);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin: 0 auto var(--space-md);
  animation: scaleIn 0.5s ease;
}

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

.order-confirmation {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  text-align: center;
}

.confirmation-number {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-primary);
  margin-bottom: var(--space-md);
}

.next-steps {
  margin-top: var(--space-lg);
  text-align: left;
}

.next-steps h4 {
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.next-steps ul {
  list-style: none;
  padding: 0;
}

.next-steps li {
  padding: var(--space-xs) 0;
  color: var(--text-secondary);
}

.next-steps li::before {
  content: '→ ';
  color: var(--accent-primary);
}

/* ============================================
   API Call Info
   ============================================ */
.api-call-info {
  margin-top: var(--space-lg);
  padding: var(--space-md);
  background: var(--bg-primary);
  border-radius: var(--radius-md);
}

.api-call-info h4 {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.api-call-info code {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-primary);
  padding: var(--space-xs) 0;
}

/* ============================================
   API Log Sidebar
   ============================================ */
.api-log {
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-default);
  display: flex;
  flex-direction: column;
  grid-row: 2 / -1;
}

.api-log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-default);
}

.api-log-header h3 {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.api-log-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md);
}

.log-empty {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-align: center;
  padding: var(--space-lg);
}

.log-entry {
  padding: var(--space-sm);
  margin-bottom: var(--space-sm);
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent-primary);
}

.log-entry.error {
  border-left-color: var(--status-error);
}

.log-method {
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--status-info);
}

.log-path {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-primary);
  word-break: break-all;
}

.log-time {
  font-size: 0.625rem;
  color: var(--text-muted);
}

/* ============================================
   Loading Overlay
   ============================================ */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 20, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.loading-overlay.active {
  opacity: 1;
  visibility: visible;
}

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

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

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

/* ============================================
   Scrollbar
   ============================================ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
