* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #1a1a2e; --panel-bg: #16213e; --header-bg: #0f3460;
  --accent: #1abc9c; --accent-hover: #16a085; --text: #e0e0e0;
  --text-muted: #888; --border: #0f3460; --input-bg: #1a1a2e;
  --modal-bg: #16213e; --diff-add: rgba(26,188,156,0.2);
  --diff-remove: rgba(231,76,60,0.2); --tree-line: #0f3460;
  --tab-bg: #0d2137; --tab-active: #16213e;
}
body.light {
  --bg: #ffffff; --panel-bg: #ffffff; --header-bg: #f0f0f0;
  --accent: #000000; --accent-hover: #333333; --text: #000000;
  --text-muted: #555555; --border: #d0d0d0; --input-bg: #ffffff;
  --modal-bg: #ffffff; --diff-add: rgba(0,0,0,0.08);
  --diff-remove: rgba(0,0,0,0.15); --tree-line: #cccccc;
  --tab-bg: #f0f0f0; --tab-active: #ffffff;
}
body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; transition: background .3s, color .3s; }

/* SVG Icons */
.icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.icon-lg { width: 22px; height: 22px; }
.icon-sm { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }

/* Header */
header { background: linear-gradient(135deg, #16a085, #1abc9c); padding: 10px 24px; display: flex; justify-content: center; align-items: center; position: relative; }
body.light header { background: linear-gradient(135deg, #222222, #000000); }
header h1 { font-size: 1.2rem; color: #fff; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.header-actions { position: absolute; right: 24px; display: flex; gap: 8px; }
.header-actions button { background: rgba(255,255,255,.15); border: none; color: #fff; padding: 6px 8px; border-radius: 6px; cursor: pointer; display: flex; align-items: center; }
.header-actions button:hover { background: rgba(255,255,255,.3); }

main { padding: 10px 14px; max-width: 1500px; margin: 0 auto; }
.stats-bar { display: flex; gap: 18px; padding: 6px 14px; background: var(--panel-bg); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 10px; font-size: .78rem; color: var(--text-muted); flex-wrap: wrap; }

/* Panels */
.panels { display: grid; grid-template-columns: 1fr 190px 1fr; gap: 10px; height: calc(100vh - 160px); }
.panel { display: flex; flex-direction: column; background: var(--panel-bg); border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.panel-header { display: flex; justify-content: space-between; align-items: center; padding: 7px 12px; background: var(--header-bg); font-weight: 600; font-size: .82rem; flex-shrink: 0; }
.panel-actions { display: flex; gap: 4px; }
.panel-header button { background: none; border: 1px solid rgba(255,255,255,.15); color: var(--text); padding: 3px 6px; border-radius: 4px; cursor: pointer; display: flex; align-items: center; }
body.light .panel-header button { border-color: rgba(0,0,0,.15); }
.panel-header button:hover { background: rgba(255,255,255,.1); }

/* Tabs */
.tab-bar { display: flex; align-items: center; background: var(--tab-bg); flex-shrink: 0; overflow: hidden; }
.tab-list { display: flex; flex: 1; overflow-x: auto; scrollbar-width: none; }
.tab-list::-webkit-scrollbar { display: none; }
.tab-item { display: flex; align-items: center; gap: 6px; padding: 6px 14px; font-size: .78rem; cursor: pointer; white-space: nowrap; border-right: 1px solid var(--border); color: var(--text-muted); transition: background .15s; user-select: none; }
.tab-item:hover { background: rgba(255,255,255,.05); }
.tab-item.active { background: var(--tab-active); color: var(--accent); font-weight: 600; }
.tab-close { display: flex; align-items: center; opacity: .5; padding: 1px; border-radius: 3px; }
.tab-close:hover { opacity: 1; background: rgba(231,76,60,.3); }
.tab-close svg { width: 12px; height: 12px; }
.tab-add { background: none; border: none; color: var(--text-muted); padding: 6px 10px; cursor: pointer; display: flex; align-items: center; flex-shrink: 0; }
.tab-add:hover { color: var(--accent); }

/* Snippet bar */
.snippet-bar { display: flex; gap: 4px; padding: 5px 8px; background: var(--header-bg); flex-shrink: 0; flex-wrap: wrap; border-bottom: 1px solid var(--border); }
.snippet-btn { background: color-mix(in srgb, var(--accent) 10%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); color: var(--accent); padding: 3px 10px; border-radius: 4px; cursor: pointer; font-size: .72rem; font-weight: 600; display: flex; align-items: center; gap: 4px; white-space: nowrap; transition: background .15s; }
.snippet-btn:hover { background: color-mix(in srgb, var(--accent) 25%, transparent); }

/* Search */
.search-bar { display: flex; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.search-bar input { flex: 1; padding: 5px 10px; border: none; background: var(--input-bg); color: var(--text); font-size: .78rem; outline: none; }
.search-bar button { padding: 5px 10px; background: var(--header-bg); border: none; color: var(--text); cursor: pointer; display: flex; align-items: center; }

/* CodeMirror */
.cm-host { flex: 1; position: relative; overflow: hidden; }
.cm-host .CodeMirror { position: absolute; top: 0; left: 0; right: 0; bottom: 0; height: 100%; font-family: 'Consolas','Courier New',monospace; font-size: 13px; line-height: 1.5; }

/* Controls */
.controls { display: flex; flex-direction: column; gap: 6px; padding: 4px 0; min-width: 190px; overflow-y: auto; max-height: calc(100vh - 160px); }
.controls::-webkit-scrollbar { width: 4px; }
.controls::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.btn { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; padding: 8px 10px; border: 1px solid var(--accent); background: transparent; color: var(--accent); border-radius: 6px; cursor: pointer; font-size: .78rem; font-weight: 600; transition: all .2s; white-space: nowrap; }
.btn:hover { background: color-mix(in srgb, var(--accent) 15%, transparent); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
select, .json-path-group input { width: 100%; padding: 6px 8px; border: 1px solid var(--border); background: var(--panel-bg); color: var(--text); border-radius: 6px; font-size: .78rem; outline: none; }
.indent-select, .convert-group, .json-path-group { display: flex; flex-direction: column; gap: 4px; }
.convert-group label, .json-path-group label { font-size: .72rem; color: var(--text-muted); }

/* Tree */
.tree-container { flex: 1; overflow: auto; padding: 12px; font-family: 'Consolas',monospace; font-size: 13px; line-height: 1.6; }
.tree-key { color: #e74c3c; } .tree-string { color: #2ecc71; } .tree-number { color: #3498db; } .tree-boolean { color: #e67e22; } .tree-null { color: #95a5a6; }
.tree-toggle { cursor: pointer; user-select: none; display: inline-block; width: 16px; text-align: center; color: var(--text-muted); }
.tree-toggle:hover { color: var(--accent); }
.tree-children { margin-left: 20px; border-left: 1px dashed var(--tree-line); padding-left: 8px; }
.tree-children.collapsed { display: none; }

/* Status */
.status-bar { margin-top: 6px; padding: 6px 12px; border-radius: 6px; font-size: .8rem; min-height: 30px; text-align: center; transition: all .3s; }
.status-bar.success { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.status-bar.error { background: rgba(231,76,60,.15); color: #e74c3c; border: 1px solid rgba(231,76,60,.3); }
.status-bar.info { background: rgba(52,152,219,.15); color: #3498db; border: 1px solid rgba(52,152,219,.3); }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal[hidden] { display: none; }
.modal-content { background: var(--modal-bg); border: 1px solid var(--border); border-radius: 10px; padding: 20px; max-width: 500px; width: 90%; max-height: 80vh; overflow-y: auto; }
.modal-wide { max-width: 900px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal-header h2 { font-size: 1.05rem; }
.modal-close { background: none; border: none; color: var(--text); cursor: pointer; display: flex; align-items: center; padding: 4px; border-radius: 4px; }
.modal-close:hover { background: rgba(231,76,60,.2); }
.history-list { display: flex; flex-direction: column; gap: 8px; }
.history-item { padding: 8px 12px; background: var(--input-bg); border: 1px solid var(--border); border-radius: 6px; cursor: pointer; font-size: .78rem; display: flex; justify-content: space-between; align-items: center; }
.history-item:hover { border-color: var(--accent); }
.history-item .time { color: var(--text-muted); font-size: .7rem; }
.diff-output { font-family: 'Consolas',monospace; font-size: 12px; line-height: 1.6; white-space: pre-wrap; word-break: break-all; }
.diff-line-add { background: var(--diff-add); color: #1abc9c; }
.diff-line-remove { background: var(--diff-remove); color: #e74c3c; }
.diff-line-same { color: var(--text-muted); }
.panel.drag-over { border-color: var(--accent); box-shadow: inset 0 0 20px color-mix(in srgb, var(--accent) 15%, transparent); }

@media (max-width: 960px) {
  /* Stack panels vertically */
  .panels {
    grid-template-columns: 1fr;
    height: auto;
    gap: 8px;
  }

  /* Reorder: input first, output second, controls last */
  #inputPanel  { order: 1; }
  #outputPanel { order: 2; }
  .controls    { order: 3; }

  /* Give editors a fixed height on mobile */
  .cm-host { min-height: 240px; position: relative; }
  .cm-host .CodeMirror { position: relative; height: 240px; }

  /* Controls: horizontal wrapping row */
  .controls {
    flex-direction: row;
    flex-wrap: wrap;
    min-width: unset;
    max-height: unset;
    overflow-y: visible;
    padding: 6px;
    background: var(--panel-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    gap: 6px;
  }
  .controls .btn { width: auto; flex: 1 1 calc(50% - 6px); min-width: 120px; }
  .indent-select,
  .convert-group,
  .json-path-group { flex: 1 1 100%; }
  .convert-group { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px; }
  .convert-group label { flex: 0 0 auto; }
  .convert-group select { flex: 1 1 120px; }
  .convert-group .btn { flex: 0 0 auto; width: auto; }
  .json-path-group { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px; }
  .json-path-group label { flex: 0 0 auto; }
  .json-path-group input { flex: 1 1 120px; }
  .json-path-group .btn { flex: 0 0 auto; width: auto; }
}

@media (max-width: 600px) {
  /* Header */
  header { padding: 8px 12px; justify-content: flex-start; }
  header h1 { font-size: 1rem; }
  .header-actions { position: static; margin-left: auto; }

  /* Stats bar */
  .stats-bar { gap: 8px; font-size: .72rem; padding: 5px 10px; }

  /* Snippet bar — horizontal scroll */
  .snippet-bar { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding: 5px 8px; }
  .snippet-bar::-webkit-scrollbar { display: none; }
  .snippet-btn { flex-shrink: 0; }

  /* Search bar */
  .search-bar input { font-size: .82rem; padding: 7px 10px; }

  /* Controls: single column on very small screens */
  .controls .btn { flex: 1 1 100%; }
  /*.convert-group { flex-direction: column; }*/
  /*.json-path-group { flex-direction: column; }*/
  .convert-group .btn,
  .json-path-group .btn { width: 100%; }

  /* Panel headers */
  .panel-header { font-size: .78rem; padding: 6px 10px; }

  /* Modals */
  .modal-content { padding: 14px; width: 95%; }
  .modal-wide { max-width: 95%; }

  /* SEO section */
  .seo-features { grid-template-columns: 1fr; }
  .seo-block h2 { font-size: 1.15rem; }
  .seo-code { font-size: .78rem; padding: 12px; }

.status-bar{
    position: fixed;
bottom: 0;
margin: 0px 0px 0px -3% !important;
width: 100%;
border: none;
}

.status-bar.success {
margin-top: 6px;
padding: 6px 12px;
border-radius: 0;
font-size: .8rem;
min-height: 30px;
text-align: center;
transition: all .3s;
}
.status-bar.success{background: color-mix(in srgb, var(--accent) 100%, transparent);
color: #000;}
}

.status-bar.error {
    background: rgba(231, 76, 60);
    color: #fff;
    border: 1px solid rgba(231, 76, 60);
}


/* ========== SEO Content Section ========== */
.seo-content {
  max-width: 900px;
  margin: 40px auto 0;
  padding: 0 20px 40px;
  color: var(--text);
  line-height: 1.75;
}

.seo-block {
  margin-bottom: 36px;
}

.seo-block h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--text);
  border-bottom: 2px solid var(--border);
  padding-bottom: 8px;
}

.seo-block h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--accent);
}

.seo-block p {
  margin-bottom: 12px;
  font-size: 0.95rem;
  color: var(--text);
}

.seo-block code {
  background: var(--header-bg);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 0.88rem;
}

.seo-block a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.seo-block a:hover {
  opacity: 0.8;
}

/* Feature Grid */
.seo-features {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.seo-feature {
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
}

.seo-feature p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

/* Steps */
.seo-steps {
  padding-left: 20px;
  font-size: 0.95rem;
}

.seo-steps li {
  margin-bottom: 10px;
}

/* List */
.seo-list {
  padding-left: 20px;
  font-size: 0.95rem;
}

.seo-list li {
  margin-bottom: 8px;
}

/* Code Block */
.seo-code {
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 12px;
}

/* FAQ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.faq-item {
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.faq-item summary {
  padding: 14px 18px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  transition: background 0.15s;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::before {
  content: '+';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--header-bg);
  color: var(--accent);
  font-size: 1rem;
  font-weight: 700;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.faq-item[open] summary::before {
  content: '−';
}

.faq-item summary:hover {
  background: var(--header-bg);
}

.faq-item p {
  padding: 0 18px 14px;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}

/* Footer */
.seo-footer {
  text-align: center;
  padding: 20px;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 10px;
}

.seo-footer a {
  color: var(--accent);
  text-decoration: none;
}

.seo-footer a:hover {
  text-decoration: underline;
}

