/**
 * ============================================================================
 * FILE: sidebar.css
 * PURPOSE: Central edit point for sidebar width, category buttons, badges, and toggle animation.
 *
 * CONNECTED TO (WIRING MAP):
 * - HTML Container: index.html (#workspaceSidebar)
 * - Interaction: js/layout/sidebar.js
 * - Item Configuration: js/config/workspace-sidebar.js
 * - Shared Components: css/components/ui-components.css
 *
 * HOW TO EDIT THIS FILE:
 * - [SECTION 1: SIDEBAR TOKENS] -> Change widths, spacing, and category sizing.
 * - [SECTION 2: BADGE TOKENS] -> Change unread badge size and color.
 * - [SECTION 3: TOGGLE ICON] -> Add or replace hamburger/icon animations.
 * ============================================================================
 */

/* SECTION 1: SIDEBAR TOKENS */
:root {
  --workspace-sidebar-width: 15%;
  --workspace-sidebar-min-width: 10.75rem;
  --workspace-sidebar-collapsed-width: 4rem;
  --workspace-sidebar-padding: 1rem 0.8rem;
  --workspace-sidebar-collapsed-padding: 0.7rem 0.35rem;
  --workspace-category-gap: 0.7rem;
  --workspace-category-padding: 0.72rem 0.7rem;
}

/* SECTION 2: BADGE TOKENS */
:root {
  --workspace-unread-badge-bg: var(--danger);
  --workspace-unread-badge-color: #fff;
  --workspace-unread-badge-size: clamp(1rem, 2.5vw, 1.2rem);
}

/* SECTION 3: TOGGLE ICON */
.workspace-sidebar-toggle {
  display: inline-grid;
  width: 2.5rem;
  height: 2.5rem;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--border-light) 30%, white);
  border-radius: var(--radius-full);
  color: var(--accent-text);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.12) 65%),
    color-mix(in srgb, var(--accent-surface) 55%, transparent);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  backdrop-filter: blur(20px) saturate(1.5);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
}

.workspace-sidebar-toggle:hover {
  color: var(--accent-text);
  border-color: var(--accent-border);
  background-color: var(--accent-surface);
  box-shadow: var(--glass-shadow);
}

.workspace-sidebar-toggle:active {
  box-shadow: var(--neu-inset-sm);
}

.workspace-sidebar-toggle [data-sidebar-icon] {
  transition: transform 180ms ease;
}

.workspace-layout.sidebar-collapsed .workspace-sidebar-toggle [data-sidebar-icon] {
  transform: rotate(180deg);
}

@media (max-width: 600px) {
  :root {
    --workspace-sidebar-width: 25%;
    --workspace-sidebar-min-width: 0;
    --workspace-sidebar-padding: 0.55rem 0.2rem;
    --workspace-category-gap: 0.3rem;
    --workspace-category-padding: 0.4rem 0;
  }
}

@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .workspace-sidebar-toggle {
    background: var(--control-surface);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .workspace-sidebar-toggle [data-sidebar-icon] {
    transition: none;
  }
}
