/* Advoke CV — Editor Section Sidebar */

.editor-sidebar {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  background-color: var(--white-warm);
  overflow: hidden;
}

.editor-sidebar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border-subtle);
  flex-shrink: 0;
  min-height: 52px;
}

.editor-sidebar__title {
  font-size: var(--text-xs);
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--letter-spacing-wider);
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin: 0;
}

.editor-sidebar__progress {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border-subtle);
  flex-shrink: 0;
}

.editor-sidebar__progress-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: var(--font-weight-medium);
}

.editor-sidebar__progress-value {
  color: var(--color-text);
  font-weight: var(--font-weight-bold);
  font-variant-numeric: tabular-nums;
}

.editor-sidebar__progress-track {
  width: 100%;
  height: 4px;
  background-color: var(--ink-100);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.editor-sidebar__progress-bar {
  height: 100%;
  background-color: var(--color-accent);
  border-radius: var(--radius-full);
  transition: width var(--duration-slow) var(--ease-out);
  width: 0%;
}

.editor-sidebar__list {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-2);
  display: flex;
  flex-direction: column;
  gap: 2px;
  list-style: none;
  margin: 0;
  -webkit-overflow-scrolling: touch;
}

.editor-sidebar__list::-webkit-scrollbar {
  width: 6px;
}

.editor-sidebar__list::-webkit-scrollbar-thumb {
  background-color: var(--color-border-strong);
  border-radius: var(--radius-full);
}

.editor-sidebar__item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 40px;
  padding: var(--space-2) var(--space-2);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
  background-color: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  transition: var(--transition-colors);
  width: 100%;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

.editor-sidebar__item:hover {
  background-color: var(--white);
  color: var(--color-text);
}

.editor-sidebar__item:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: -2px;
}

.editor-sidebar__item[aria-current="true"],
.editor-sidebar__item.is-active {
  background-color: var(--color-accent-soft);
  color: var(--color-text);
  border-color: var(--yellow-200);
  font-weight: var(--font-weight-semibold);
}

.editor-sidebar__item.is-active::before {
  content: "";
  position: absolute;
  left: -2px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background-color: var(--color-accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.editor-sidebar__item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--color-text-muted);
}

.editor-sidebar__item.is-active .editor-sidebar__item-icon {
  color: var(--color-accent-active);
}

.editor-sidebar__item-icon svg {
  width: 100%;
  height: 100%;
}

.editor-sidebar__item-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-sidebar__item-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 var(--space-1-5);
  font-size: var(--text-2xs);
  font-weight: var(--font-weight-bold);
  background-color: var(--ink-100);
  color: var(--color-text-muted);
  border-radius: var(--radius-full);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.editor-sidebar__item.is-active .editor-sidebar__item-count {
  background-color: var(--yellow-200);
  color: var(--yellow-800);
}

.editor-sidebar__item-count--hidden {
  background-color: transparent;
  border: 1px dashed var(--color-border-strong);
  color: var(--color-text-subtle);
}

.editor-sidebar__item-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--color-text-subtle);
  cursor: pointer;
  transition: var(--transition-colors);
  flex-shrink: 0;
  padding: 0;
}

.editor-sidebar__item-toggle:hover {
  background-color: rgba(0, 0, 0, 0.06);
  color: var(--color-text);
}

.editor-sidebar__item-toggle svg {
  width: 14px;
  height: 14px;
}

.editor-sidebar__item[data-hidden="true"] {
  opacity: 0.55;
}

.editor-sidebar__item[data-hidden="true"] .editor-sidebar__item-label {
  text-decoration: line-through;
}

.editor-sidebar__item-grip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 20px;
  color: var(--color-text-subtle);
  cursor: grab;
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-out);
  flex-shrink: 0;
}

.editor-sidebar__item:hover .editor-sidebar__item-grip {
  opacity: 1;
}

.editor-sidebar__item-grip:active {
  cursor: grabbing;
}

.editor-sidebar__item-grip svg {
  width: 12px;
  height: 12px;
}

.editor-sidebar__item.is-dragging {
  opacity: 0.5;
}

.editor-sidebar__item.is-drop-target {
  border-top: 2px solid var(--color-accent);
}

.editor-sidebar__add-custom {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 40px;
  padding: var(--space-2);
  margin: var(--space-2) var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-accent-active);
  background-color: transparent;
  border: 1px dashed var(--yellow-300);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-colors);
  justify-content: center;
  flex-shrink: 0;
}

.editor-sidebar__add-custom:hover {
  background-color: var(--color-accent-tint);
  border-color: var(--color-accent);
}

.editor-sidebar__add-custom svg {
  width: 14px;
  height: 14px;
}

.editor-sidebar__footer {
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--color-border-subtle);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex-shrink: 0;
  background-color: var(--white-warm);
}

.editor-sidebar__footer-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 36px;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-secondary);
  background-color: var(--white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-colors);
  text-align: left;
  width: 100%;
}

.editor-sidebar__footer-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-text);
  background-color: var(--color-accent-tint);
}

.editor-sidebar__footer-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--color-accent-active);
}

@media (prefers-reduced-motion: reduce) {
  .editor-sidebar__item,
  .editor-sidebar__item-grip,
  .editor-sidebar__item-toggle,
  .editor-sidebar__add-custom,
  .editor-sidebar__footer-btn,
  .editor-sidebar__progress-bar {
    transition: none;
  }
}