/* ===== CSS Variables ===== */
:root {
  /* Dark Theme (Default) */
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-tertiary: #1a1a25;
  --bg-glass: rgba(26, 26, 37, 0.8);

  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(99, 102, 241, 0.3);

  --text-primary: #f1f1f3;
  --text-secondary: #a0a0b0;
  --text-muted: #6b6b7b;

  --accent-primary: #6366f1;
  --accent-secondary: #8b5cf6;
  --accent-gradient: linear-gradient(135deg, #6366f1, #8b5cf6);

  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.15);

  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
}

/* Light Theme */
[data-theme="light"] {
  --bg-primary: #f8f9fc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #eef1f6;
  --bg-glass: rgba(255, 255, 255, 0.9);

  --border-color: rgba(0, 0, 0, 0.1);
  --border-glow: rgba(99, 102, 241, 0.4);

  --text-primary: #1a1a2e;
  --text-secondary: #4a4a6a;
  --text-muted: #8a8aa0;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.2);
}

/* Theme Toggle Button */
.btn-icon {
  width: 42px;
  height: 42px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  border-color: var(--accent-primary);
}

/* Show/hide theme icons based on current theme */
.theme-icon-light {
  display: none;
}

.theme-icon-dark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.theme-icon-dark svg,
.theme-icon-light svg {
  width: 20px;
  height: 20px;
  stroke: var(--text-primary);
}

[data-theme="light"] .theme-icon-light {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

[data-theme="light"] .theme-icon-dark {
  display: none;
}

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

html {
  touch-action: manipulation;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
}

/* Prevent iOS zoom on input focus (needs 16px+ font) */
input,
textarea,
select {
  font-size: 16px !important;
}

/* ===== App Layout ===== */
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ===== Header ===== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  gap: 16px;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.logo span {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-spacer {
  width: 100px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

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

.btn-primary {
  background: var(--accent-gradient);
  border: none;
  color: white;
}

.btn-primary:hover:not(:disabled) {
  box-shadow: var(--shadow-glow);
}

.btn-small {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-success {
  background: var(--success);
  border: none;
  color: white;
}

.btn-warning {
  background: transparent;
  border: 1px solid var(--warning);
  color: var(--warning);
}

.btn-danger {
  background: transparent;
  border: 1px solid var(--error);
  color: var(--error);
}

.btn-danger:hover:not(:disabled) {
  background: var(--error);
  color: white;
}

.icon {
  font-size: 1.1em;
}

/* ===== Main Layout ===== */
.main {
  display: grid;
  grid-template-columns: 240px 1fr 1fr;
  flex: 1;
  overflow: hidden;
}

/* ===== Sidebar ===== */
.sidebar {
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-header h2 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.json-list {
  list-style: none;
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.json-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  margin-bottom: 4px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.json-list-item:hover {
  background: var(--bg-tertiary);
}

.json-list-item.active {
  background: var(--bg-tertiary);
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-glow);
}

.json-list-item-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.json-list-item-delete {
  opacity: 0;
  padding: 4px 8px;
  font-size: 0.75rem;
  background: transparent;
  border: none;
  color: var(--error);
  cursor: pointer;
  transition: opacity var(--transition-fast);
}

.json-list-item:hover .json-list-item-delete {
  opacity: 1;
}

.sidebar-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
}

.sidebar-empty .hint {
  font-size: 0.8rem;
  margin-top: 8px;
}

.sidebar-empty.hidden {
  display: none;
}

/* Rename Input */
.rename-input {
  width: 100%;
  padding: 4px 8px;
  font-size: 0.875rem;
  font-weight: 500;
  background: var(--bg-primary);
  border: 1px solid var(--accent-primary);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Context Menu */
.context-menu {
  position: fixed;
  min-width: 140px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 1000;
  overflow: hidden;
}

.context-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  font-size: 0.875rem;
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  transition: background var(--transition-fast);
  text-align: left;
}

.context-menu-item:hover {
  background: var(--bg-secondary);
}

.context-menu-item.danger {
  color: var(--error);
}

.context-menu-item.danger:hover {
  background: rgba(239, 68, 68, 0.1);
}

/* ===== Panels ===== */
.panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--border-color);
}

.panel:last-child {
  border-right: none;
}

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

.panel-header h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.panel-actions {
  display: flex;
  gap: 8px;
}

.panel-content {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
}

/* ===== JSON Panel ===== */
.json-editor {
  position: relative;
  flex: 1;
  display: flex;
  overflow: hidden;
  max-width: 100%;
}

.json-input {
  margin: 0;
  padding: 20px;
  font-family: 'Fira Code', 'Monaco', monospace;
  font-size: 0.875rem;
  line-height: 1.6;
  background: transparent !important;
  border: none;
  overflow: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
  box-sizing: border-box;
  flex: 1;
  width: 100%;
  outline: none;
  cursor: text;
}

.json-input:empty::before {
  content: attr(data-placeholder);
  color: var(--text-muted);
}

.json-input code {
  display: block;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  background: transparent !important;
  padding: 0;
  margin: 0;
  white-space: pre-wrap !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
  word-break: break-word !important;
  outline: none;
}

/* Override Prism theme colors for our theme */
.json-input .token.property {
  color: var(--accent-primary);
}

.json-input .token.string {
  color: var(--color-success, #22c55e);
}

.json-input .token.number {
  color: var(--color-warning, #f59e0b);
}

.json-input .token.boolean {
  color: var(--accent-secondary, #a855f7);
}

.json-input .token.null {
  color: var(--color-error, #ef4444);
}

.json-input .token.punctuation {
  color: var(--text-muted);
}

.error-message {
  padding: 12px 20px;
  background: rgba(239, 68, 68, 0.1);
  border-top: 1px solid var(--error);
  color: var(--error);
  font-size: 0.875rem;
  display: none;
}

.error-message.visible {
  display: block;
}

/* ===== Form Panel ===== */
.form-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.form-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  text-align: center;
}

.form-placeholder.hidden {
  display: none;
}

.placeholder-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.3;
}

/* ===== Form Fields ===== */
.form-group {
  margin-bottom: 16px;
  padding-right: 4px;
}

.form-group.nested {
  margin-left: 16px;
  padding-left: 16px;
  border-left: 2px solid var(--border-color);
}

.form-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: capitalize;
}

.form-label .type-badge {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  font-weight: 500;
  text-transform: lowercase;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.875rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

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

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

/* Auto-growing textarea for string fields */
.form-textarea {
  resize: none;
  overflow: hidden;
  min-height: 42px;
  max-height: 42px;
  line-height: 1.5;
  font-family: inherit;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: max-height 0.15s ease;
}

.form-textarea:focus {
  max-height: none;
  white-space: pre-wrap;
  overflow: hidden;
  box-shadow: none;
  outline: 2px solid var(--accent-primary);
  outline-offset: -2px;
}

/* Toggle Switch */
.toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toggle {
  position: relative;
  width: 48px;
  height: 26px;
  background: var(--bg-tertiary);
  border-radius: 13px;
  cursor: pointer;
  transition: background var(--transition-fast);
  border: 1px solid var(--border-color);
}

.toggle.active {
  background: var(--success);
  border-color: var(--success);
}

.toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition-fast);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle.active::after {
  transform: translateX(22px);
}

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

/* Array Fields */
.array-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.array-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
}

.array-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.array-items {
  padding: 12px;
}

.array-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.array-item:last-child {
  margin-bottom: 0;
}

.array-item .form-input {
  flex: 1;
}

.array-item-remove {
  padding: 6px 10px;
  background: transparent;
  border: 1px solid var(--error);
  color: var(--error);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.75rem;
  transition: all var(--transition-fast);
}

.array-item-remove:hover {
  background: var(--error);
  color: white;
}

.array-add {
  width: 100%;
  padding: 8px;
  background: transparent;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  transition: all var(--transition-fast);
  margin-top: 8px;
}

.array-add:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* Object Fields */
.object-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.object-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background var(--transition-fast);
}

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

.object-toggle {
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: transform var(--transition-fast);
}

.object-toggle.collapsed {
  transform: rotate(-90deg);
}

.object-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.object-content {
  padding: 12px;
}

.object-content.collapsed {
  display: none;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 12px 24px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transition: all var(--transition-normal);
  z-index: 1000;
}

.toast.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast.success {
  border-color: var(--success);
  background: var(--success);
  color: white;
}

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

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

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

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

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .main {
    grid-template-columns: 200px 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .app {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .main {
    display: flex;
    flex-direction: column;
    overflow: visible;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    z-index: 1001;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }

  .sidebar-overlay.visible {
    opacity: 1;
    visibility: visible;
  }

  .header {
    padding: 12px 16px;
  }

  .header-left {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .mobile-only {
    display: flex !important;
  }

  .logo {
    font-size: 1.25rem;
  }

  .panel {
    overflow: visible;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }

  .panel-content {
    overflow: visible;
  }

  .json-panel .panel-content {
    min-height: 150px;
    max-height: 200px;
  }

  .json-input {
    min-height: 120px;
    max-height: 180px;
  }

  .form-panel {
    flex: none;
  }

  .form-panel .panel-header {
    flex-wrap: nowrap;
    gap: 8px;
  }

  .form-panel .panel-header h2 {
    flex-shrink: 0;
  }

  .form-panel .panel-header .btn-group {
    display: flex;
    gap: 4px;
    flex-wrap: nowrap;
  }

  .form-panel .panel-header .btn-group .btn {
    padding: 6px 8px;
    font-size: 0.75rem;
  }

  .form-panel .panel-header .btn-group .btn svg {
    display: none;
  }

  /* Hide icons in Form View panel-actions on mobile */
  .panel-actions .btn svg,
  .panel-actions .btn [data-lucide] {
    display: none;
  }

  .form-container {
    overflow: visible;
    min-height: 200px;
  }
}

/* Hide mobile-only elements on desktop */
@media (min-width: 769px) {
  .mobile-only {
    display: none !important;
  }
}

/* Header left group */
.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Sidebar overlay hidden by default on desktop */
.sidebar-overlay {
  display: none;
}

@media (max-width: 768px) {
  .sidebar-overlay {
    display: block;
  }

  .mobile-only {
    display: flex !important;
  }
}

/* ===== About Page Styles ===== */
.about-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.about-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.about-header .logo {
  text-decoration: none;
}

/* Hero Section */
.hero {
  padding: 80px 40px;
  background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
  text-align: center;
}

.hero-content {
  max-width: 700px;
  margin: 0 auto 60px;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 24px;
  color: var(--text-primary);
}

.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 40px;
}

.btn-large {
  padding: 16px 32px;
  font-size: 1rem;
}

/* Hero Visual */
.hero-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.code-block,
.form-preview {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  width: 280px;
  text-align: left;
  box-shadow: var(--shadow-md);
}

.code-header,
.form-preview-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot.red {
  background: #ff5f56;
}

.dot.yellow {
  background: #ffbd2e;
}

.dot.green {
  background: #27ca40;
}

.code-title {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: auto;
}

.code-content {
  padding: 16px;
  font-family: 'Fira Code', 'Monaco', monospace;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--text-primary);
  margin: 0;
}

.arrow {
  font-size: 2rem;
  color: var(--accent-primary);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 0.5;
    transform: translateX(0);
  }

  50% {
    opacity: 1;
    transform: translateX(5px);
  }
}

.form-preview-content {
  padding: 16px;
}

.preview-field {
  margin-bottom: 12px;
}

.preview-field:last-child {
  margin-bottom: 0;
}

.preview-field label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.preview-field input {
  width: 100%;
  padding: 8px 12px;
  font-size: 0.8rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
}

.preview-toggle {
  width: 40px;
  height: 22px;
  background: var(--bg-secondary);
  border-radius: 11px;
  border: 1px solid var(--border-color);
  position: relative;
}

.preview-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
}

.preview-toggle.active {
  background: var(--success);
  border-color: var(--success);
}

.preview-toggle.active::after {
  transform: translateX(18px);
}

/* Sections */
.section {
  padding: 80px 40px;
  max-width: 1200px;
  margin: 0 auto;
}

.section h2 {
  font-size: 2.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 48px;
  color: var(--text-primary);
}

/* Problem & Solution Cards */
.problem-grid,
.solution-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.problem-card,
.solution-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  transition: all var(--transition-normal);
}

.problem-card:hover,
.solution-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
  border-color: var(--accent-primary);
}

.problem-icon,
.solution-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.problem-card h3,
.solution-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.problem-card p,
.solution-card p {
  color: var(--text-secondary);
  line-height: 1.6;
}

.problem-section {
  background: linear-gradient(180deg, var(--bg-primary) 0%, rgba(239, 68, 68, 0.03) 100%);
}

.solution-section {
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.03) 0%, var(--bg-primary) 100%);
}

/* Use Cases */
.use-cases-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.use-case-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: all var(--transition-normal);
}

.use-case-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
  border-color: var(--accent-primary);
}

.use-case-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.use-case-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.use-case-card p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
}

.use-case-example {
  padding: 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.use-case-example strong {
  color: var(--accent-primary);
}

/* How It Works */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.step-card {
  text-align: center;
  position: relative;
}

.step-number {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--accent-gradient);
  color: white;
  border-radius: 50%;
}

.step-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.step-card p {
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.feature {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

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

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

.feature-text {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* CTA Section */
.cta-section {
  text-align: center;
  padding: 100px 40px;
  background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.cta-section p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

/* Footer */
.footer {
  padding: 24px 40px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-logo {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.footer-logo span {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer-separator {
  color: var(--text-muted);
}

.footer-year {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color var(--transition-fast);
}

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

/* About Page Responsive */
@media (max-width: 1024px) {

  .use-cases-grid,
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .about-header {
    padding: 16px 20px;
  }

  .hero {
    padding: 60px 20px;
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .hero-visual {
    flex-direction: column;
  }

  .arrow {
    transform: rotate(90deg);
  }

  .section {
    padding: 60px 20px;
  }

  .section h2 {
    font-size: 2rem;
  }

  .problem-grid,
  .solution-grid,
  .steps-grid {
    grid-template-columns: 1fr;
  }

  .use-cases-grid,
  .features-grid {
    grid-template-columns: 1fr;
  }

  .footer {
    padding: 20px;
  }

  .footer-content {
    gap: 8px;
  }

  .seo-content {
    padding: 40px 20px;
  }

  .seo-content h2 {
    font-size: 1.25rem;
  }

  .seo-steps {
    gap: 24px;
  }
}

/* ===== SEO Content Section ===== */
.seo-content {
  padding: 60px 40px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.seo-content h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.seo-content>p {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 40px;
  line-height: 1.6;
}

.seo-steps {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
  max-width: 900px;
  margin: 0 auto;
}

.seo-step {
  flex: 1;
  min-width: 200px;
  max-width: 280px;
  text-align: left;
}

.seo-step strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.seo-step p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* SEO Use Cases Collapsible */
.seo-use-cases {
  margin-top: 40px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}

.seo-use-cases summary {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.seo-use-cases summary::-webkit-details-marker {
  display: none;
}

.seo-use-cases summary::after {
  content: '▼';
  font-size: 0.7rem;
  transition: transform var(--transition-fast);
}

.seo-use-cases[open] summary::after {
  transform: rotate(180deg);
}

.seo-use-cases summary:hover {
  border-color: var(--accent-primary);
  background: var(--bg-primary);
}

.use-cases-list {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.use-case-item {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
  padding: 8px 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  text-decoration: none;
  display: block;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.use-case-item:hover {
  background: var(--bg-primary);
}

.use-case-item span {
  margin-right: 6px;
}

.use-case-item strong {
  color: var(--text-primary);
}

/* ===== Fix JSON Modal ===== */
.fix-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  transition: opacity 200ms ease;
  padding: 20px;
}

.fix-modal-overlay.visible {
  opacity: 1;
}

.fix-modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-md);
  transform: scale(0.95);
  transition: transform 200ms ease;
}

.fix-modal-overlay.visible .fix-modal {
  transform: scale(1);
}

.fix-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-color);
}

.fix-modal-icon {
  font-size: 1.5rem;
}

.fix-modal-header h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.fix-modal-body {
  padding: 20px 24px;
}

.fix-modal-error {
  font-size: 0.8rem;
  color: var(--error);
  background: rgba(239, 68, 68, 0.1);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-family: 'Fira Code', monospace;
  word-break: break-word;
}

.fix-modal-message {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.5;
}

.fix-modal-warning {
  font-size: 0.85rem;
  color: var(--warning);
  margin: 0;
}

.fix-modal-actions {
  display: flex;
  gap: 12px;
  padding: 16px 24px 20px;
  justify-content: flex-end;
}

.fix-modal-cancel {
  padding: 10px 20px;
}

.fix-modal-confirm {
  padding: 10px 20px;
}

/* ===== Lucide Icons ===== */
.lucide-icon,
[data-lucide] {
  width: 1em;
  height: 1em;
  stroke-width: 2;
  vertical-align: middle;
}

.btn .lucide-icon,
.btn [data-lucide] {
  width: 1.1em;
  height: 1.1em;
  margin-right: 4px;
}

/* Problem, Solution, Use Case icons - larger */
.problem-icon [data-lucide],
.solution-icon [data-lucide],
.use-case-icon [data-lucide] {
  width: 2.5rem;
  height: 2.5rem;
  stroke-width: 1.5;
  color: var(--accent-primary);
}

/* Feature icons */
.feature-icon [data-lucide] {
  width: 1.25rem;
  height: 1.25rem;
  stroke-width: 2;
}

/* ===== Use Case Pages ===== */
.use-case-page {
  min-height: 100vh;
  background: var(--bg-primary);
}

/* Breadcrumb */
.breadcrumb {
  padding: 16px 40px;
  font-size: 0.875rem;
  color: var(--text-muted);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.breadcrumb a:hover {
  color: var(--accent-primary);
}

.breadcrumb .separator {
  margin: 0 8px;
  color: var(--text-muted);
}

.breadcrumb .current {
  color: var(--text-primary);
}

/* Use Case Hero */
.use-case-hero {
  padding: 80px 40px;
  text-align: center;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.use-case-icon-large {
  margin-bottom: 24px;
}

.use-case-icon-large [data-lucide] {
  width: 4rem;
  height: 4rem;
  color: var(--accent-primary);
  stroke-width: 1.5;
}

.use-case-hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.use-case-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto 32px;
  line-height: 1.7;
}

/* Challenge Section */
.challenge-content {
  max-width: 800px;
  margin: 0 auto;
}

.challenge-content p {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 24px;
}

.challenge-content code {
  background: var(--bg-tertiary);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: 'Fira Code', monospace;
  font-size: 0.9em;
  color: var(--accent-primary);
}

.pain-points {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pain-point {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.pain-point [data-lucide] {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--error);
  flex-shrink: 0;
}

/* Example Section */
.example-section {
  background: var(--bg-primary);
}

.section-intro {
  text-align: center;
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 40px;
}

.example-comparison {
  display: flex;
  align-items: stretch;
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto;
}

.example-json,
.example-form {
  flex: 1;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.example-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
}

.example-header .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.example-header .dot.red {
  background: #ff5f57;
}

.example-header .dot.yellow {
  background: #febc2e;
}

.example-header .dot.green {
  background: #28c840;
}

.example-title {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: 8px;
}

.example-code {
  padding: 20px;
  font-family: 'Fira Code', monospace;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--text-primary);
  overflow-x: auto;
  margin: 0;
}

.example-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  flex-shrink: 0;
}

.example-arrow [data-lucide] {
  width: 2rem;
  height: 2rem;
  color: var(--accent-primary);
}

.example-form-content {
  padding: 16px;
}

.form-group-preview {
  margin-bottom: 16px;
  padding: 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

.form-group-preview:last-child {
  margin-bottom: 0;
}

.group-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.field-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.field-preview:last-child {
  margin-bottom: 0;
}

.field-preview label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  width: 100px;
  flex-shrink: 0;
}

.field-preview input {
  flex: 1;
  padding: 8px 12px;
  font-size: 0.85rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
}

.field-preview.toggle-field {
  justify-content: flex-start;
}

.preview-toggle {
  width: 40px;
  height: 22px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 11px;
  position: relative;
  transition: all var(--transition-fast);
}

.preview-toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: all var(--transition-fast);
}

.preview-toggle.active {
  background: var(--success);
  border-color: var(--success);
}

.preview-toggle.active::after {
  background: white;
  transform: translateX(18px);
}

/* Steps Section */
.steps-section {
  background: var(--bg-secondary);
}

/* Benefits Section */
.benefits-section {
  background: var(--bg-primary);
}

.benefits-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  max-width: 1000px;
  margin: 0 auto;
}

.benefit-card {
  text-align: center;
  padding: 32px 24px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  transition: all var(--transition-fast);
}

.benefit-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-glow);
}

.benefit-card [data-lucide] {
  width: 2.5rem;
  height: 2.5rem;
  color: var(--accent-primary);
  margin-bottom: 16px;
}

.benefit-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.benefit-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Use Case Page Responsive */
@media (max-width: 1024px) {
  .benefits-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .breadcrumb {
    padding: 12px 20px;
    font-size: 0.8rem;
  }

  .use-case-hero {
    padding: 60px 20px;
  }

  .use-case-hero h1 {
    font-size: 1.75rem;
  }

  .use-case-subtitle {
    font-size: 1rem;
  }

  .example-comparison {
    flex-direction: column;
  }

  .example-arrow {
    width: 100%;
    padding: 16px 0;
    transform: rotate(90deg);
  }

  .benefits-grid {
    grid-template-columns: 1fr;
  }

  .field-preview {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .field-preview label {
    width: auto;
  }

  .field-preview input {
    width: 100%;
  }
}

/* Use Case Card Links */
.use-case-link {
  text-decoration: none;
  display: block;
}

.use-case-link .use-case-cta {
  display: block;
  margin-top: 16px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent-primary);
  opacity: 0;
  transform: translateY(8px);
  transition: all var(--transition-fast);
}

.use-case-link:hover .use-case-cta {
  opacity: 1;
  transform: translateY(0);
}

.use-case-link:hover {
  transform: translateY(-6px);
}