/* DesignLink Sidebar - DesignLink_SideBar.svg specs: 280px, #003E52, #004D7A */

.designlink-sidebar {
  width: 252px;
  min-width: 252px;
  background-color: #003E52;
  color: #fff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  margin: 14px 0 14px 14px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 62, 82, 0.12);
  overflow: hidden;
}

.sidebar-nav {
  flex: 1;
  padding: 8px 0 16px 0;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Custom scrollbar for sidebar */
.sidebar-nav::-webkit-scrollbar {
  width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.sidebar-group-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.5);
  padding: 14px 18px 7px;
  margin-top: 10px;
}

.sidebar-group-label:first-child {
  margin-top: 0;
  padding-top: 18px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  margin: 2px 9px;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.2s ease;
  border-radius: 7px;
  border-left: 3px solid transparent;
  position: relative;
}

.sidebar-link:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  transform: translateX(2px);
}

.sidebar-link.active {
  background-color: rgba(0, 183, 189, 0.15);
  border-left-color: #00B7BD;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 183, 189, 0.1);
}

.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 60%;
  background: linear-gradient(to bottom, #00B7BD, #00B289);
  border-radius: 0 2px 2px 0;
}

.sidebar-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.85;
  transition: opacity 0.2s ease;
}

.sidebar-link:hover .sidebar-icon,
.sidebar-link.active .sidebar-icon {
  opacity: 1;
  filter: brightness(0) invert(1);
}

.sidebar-text {
  white-space: normal;
  line-height: 1.3;
  letter-spacing: 0.01em;
  flex: 1;
}

/* Layout wrapper when sidebar is present */
.layout-with-sidebar {
  display: flex;
  flex: 1;
  min-height: 0;
  padding: 0 14px 14px 0;
  gap: 0;
}

.layout-with-sidebar main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  margin-left: 14px;
  margin-top: 14px;
  margin-bottom: 14px;
  background-color: #ffffff;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  overflow: visible; /* Don't scroll here - let content flow naturally */
}

/* Responsive: collapse sidebar on smaller screens */
@media (max-width: 991.98px) {
  .designlink-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1030;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.2);
    margin: 0;
    border-radius: 0;
    height: 100vh;
    width: 280px;
    min-width: 280px;
  }

  .designlink-sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1029;
  }

  .sidebar-overlay.is-visible {
    display: block;
  }

  .layout-with-sidebar {
    padding: 0;
  }

  .layout-with-sidebar main {
    margin: 8px;
    border-radius: 8px;
  }
}

/* When global sidebar is shown, hide the in-page left menu on Application details */
.layout-with-sidebar .application-details-container .left-menu {
  display: none;
}
