/* ==========================================================================
   TOOL SIDEBAR – Responsive, clean, collapsible, on-brand
   ========================================================================== */

/* =========================
   Base Sidebar (Desktop)
   ========================= */
.tool-sidebar {
  position: fixed;
  top: 76px;                      /* Below fixed navbar */
  left: 0;
  bottom: 0;
  width: 280px;
  background: var(--bs-primary);  /* Astronaut #255c71 */
  color: #fff;
  z-index: 1030;
  overflow-y: auto;
  transform: translateX(0);
  transition: transform 0.3s ease;
  box-shadow: 4px 0 15px rgba(0,0,0,0.15);
}

/* =========================
   Sidebar Header
   ========================= */
/* =========================
   Sidebar Header
   ========================= */
.sidebar-header {
  padding: 1.5rem;
  background: rgba(0,0,0,0.2);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  font-size: 1.1rem;
  font-weight: 600;
}

/* Add padding on mobile to avoid toggle button overlap */
@media (max-width: 992px) {
  .sidebar-header {
    padding-left: 4rem; /* Make room for the toggle button */
  }
}
/* =========================
   Section Headers
   ========================= */
.nav-section {
  padding: 0.9rem 1.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: none;           /* ✅ no forced caps */
  letter-spacing: 0.5px;
  color: var(--bs-info);          /* Downy #78c3d6 */
  cursor: pointer;
  display: flex;
  align-items: center;
  user-select: none;
  transition: background 0.2s ease;
}

.nav-section:hover {
  background: rgba(255,255,255,0.1);
}

/* =========================
   Chevron
   ========================= */
.collapse-chevron {
  margin-left: auto;
  font-size: 0.95rem;
  transition: transform 0.3s ease;
}

.nav-section[aria-expanded="false"] .collapse-chevron {
  transform: rotate(-90deg);
}

/* =========================
   Divider
   ========================= */
.nav-divider {
  height: 1px;
  background: rgba(255,255,255,0.15);
  margin: 1rem 1.5rem;
}

/* =========================
   Navigation Links
   ========================= */
.nav-item .nav-link {
  padding: 0.75rem 2.2rem;
  color: rgba(255,255,255,0.88);
  display: block;
  font-size: 0.9rem;
  transition: background 0.25s ease, padding-left 0.25s ease;
}

/* Hover */
.nav-item .nav-link:hover:not(.disabled) {
  background: var(--bs-secondary); /* Steel Blue */
  color: #fff;
  padding-left: 2.5rem;
}

/* Active */
.nav-item .nav-link.active {
  background: var(--bs-info);     /* Downy */
  color: #fff;
  font-weight: 600;
  border-left: 4px solid #fff;
  padding-left: calc(2.2rem - 4px);
}

/* Disabled */
.nav-item .nav-link.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* =========================
   Collapse Animation
   ========================= */
.collapse {
  transition: height 0.35s ease;
}

/* =========================
   Sidebar Toggle Button
   ========================= */
.sidebar-collapse-btn {
  position: absolute;
  top: 1rem;
  right: -40px;
  width: 40px;
  height: 40px;
  background: var(--bs-primary);
  color: #fff;
  border: none;
  border-radius: 0 8px 8px 0;
  font-size: 1.1rem;
  box-shadow: 3px 0 10px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* =========================
   Tablet & Mobile Behaviour
   ========================= */
@media (max-width: 992px) {

  .tool-sidebar {
    width: 260px;
    transform: translateX(-100%);
  }

  .tool-sidebar.show {
    transform: translateX(0);
  }

  /* Improve touch targets */
  .nav-item .nav-link {
    padding: 0.85rem 2rem;
    font-size: 0.95rem;
  }

  .nav-section {
    padding: 1rem 1.25rem;
  }
}

/* =========================
   Small Mobile Refinements
   ========================= */
@media (max-width: 576px) {

  .tool-sidebar {
    width: 240px;
  }

  .sidebar-header {
    font-size: 1rem;
    padding: 1.25rem;
  }

  .nav-section {
    font-size: 0.8rem;
  }
}
/* =========================
   Mobile Sidebar Toggle Button
   ========================= */
.sidebar-toggle-btn {
  position: fixed;
  top: 90px; /* below navbar */
  left: 1rem;
  z-index: 1040;
  width: 42px;
  height: 42px;
  background: var(--bs-primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

/* Hide toggle on desktop */
@media (min-width: 992px) {
  .sidebar-toggle-btn {
    display: none;
  }
}
