/* Common styles for documentation site */

/* Search highlight styles */
.search-highlight {
  background-color: #fff3cd;
  padding: 0 2px;
  border-radius: 2px;
}

.nav-link .bg-warning {
  border-radius: 2px;
  padding: 0 2px;
}

#searchFeedback {
  font-size: 0.8rem;
  padding-left: 0.5rem;
}

/* Smooth transitions */
.sidebar-heading {
  transition: all 0.2s ease;
}

.nav-link {
  transition: all 0.2s ease;
}

/* Keyboard shortcut hint */
.search-shortcut {
  position: absolute;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 0.7rem;
  color: #6c757d;
  pointer-events: none;
}

/* No results message */
.no-results {
  padding: 1rem;
  text-align: center;
  color: #6c757d;
  font-style: italic;
}

/* Add styles for the edit button */
.edit-link {
  font-size: 0.8rem;
  opacity: 0.6;
  transition: opacity 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
}

.edit-link:hover {
  opacity: 1;
  background-color: rgba(0, 0, 0, 0.05);
}

/* Ultra-compact category styles */
.category-container {
  margin: 0;
  padding: 0;
}

/* Reduce spacing between sidebar items */
.sidebar .nav-item {
  margin: 0;
  padding: 0;
}

.sidebar-heading {
  cursor: pointer;
  user-select: none;
  padding: 0.15rem 0.25rem; /* Further reduced padding */
  border-radius: 4px;
  margin: 0.1rem 0; /* Minimal margins */
  font-size: 1rem; /* Slightly smaller font */
  line-height: 1.2; /* Tighter line height */
}

.sidebar-heading:hover {
  background-color: rgba(0, 0, 0, 0.03);
}

.sidebar-heading .toggle-icon {
  transition: transform 0.3s ease;
  font-size: 0.8rem; /* Smaller icon */
}

.sidebar-heading.collapsed .toggle-icon {
  transform: rotate(-90deg);
}

.category-documents {
  transition: max-height 0.3s ease;
  overflow: hidden;
  padding-left: 0.75rem; /* Reduced padding */
  border-left: 1px solid #e9ecef; /* Thinner border */
  margin-left: 0.25rem; /* Reduced margin */
  margin-top: 0;
  margin-bottom: 0.1rem; /* Minimal bottom margin */
}

/* Make the nav links more compact */
.sidebar .nav-link {
  padding: 0.15rem 0; /* Minimal padding */
  margin: 0;
  font-size: 0.9rem; /* Slightly smaller font */
  line-height: 1.2; /* Tighter line height */
}

/* Compact the sidebar navigation */
.sidebar .nav {
  padding: 0;
  margin: 0;
}

/* Reduce spacing in the entire sidebar */
.sidebar .mt-4 {
  margin-top: 0.5rem !important; /* Override Bootstrap margin */
}

.sidebar h5.fw-bold.mb-3 {
  margin-bottom: 0.5rem !important; /* Override Bootstrap margin */
  font-size: 1rem; /* Smaller heading */
}

/* Make document items more compact */
.d-flex.align-items-center {
  margin: 0;
  padding: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .search-shortcut {
    display: none !important;
  }

  /* Hide edit button on mobile to save space */
  .edit-link {
    width: 18px;
    height: 18px;
  }

  /* Make category headings easier to tap on mobile */
  .sidebar-heading {
    padding: 0.35rem 0.25rem; /* Slightly larger on mobile for touch targets */
  }
}


/* Global link polishing - remove default underline decorations */
a, a:hover, a:focus, a:active {
  text-decoration: none !important;
}
