.sidebar {
  width: 100%;
  height: 100%;
  background-color: var(--vscode-sideBar-background);
  border-right: 1px solid var(--vscode-sideBar-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-section {
  margin-bottom: 4px;
}

.sidebar-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--vscode-sideBar-foreground);
}

.sidebar-action {
  background: transparent;
  border: none;
  padding: 2px;
  color: var(--vscode-sideBar-foreground);
  cursor: pointer;
  opacity: 0.7;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
}

.sidebar-action:hover {
  opacity: 1;
  background-color: var(--vscode-list-hoverBackground);
}

.sidebar-section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  font-size: 12px;
  color: var(--vscode-descriptionForeground);
}

.section-icon {
  font-size: 8px;
}

.sidebar-list {
  display: flex;
  flex-direction: column;
}

.sidebar-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 12px 6px 12px;
  cursor: pointer;
  border-left: 2px solid transparent;
}

.sidebar-item:hover {
  background-color: var(--vscode-list-hoverBackground);
}

.sidebar-item.selected {
  background-color: var(--vscode-list-activeSelectionBackground);
  border-left-color: var(--vscode-focusBorder);
}

.post-type-icon {
  font-size: 14px;
  line-height: 1.4;
  flex-shrink: 0;
  opacity: 0.85;
}

.sidebar-item-content {
  flex: 1;
  min-width: 0;
}

/* Post type specific styling */
.sidebar-item.post-type-picture {
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.05) 0%, transparent 100%);
}

.sidebar-item.post-type-aside {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.05) 0%, transparent 100%);
}

.sidebar-item.post-type-quote {
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.05) 0%, transparent 100%);
}

.sidebar-item.post-type-link {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.05) 0%, transparent 100%);
}

.sidebar-item.post-type-video {
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.05) 0%, transparent 100%);
}

.sidebar-item-title {
  font-size: 13px;
  color: var(--vscode-sideBar-foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-item-meta {
  font-size: 11px;
  color: var(--vscode-descriptionForeground);
  margin-top: 2px;
}

.sidebar-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: var(--vscode-descriptionForeground);
}

.sidebar-empty p {
  margin-bottom: 16px;
}

/* Load More Button */
.sidebar-load-more {
  padding: 12px 16px;
  display: flex;
  justify-content: center;
}

.load-more-button {
  width: 100%;
  padding: 8px 16px;
  background-color: var(--vscode-button-secondaryBackground);
  color: var(--vscode-button-secondaryForeground);
  border: none;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.load-more-button:hover:not(:disabled) {
  background-color: var(--vscode-button-secondaryHoverBackground);
}

.load-more-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Media Grid */
.media-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
  padding: 4px;
}

.media-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  cursor: pointer;
  border-radius: 4px;
}

.media-item:hover {
  background-color: var(--vscode-list-hoverBackground);
}

.media-item.selected {
  background-color: var(--vscode-list-activeSelectionBackground);
}

.media-thumbnail {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--vscode-input-background);
  border-radius: 4px;
  flex-shrink: 0;
  overflow: hidden;
}

.media-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-item-info {
  flex: 1;
  min-width: 0;
}

.media-item-name {
  font-size: 12px;
  color: var(--vscode-sideBar-foreground);
}

.media-item-size {
  font-size: 10px;
  color: var(--vscode-descriptionForeground);
}

/* Settings Panel */
.settings-panel {
  padding: 0 12px 12px;
}

.settings-nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 0 12px;
}

.settings-nav-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--vscode-sideBar-foreground);
  border-radius: 3px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background-color 0.1s;
}

.settings-nav-entry:hover {
  background-color: var(--vscode-list-hoverBackground);
}

.settings-nav-entry.active {
  background-color: var(--vscode-list-activeSelectionBackground);
  color: var(--vscode-list-activeSelectionForeground);
}

.settings-nav-entry-icon {
  font-size: 14px;
  width: 20px;
  text-align: center;
}

.settings-nav-badge {
  margin-left: auto;
  font-size: 11px;
  color: var(--vscode-testing-iconPassed, #73c991);
}

.settings-hint {
  font-size: 11px;
  color: var(--vscode-descriptionForeground);
  padding: 8px 12px;
  line-height: 1.5;
}

.settings-group {
  margin-bottom: 24px;
}

.settings-group h3 {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--vscode-sideBar-foreground);
}

.settings-field {
  margin-bottom: 12px;
}

.settings-field label {
  display: block;
  font-size: 12px;
  margin-bottom: 4px;
  color: var(--vscode-descriptionForeground);
}

.settings-field input {
  width: 100%;
  padding: 6px 8px;
}

.settings-group button {
  width: 100%;
  margin-bottom: 8px;
}

.settings-status {
  font-size: 12px;
  margin-top: 8px;
}

/* Search Box */
.search-box {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px 8px;
  position: relative;
}

.search-box input {
  flex: 1;
  padding: 6px 28px 6px 8px;
  font-size: 12px;
  background-color: var(--vscode-input-background);
  border: 1px solid var(--vscode-input-border);
  color: var(--vscode-input-foreground);
  border-radius: 3px;
}

.search-box input::placeholder {
  color: var(--vscode-input-placeholderForeground);
}

.search-box input:focus {
  outline: none;
  border-color: var(--vscode-focusBorder);
}

.search-box button[type="submit"] {
  position: absolute;
  right: 40px;
  background: transparent;
  border: none;
  padding: 4px;
  color: var(--vscode-descriptionForeground);
  cursor: pointer;
  opacity: 0.7;
}

.search-box button[type="submit"]:hover {
  opacity: 1;
}

.search-box .clear-search {
  position: absolute;
  right: 16px;
  background: transparent;
  border: none;
  padding: 4px;
  color: var(--vscode-descriptionForeground);
  cursor: pointer;
  font-size: 10px;
  opacity: 0.7;
}

.search-box .clear-search:hover {
  opacity: 1;
}

/* Sidebar header actions */
.sidebar-actions {
  display: flex;
  gap: 4px;
}

.sidebar-action.active {
  background-color: var(--vscode-list-activeSelectionBackground);
  opacity: 1;
}

/* Calendar View */
.calendar-view {
  padding: 8px 12px;
  border-bottom: 1px solid var(--vscode-sideBar-border);
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--vscode-descriptionForeground);
  margin-bottom: 8px;
}

.calendar-header.collapsible-header {
  cursor: pointer;
  padding: 4px 6px;
  margin: 0 -6px 8px -6px;
  border-radius: 3px;
  user-select: none;
}

.calendar-header.collapsible-header:hover {
  background-color: var(--vscode-list-hoverBackground);
}

.calendar-header.collapsible-header.collapsed {
  margin-bottom: 0;
}

.calendar-header .collapse-icon {
  font-size: 9px;
  margin-right: 4px;
  opacity: 0.7;
}

.calendar-header .clear-filter {
  background: transparent;
  border: none;
  color: var(--vscode-descriptionForeground);
  cursor: pointer;
  font-size: 10px;
  padding: 2px 4px;
  opacity: 0.7;
}

.calendar-header .clear-filter:hover {
  opacity: 1;
}

.calendar-years {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.calendar-year-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  cursor: pointer;
  border-radius: 3px;
  font-size: 12px;
  color: var(--vscode-sideBar-foreground);
}

.calendar-year-header:hover {
  background-color: var(--vscode-list-hoverBackground);
}

.calendar-year-header.selected {
  background-color: var(--vscode-list-activeSelectionBackground);
}

.calendar-year-header .expand-icon {
  font-size: 8px;
  color: var(--vscode-descriptionForeground);
  width: 10px;
}

.calendar-year-header .year-label {
  flex: 1;
}

.calendar-year-header .year-count {
  font-size: 10px;
  color: var(--vscode-descriptionForeground);
  background-color: var(--vscode-badge-background);
  padding: 1px 6px;
  border-radius: 8px;
}

.calendar-months {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding-left: 16px;
  margin-top: 2px;
}

.calendar-month {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 6px;
  cursor: pointer;
  border-radius: 3px;
  font-size: 12px;
  color: var(--vscode-sideBar-foreground);
}

.calendar-month:hover {
  background-color: var(--vscode-list-hoverBackground);
}

.calendar-month.selected {
  background-color: var(--vscode-list-activeSelectionBackground);
}

.calendar-month .month-count {
  font-size: 10px;
  color: var(--vscode-descriptionForeground);
}

.calendar-empty {
  font-size: 12px;
  color: var(--vscode-descriptionForeground);
  padding: 8px;
  text-align: center;
}

/* Filter Panel */
.filter-panel {
  padding: 8px 12px;
  border-bottom: 1px solid var(--vscode-sideBar-border);
}

.filter-section {
  margin-bottom: 12px;
}

.filter-section:last-child {
  margin-bottom: 0;
}

.filter-header {
  display: flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--vscode-descriptionForeground);
  margin-bottom: 6px;
}

.filter-header.collapsible-header {
  cursor: pointer;
  padding: 4px 6px;
  margin: 0 -6px 6px -6px;
  border-radius: 3px;
  user-select: none;
}

.filter-header.collapsible-header:hover {
  background-color: var(--vscode-list-hoverBackground);
}

.filter-header.collapsible-header.collapsed {
  margin-bottom: 0;
}

.filter-header .collapse-icon {
  font-size: 9px;
  margin-right: 4px;
  opacity: 0.7;
}

.filter-header .clear-filter {
  background: transparent;
  border: none;
  color: var(--vscode-descriptionForeground);
  cursor: pointer;
  font-size: 10px;
  padding: 2px 4px;
  margin-left: auto;
  opacity: 0.7;
}

.filter-header .clear-filter:hover {
  opacity: 1;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.filter-chip {
  background-color: var(--vscode-button-secondaryBackground);
  color: var(--vscode-button-secondaryForeground);
  border: none;
  padding: 2px 8px;
  font-size: 11px;
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 0.15s, opacity 0.15s;
}

.filter-chip:hover {
  background-color: var(--vscode-button-secondaryHoverBackground);
}

.filter-chip.active {
  background-color: var(--vscode-button-background);
  color: var(--vscode-button-foreground);
}

/* Colored filter chips (tags with assigned colors) */
.filter-chip.has-color {
  border: 1px solid transparent;
}

.filter-chip.has-color:hover {
  opacity: 0.85;
}

.filter-chip.has-color.active {
  box-shadow: 0 0 0 2px var(--vscode-focusBorder, #007fd4);
}

/* Filter Status */
.filter-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  font-size: 11px;
  color: var(--vscode-descriptionForeground);
  background-color: var(--vscode-list-hoverBackground);
  border-bottom: 1px solid var(--vscode-sideBar-border);
}

.filter-status button {
  background: transparent;
  border: none;
  color: var(--vscode-textLink-foreground);
  cursor: pointer;
  font-size: 11px;
  padding: 0;
}

.filter-status button:hover {
  text-decoration: underline;
}

/* Unsaved drafts styling */
.status-unsaved {
  color: #f59e0b;
}

.sidebar-item.unsaved {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.1) 0%, transparent 100%);
}

.sidebar-item.unsaved .sidebar-item-title {
  display: flex;
  align-items: center;
  gap: 6px;
}

.unsaved-indicator {
  color: #f59e0b;
  font-size: 10px;
  flex-shrink: 0;
}

.sidebar-item.unsaved .sidebar-item-meta {
  font-style: italic;
}

/* Chat List Styles */
.chat-list {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.chat-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--vscode-sideBar-foreground);
  border-bottom: 1px solid var(--vscode-sideBar-border);
}

.chat-new-button {
  background: transparent;
  border: none;
  color: var(--vscode-textLink-foreground);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 3px;
}

.chat-new-button:hover {
  background-color: var(--vscode-list-hoverBackground);
}

.chat-user-info {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--vscode-descriptionForeground);
  border-bottom: 1px solid var(--vscode-sideBar-border);
}

.chat-user-icon {
  font-size: 14px;
}

.chat-username {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-list-items {
  flex: 1;
  overflow-y: auto;
}

.chat-list-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--vscode-sideBar-border);
}

.chat-list-item:hover {
  background-color: var(--vscode-list-hoverBackground);
}

.chat-item-content {
  flex: 1;
  overflow: hidden;
}

.chat-item-title {
  font-size: 13px;
  color: var(--vscode-foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 2px;
}

.chat-item-date {
  font-size: 11px;
  color: var(--vscode-descriptionForeground);
}

.chat-item-delete {
  background: transparent;
  border: none;
  color: var(--vscode-descriptionForeground);
  cursor: pointer;
  font-size: 16px;
  padding: 0 4px;
  opacity: 0;
  transition: opacity 0.15s;
}

.chat-list-item:hover .chat-item-delete {
  opacity: 1;
}

.chat-item-delete:hover {
  color: var(--vscode-errorForeground);
}

.chat-loading,
.chat-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  color: var(--vscode-descriptionForeground);
  font-size: 13px;
}

.chat-start-button,
.chat-login-button {
  margin-top: 12px;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--vscode-button-foreground);
  background-color: var(--vscode-button-background);
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.chat-start-button:hover,
.chat-login-button:hover {
  background-color: var(--vscode-button-hoverBackground);
}

.chat-auth-prompt {
  padding: 24px;
  text-align: center;
  color: var(--vscode-descriptionForeground);
}

.chat-auth-prompt p {
  margin: 0 0 12px 0;
  font-size: 13px;
}

.device-code-prompt {
  margin-top: 16px;
}

.device-code-prompt a {
  color: var(--vscode-textLink-foreground);
  text-decoration: none;
  font-size: 12px;
}

.device-code-prompt a:hover {
  text-decoration: underline;
}

.device-code {
  margin-top: 8px;
  padding: 8px 16px;
  font-size: 20px;
  font-weight: 600;
  font-family: var(--vscode-editor-font-family, monospace);
  letter-spacing: 3px;
  color: var(--vscode-foreground);
  background-color: var(--vscode-input-background);
  border: 1px solid var(--vscode-input-border);
  border-radius: 4px;
}
