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

:root {
  --bg-dark: #0f172a;
  --bg-card: #1e293b;
  --border-color: #334155;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent-1: #3b82f6;
  --accent-2: #2563eb;
  --success: #10b981;
  --error: #ef4444;
  --glass-blur: 0px;
}

body {
  background: var(--bg-dark);
  color: var(--text-main);
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── App Layout ──────────────────────────────────── */
.app-wrapper {
  width: 100%;
  margin: 0;
  padding: 0;
}

.app-header {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.top-nav {
  display: flex;
  gap: 8px;
  background: transparent;
  padding: 6px;
  border-radius: 0;
  border: none;
}

.nav-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 0;
  cursor: pointer;
  transition: all 0.3s ease;
}

.nav-btn:hover {
  color: var(--text-main);
}

.nav-btn.active {
  background: var(--accent-1);
  color: #fff;
  box-shadow: none;
}

.icon-btn {
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Glassmorphism Panels ────────────────────────── */
.glass-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0;
  box-shadow: none;
}

.glass-panel.padded {
  padding: 32px;
}

/* ── Wizard Stepper ──────────────────────────────── */
.wizard-tabs {
  display: flex;
  gap: 8px;
  margin: 24px 20px;
}
.w-tab {
  flex: 1;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: all 0.3s ease;
}
.w-tab:hover {
  background: rgba(255, 255, 255, 0.05);
}
.w-tab.active {
  background: var(--accent-1);
  color: #fff;
  border-color: var(--accent-1);
}

.wizard-container {
  display: flex;
  flex-direction: column;
  padding: 0 20px;
  max-width: 100%;
  margin: 0 auto;
}

.wizard-step {
  display: none;
}

.wizard-step.active {
  display: block;
  animation: fadeIn 0.4s ease;
}

.step-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.step-icon {
  width: 40px;
  height: 40px;
  border-radius: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-muted);
}

.wizard-step.active .step-icon {
  background: var(--accent-1);
  color: #fff;
  border: 1px solid var(--accent-1);
  box-shadow: none;
}

.step-title-wrap h2 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 4px;
}

.step-title-wrap p {
  font-size: 14px;
  color: var(--text-muted);
}

/* ── Forms & Inputs ──────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.premium-input {
  background: #0f172a;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: 0;
  padding: 14px 16px;
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  transition: all 0.3s ease;
  outline: none;
}

.premium-input:focus {
  border-color: var(--accent-1);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.premium-textarea {
  width: 100%;
  min-height: 120px;
  background: #0f172a;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: 0;
  padding: 16px;
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  resize: vertical;
  outline: none;
  transition: all 0.3s ease;
}

.premium-textarea.code-font {
  font-family: monospace;
  font-size: 13px;
  color: #a5b4fc;
}

#lgBlueprint {
  min-height: 450px;
}

.premium-textarea:focus {
  border-color: var(--accent-2);
}

/* ── Buttons ─────────────────────────────────────── */
.step-actions {
  margin-top: 32px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.step-actions.right {
  justify-content: flex-end;
}

.step-actions.split {
  justify-content: space-between;
}

.btn-glow {
  background: var(--accent-1);
  color: #fff;
  border: none;
  padding: 14px 28px;
  border-radius: 0;
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-glow:hover {
  background: var(--accent-2);
}

.btn-glow:active {
  transform: translateY(0);
}

.btn-glow.large {
  padding: 18px 32px;
  font-size: 16px;
}

.w-full { width: 100%; }

.btn-secondary {
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 14px 24px;
  border-radius: 0;
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-text {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 10px;
  transition: color 0.3s ease;
}

.btn-text:hover {
  color: var(--text-main);
}

/* ── Advanced Settings Accordion ─────────────────── */
.advanced-settings-wrapper {
  margin-top: 24px;
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
}

.advanced-toggle {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 0;
}

.advanced-toggle span {
  font-size: 10px;
  transition: transform 0.3s;
}

.advanced-toggle.open span {
  transform: rotate(180deg);
}

.advanced-content {
  margin-top: 16px;
  animation: fadeIn 0.4s ease;
}

/* ── Custom Checkboxes ───────────────────────────── */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.custom-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-main);
  user-select: none;
}

.custom-checkbox input {
  display: none;
}

.checkmark {
  width: 20px;
  height: 20px;
  border-radius: 0;
  border: 1px solid var(--border-color);
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.custom-checkbox input:checked ~ .checkmark {
  background: var(--accent-1);
  border-color: var(--accent-1);
}

.custom-checkbox input:checked ~ .checkmark::after {
  content: "✓";
  color: white;
  font-size: 12px;
}

/* ── Visual Selection Cards (Step 2) ─────────────── */
.visual-selection-grid {
  display: grid;
  gap: 32px;
}

.selection-box label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 12px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}

.sel-card {
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: 0;
  padding: 16px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.sel-card:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
}

.sel-card.active {
  border-color: var(--accent-1);
  background: rgba(59, 130, 246, 0.1);
  box-shadow: inset 0 0 0 2px var(--accent-1);
}

/* Indicators inside cards */
.color-dot-blue::before { content:''; display:block; width:12px; height:12px; border-radius:50%; background:#3b82f6; margin:0 auto 8px; }
.color-dot-green::before { content:''; display:block; width:12px; height:12px; border-radius:50%; background:#10b981; margin:0 auto 8px; }
.color-dot-red::before { content:''; display:block; width:12px; height:12px; border-radius:50%; background:#ef4444; margin:0 auto 8px; }
.color-dot-purple::before { content:''; display:block; width:12px; height:12px; border-radius:50%; background:#8b5cf6; margin:0 auto 8px; }

.font-sans { font-family: 'Outfit', sans-serif; }
.font-serif { font-family: 'Georgia', serif; }
.font-mono { font-family: 'Courier New', monospace; }

/* ── Logs & Terminal ─────────────────────────────── */
.terminal-box {
  background: #090c10;
  border: 1px solid #30363d;
  border-radius: 0;
  padding: 16px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px;
  color: #a5b4fc;
  height: 200px;
  overflow-y: auto;
  box-shadow: none;
  margin-top: 24px;
}

.terminal-box.large {
  height: 300px;
}

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 32px 0 16px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(139, 92, 246, 0.2);
  border-top-color: var(--accent-1);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.pulse-text {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-main);
  animation: pulse 1.5s infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ── Results & Success ───────────────────────────── */
.success-title {
  font-size: 20px;
  color: var(--success);
  margin-bottom: 8px;
}

.sub-text {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.iframe-wrap {
  background: #fff;
  border-radius: 12px;
  padding: 4px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

iframe {
  width: 100%;
  height: 400px;
  border: none;
  border-radius: 8px;
}

.success-icon-large {
  font-size: 64px;
  margin-bottom: 16px;
}

.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

.action-buttons-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Final Build Stats ───────────────────────────── */
.build-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stats-badge {
  display: flex;
  gap: 16px;
  background: rgba(0,0,0,0.3);
  padding: 8px 16px;
  border-radius: 100px;
  border: 1px solid var(--border-color);
  font-size: 13px;
}

.stats-badge b { color: var(--text-main); }

.progress-bar {
  height: 8px;
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: 0;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-1);
  transition: width 0.3s ease;
}

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

.step-state {
  animation: fadeIn 0.4s ease forwards;
}

/* ── Share Box ───────────────────────────────────── */
.share-box {
  display: flex;
  gap: 8px;
  max-width: 400px;
  margin: 0 auto;
}

/* ── Modals & Tables (Legacy overrides) ──────────── */
.modal {
  position: fixed;
  top:0; left:0; right:0; bottom:0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.6);
  z-index: 9999;
  backdrop-filter: blur(4px);
}
.modal .modal-content {
  background: #0f172a;
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 40px rgba(0,0,0,0.8);
  padding: 32px;
  width: 100%;
  max-width: 440px;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.modal-header { 
  display: flex; 
  justify-content: space-between; 
  align-items: center;
  margin-bottom: 8px; 
}
.modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
}
.close-btn { background: transparent; border:none; color: var(--text-muted); cursor: pointer; font-size:16px;}
.close-btn:hover { color: var(--error); }

.premium-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}
.premium-table th {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-muted);
  font-weight: 500;
}
.premium-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.3s; }

/* ── SEO Cards & View Toggle ──────────────────────── */
.view-toggle {
  display: flex;
  align-items: center;
}
.view-btn {
  background: #0f172a;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 8px 16px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
}
.view-btn.active {
  background: var(--accent-1);
  color: #fff;
  border-color: var(--accent-1);
}
.view-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

#seoResultsWrap {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
}

.seo-card {
  background: #0f172a;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

.seo-card-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  justify-content: space-between;
  align-items: center;
  word-break: break-all;
}
.seo-card-header.wait { color: var(--text-muted); }
.seo-card-title {
  font-size: 14px;
}

.seo-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
}
.seo-metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.seo-metric-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.seo-metric-value {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-main);
}
.color-green { color: #4ade80; }
.color-red { color: var(--error); }
.color-yellow { color: #facc15; }

.seo-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 16px;
  gap: 16px;
}
.seo-col h4 {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 12px;
  margin-top: 0;
  letter-spacing: 0.5px;
}
.seo-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 13px;
  color: #cbd5e1;
}
.seo-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
  line-height: 1.4;
}
.seo-icon {
  font-size: 12px;
  margin-top: 2px;
}
.seo-icon.check { color: #4ade80; }
.seo-icon.cross { color: var(--error); }

.share-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  margin-left: 12px;
}
.share-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  margin-right: 8px;
}
.badge-wait { background: #334155; color: #cbd5e1; }
