/* AI Rule Editor Styles */
.rule-editor-section {
  background: var(--bg);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.section-title {
  margin: 0 0 16px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text, #505050);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title i {
  color: var(--accent, #fd6c1d);
}

.query-display {
  background: var(--card-bg);
  border-radius: 6px;
  padding: 16px;
}

.query-metadata {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.metadata-item {
  font-size: 13px;
  color: var(--text);
}

.conflict-display, .ai-display {
  background: var(--card-bg);
  border-radius: 6px;
  padding: 16px;
}

.conflict-item {
  background: rgba(239,68,68,0.05);
  border-left: 3px solid #ef4444;
  padding: 12px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.conflict-item-title {
  font-weight: 600;
  color: #ef4444;
  margin-bottom: 4px;
}

.no-conflicts {
  background: rgba(16,185,129,0.05);
  border-left: 3px solid #10b981;
  padding: 12px;
  border-radius: 4px;
  color: #10b981;
  font-weight: 600;
}

.ai-results {
  background: rgba(59,130,246,0.05);
  border-left: 3px solid #3b82f6;
  padding: 16px;
  border-radius: 4px;
  margin-top: 12px;
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.6;
}

.ai-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted, #8a8a8a);
}

.json-editor-container {
  background: var(--card-bg);
  border-radius: 6px;
  padding: 0;
  overflow: hidden;
}

.json-editor {
  width: 100%;
  min-height: 400px;
  padding: 16px;
  border: 1px solid var(--border-color-strong);
  border-radius: 6px;
  font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
  font-size: 13px;
  resize: vertical;
  background: var(--code-bg);
  color: var(--text);
}

.json-editor:focus {
  outline: none;
  border-color: #fd6c1d;
  box-shadow: 0 0 0 3px rgba(253,108,29,0.1);
}

/* Rule Properties Form */
.rule-properties-form {
  background: var(--card-bg);
  border-radius: 6px;
  padding: 16px;
}

.form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.form-field {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.form-field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text, #505050);
  margin-bottom: 6px;
}

.form-input {
  padding: 10px 12px;
  border: 1px solid var(--border-color-strong);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: var(--input-bg);
  color: var(--text);
}

.form-input:focus {
  outline: none;
  border-color: #fd6c1d;
  box-shadow: 0 0 0 3px rgba(253,108,29,0.1);
}

.help-icon {
  cursor: help;
  color: var(--muted, #8a8a8a);
  font-size: 14px;
  margin-left: 4px;
}

.cache-key-elements-editor {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 40px;
  padding: 8px;
  border: 1px solid var(--border-color-strong);
  border-radius: 6px;
  background: var(--bg);
}

.cache-key-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(59,130,246,0.1);
  color: #3b82f6;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 13px;
  font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
}

.cache-key-chip-remove {
  cursor: pointer;
  color: #ef4444;
  font-weight: bold;
  padding: 0 4px;
  border-radius: 3px;
  transition: background 0.2s;
}

.cache-key-chip-remove:hover {
  background: rgba(239,68,68,0.2);
}

/* Green button hover fix */
.btn-green {
  background: #10b981 !important;
  color: white;
}

.btn-green:hover {
  background: #059669 !important;
  color: white !important;
}
