/* Bookmark Sidebar - Modern styling to match AllTools section */

.bookmark-sidebar {
  display: flex;
  flex-direction: column;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--bg-toolbar) 96%, transparent),
    color-mix(in srgb, var(--bg-background) 90%, transparent)
  );
  border-left: 1px solid color-mix(in srgb, var(--border-subtle) 75%, transparent);
  box-shadow: -2px 0 16px color-mix(in srgb, var(--shadow-color, rgba(15, 23, 42, 0.35)) 20%, transparent);
  backdrop-filter: blur(12px);
}

/* Header Section */
.bookmark-sidebar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.875rem;
  background: var(--bg-toolbar);
  border-bottom: 1px solid var(--border-subtle);
}

.bookmark-sidebar__header-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.bookmark-sidebar__header-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mantine-color-blue-6);
  font-size: 1.1rem;
}

/* Search Section */
.bookmark-sidebar__search {
  background: var(--tool-panel-search-bg, var(--bg-toolbar));
  border-bottom: 1px solid var(--tool-panel-search-border-bottom, var(--border-subtle));
  padding-top: 0.75rem !important;
}

/* Content Section */
.bookmark-sidebar__content {
  padding-top: 0.5rem !important;
}

.bookmark-sidebar__empty-state,
.bookmark-sidebar__error {
  padding: 2rem 1rem;
  text-align: center;
}

.bookmark-sidebar__loading {
  padding: 2rem 1rem !important;
}

/* Bookmark List */
.bookmark-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* Bookmark Items */
.bookmark-item-wrapper {
  display: flex;
  flex-direction: column;
}

.bookmark-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  border-radius: 0.65rem;
  cursor: default;
  transition: all 0.2s ease;
  background: transparent;
  border: 1px solid transparent;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  text-align: left;
  outline: none;
}

.bookmark-item--clickable {
  cursor: pointer;
  background: color-mix(in srgb, var(--bg-toolbar) 86%, transparent);
}

.bookmark-item--clickable:hover {
  background: color-mix(in srgb, var(--text-primary) 8%, var(--bg-toolbar));
  border-color: color-mix(in srgb, var(--text-primary) 20%, var(--border-subtle));
  transform: translateX(2px);
}

.bookmark-item--clickable:active {
  transform: translateX(3px);
}

.bookmark-item--clickable:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--text-primary) 30%, var(--border-subtle));
  outline-offset: 2px;
}

/* Expand Icon */
.bookmark-item__expand-icon {
  flex-shrink: 0;
  transition: transform 0.2s ease;
  width: 2rem;
  height: 2rem;
}

.bookmark-item:hover .bookmark-item__expand-icon {
  transform: scale(1.05);
}

/* Dash for items without children */
.bookmark-item__dash {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 1.25rem;
  opacity: 0.5;
  font-weight: 300;
}

/* Content */
.bookmark-item__content {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
  min-width: 0;
}

.bookmark-item__title {
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
  color: var(--text-primary);
}

.bookmark-item--clickable:hover .bookmark-item__title {
  color: var(--text-primary);
}

.bookmark-item__page {
  line-height: 1.3;
  font-size: 0.75rem;
}

/* Children Container */
.bookmark-item__children {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.25rem;
}

/* Smooth expand/collapse animation */
@keyframes bookmark-fade-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.bookmark-item__children {
  animation: bookmark-fade-in 0.2s ease;
}

/* Accessibility & Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .bookmark-item,
  .bookmark-item__expand-icon,
  .bookmark-item__children {
    transition: none;
    animation: none;
  }
}

