/* ========================================================================== */
/* Preset Commands Bar — merged from 2 duplicate .preset-chip definitions     */
/* ========================================================================== */

.preset-bar {
  display: flex;
  gap: 6px;
  padding: 6px 16px;
  overflow-x: auto;
  background: var(--bg-secondary, #1e293b);
  border-top: 1px solid var(--border-color, #334155);
  scrollbar-width: thin;
}

.preset-bar::-webkit-scrollbar {
  height: 4px;
}

.preset-bar::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 2px;
}

/* Preset chip — later definition wins (L1201) */
.preset-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 12px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(51, 65, 85, 0.4);
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.preset-chip:hover:not(:disabled) {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.4);
  color: #93c5fd;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.preset-chip:active:not(:disabled) {
  transform: scale(0.96);
}

.preset-chip:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Preset Management (Settings Panel) ── */
.preset-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.preset-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: rgba(51, 65, 85, 0.4);
  border-radius: 8px;
  border: 1px solid rgba(71, 85, 105, 0.4);
}

.preset-item-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.preset-item-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.preset-item-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.preset-item-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--xbot-text-primary);
}

.preset-item-content {
  font-size: 11px;
  color: var(--xbot-text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preset-item-actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
  margin-left: 8px;
}

.preset-action-btn {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  background: transparent;
  color: var(--xbot-text-secondary);
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-action-btn:hover:not(:disabled) {
  background: rgba(71, 85, 105, 0.6);
  color: var(--xbot-text-primary);
}

.preset-action-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.preset-action-delete:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.2);
  color: var(--xbot-text-danger);
}

.preset-edit-form {
  padding: 12px;
  background: rgba(51, 65, 85, 0.3);
  border-radius: 8px;
  border: 1px solid rgba(71, 85, 105, 0.4);
}

/* ---- Light theme overrides ---- */
[data-theme="light"] .preset-bar {
  background: #f8fafc;
  border-top-color: var(--xbot-text-primary);
}

[data-theme="light"] .preset-chip {
  background: rgba(226, 232, 240, 0.6);
  color: var(--xbot-border-light);
  border-color: rgba(203, 213, 225, 0.6);
}

[data-theme="light"] .preset-chip:hover:not(:disabled) {
  background: rgba(203, 213, 225, 0.8);
  color: #1e293b;
}

[data-theme="light"] .preset-item {
  background: rgba(241, 245, 249, 0.6);
  border-color: rgba(226, 232, 240, 0.6);
}

[data-theme="light"] .preset-item-label {
  color: #1e293b;
}

[data-theme="light"] .preset-item-content {
  color: var(--xbot-text-muted);
}

[data-theme="light"] .preset-action-btn {
  color: var(--xbot-text-muted);
}

[data-theme="light"] .preset-action-btn:hover:not(:disabled) {
  background: rgba(226, 232, 240, 0.8);
  color: #1e293b;
}

[data-theme="light"] .preset-edit-form {
  background: rgba(241, 245, 249, 0.5);
  border-color: rgba(226, 232, 240, 0.6);
}
