/* ============================================================
   Agent V2 — Slash Palette & Mention Picker Styles
   Glassmorphic dropdown for slash commands and @mentions.
   Depends on: agent-v2-tokens.css
   ============================================================ */

/* ── Entrance Animation ────────────────────────────────────────── */

@keyframes paletteEnter {
  from {
    opacity: 0;
    transform: translateY(4px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ── Slash Palette Container ───────────────────────────────────── */

.slash-palette {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  z-index: 100;
  display: none;
  flex-direction: column;
  max-height: var(--palette-max-height, 320px);
  overflow-y: auto;
  overflow-x: hidden;
  margin-bottom: 6px;
  background: var(--palette-bg);
  backdrop-filter: blur(25px) saturate(200%);
  -webkit-backdrop-filter: blur(25px) saturate(200%);
  border: 1px solid rgba(0, 240, 255, 0.15);
  border-radius: var(--card-radius-lg);
  box-shadow:
    0 -8px 32px rgba(0, 0, 0, 0.45),
    0 0 16px rgba(0, 240, 255, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.slash-palette--visible {
  display: flex;
  animation: paletteEnter var(--duration-normal) var(--ease-out-spring);
}

/* ── Palette List ──────────────────────────────────────────────── */

.slash-palette__list {
  display: flex;
  flex-direction: column;
  padding: 4px;
  gap: 1px;
}

/* ── Category Header ───────────────────────────────────────────── */

.slash-category {
  padding: 8px 10px 4px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--palette-category);
  user-select: none;
  pointer-events: none;
}

/* ── Command Item ──────────────────────────────────────────────── */

.slash-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--card-radius);
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  width: 100%;
  color: var(--md-sys-color-on-surface, #e2e8f0);
  font-family: inherit;
  font-size: 12px;
  outline: none;
  transition:
    background var(--duration-instant) ease,
    box-shadow var(--duration-instant) ease;
}

.slash-item:hover,
.slash-item--active {
  background: var(--palette-item-hover, rgba(255, 255, 255, 0.07));
}

.slash-item--active {
  box-shadow: inset 0 0 0 1px rgba(0, 240, 255, 0.12);
}

.slash-item:active {
  background: var(--palette-item-active, rgba(255, 255, 255, 0.12));
}

/* ── Item Parts ────────────────────────────────────────────────── */

.slash-item__icon {
  flex-shrink: 0;
  width: 20px;
  text-align: center;
  font-size: 14px;
  line-height: 1;
}

.slash-item__name {
  flex-shrink: 0;
  font-weight: 600;
  font-size: 12px;
  color: var(--md-sys-color-on-surface-strong, #f8f8f2);
  white-space: nowrap;
}

.slash-item__desc {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  color: var(--md-sys-color-on-surface-variant, #888);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slash-item__kbd {
  flex-shrink: 0;
  padding: 1px 5px;
  font-size: 10px;
  font-family: inherit;
  font-weight: 500;
  color: var(--md-sys-color-on-surface-variant);
  background: var(--palette-kbd-bg);
  border: 1px solid var(--palette-kbd-border);
  border-radius: 4px;
  line-height: 1.4;
}

/* ── Fuzzy Match Highlight ─────────────────────────────────────── */

.slash-match {
  color: var(--md-sys-color-primary);
  font-weight: 700;
}

/* ── Mention Picker V2 ─────────────────────────────────────────── */

.mention-picker-v2 {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  z-index: 100;
  display: none;
  flex-direction: column;
  max-height: var(--palette-max-height, 320px);
  overflow-y: auto;
  overflow-x: hidden;
  margin-bottom: 6px;
  background: var(--palette-bg);
  backdrop-filter: blur(25px) saturate(200%);
  -webkit-backdrop-filter: blur(25px) saturate(200%);
  border: 1px solid rgba(0, 240, 255, 0.15);
  border-radius: var(--card-radius-lg);
  box-shadow:
    0 -8px 32px rgba(0, 0, 0, 0.45),
    0 0 16px rgba(0, 240, 255, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.mention-picker-v2--visible {
  display: flex;
  animation: paletteEnter var(--duration-normal) var(--ease-out-spring);
}

/* ── Mention Item ──────────────────────────────────────────────── */

.mention-item-v2 {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--card-radius);
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  width: 100%;
  color: var(--md-sys-color-on-surface, #e2e8f0);
  font-family: inherit;
  font-size: 12px;
  outline: none;
  transition: background var(--duration-instant) ease;
}

.mention-item-v2:hover,
.mention-item-v2.focused {
  background: var(--palette-item-hover, rgba(255, 255, 255, 0.07));
}

/* ── Inline Mention Chip ───────────────────────────────────────── */

.mention-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 7px;
  margin: 0 2px;
  font-size: 11px;
  font-weight: 600;
  color: var(--md-sys-color-primary);
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.15);
  border-radius: 10px;
  white-space: nowrap;
  vertical-align: baseline;
  line-height: 1.5;
}

/* ── Scrollbar ─────────────────────────────────────────────────── */

.slash-palette::-webkit-scrollbar,
.mention-picker-v2::-webkit-scrollbar {
  width: 4px;
}

.slash-palette::-webkit-scrollbar-track,
.mention-picker-v2::-webkit-scrollbar-track {
  background: transparent;
}

.slash-palette::-webkit-scrollbar-thumb,
.mention-picker-v2::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

/* ── Reduced Motion ────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .slash-palette--visible,
  .mention-picker-v2--visible {
    animation: none;
  }
}
