/* YAML Path Explorer — Indigo/Cyan theme */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #6366F1;
  --primary-dim: rgba(99,102,241,0.12);
  --primary-glow: rgba(99,102,241,0.3);
  --secondary: #94A3B8;
  --accent: #22D3EE;
  --accent-dim: rgba(34,211,238,0.12);
  --bg: #0F172A;
  --bg-card: #1E293B;
  --bg-input: #0C1322;
  --border: rgba(99,102,241,0.15);
  --border-focus: rgba(99,102,241,0.5);
  --text: #E2E8F0;
  --text-dim: #94A3B8;
  --text-muted: #475569;
  --green: #34D399;
  --yellow: #FACC15;
  --red: #F87171;
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --transition: 0.2s ease;
}

html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; line-height: 1.6; }
body::before { content: ''; position: fixed; inset: 0; background: radial-gradient(ellipse at top, rgba(99,102,241,0.04), transparent 50%); pointer-events: none; }

.header { border-bottom: 1px solid var(--border); background: rgba(30,41,59,0.9); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 10; }
.header-inner { max-width: 1100px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; }
.header-left { display: flex; align-items: center; gap: 10px; }
.logo-icon { font-size: 1.2rem; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; background: var(--primary-dim); border-radius: var(--radius-sm); }
.header h1 { font-size: 1.05rem; font-weight: 700; }
.subtitle { font-size: 0.72rem; color: var(--text-dim); }

.path-fmt { padding: 5px 8px; font-family: var(--font); font-size: 0.75rem; color: var(--text-dim); background: var(--bg-card); border: 1px solid var(--border); border-radius: 6px; outline: none; cursor: pointer; }

.main { max-width: 1100px; margin: 0 auto; padding: 20px; }
.layout { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; min-height: calc(100vh - 120px); }

.editor-panel, .tree-panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden; }
.panel-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.panel-label { font-size: 0.75rem; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.04em; }

.code-editor { flex: 1; width: 100%; padding: 14px; font-family: var(--mono); font-size: 0.8rem; line-height: 1.7; color: var(--accent); background: var(--bg-input); border: none; outline: none; resize: none; min-height: 300px; tab-size: 2; }

.search-field { padding: 4px 8px; font-family: var(--font); font-size: 0.72rem; color: var(--text); background: var(--bg-input); border: 1px solid var(--border); border-radius: 4px; outline: none; width: 120px; }
.search-field:focus { border-color: var(--border-focus); width: 160px; }

.tree-content { flex: 1; overflow: auto; padding: 10px 14px; font-family: var(--mono); font-size: 0.78rem; }

.tree-node { margin-left: 16px; }
.tree-key { cursor: pointer; padding: 1px 4px; border-radius: 3px; transition: background var(--transition); display: inline-flex; gap: 4px; align-items: center; }
.tree-key:hover { background: var(--primary-dim); }
.tree-key .key-name { color: var(--primary); font-weight: 500; }
.tree-key .key-val { color: var(--text-dim); }
.tree-key .key-val.str { color: var(--green); }
.tree-key .key-val.num { color: var(--yellow); }
.tree-key .key-val.bool { color: var(--accent); }
.tree-key .toggle { color: var(--text-muted); font-size: 0.65rem; min-width: 12px; text-align: center; }
.tree-key.highlight { background: rgba(99,102,241,0.2); }
.tree-children { display: block; }
.tree-children.collapsed { display: none; }

.error-bar { background: rgba(248,113,113,0.1); border: 1px solid rgba(248,113,113,0.3); color: var(--red); padding: 8px 14px; border-radius: var(--radius-sm); font-size: 0.78rem; margin-top: 8px; }

.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column-reverse; gap: 8px; }
.toast { padding: 10px 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: 0 4px 24px rgba(0,0,0,0.5); font-size: 0.82rem; animation: toastIn 0.3s ease; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

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