/* Premium Light Sidebar - 280px Width, Black Writing & Centered Hover Alignment */
#global-sidebar {
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
  color: #1a1e1a !important;
  width: 280px !important;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  position: relative !important;
}
#global-sidebar.collapsed {
  width: 80px !important;
}
#global-sidebar .border-b,
#global-sidebar .border-t {
  border-color: #f1f5f9 !important;
}
#sidebar-site-title {
  color: #1a1e1a !important;
}
#sidebar-site-subtitle {
  color: #64748b !important;
}

/* Navigation items */
.nav-item, #parent-search-sites {
  color: #1a1e1a !important;
  transition: all 0.2s ease-in-out !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.75rem !important;
  padding: 0.35rem 1rem !important;
  border-radius: 0.75rem !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
}
.nav-item:hover, #parent-search-sites:hover {
  background-color: #f8fafc !important;
  color: #FF640D !important;
}
.nav-item:hover svg, #parent-search-sites:hover svg {
  color: #FF640D !important;
}
.nav-item.active {
  background-color: rgba(255, 100, 13, 0.08) !important;
  color: #FF640D !important;
}
.nav-item.active svg {
  color: #FF640D !important;
}

.nav-item span, #parent-search-sites span {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  line-height: 1.5 !important;
  padding-bottom: 1.5px !important;
}

/* Dynamic SVG sizing inside sidebar (making icons larger) */
#global-sidebar svg:not(#sidebar-toggle-icon) {
  width: 20px !important;
  height: 20px !important;
  transition: all 0.2s ease-in-out !important;
  color: #1a1e1a !important;
}
#global-sidebar .nav-item.active svg {
  color: #FF640D !important;
}
#global-sidebar .nav-item:hover svg,
#global-sidebar #parent-search-sites:hover svg {
  color: #FF640D !important;
}

/* Larger icons when collapsed */
#global-sidebar.collapsed svg:not(#sidebar-toggle-icon) {
  width: 26px !important;
  height: 26px !important;
}

/* Sub-navigation items (Aligned with parent hover box, contents indented) */
.sub-nav-item {
  color: #1a1e1a !important;
  transition: all 0.2s ease-in-out !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.75rem !important;
  padding-inline-start: 2.25rem !important;
  padding-inline-end: 1rem !important;
  padding-top: 0.25rem !important;
  padding-bottom: 0.25rem !important;
  border-radius: 0.5rem !important;
  background-color: transparent !important;
  width: 100% !important;
  border: 0 !important;
  cursor: pointer !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
}
.sub-nav-item:hover {
  background-color: #f8fafc !important;
  color: #FF640D !important;
}
.sub-nav-item.active {
  background-color: rgba(255, 100, 13, 0.08) !important;
  color: #FF640D !important;
}
.sub-nav-item span {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  line-height: 1.5 !important;
  padding-bottom: 1.5px !important;
}

.sub-nav-item .nav-bullet {
  background-color: #cbd5e1 !important;
  transition: all 0.2s ease-in-out !important;
  width: 6px !important;
  height: 6px !important;
}
.sub-nav-item:hover .nav-bullet {
  background-color: #FF640D !important;
}
.sub-nav-item.active .nav-bullet {
  background-color: #FF640D !important;
  transform: scale(1.4) !important;
}

#chevron-search-sites {
  color: #1a1e1a !important;
}
#parent-search-sites:hover #chevron-search-sites {
  color: #FF640D !important;
}

/* Logo toggle & permanent centering rules */
#sidebar-brand-wrapper {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  text-align: center !important;
  width: 100% !important;
}

#sidebar-brand-wrapper a {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  text-align: center !important;
  width: 100% !important;
  margin: 0 auto !important;
}

#sidebar-brand-wrapper a div {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  width: 100% !important;
  margin: 0 auto !important;
}

#global-sidebar .logo-full {
  display: block !important;
  text-align: center !important;
  width: 100% !important;
  margin: 0 auto !important;
}

#global-sidebar .logo-short {
  display: none !important;
  text-align: center !important;
  width: 100% !important;
  margin: 0 auto !important;
}

/* Collapsed visibility overrides */
#global-sidebar.collapsed #sidebar-site-title,
#global-sidebar.collapsed #sidebar-site-subtitle,
#global-sidebar.collapsed .nav-item span,
#global-sidebar.collapsed .sub-nav-item span,
#global-sidebar.collapsed #parent-search-sites span,
#global-sidebar.collapsed #sub-menu-search-sites,
#global-sidebar.collapsed #chevron-search-sites,
#global-sidebar.collapsed #sidebar-projects-list,
#global-sidebar.collapsed #sidebar-footer-container span,
#global-sidebar.collapsed .projects-header-title,
#global-sidebar.collapsed .projects-add-btn,
#global-sidebar.collapsed .logo-full {
  display: none !important;
}

#global-sidebar.collapsed .logo-short {
  display: block !important;
  text-align: center !important;
  width: 100% !important;
  margin: 0 auto !important;
  direction: ltr !important;
  line-height: 1 !important;
}

#global-sidebar.collapsed #sidebar-brand-wrapper {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  padding: 1.25rem 0 !important;
  width: 100% !important;
}

#global-sidebar.collapsed #sidebar-brand-wrapper a {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  width: 100% !important;
  gap: 0 !important;
  margin: 0 auto !important;
}

#global-sidebar.collapsed #sidebar-brand-wrapper a > div:first-child {
  display: none !important;
}

#global-sidebar.collapsed #sidebar-brand-wrapper a > div:last-child {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  width: 100% !important;
  direction: ltr !important;
  margin: 0 auto !important;
}

/* Center items when collapsed */
#global-sidebar.collapsed .p-6 {
  padding: 1.5rem 0.5rem !important;
  justify-content: center !important;
}
#global-sidebar.collapsed .p-4 {
  padding: 1rem 0.5rem !important;
}
#global-sidebar.collapsed .nav-item {
  justify-content: center !important;
  padding: 0.625rem 0 !important;
}
#global-sidebar.collapsed .sub-nav-item {
  justify-content: center !important;
  padding: 0.5rem 0 !important;
}

/* Footer button collapsed style */
#global-sidebar.collapsed #open-publisher-modal {
  border-radius: 9999px !important;
  padding: 8px !important;
  width: 44px !important;
  height: 44px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 auto !important;
}
#global-sidebar.collapsed #open-publisher-modal span {
  display: none !important;
}
#global-sidebar.collapsed #open-publisher-modal svg {
  width: 22px !important;
  height: 22px !important;
  color: #ffffff !important;
}
#global-sidebar.collapsed #sidebar-footer-container {
  padding: 1rem 0.5rem !important;
  display: flex !important;
  justify-content: center !important;
}

/* Sleek Toggle Button styling on the edge */
#sidebar-toggle-btn {
  position: absolute !important;
  top: 47px !important;
  left: 0 !important;
  transform: translate(-50%, 0) !important;
  width: 32px !important;
  height: 32px !important;
  background-color: #ffffff !important;
  border: 1px solid #eaeaea !important;
  border-radius: 5px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  
  transition: all 0.25s ease-in-out !important;
  z-index: 50 !important;
  color: #c5c5c5 !important;
}
#sidebar-toggle-btn:hover {
  background-color:  #ffffff !important;
  border-color: #eaeaea !important;
  color: #c5c5c5 !important;
  
}
#sidebar-toggle-btn:hover svg {
  color: #c5c5c5 !important;
}

/* Rotate toggle button icon */
#global-sidebar.collapsed #sidebar-toggle-icon {
  transform: rotate(180deg) !important;
}

/* Projects list */
#sidebar-projects-list > div {
  color: #1a1e1a !important;
  border-color: transparent !important;
  padding: 0.5rem 0.75rem !important;
  border-radius: 0.5rem !important;
  transition: all 0.2s ease-in-out !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}
#sidebar-projects-list > div:hover {
  background-color: #f8fafc !important;
  color: #FF640D !important;
}
#sidebar-projects-list span.text-slate-350,
#sidebar-projects-list span.text-slate-700 {
  color: #1a1e1a !important;
  font-weight: 700 !important;
}
#sidebar-projects-list div:hover span.text-slate-350,
#sidebar-projects-list div:hover span.text-slate-700 {
  color: #FF640D !important;
}

/* Sidebar footer */
#sidebar-footer-container {
  background-color: #f8fafc !important;
  border-color: #e2e8f0 !important;
  flex-shrink: 0 !important;
}

/* Collapsible sub-menu transition styles */
#sub-menu-search-sites {
  max-height: 0 !important;
  opacity: 0 !important;
  overflow: hidden !important;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease-out !important;
}
#sub-menu-search-sites.open {
  max-height: 160px !important;
  opacity: 1 !important;
}

/* Animated Plus to Minus Icon toggle */
#plus-vertical-line {
  transform-origin: center !important;
  transition: transform 0.3s ease-in-out, opacity 0.2s ease-in-out !important;
}
.menu-open #plus-vertical-line {
  transform: rotate(90deg) scale(0) !important;
  opacity: 0 !important;
}

/* Stack projects action buttons vertically when sidebar is collapsed */
#global-sidebar.collapsed #sidebar-projects-actions-wrapper {
  flex-direction: column !important;
  align-items: center !important;
  gap: 0.5rem !important;
  padding: 0.5rem 0 !important;
}
#global-sidebar.collapsed #nav-item-projects {
  justify-content: center !important;
  padding: 0.5rem 0 !important;
  width: 100% !important;
}
#global-sidebar.collapsed #sidebar-btn-add-project {
  width: 100% !important;
  height: 32px !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  padding: 0 !important;
}
