@import "./constants.css";

  .sidebar {
    background-color: var(--sidebar-bg);
    color: var(--sidebar-font-color);
    padding: var(--spacing-md) 0;
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--header-height));
    flex: 0 0 240px;
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    position: fixed;
    top: var(--header-height);
    border-right: none;
    box-shadow: var(--box-shadow-sidebar);
    transition: all var(--transition-speed) ease;
    z-index: 10;
    left: 0;
    overflow-y: auto;
    }
  
  .sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 0 var(--spacing-md);
    width: 100%;
  }
  
  .sidebar-nav h2 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #555;
  letter-spacing: 0;
  text-transform: none;
  border-bottom: 2px solid var(--main-color);
  padding-bottom: 6px;
  text-decoration: none;
}

/* Filter sections container */
.sidebar-filters {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 6px var(--spacing-md) var(--spacing-md);
  width: 100%;
}

/* Individual filter section */
.sidebar-section {
  display: flex;
  flex-direction: column;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}

.sidebar-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

/* Taller office multiselect */
.custom-multiselect .mantine-MultiSelect-input {
  max-height: 60px !important;
  overflow-y: auto;
  transition: max-height 0.2s ease;
}

.custom-multiselect .mantine-MultiSelect-input:focus-within {
  max-height: 300px !important;
}

/* Compact section labels */
.sidebar-section h4 {
  font-size: 0.72rem !important;
  margin-bottom: 5px !important;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #888;
  font-weight: 700;
}

/* Compact checklist items */
.sidebar-section .checklist label {
  font-size: 0.82rem !important;
}

.nav-link {
  font-weight: 500;
  color: var(--sidebar-font-color);
  font-size: 0.9rem;
  padding: 5px var(--spacing-md);
  margin-bottom: 1px;
  border-radius: var(--border-radius);
  transition: all var(--transition-speed) ease;
  display: flex;
  align-items: center;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.nav-link:before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 4px;
  background-color: transparent;
  transition: all var(--transition-speed) ease;
}

.nav-link:hover {
  background-color: var(--main-color-light);
  color: var(--main-color);
  transform: translateX(3px);
}

.nav-link.active {
  color: var(--main-color);
  background-color: var(--main-color-light);
  font-weight: 600;
}

.nav-link.active:before {
  background-color: var(--main-color);
}

/* Add a subtle animation for active state */
.nav-link.active:hover {
  background-color: var(--main-color-medium);
  transform: translateX(5px);
}

/* ----------------------------------------------------------*/
/* NAV LINK ICONS                                            */
/* ----------------------------------------------------------*/
.nav-link-icon {
  width: 16px;
  margin-right: 10px;
  text-align: center;
  opacity: 0.85;
  flex-shrink: 0;
}

.nav-link:hover .nav-link-icon,
.nav-link.active .nav-link-icon {
  opacity: 1;
}

/* ----------------------------------------------------------*/
/* SIDEBAR GROUPS (static, always-open sections)             */
/* ----------------------------------------------------------*/
.sidebar-group {
  margin: 1px 0;
}

.sidebar-group-trigger {
  display: flex;
  align-items: center;
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--sidebar-font-color);
  padding: var(--spacing-sm) var(--spacing-md);
  padding-top: 10px;
  border-radius: var(--border-radius);
  cursor: default;
  user-select: none;
  opacity: 0.85;
}

.sidebar-group-label {
  flex: 1;
}

.sidebar-group-templates {
  padding-left: 8px;
}

/* Items inside groups */
.sidebar-group-templates .nav-link {
  color: var(--sidebar-font-color);
  padding-left: 14px;
}

/* Project name at top of project sidebar */
.sidebar-project-name {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--main-color-dark);
  padding: 2px var(--spacing-md) 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-separator {
  margin: 4px var(--spacing-md);
  border-color: rgba(0, 0, 0, 0.08);
}

.sidebar-separator--bottom {
  margin-top: auto;
}
  
/* Colonne wrapper du sidebar dans la grille — cachée sur mobile */
.sidebar-col {
  padding: 0 !important;
}

@media (max-width: 767px) {
  /* Ne pas display:none — ça cacherait aussi le drawer #app-sidebar (position:fixed) */
  .sidebar-col {
    flex: 0 0 0px !important;
    width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
  }
}

/* Overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  top: var(--header-height);
  background: rgba(0, 0, 0, 0.4);
  z-index: 499;
}

.sidebar-overlay--visible {
  display: block;
}

@media (max-width: 767px) {
  /* Drawer : caché par défaut, glisse depuis la gauche */
  /* z-index > 1000 pour passer au-dessus des contrôles Leaflet */
  .sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    height: calc(100vh - var(--header-height));
    width: 260px;
    min-width: 0;
    max-width: 260px;
    flex: none;
    transform: translateX(-100%);
    transition: transform var(--transition-speed) ease;
    z-index: 1050;
    overflow-y: auto;
    padding: var(--spacing-md) 0;
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.15);
  }

  /* Drawer ouvert */
  .sidebar.sidebar--open {
    transform: translateX(0);
  }

  /* Nav verticale dans le drawer */
  .sidebar-nav {
    flex-direction: column;
    padding: 0 var(--spacing-md);
    gap: 2px;
  }

  .nav-link {
    margin-bottom: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    justify-content: flex-start;
    text-align: left;
    min-width: 0;
  }

  .nav-link:before {
    width: 4px;
    height: 100%;
    top: 0;
    bottom: auto;
    left: 0;
    right: auto;
    margin: 0;
  }

  .nav-link:hover  { transform: translateX(3px); }
  .nav-link.active:hover { transform: translateX(5px); }
}


