/* Bookmarks (frontend/chat/bookmarks.js) */
:root { --bookmark-color: #f5b942; }

/* Thread: action-row toggle, amber bar and label on a bookmarked message */
.msg-action-btn.bookmark-btn:hover { color: var(--bookmark-color); }
.msg-action-btn.bookmark-btn.on { color: var(--bookmark-color); border-color: rgba(245, 185, 66, 0.45); }
.msg-action-btn.bookmark-btn.on svg { fill: currentColor; }
.message.bookmarked { position: relative; }
.message.bookmarked::before {
  content: ""; position: absolute; top: 10px; bottom: 36px; width: 3px; border-radius: 2px;
  background: var(--bookmark-color); opacity: 0.7; pointer-events: none;
}
.message.assistant.bookmarked::before { left: 14px; }
.message.user.bookmarked::before { right: 14px; }
/* Keep the bookmarked state visible without hovering */
.message.user.bookmarked .message-actions,
.message.assistant.bookmarked .message-actions { opacity: 0.45; }
.message.user.bookmarked:hover .message-actions,
.message.assistant.bookmarked:hover .message-actions { opacity: 1; }
.message-bookmark-tag {
  display: flex; align-items: center; gap: 5px; max-width: 72%;
  margin-bottom: 4px; font-size: 12px; color: var(--bookmark-color);
}
.message-bookmark-tag svg { width: 12px; height: 12px; flex: none; }
.message-bookmark-tag span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Sidebar: bookmark button at the right edge of the "Search chats" box */
.sidebar-search input { padding-right: 40px; }
.sidebar-bookmarks-btn {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 28px; border: none; border-radius: 6px;
  background: transparent; color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.sidebar-bookmarks-btn:hover { background: var(--bg-tertiary); color: var(--bookmark-color); }
.sidebar-bookmarks-btn svg { width: 16px; height: 16px; }
.sidebar-bookmarks-btn.pulse { color: var(--bookmark-color); animation: bookmark-pulse 1.2s ease 2; }
@keyframes bookmark-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 185, 66, 0); }
  40% { box-shadow: 0 0 0 5px rgba(245, 185, 66, 0.35); background: rgba(245, 185, 66, 0.12); }
}
.sidebar.collapsed .sidebar-bookmarks-btn { display: none; }

/* Search overlay: the Bookmarks filter */
.search-filters { align-items: center; flex-wrap: wrap; }
.filter-sep { width: 1px; align-self: stretch; margin: 4px 2px; background: var(--border-color); }
.filter-btn-bookmarks { display: inline-flex; align-items: center; gap: 5px; }
.filter-btn-bookmarks svg { width: 12px; height: 12px; }
.bookmarks-mode .search-ai-options { display: none; }

.bookmark-group-header {
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px; padding: 10px 12px 4px;
}
.bookmark-result { display: flex; align-items: flex-start; gap: 10px; }
.bookmark-result:focus-visible { outline: 1px solid var(--accent-color); outline-offset: -1px; }
.bookmark-result-icon { color: var(--bookmark-color); flex: none; margin-top: 2px; }
.bookmark-result-icon svg { width: 14px; height: 14px; display: block; }
.bookmark-result-body { flex: 1; min-width: 0; }
.bookmark-result.chat-gone .bookmark-result-icon,
.bookmark-result.chat-gone .bookmark-result-body > :not(.bookmark-gone-note) { opacity: 0.5; }
.bookmark-result-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 2px; }
.bookmark-result .search-result-meta { margin-top: 4px; }
.bookmark-gone-note { margin-top: 6px; font-size: 13px; color: var(--text-secondary); }
.bookmark-gone-remove {
  margin-left: 6px; padding: 2px 8px; border: 1px solid var(--border-color); border-radius: 6px;
  background: transparent; color: var(--text-primary); font: inherit; font-size: 12px; cursor: pointer;
}
.bookmark-gone-remove:hover { background: var(--bg-hover); }
.bookmark-rename-input {
  width: 100%; box-sizing: border-box; padding: 3px 6px;
  background: var(--bg-primary); border: 1px solid var(--accent-color); border-radius: 6px;
  color: var(--text-primary); font: inherit; font-size: 14px; font-weight: 500; outline: none;
}
.bookmark-result-actions { display: flex; gap: 2px; flex: none; visibility: hidden; }
.bookmark-result:hover .bookmark-result-actions,
.bookmark-result:focus-within .bookmark-result-actions { visibility: visible; }
@media (hover: none) { .bookmark-result-actions { visibility: visible; opacity: 0.7; } }
.bookmark-result-actions button {
  width: 28px; height: 28px; border: none; border-radius: 6px; background: transparent;
  color: var(--text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.bookmark-result-actions button:hover { background: var(--bg-primary); color: var(--text-primary); }
.bookmark-result-actions .bookmark-delete-btn:hover { color: #ef4444; }
.bookmark-result-actions svg { width: 14px; height: 14px; }
