/* Left Sidebar Styles */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  background: var(--bg-primary);
  border-right: 1px solid var(--border-color);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  z-index: 50;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: var(--shadow-lg);
}

.sidebar.open {
  transform: translateX(0);
}

/* Shift main content when sidebar is open */
body.sidebar-open .container {
  margin-left: 280px;
  transition: margin-left 0.3s ease;
}

body.sidebar-open .header {
  transition: padding-left 0.3s ease;
}

.sidebar-header {
  background: var(--bg-secondary);
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1;
}

.sidebar-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.2s, color 0.2s;
  float: right;
}

.sidebar-close:hover {
  background: var(--bg-primary);
  color: var(--text-primary);
}

.sidebar-title {
  margin: 0;
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 600;
}

.sidebar-content {
  padding: 20px;
  overflow-x: hidden;
}

.sidebar-section {
  margin-bottom: 24px;
  overflow-x: hidden;
}

.sidebar-section-title {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.sidebar-breadcrumb {
  background: var(--bg-secondary);
  padding: 12px 16px;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  margin-bottom: 12px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.sidebar-breadcrumb a {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  display: block;
  padding: 4px 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.sidebar-breadcrumb a:hover {
  text-decoration: underline;
  color: var(--accent-hover);
}

.sidebar-breadcrumb-separator {
  color: var(--text-tertiary);
  margin: 0 4px;
}

.sidebar-breadcrumb-current {
  color: var(--text-primary);
  font-weight: 600;
  display: block;
  padding: 4px 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.sidebar-search {
  width: 100%;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.sidebar-search::placeholder {
  color: var(--text-tertiary);
}

.sidebar-search:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.sidebar-count {
  background: var(--bg-secondary);
  padding: 10px 14px;
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 14px;
  border: 1px solid var(--border-color);
  text-align: center;
}

.sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-action-btn {
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: var(--bg-secondary);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  transition: background-color 0.2s, transform 0.1s;
  border: 1px solid var(--border-color);
}

.sidebar-action-btn:hover {
  background: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
}

.sidebar-action-btn:active {
  transform: scale(0.98);
}

.sidebar-action-btn.primary {
  background: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
}

.sidebar-action-btn.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

/* Hamburger Menu Button */
.sidebar-toggle {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px;
  margin-right: 12px;
  transition: opacity 0.2s;
}

.sidebar-toggle:hover {
  opacity: 0.7;
}

.sidebar-toggle:active {
  transform: scale(0.95);
}

.sidebar-toggle-bar {
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: background-color 0.2s;
}

/* Project List Styles */
.sidebar-projects {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-project-item {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  transition: background-color 0.2s, transform 0.1s;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  box-sizing: border-box;
}

.sidebar-project-item span:last-child {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-project-item:hover {
  background: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
}

.sidebar-project-item:active {
  transform: scale(0.98);
}

.sidebar-project-icon {
  font-size: 16px;
}

.sidebar-loading {
  text-align: center;
  padding: 20px;
  color: var(--text-secondary);
  font-size: 14px;
}

.sidebar-empty {
  text-align: center;
  padding: 20px;
  color: var(--text-secondary);
  font-size: 14px;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .sidebar {
    width: 85%;
    max-width: 320px;
  }
}
