/* ═══════════════════════════════════════════════════════════════════════════
   08-sidebar-ux.css — 10× Sidebar & Global UX Overhaul
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Sidebar slide transition ── */
.navigator {
  transform: translateX(0);
  opacity: 1;
  transition: transform 320ms cubic-bezier(0.22, 0.61, 0.36, 1),
              opacity 280ms ease,
              box-shadow 320ms ease;
  will-change: transform, opacity;
}

.app-shell.sidebar-closed .navigator {
  display: flex;
  transform: translateX(-110%);
  opacity: 0;
  pointer-events: none;
  box-shadow: none;
}

/* Board-area smoothly expands when sidebar closes */
.app-shell {
  transition: grid-template-columns 340ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ── Glass-morphism depth boost ── */
.navigator {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  border: 1px solid rgba(32, 33, 36, 0.08);
  box-shadow:
    0 4px 24px rgba(32, 33, 36, 0.07);
}


/* ── Navigator list items — enhanced ── */
.navigator-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: transparent;
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
  transition: all 200ms cubic-bezier(0.22, 0.61, 0.36, 1);
}
.navigator-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--kind-accent, var(--muted));
  opacity: 0;
  transform: scaleY(0.6);
  transition: all 200ms cubic-bezier(0.22, 0.61, 0.36, 1);
}
.navigator-item:hover::before,
.navigator-item.active::before {
  opacity: 1;
  transform: scaleY(1);
}
.navigator-item:hover {
  background: rgba(31, 111, 139, 0.04);
  border-color: rgba(31, 111, 139, 0.08);
  transform: translateX(2px);
}
.navigator-item.active {
  background: #fff;
  border-color: rgba(32, 33, 36, 0.1);
  box-shadow: 0 2px 12px rgba(32, 33, 36, 0.06);
  transform: translateX(2px);
}

/* Navigator item thumbnail */
.nav-thumb {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  flex-shrink: 0;
  overflow: hidden;
  background: rgba(32, 33, 36, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.nav-thumb-icon {
  font-size: 1rem;
  line-height: 1;
  opacity: 0.45;
  user-select: none;
}

/* Navigator item text block */
.nav-item-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.navigator-title {
  font-size: 0.82rem;
  font-weight: 620;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  transition: color 150ms;
}
.navigator-item.active .navigator-title {
  font-weight: 700;
  color: var(--marker);
}

.navigator-meta {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.7;
}

/* ── Bucket headers refresh ── */
.navigator-bucket-header {
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 0.76rem;
  font-weight: 750;
  transition: all 180ms ease;
}
.navigator-bucket[open] > .navigator-bucket-header {
  background: rgba(31, 111, 139, 0.06);
}
.navigator-bucket-header:hover {
  background: rgba(31, 111, 139, 0.04);
}
.bucket-count {
  background: rgba(32, 33, 36, 0.05);
  border-radius: 10px;
  font-size: 0.66rem;
  font-weight: 700;
  padding: 2px 9px;
  letter-spacing: 0.02em;
}
.bucket-label {
  font-size: 0.78rem;
  font-weight: 680;
  letter-spacing: -0.01em;
}

/* ── Sticky quick-add button at sidebar bottom ── */
#navigatorQuickAdd {
  flex: 0 0 auto;
  margin: 8px 12px 10px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: rgba(31, 111, 139, 0.07);
  border: 1.5px dashed rgba(31, 111, 139, 0.25);
  border-radius: 12px;
  color: var(--marker);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 200ms cubic-bezier(0.22, 0.61, 0.36, 1);
  letter-spacing: 0.01em;
}
#navigatorQuickAdd:hover {
  background: rgba(31, 111, 139, 0.13);
  border-color: rgba(31, 111, 139, 0.5);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(31, 111, 139, 0.12);
}
#navigatorQuickAdd:active {
  transform: translateY(0) scale(0.97);
}
#navigatorQuickAdd .quick-add-plus {
  font-size: 1.2rem;
  font-weight: 300;
  line-height: 1;
}

/* ── Navigator scrollbar styling ── */
.navigator-list {
  scrollbar-width: thin;
  scrollbar-color: rgba(32,33,36,0.12) transparent;
  padding: 6px 8px;
  gap: 3px;
}
.navigator-list::-webkit-scrollbar {
  width: 5px;
}
.navigator-list::-webkit-scrollbar-track {
  background: transparent;
}
.navigator-list::-webkit-scrollbar-thumb {
  background: rgba(32,33,36,0.12);
  border-radius: 10px;
}
.navigator-list::-webkit-scrollbar-thumb:hover {
  background: rgba(32,33,36,0.22);
}

/* ── Empty state ── */
.navigator-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.navigator-empty-icon {
  font-size: 2rem;
  opacity: 0.4;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Board Area & Canvas UX
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Board border glow ── */
.board {
  border-radius: 24px;
  box-shadow:
    inset 0 0 0 6px rgba(255, 255, 255, 0.15),
    0 8px 40px rgba(32, 33, 36, 0.10),
    0 2px 8px rgba(32, 33, 36, 0.04);
  transition: border-radius 340ms cubic-bezier(0.22, 0.61, 0.36, 1),
              box-shadow 340ms ease;
}

/* ── Card micro-interactions ── */
.memory-card {
  transition:
    box-shadow 220ms cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 220ms cubic-bezier(0.22, 0.61, 0.36, 1),
    outline 180ms ease,
    outline-offset 180ms ease;
}
.memory-card:hover {
  box-shadow:
    0 12px 36px rgba(0,0,0,0.12),
    0 2px 6px rgba(0,0,0,0.06),
    0 0 0 1px rgba(31,111,139,0.08);
  transform:
    translate3d(var(--card-x), var(--card-y), 0)
    scale(1.01)
    rotate(var(--card-r, 0deg));
  z-index: 4;
}
.memory-card:active {
  transform:
    translate3d(var(--card-x), var(--card-y), 0)
    scale(0.985)
    rotate(var(--card-r, 0deg));
  transition-duration: 80ms;
}
.memory-card.selected {
  outline: 3px solid var(--card-border, rgba(31, 111, 139, 0.65));
  outline-offset: 4px;
  border-radius: 14px;
  z-index: 8;
  box-shadow:
    0 12px 40px rgba(31,111,139,0.18),
    0 4px 12px rgba(0,0,0,0.08),
    0 0 0 6px rgba(31,111,139,0.06);
}

/* ── Drag handle — always visible when card is hovered ── */
.drag-handle {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(32,33,36,0.10);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  opacity: 0;
  transition: opacity 180ms ease, transform 150ms ease;
  transform: translateY(-2px);
}
.memory-card:hover .drag-handle,
.memory-card:focus-within .drag-handle {
  opacity: 1;
  transform: translateY(0);
}

/* ── Floating toolbar depth ── */
.floating-toolbar {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(24px) saturate(1.3);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  border: 1px solid rgba(255,255,255,0.5);
  box-shadow:
    0 8px 40px rgba(0,0,0,0.10),
    0 2px 8px rgba(0,0,0,0.04),
    inset 0 1px 0 rgba(255,255,255,0.5);
  padding: 6px 8px;
  border-radius: 16px;
  gap: 2px;
}

.tool-button {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  transition: all 200ms cubic-bezier(0.22, 0.61, 0.36, 1);
}
.tool-button:hover {
  background: rgba(0,0,0,0.06);
  transform: scale(1.06);
}
.tool-button.active {
  background: var(--marker);
  color: #fff;
}
.tool-button.active svg {
  stroke: #fff;
}
.tool-button.active:hover {
  background: #17596f;
  color: #fff;
}

.floating-search {
  padding: 0 14px;
  font-size: 0.9rem;
}

/* ── Zoom bar depth ── */
.zoom-bar {
  background: rgba(255,255,255,0.9);
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.5);
  box-shadow:
    0 4px 20px rgba(0,0,0,0.08),
    inset 0 1px 0 rgba(255,255,255,0.5);
  padding: 5px 8px;
}

.zoom-bar-btn {
  border-radius: 8px;
  transition: all 150ms ease;
}
.zoom-bar-btn:hover {
  background: rgba(0,0,0,0.06);
  transform: scale(1.08);
}

#sidebarButton {
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0;
  padding: 0 8px;
  width: auto;
  min-width: 32px;
  line-height: 1;
}

/* ── Minimap glow ── */
.minimap {
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.5);
  box-shadow:
    0 4px 24px rgba(0,0,0,0.08),
    inset 0 1px 0 rgba(255,255,255,0.4);
}

/* ── Composer depth ── */
.capture-canvas {
  border-radius: 18px;
  border: 1px solid rgba(32, 33, 36, 0.08);
  background: rgba(255, 253, 247, 0.88);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  box-shadow:
    0 18px 50px rgba(32, 33, 36, 0.13),
    0 4px 12px rgba(0,0,0,0.06);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Toast & Modal Polish
   ═══════════════════════════════════════════════════════════════════════════ */

.toast {
  border-radius: 14px;
  padding: 0.8rem 1rem;
  font-size: 0.85rem;
  letter-spacing: -0.01em;
  box-shadow:
    0 12px 32px rgba(0,0,0,0.25),
    0 2px 6px rgba(0,0,0,0.1);
  border: 1px solid rgba(255,255,255,0.15);
}

.lightbox img {
  border-radius: 18px;
  box-shadow:
    0 28px 90px rgba(0,0,0,0.45),
    0 4px 16px rgba(0,0,0,0.15);
}

.settings-panel-box,
.shortcuts-box {
  border-radius: 18px;
  box-shadow:
    0 28px 80px rgba(0,0,0,0.22),
    0 2px 8px rgba(0,0,0,0.08);
}

.context-menu {
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.5);
  box-shadow:
    0 16px 48px rgba(0,0,0,0.14),
    0 2px 8px rgba(0,0,0,0.06),
    inset 0 1px 0 rgba(255,255,255,0.4);
  padding: 6px;
}

.context-menu button {
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 0.85rem;
  transition: all 150ms ease;
}

/* ── Focus rings ── */
:focus-visible {
  outline: 2px solid var(--marker);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ── Smooth all transitions ── */
.app-shell {
  transition: grid-template-columns 340ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

@media (max-width: 760px) {
  .navigator {
    transform: none;
    transition: transform 280ms cubic-bezier(0.22, 0.61, 0.36, 1),
                opacity 240ms ease;
  }
}