/* Deep-link JSON preview enhancements */
body.deep-link .json-code-block {
  background: #0f172a;
  color: #e5e7eb;
  padding: 16px;
  border-radius: 8px;
}

@media (max-width: 600px) {
  #shareArea {
    flex-direction: row;
    gap: 8px;
  }
  #qrcode {
    width: 96px;
    height: 96px;
  }
}
/* ======= MODERN SAAS AI DESIGN SYSTEM ======= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  /* Pure Monochrome Palette - SaaS AI Style */
  --color-white: #fff;
  --color-black: #111;
  --gray-50: #f8f8f8;
  --gray-100: #ececec;
  --gray-200: #e0e0e0;
  --gray-300: #cccccc;
  --gray-400: #b3b3b3;
  --gray-500: #999999;
  --gray-600: #666666;
  --gray-700: #444444;
  --gray-800: #222222;
  --gray-900: #111111;

  --brand-primary: var(--gray-900);
  --brand-primary-fg: var(--color-white);
  --brand-secondary: var(--color-white);
  --brand-secondary-fg: var(--gray-700);

  --bg-body: var(--gray-50);
  --bg-surface: var(--color-white);
  --bg-surface-hover: var(--gray-100);
  --bg-glass: rgba(255,255,255,0.85);

  /* Template Library Colors */
  --template-card-bg: var(--color-white);
  --template-card-border: var(--gray-200);
  --template-card-hover: var(--gray-50);
  --template-tag-bg: var(--gray-100);
  --template-tag-fg: var(--gray-700);
  --bg-input: var(--color-white);

  --text-primary: var(--gray-900);
  --text-secondary: var(--gray-600);
  --text-tertiary: var(--gray-400);

  --border-subtle: var(--gray-200);
  --border-strong: var(--gray-300);
  --border-focus: var(--gray-900);

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --header-height: 56px;
  --container-width: 1200px;
  --sidebar-width: 260px;

  --shadow-xs: 0 1px 2px 0 rgba(17,17,17,0.04);
  --shadow-sm: 0 2px 8px rgba(17,17,17,0.04);
  --shadow-md: 0 4px 16px rgba(17,17,17,0.08);
  --shadow-lg: 0 8px 24px rgba(17,17,17,0.12);
  --shadow-focus: 0 0 0 2px var(--bg-body), 0 0 0 4px var(--gray-200);
  /* Alias for legacy inline usages */
  --bg-hover: var(--bg-surface-hover);
  letter-spacing: -0.01em;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-primary);
  background: var(--bg-body);
  margin: 0;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1 {
  font-size: 20px;
}

h2 {
  font-size: 18px;
}

h3 {
  font-size: 16px;
}

h4 {
  font-size: 14px;
  background: var(--brand-primary);
  color: var(--brand-primary-fg);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.brand-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
}

.brand-sub {
  display: none;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Fade-in utility (used on dashboard-layout) */
.fade-in {
  animation: fadeIn 0.5s ease forwards;
  opacity: 0;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Sidebar list container placeholder */
.sidebar-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Floating popup menu override (library-injected element) */
#vtPopupMenu {
  position: fixed !important;
  top: calc(var(--header-height) + 8px);
  right: 24px;
  z-index: 300;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  box-shadow: var(--shadow-md);
  min-width: 240px;
  font-size: 13px;
}

#vtPopupMenu.hidden, #vtPopupMenu[aria-hidden="true"] { display: none !important; }

#vtPopupMenu button, #vtPopupMenu .action-item {
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}

#vtPopupMenu button:hover, #vtPopupMenu .action-item:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

/* ======= DASHBOARD LAYOUT ======= */
.dashboard-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr 260px;
  gap: 24px;
  max-width: var(--container-width);
  margin: 24px auto;
  padding: 0 20px;
  align-items: start;
}

/* Minimal deep-link view: only JSON card */
/* Deep-link minimal mode hard hide: only render the JSON/card */
body.deep-link .topbar,
body.deep-link .hero-section,
body.deep-link #dashboardView,
body.deep-link .dashboard-layout,
body.deep-link .dashboard-sidebar,
body.deep-link .dashboard-main,
body.deep-link .dashboard-right-sidebar,
body.deep-link .generator-actions,
body.deep-link #status { display: none !important; }

body.deep-link main { padding: 24px; }
body.deep-link .json-preview-container { box-shadow: var(--shadow-md); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); overflow: hidden; max-width: 800px; margin: 32px auto; display: block; }
body.deep-link .json-header { padding: 12px; border-bottom: 1px solid var(--border-subtle); background: var(--bg-surface); }
body.deep-link .json-code-block { background: #0f172a; color: #e5e7eb; }

  #shareArea {
    flex-direction: row;
    gap: 8px;
  }
  #qrcode { width: 96px; height: 96px; }
   

@media (max-width: 768px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
  }
  /* Mobile sidebar: hidden by default, toggled with .open */
  .dashboard-sidebar {
    display: none;
    position: fixed;
    left: 0;
    top: var(--header-height);
    width: 80%;
    max-width: 300px;
    height: calc(100vh - var(--header-height));
    overflow-y: auto;
    z-index: 400;
    box-shadow: var(--shadow-lg);
  }
  .dashboard-sidebar.open { display: block; }
  #sidebarToggle { display: inline-flex !important; }
}

/* Desktop: hide toggle button */
#sidebarToggle { display: none; }

.dashboard-main {
  min-width: 0;
}

.dashboard-sidebar,
.dashboard-right-sidebar {
  position: sticky;
  top: calc(var(--header-height) + 24px);
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-md);
  padding: 16px;
  border: 1px solid var(--border-subtle);
}

/* Sidebar Styling */
.sidebar-section {
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: visible;
  margin-bottom: 20px;
  box-shadow: none;
}

.sidebar-section summary {
  padding: 10px 0;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  cursor: pointer;
  background: transparent;
  border-bottom: 1px solid var(--border-subtle);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.sidebar-content {
  padding: 0;
}

/* Main Card Styling */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

/* ======= BUTTONS ======= */
button {
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
}

.primary {
  background: var(--gray-900);
  color: var(--color-white);
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 15px;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

/* Secondary button for Quick Mode */
.btn-secondary {
  background: #f3f4f6;
  color: #111827;
  border: 1px solid #e5e7eb;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
}
.btn-secondary:hover {
  background: #e5e7eb;
}

/* Template card actions row */
.template-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.primary:hover {
  background: var(--gray-700);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.primary:active {
  transform: scale(0.98);
}

.ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: all 0.2s;
}

.ghost:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

/* ======= GENERATOR UI ======= */
.generator-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.generator-header-flush {
  background: var(--bg-surface);
  padding: 0;
  border-bottom: 1px solid var(--border-subtle);
  margin: 0;
  display: block;
}

.mode-tabs {
  display: flex;
  width: 100%;
}

.mode-tab {
  flex: 1;
  padding: 16px;
  border: none;
  background: transparent;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 13px;
}

.mode-tab:hover {
  color: var(--text-primary);
  background: var(--bg-surface-hover);
}

.mode-tab.active {
  border-bottom-color: var(--text-primary);
  font-weight: 600;
  color: var(--text-primary);
}

.mode-selector {
  display: flex;
  background: var(--bg-body);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.mode-btn {
  padding: 4px 12px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 4px;
  font-weight: 500;
  font-size: 12px;
  transition: all 0.2s;
}

.mode-btn.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-xs);
  font-weight: 600;
}

/* Category Buttons */
.category-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.category-btn {
  padding: 6px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 12px;
  transition: all 0.2s;
}

.category-btn:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

.category-btn.active {
  background: var(--text-primary);
  color: var(--bg-surface);
  border-color: var(--text-primary);
}

/* Segmented Control */
.category-segmented-control {
  display: flex;
  background: var(--gray-100);
  padding: 4px;
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  gap: 4px;
}
.category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.category-grid-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
}
.category-grid-summary:hover {
  color: var(--text-primary);
}
.category-grid-summary .summary-hint {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-tertiary);
}

.category-card {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
  transition: all .2s ease;
}
.category-card:hover {
  background: var(--bg-surface-hover);
  border-color: var(--gray-700);
  transform: translateY(-1px);
}
.category-card .cat-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.category-card .cat-icon { font-size: 18px; }
.category-card .cat-title { font-weight: 600; color: var(--text-primary); }
.category-card .cat-badge {
  margin-left: auto;
  font-size: 11px;
  color: #0ea5e9;
  background: rgba(14,165,233,.12);
  padding: 2px 6px;
  border-radius: 999px;
}
.category-card .cat-desc {
  font-size: 12px;
  color: var(--text-secondary);
}

.segment-btn {
  flex: 1;
  background: transparent;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.segment-btn:hover {
  color: var(--text-primary);
  background: var(--bg-surface-hover);
}

.segment-btn.active {
  background: var(--gray-900);
  color: var(--color-white);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

/* Inputs & Textareas */
input[type="text"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  transition: all 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--border-focus);
  background: var(--bg-surface);
  box-shadow: var(--shadow-focus);
}

label.small {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* File Upload */
.file-drop-zone {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--bg-body);
}

.file-drop-zone:hover {
  border-color: var(--text-primary);
  background: var(--bg-surface-hover);
}

/* Result Area */
.result {
  background: #09090b;
  color: #f8fafc;
  padding: 16px;
  border-radius: var(--radius-md);
  font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.5;
  overflow-x: auto;
  margin-top: 24px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  position: relative;
}

/* ======= FOOTER ======= */
.footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 32px 0 24px;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  max-width: var(--container-width);
  margin: 0 auto 32px;
  padding: 0 20px;
}

.footer-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 8px;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s;
}

.card-flush {
  padding: 0 !important;
  overflow: hidden;
}

/* Toast */
#toastContainer {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--bg-body) 25%, var(--border-subtle) 50%, var(--bg-body) 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

.modal-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.modal-content {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 600px;
  transform: scale(1);
  transition: transform 0.3s ease;
  position: relative;
}

.modal-overlay.hidden .modal-content {
  transform: scale(0.95);
}

/* Strong fallback in case original modal styles are not applied due to load/order issues */
#jsonModal.modal-overlay, #shareModal.modal-overlay, #recentPromptsModal.modal-overlay {
  position: fixed !important;
  inset: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 1000 !important;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Template Card Hover Effects */
.template-card {
  transition: all 0.2s ease;
}

.template-card:hover {
  border-color: var(--gray-700) !important;
  background: var(--bg-surface-hover) !important;
  transform: scale(1.01);
}

.template-card.active {
  border-color: var(--text-primary) !important;
  background: var(--text-primary) !important;
}

.template-card.active div {
  color: var(--bg-surface) !important;
}

.template-card.active .muted {
  color: var(--gray-400) !important;
}

/* Template Grid Styling */
.template-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 4px;
}

.template-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}

.template-item:hover {
  border-color: var(--gray-700);
  background: var(--bg-surface-hover);
  transform: scale(1.02);
  box-shadow: var(--shadow-sm);
}

.template-icon {
  font-size: 20px;
}

.template-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-primary);
}

/* Recent Prompts Styling */
.recent-prompt-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.recent-prompt-card:hover {
  border-color: var(--gray-700);
  background: var(--bg-surface-hover);
  transform: scale(1.02);
  box-shadow: var(--shadow-sm);
}

.recent-prompt-text {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.4;
}

.recent-prompt-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: var(--text-secondary);
}

.recent-prompt-tag {
  background: var(--gray-100);
  color: var(--gray-700);
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
}

/* History Items (Sidebar & Modal) */
.history-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.history-item:hover {
  border-color: var(--gray-700);
  background: var(--bg-surface-hover);
  transform: translateX(2px);
}

.history-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 11px;
}

.history-category-badge {
  background: var(--gray-100);
  color: var(--gray-700);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.history-time {
  color: var(--text-secondary);
  font-size: 10px;
}

.history-item-text {
  font-size: 12px;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.4;
}

.history-item-actions {
  display: flex;
  gap: 8px;
}

.history-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-secondary);
}

.history-btn:hover {
  border-color: var(--gray-700);
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

/* Badges */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.badge-outline {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

/* ======= WIZARD ======= */
.wizard-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.wizard-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wizard-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.wizard-progress {
  height: 4px;
  background: var(--bg-body);
  border-radius: 2px;
  overflow: hidden;
}

.wizard-progress-bar {
  height: 100%;
  background: var(--text-primary);
  transition: width 0.3s ease;
}

.wizard-steps-indicator {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
  text-align: right;
}

.wizard-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.wizard-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wizard-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
}

.wizard-label .required {
  color: #ef4444;
  margin-left: 2px;
}

.wizard-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
  margin-top: 8px;
}

/* Wizard Inputs */
.wizard-input,
.wizard-textarea,
.wizard-select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 13px;
  transition: all 0.2s;
}

.wizard-input:focus,
.wizard-textarea:focus,
.wizard-select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: var(--shadow-focus);
}

/* Checkbox & Radio */
.wizard-field-checkbox {
  flex-direction: row;
  align-items: center;
}

.wizard-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
}

.wizard-radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wizard-radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
}

/* Range */
.wizard-range {
  width: 100%;
  accent-color: var(--text-primary);
}

.wizard-range-value {
  font-size: 11px;
  color: var(--text-secondary);
  background: var(--bg-body);
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 8px;
}

/* ======= QUALITY SCORE ======= */
.quality-score-card {
  margin-top: 24px;
  padding: 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.score-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.score-value {
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
}

.score-label {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
}

.score-sub {
  font-size: 11px;
  color: var(--text-secondary);
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.score-item {
  padding: 12px;
  background: var(--bg-body);
  border-radius: var(--radius-sm);
  text-align: center;
  border: 1px solid var(--border-subtle);
}

.score-item-value {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.score-item-label {
  font-size: 10px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.recommendation-box {
  padding: 16px;
  background: var(--bg-body);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.recommendation-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.recommendation-list {
  margin: 0;
  padding-left: 20px;
  font-size: 12px;
  color: var(--text-secondary);
}

.recommendation-list li {
  margin-bottom: 4px;
}

/* ======= JSON PREVIEW ======= */
.json-preview-container {
  margin-top: 24px;
  max-width: 100%;
}

.json-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.json-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.copy-btn-mini {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.copy-btn-mini:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

.json-code-block {
  background: var(--bg-body);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  margin: 0;
  font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-primary);
  transition: all 0.2s;
  overflow-x: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  max-width: 100%;
}

/* Utility Classes */
.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ======= TOP BAR ======= */
.topbar {
  height: var(--header-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
}

.topbar-row {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-inline {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 32px;
  height: 32px;
  background: var(--brand-primary);
  color: var(--brand-primary-fg);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
}

/* ======= HERO SECTION ======= */
.hero-section {
  text-align: center;
  padding: 48px 20px 32px;
  max-width: 600px;
  margin: 0 auto;
}

.hero-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.hero-section .muted,
.hero-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
}

.hero-feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border-color: rgba(79, 70, 229, 0.3);
}

.muted {
  color: var(--text-secondary);
}

/* ======= ANIMATIONS & MICRO-INTERACTIONS ======= */

/* Modal Overlay - Simple hidden state */
.modal-overlay.hidden {
  display: none !important;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { transform: translateX(-20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@keyframes ripple {
  0% { transform: scale(0); opacity: 0.6; }
  100% { transform: scale(2); opacity: 0; }
}

/* Fade-in utility */
.fade-in {
  animation: fadeIn 0.4s ease-out;
}

/* Smooth transitions for all interactive elements */
button,
a,
input,
textarea,
select,
.template-card,
.history-item,
.badge {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover lift effect */
.template-card:hover,
.history-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Button ripple effect */
button {
  position: relative;
  overflow: hidden;
}

button::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transform: translate(-50%, -50%);
  transition: width 0.4s, height 0.4s;
}

button:active::after {
  width: 200px;
  height: 200px;
}

/* Focus states with smooth ring */
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

/* Loading pulse */
.skeleton {
  background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
  background-size: 200% 100%;
  animation: pulse 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

/* Smooth page transitions */
.wizard-container,
.modal-content {
  animation: fadeIn 0.3s ease-out;
}

/* Stagger animation for lists */
.history-item:nth-child(1) { animation-delay: 0.05s; }
.history-item:nth-child(2) { animation-delay: 0.1s; }
.history-item:nth-child(3) { animation-delay: 0.15s; }
.history-item:nth-child(4) { animation-delay: 0.2s; }
.history-item:nth-child(5) { animation-delay: 0.25s; }

/* Badge pulse for new items */
.badge-new {
  position: relative;
}

.badge-new::before {
  content: '';
  position: absolute;
  top: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

/* Smooth scroll */
html {
  scroll-behavior: smooth;
}

/* ======= SOCIAL SHARING BADGE ======= */
.made-with-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  font-size: 11px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.made-with-badge:hover {
  border-color: var(--gray-400);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.made-with-badge svg {
  width: 12px;
  height: 12px;
}

/* ======= QR CODE MODAL ======= */
#qrModal .modal-content {
  text-align: center;
  max-width: 360px;
}

#qrCodeContainer {
  display: flex;
  justify-content: center;
  margin: 20px 0;
  padding: 16px;
  background: var(--color-white);
  border-radius: var(--radius-sm);
}

#qrCodeContainer canvas {
  border-radius: 8px;
}

.qr-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
}

/* ======= SHARE PROMPT ENHANCEMENTS ======= */
.share-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.share-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.share-option:hover {
  background: var(--bg-surface-hover);
  border-color: var(--gray-400);
  transform: translateX(4px);
}

.share-option svg {
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
}

.share-option-text {
  flex: 1;
}

.share-option-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
}

.share-option-desc {
  font-size: 11px;
  color: var(--text-secondary);
}

/* ======= INTERACTIVE VIDEO DESIGNER ACTIONS ======= */
.video-action-btn {
  transition: all 0.2s ease;
}

.video-action-btn.active {
  background: var(--gray-900) !important;
  color: var(--color-white) !important;
  border-color: var(--gray-900) !important;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(17, 17, 17, 0.15);
}

.video-action-btn.active:hover {
  background: var(--gray-800) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(17, 17, 17, 0.2);
}

/* ======= TEMPLATE LIBRARY STYLES ======= */

/* Sidebar Quick Access Buttons */
.sidebar-item:hover {
  background: var(--bg-surface-hover) !important;
  transform: translateX(4px);
}

.template-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 20px;
  background: var(--bg-surface);
  border-radius: 12px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 180px;
}

.filter-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

#templateSearch {
  padding: 10px 14px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s;
}

#templateSearch:focus {
  outline: none;
  border-color: var(--gray-900);
  box-shadow: 0 0 0 3px rgba(17,17,17,0.1);
}

#templateCategoryFilter,
#templateDifficultyFilter,
#templateSortFilter {
  padding: 10px 14px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-size: 14px;
  background: var(--color-white);
  cursor: pointer;
  transition: all 0.2s;
}

#templateCategoryFilter:hover,
#templateDifficultyFilter:hover,
#templateSortFilter:hover {
  border-color: var(--gray-400);
}

#btnResetFilters {
  align-self: flex-end;
  padding: 10px 20px;
  background: var(--gray-100);
  color: var(--gray-700);
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

#btnResetFilters:hover {
  background: var(--gray-200);
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.template-card {
  background: var(--template-card-bg);
  border: 1px solid var(--template-card-border);
  border-radius: 12px;
  padding: 20px;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}

.template-card:hover {
  background: var(--template-card-hover);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  transform: translateY(-4px);
  border-color: var(--gray-300);
}

.template-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.template-icon {
  font-size: 32px;
}

.template-badge {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 600;
}

.template-badge.featured {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: var(--color-white);
}

.template-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.template-description {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
  flex-grow: 1;
}

.template-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--gray-200);
}

.template-category,
.template-difficulty,
.template-popularity {
  padding: 4px 10px;
  background: var(--template-tag-bg);
  border-radius: 6px;
  font-weight: 600;
}

.template-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.template-tags .tag {
  font-size: 11px;
  padding: 4px 8px;
  background: var(--gray-100);
  color: var(--gray-600);
  border-radius: 4px;
}

.btn-use-template {
  padding: 12px;
  background: var(--gray-900);
  color: var(--color-white);
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 8px;
}

.btn-use-template:hover {
  background: var(--gray-800);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(17,17,17,0.2);
}

.no-templates {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.no-templates p {
  font-size: 16px;
  margin: 0;
}

.featured-section {
  margin: 40px 0;
}

.featured-section h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.template-grid.featured {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* Responsive */
@media (max-width: 768px) {
  .template-filters {
    flex-direction: column;
  }
  
  .filter-group {
    width: 100%;
  }
  
  .template-grid {
    grid-template-columns: 1fr;
  }
  
  #btnResetFilters {
    width: 100%;
  }
}
