/* Category Item Styles */




.itemWrapper {
  position: relative;
}



.categoryItemContainer {
  display: flex;
  align-items: center;
  border-radius: 4px;
  transition: background-color 0.2s ease;
  position: relative;
  z-index: 1; /* Ensure items are above the line */
  background: var(--bg-color);
  min-height: 36px;
  padding: 2px 0;
}

.expandButton {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center; /* Center the icon */
  color: var(--primary-text-color);
  transition: transform 0.2s ease, background-color 0.2s ease;
  padding: 4px;
  border-radius: 50%; /* Make it a circle */
  width: 24px; /* Explicit width */
  height: 24px; /* Explicit height */
  flex-shrink: 0; /* Prevent shrinking in flex container */
  min-width: 24px; /* Ensure minimum width */
}

.expandButton:hover {
  background-color: var(--hover-bg-color);
  border-color: var(--hover-border-color);
}

.categoryLink {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex: 1;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.categoryLink:hover {
  background-color: var(--hover-bg-color);
  border-color: var(--hover-border-color);
}

/* Remove duplicate - will be handled by .title and .categoryTitle classes */

/* Removed - using unified categoryTitle class instead */

.postCount {
  color: var(--primary-text-color);
  opacity: 0.6;
  font-size: 12px;
  font-weight: 400;
  background-color: var(--hover-bg-color);
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  margin-left: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}



/* Database item styles */
.databaseItem .title {
  font-size: 18px;
  font-weight: 500;
  color: var(--primary-text-color);
}

/* Category title styles */
.categoryTitle {
  font-size: 16px !important;
  font-weight: 500 !important;
}

.title {
  color: var(--primary-text-color);
  line-height: 1.4;
  flex: 1;
  text-align: left;
  display: flex;
  align-items: center;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Post item styles */
.postItem .title {
  font-size: 14px;
  font-weight: 400;
  color: var(--primary-text-color);
  opacity: 0.8;
}

.postItem {
  padding: 2px 8px;
  margin: 1px 0;
  line-height: 1.3;
}

.postItem:hover .title {
  opacity: 1;
}

.coverImage {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: cover;
  margin-right: 12px;
  flex-shrink: 0;
}

/* Hide cover image for non-database items */
.postItem .coverImage,
.categoryItemContainer:not(.databaseItem) .coverImage {
  display: none;
}

.databaseItem {
  display: flex;
  align-items: center;
}

.indentPlaceholder {
  display: inline-block;
  width: 24px; /* Match the expand button width */
  height: 24px; /* Match the expand button height */
  flex-shrink: 0; /* Prevent shrinking in flex container */
  min-width: 24px; /* Ensure minimum width */
}

/* --- Transition Styles --- */
/* --- Transition Styles --- */
.collapsible {
  overflow: hidden;
}

.line {
  position: absolute;
  top: 32px; /* Adjust to start below the parent item */
  bottom: 10px; /* Adjust to end before the last child item's bottom */
  left: 12px; /* Will be overridden by inline style */
  width: 1px;
  background-color: var(--secondary-bg-color);
  z-index: 0;
}

.childrenContainer {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s ease-in-out;
}

.childrenContainer.expanded {
  grid-template-rows: 1fr;
}

.childrenContent {
  overflow: hidden;
}

/* styles/components/CategoryTree.module.css */
.categoryTreeWrapper {
  padding: 16px;
  border: 1px solid var(--border-color);
  border-radius: 32px;
  background-color: var(--default-bg-color);
  box-shadow: 0 0 32px 0 var(--shadow-color);
  transition: background-color 0.2s ease-in-out;
  position: relative;
}


/* Legacy transition classes - can be removed if not used elsewhere */
.collapsibleEnter {
  max-height: 0;
  opacity: 0;
  transform: translateY(-10px);
}

.collapsibleEnterActive {
  max-height: 1000px;
  opacity: 1;
  transform: translateY(0);
  transition: max-height 0.3s ease-out, opacity 0.2s ease-out, transform 0.25s ease-out;
}

.collapsibleExit {
  max-height: 1000px;
  opacity: 1;
  transform: translateY(0);
}

.collapsibleExitActive {
  max-height: 0;
  opacity: 0;
  transform: translateY(-10px);
  transition: max-height 0.25s ease-in, opacity 0.2s ease-in, transform 0.2s ease-in;
}