/* tools/jinja-editor/css/style.css — Tool-specific styles only */
/* Shared styles (reset, nav, ads) are in /shared/shell.css */

/* Header bar */
#header-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 16px; background: #11111b; border-bottom: 1px solid #313244;
}
#header-bar h1 { font-size: 16px; font-weight: 600; }
#header-actions { display: flex; gap: 8px; }
#header-actions button {
  background: #313244; color: #cdd6f4; border: 1px solid #45475a;
  border-radius: 4px; padding: 4px 12px; font-size: 13px; cursor: pointer;
}
#header-actions button:hover { background: #45475a; }

/* Toolbar */
#toolbar {
  display: flex; align-items: center; gap: 4px;
  padding: 8px 12px; background: #1e1e2e; border-bottom: 2px solid #45475a;
  flex-wrap: wrap;
}
.toolbar-group { display: flex; gap: 4px; align-items: center; }
.toolbar-separator { width: 1px; height: 24px; background: #45475a; margin: 0 4px; }
#toolbar button {
  background: #313244; color: #cdd6f4; border: 1px solid #45475a;
  border-radius: 4px; padding: 4px 10px; font-size: 13px; cursor: pointer;
  white-space: nowrap;
}
#toolbar button:hover { background: #45475a; }

/* Jinja buttons — colored */
.jinja-var { background: #89b4fa !important; color: #1e1e2e !important; border-color: #89b4fa !important; font-weight: 600; }
.jinja-if { background: #a6e3a1 !important; color: #1e1e2e !important; border-color: #a6e3a1 !important; font-weight: 600; }
.jinja-else { background: #94e2d5 !important; color: #1e1e2e !important; border-color: #94e2d5 !important; font-weight: 600; }
.jinja-for { background: #f9e2af !important; color: #1e1e2e !important; border-color: #f9e2af !important; font-weight: 600; }

/* Warning bar */
#warning-bar {
  padding: 6px 12px; background: #181825; border-bottom: 1px solid #313244;
  font-size: 13px; cursor: pointer;
}
#warning-bar.hidden { display: none; }
#warning-badge { color: #f9e2af; }
#warning-badge.error { color: #f38ba8; }
#warning-badge.ok { color: #a6e3a1; }
#warning-list { margin-top: 8px; }
#warning-list.hidden { display: none; }
.warning-item { padding: 4px 0; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.warning-item:hover { color: #89b4fa; }
.warning-severity { font-size: 11px; padding: 1px 6px; border-radius: 3px; }
.warning-severity.warning { background: #f9e2af; color: #1e1e2e; }
.warning-severity.error { background: #f38ba8; color: #1e1e2e; }

/* Main area */
#main { display: flex; flex: 1; min-height: 0; }
#editor-pane { flex: 1; display: flex; flex-direction: column; border-right: 2px solid #45475a; min-width: 0; }
#preview-pane { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.pane-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 12px; background: #181825; font-size: 12px; color: #6c7086;
  border-bottom: 1px solid #313244;
}
.badge { font-size: 11px; background: #313244; padding: 2px 8px; border-radius: 3px; }

/* Editor container */
#editor-container { flex: 1; overflow: auto; }
#editor-container .cm-editor { height: 100%; }

/* Preview */
#preview-wrapper { flex: 1; background: #bac2de; display: flex; justify-content: center; padding: 20px; overflow: auto; }
#preview-iframe {
  width: 100%; max-width: 600px; border: none; background: white;
  border-radius: 4px; box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Data panel */
#data-panel { background: #181825; border-top: 2px solid #45475a; }
#data-panel-header {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px; cursor: pointer; font-size: 12px; color: #6c7086;
}
#data-summary { color: #89b4fa; font-size: 12px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#data-panel-toggle { background: none; border: none; color: #6c7086; cursor: pointer; font-size: 12px; }
#data-panel-body { padding: 12px; max-height: 250px; overflow-y: auto; }
#data-panel-body.hidden { display: none; }

/* Data panel form fields */
.data-field { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.data-field label { min-width: 120px; font-size: 13px; color: #cdd6f4; font-family: monospace; }
.data-field input[type="text"] {
  flex: 1; background: #313244; border: 1px solid #45475a; border-radius: 4px;
  padding: 4px 8px; color: #cdd6f4; font-size: 13px;
}
.data-field.removed { opacity: 0.4; }
.data-field-toggle { width: 40px; height: 22px; background: #45475a; border-radius: 11px; cursor: pointer; position: relative; border: none; }
.data-field-toggle.active { background: #a6e3a1; }
.data-field-toggle::after {
  content: ''; position: absolute; width: 18px; height: 18px; background: white;
  border-radius: 50%; top: 2px; left: 2px; transition: left 0.2s;
}
.data-field-toggle.active::after { left: 20px; }

/* List field */
.data-list-items { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.data-list-item { display: flex; gap: 4px; }
.data-list-item input { flex: 1; background: #313244; border: 1px solid #45475a; border-radius: 4px; padding: 4px 8px; color: #cdd6f4; font-size: 13px; }
.data-list-item button { background: #f38ba8; color: #1e1e2e; border: none; border-radius: 4px; padding: 2px 8px; cursor: pointer; font-size: 12px; }
.data-list-add { background: #313244; color: #cdd6f4; border: 1px solid #45475a; border-radius: 4px; padding: 4px 8px; cursor: pointer; font-size: 12px; margin-top: 4px; }

/* JSON editor */
#json-editor-container { display: none; }
#json-editor {
  width: 100%; min-height: 120px; background: #313244; border: 1px solid #45475a;
  border-radius: 4px; padding: 8px; color: #cdd6f4; font-family: monospace; font-size: 13px;
  resize: vertical;
}
#json-error { color: #f38ba8; font-size: 12px; margin-top: 4px; }
.data-panel-toolbar { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.data-panel-toolbar button {
  background: #313244; color: #cdd6f4; border: 1px solid #45475a;
  border-radius: 4px; padding: 4px 12px; font-size: 12px; cursor: pointer;
}

/* Popover */
#popover {
  position: fixed; background: #313244; border: 1px solid #45475a;
  border-radius: 8px; padding: 12px; z-index: 100;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3); min-width: 240px;
}
#popover.hidden { display: none; }
#popover-content { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
#popover-content label { font-size: 12px; color: #a6adc8; }
#popover-content input[type="text"] {
  width: 100%; background: #1e1e2e; border: 1px solid #45475a; border-radius: 4px;
  padding: 6px 8px; color: #cdd6f4; font-size: 13px;
}
#popover-content input[type="color"] { width: 40px; height: 30px; border: none; cursor: pointer; background: none; }
#popover-actions { display: flex; justify-content: flex-end; gap: 8px; }
#popover-actions button {
  padding: 4px 16px; border-radius: 4px; font-size: 13px; cursor: pointer; border: none;
}
#popover-cancel { background: #45475a; color: #cdd6f4; }
#popover-confirm { background: #89b4fa; color: #1e1e2e; font-weight: 600; }

/* Jinja decorations in CodeMirror */
.cm-jinja-variable { color: #89b4fa; font-weight: 600; }
.cm-jinja-tag { color: #a6e3a1; font-weight: 600; }
.cm-jinja-comment { color: #6c7086; font-style: italic; }

