/* Sidebar Groups */

/* Header row is clickable */
.sidebar-group-header {
  cursor: pointer;
}

/* Active (expanded) state - override djangocms-admin-style with higher specificity */
.djangocms-admin-style .main #nav-sidebar tr.sidebar-group-header.sidebar-group-header--expanded th a.sidebar-group-link,
.djangocms-admin-style .main #content-main tr.sidebar-group-header.sidebar-group-header--expanded th a.sidebar-group-link {
  color: var(--primary);
}

/* Arrow indicator on the outer right side */
.sidebar-group-link {
  position: relative;
  display: block;
  padding-right: 30px !important;
}

.sidebar-group-link::after {
  content: '›';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  font-weight: 400;
  transition: transform 0.15s;
}

.sidebar-group-header--expanded .sidebar-group-link::after {
  transform: translateY(-50%) rotate(90deg);
}

/* Indent children */
#nav-sidebar .module tr.sidebar-group-child th,
#content-main table tr.sidebar-group-child th {
  padding-left: 20px;
}

/* Vertically center add button in sidebar */
#nav-sidebar .module tr td {
  vertical-align: middle;
}

/* Proper hyphenation for long words */
.sidebar-group-child th,
.sidebar-group-child th a,
.sidebar-group-header th,
.sidebar-group-link {
  hyphens: auto;
  -webkit-hyphens: auto;
  word-break: break-word;
}

/* Hide collapsed children */
.sidebar-group-child--collapsed {
  display: none;
}

/* Child items: normal font-weight by default */
#nav-sidebar .module tr.sidebar-group-child th a,
#content-main table tr.sidebar-group-child th a,
.dashboard #content-main .module tr.sidebar-group-child th a {
  font-weight: 400 !important;
}

/* Child items: border bottom */
#nav-sidebar .module tr.sidebar-group-child th,
#content-main table tr.sidebar-group-child th,
.dashboard #content-main .module tr.sidebar-group-child th {
  border-bottom: 1px solid #f0f0f0 !important;
}

/* Child items: padding-left on hover, no background (exclude active items) - sidebar */
#nav-sidebar .module tr.sidebar-group-child:not(.current-model) th a:hover,
#content-main table tr.sidebar-group-child:not(.current-model) th a:hover {
  padding-left: 42px !important;
  background: none !important;
  background-color: transparent !important;
  color: #374151 !important;
}

/* Child items: padding-left on hover, no background (exclude active items) - dashboard */
.dashboard #content-main .module tr.sidebar-group-child:not(.current-model) th a:hover,
.dashboard #content-main .module table tr.sidebar-group-child:not(.current-model) th a:hover {
  padding-left: 22px !important;
  background: none !important;
  background-color: transparent !important;
  color: #374151 !important;
}

/* Child items: bold when active (current-model), no background */
#nav-sidebar .module tr.sidebar-group-child.current-model th a,
#content-main table tr.sidebar-group-child.current-model th a {
  font-weight: 700 !important;
  background: transparent !important;
}

/* Parent header active when child is selected */
#nav-sidebar .module tr.sidebar-group-header.sidebar-group-header--child-active th a.sidebar-group-link,
#content-main table tr.sidebar-group-header.sidebar-group-header--child-active th a.sidebar-group-link {
  background: #dadee5 !important;
  font-weight: 700 !important;
}

/* Alternating row backgrounds - override nth-child after reordering */
tr.sidebar-row-odd {
  background: var(--body-bg);
}

tr.sidebar-row-even {
  background: var(--darkened-bg);
}
