/* ==========================================================================
   Sidebar Layout & Navigation Styles
   ========================================================================== */

#sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: var(--space-xl) var(--space-md);
  user-select: none;
  z-index: 100;
}

/* Brand Logo Container */
.brand-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0 var(--space-sm) var(--space-xl) var(--space-sm);
  text-decoration: none;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--space-md);
  min-height: 48px;
}

.brand-logo-img {
  height: 36px;
  width: auto;
  max-width: 185px;
  object-fit: contain;
  display: block;
  transition: transform var(--transition-fast);
}

.brand-logo:hover .brand-logo-img {
  transform: scale(1.02);
}

.brand-tag {
  font-size: 9px;
  font-weight: 800;
  background: rgba(var(--accent-rgb), 0.15);
  color: var(--accent-primary);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  padding: 2px 6px;
  border-radius: var(--radius-full);
  margin-left: auto;
  letter-spacing: 0.05em;
}

/* Nav Menus Scroll Container */
.sidebar-nav-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  padding-right: 4px;
}

.nav-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dimmed);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0 var(--space-md);
  margin-bottom: var(--space-xs);
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  width: 100%;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 9px 14px;
  border-radius: var(--radius-md);
  color: var(--icon-neutral);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.nav-link:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.nav-link svg, .nav-link .fl-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: currentColor;
  transition: color var(--transition-fast);
}

.nav-link.active {
  background: var(--accent-primary);
  color: #061A10;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(var(--accent-rgb), 0.35);
}

.nav-link.active svg, .nav-link.active .fl-icon {
  color: #061A10;
}

.nav-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.nav-link.active .nav-badge {
  background: rgba(0, 0, 0, 0.2);
  color: #061A10;
}

/* Upgrade Card */
.sidebar-upgrade-card {
  background: linear-gradient(180deg, #131B2C 0%, #0D1320 100%);
  border: 1px solid rgba(var(--accent-rgb), 0.25);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-md);
  margin: var(--space-md) 0 var(--space-sm) 0;
  position: relative;
  overflow: hidden;
}

.sidebar-upgrade-card::before {
  content: '';
  position: absolute;
  top: -20px;
  right: -20px;
  width: 70px;
  height: 70px;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.upgrade-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.upgrade-header .fl-icon {
  color: var(--accent-primary);
  width: 20px;
  height: 20px;
}

.upgrade-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: var(--space-md);
}

.upgrade-btn {
  width: 100%;
  background: var(--accent-primary);
  color: #061A10;
  font-weight: 700;
  font-size: 12px;
  padding: 8px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 8px rgba(var(--accent-rgb), 0.25);
}

.upgrade-btn:hover {
  background: var(--accent-primary-hover);
  box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.4);
}

/* User Account Footer */
.sidebar-footer {
  border-top: 1px solid var(--border-subtle);
  padding-top: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.user-avatar-box {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--bg-card-elevated);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--text-primary);
  font-size: 14px;
  flex-shrink: 0;
}

.user-info-text {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-plan-label {
  font-size: 11px;
  color: var(--text-muted);
}

.sidebar-settings-btn {
  background: none;
  border: none;
  color: var(--icon-neutral);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.sidebar-settings-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.sidebar-settings-btn:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 1px;
}
