/**
 * ============================================
 * BRAINDUMP V2.00 - SIDEBAR CSS
 * ============================================
 *
 * @version     1.0.0
 * @date        2026-01-05
 *
 * DESIGN REFERENCE:
 * - docs/20260105_mvp_version_2.00_BrainDump_UX_Guide.md
 *   Section 3: MAIN DASHBOARD - Sidebar (170px)
 *
 * ============================================
 */

/* ============================================
   LAYOUT WRAPPER (V8.0 - Centered Layout)
   ============================================ */
.v2-layout {
  display: flex;
  min-height: calc(100vh - 60px);
  margin-top: 0;
}

.v2-sidebar-container {
  flex-shrink: 0;
}

.v2-main-content {
  flex: 1;
  min-width: 0;
  padding: 20px;

  /* V8.0: Center content within main area */
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* V8.0: Ensure inner content has proper max-width and centering */
.v2-main-content > * {
  width: 100%;
  max-width: 900px;
}

/* Allow feed area to be wider on large screens */
.v2-main-content > .feed-area,
.v2-main-content > #feed-area,
.v2-main-content > .smart-stack-container {
  max-width: 1000px;
}

/* ============================================
   SIDEBAR
   ============================================ */
.v2-sidebar {
  width: 170px;
  background: var(--v2-surface, #FFFFF5);
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  height: calc(100vh - 60px);
  position: sticky;
  top: 60px;
  transition: width 250ms ease, transform 250ms ease;
  overflow-y: auto;
  overflow-x: hidden;
}

.v2-sidebar--collapsed {
  width: 50px;
}

.v2-sidebar--collapsed .v2-sidebar__nav-label,
.v2-sidebar--collapsed .v2-sidebar__nav-count,
.v2-sidebar--collapsed .v2-sidebar__filters {
  display: none;
}

.v2-sidebar--collapsed .v2-sidebar__nav-item {
  justify-content: center;
  padding: 12px;
}

/* ============================================
   NAVIGATION
   ============================================ */
.v2-sidebar__nav {
  padding: 16px 0;
  flex: 1;
}

.v2-sidebar__nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  color: var(--v2-text-dark, #134252);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background 150ms ease, color 150ms ease;
  border-left: 3px solid transparent;
  cursor: pointer;
}

.v2-sidebar__nav-item:hover {
  background: var(--v3-accent-subtle, rgba(249, 115, 22, 0.08));
  color: var(--v3-accent, #F97316);
}

.v2-sidebar__nav-item.active {
  background: var(--v3-accent-subtle, rgba(249, 115, 22, 0.1));
  color: var(--v3-accent, #F97316);
  border-left-color: var(--v3-accent, #F97316);
  font-weight: 600;
}

.v2-sidebar__nav-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.v2-sidebar__nav-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.v2-sidebar__nav-count {
  font-size: 12px;
  color: var(--v2-text-light, #627C7C);
  font-weight: 600;
}

/* ============================================
   FILTERS SECTION
   ============================================ */
.v2-sidebar__filters {
  padding: 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.v2-sidebar__filters-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 0;
  background: none;
  border: none;
  color: var(--v2-text-light, #627C7C);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: color 150ms ease;
}

.v2-sidebar__filters-toggle:hover {
  color: var(--v2-text-dark, #134252);
}

.v2-sidebar__filters-icon {
  font-size: 10px;
  transition: transform 200ms ease;
}

.v2-sidebar__filters-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 12px;
  max-height: 200px;
  overflow: hidden;
  transition: max-height 250ms ease, opacity 250ms ease, margin 250ms ease;
}

.v2-sidebar__filters-list.collapsed {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
}

/* Filter Items */
.v2-sidebar__filter {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--v2-radius-sm, 6px);
  cursor: pointer;
  transition: background 150ms ease;
  user-select: none;
}

.v2-sidebar__filter:hover {
  background: rgba(0, 0, 0, 0.04);
}

.v2-sidebar__filter.active {
  background: rgba(32, 140, 141, 0.1);
}

.v2-sidebar__filter input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.v2-sidebar__filter-checkbox {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--v2-text-light, #627C7C);
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 3px;
  background: white;
  transition: all 150ms ease;
}

.v2-sidebar__filter.active .v2-sidebar__filter-checkbox {
  background: var(--v3-accent, #F97316);
  border-color: var(--v3-accent, #F97316);
  color: white;
}

.v2-sidebar__filter-label {
  font-size: 13px;
  color: var(--v2-text-dark, #134252);
}

/* ============================================
   BOTTOM SECTION
   ============================================ */
.v2-sidebar__bottom {
  padding: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  justify-content: flex-end;
}

.v2-sidebar__collapse-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.04);
  border: none;
  border-radius: 50%;
  color: var(--v2-text-light, #627C7C);
  font-size: 12px;
  cursor: pointer;
  transition: all 150ms ease;
}

.v2-sidebar__collapse-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  color: var(--v2-text-dark, #134252);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .v2-sidebar {
    width: 60px;
  }

  .v2-sidebar .v2-sidebar__nav-label,
  .v2-sidebar .v2-sidebar__nav-count,
  .v2-sidebar .v2-sidebar__filters {
    display: none;
  }

  .v2-sidebar .v2-sidebar__nav-item {
    justify-content: center;
    padding: 14px;
  }

  .v2-sidebar .v2-sidebar__bottom {
    display: none;
  }
}

@media (max-width: 768px) {
  .v2-layout {
    flex-direction: column;
  }

  .v2-sidebar {
    display: none;
    /* Mobile uses bottom navigation instead */
  }

  .v2-main-content {
    padding: 16px;
  }
}

/* ============================================
   DARK THEME
   ============================================ */
[data-theme="warm-vault"] .v2-sidebar {
  background: var(--surface-secondary, #1a1a1a);
  border-right-color: rgba(255, 255, 255, 0.1);
}

[data-theme="warm-vault"] .v2-sidebar__nav-item {
  color: rgba(255, 255, 255, 0.8);
}

[data-theme="warm-vault"] .v2-sidebar__nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--v3-accent, #F97316);
}

[data-theme="warm-vault"] .v2-sidebar__nav-item.active {
  background: rgba(249, 115, 22, 0.15);
}

[data-theme="warm-vault"] .v2-sidebar__nav-count {
  color: rgba(255, 255, 255, 0.5);
}

[data-theme="warm-vault"] .v2-sidebar__filters-toggle {
  color: rgba(255, 255, 255, 0.5);
}

[data-theme="warm-vault"] .v2-sidebar__filters-toggle:hover {
  color: rgba(255, 255, 255, 0.8);
}

[data-theme="warm-vault"] .v2-sidebar__filter:hover {
  background: rgba(255, 255, 255, 0.05);
}

[data-theme="warm-vault"] .v2-sidebar__filter.active {
  background: rgba(32, 140, 141, 0.2);
}

[data-theme="warm-vault"] .v2-sidebar__filter-checkbox {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.5);
}

[data-theme="warm-vault"] .v2-sidebar__filter-label {
  color: rgba(255, 255, 255, 0.8);
}

[data-theme="warm-vault"] .v2-sidebar__collapse-btn {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.5);
}

[data-theme="warm-vault"] .v2-sidebar__collapse-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
}

[data-theme="warm-vault"] .v2-sidebar__filters {
  border-top-color: rgba(255, 255, 255, 0.08);
}

[data-theme="warm-vault"] .v2-sidebar__bottom {
  border-top-color: rgba(255, 255, 255, 0.08);
}
