/* ========================================================================== */
/* MOBILE SIDEBAR REFACTOR (High Specificity)                               */
/* ========================================================================== */

/* NICHOLAS 16/12/2025 */
/* Fix sidepanel height/position to fit scroll properly and avoid cutoff */
.sidepanel {
  position: fixed !important;
  top: 55px !important;
  height: calc(100% - 55px) !important;
  z-index: 3000;
}

/* 1. FORCE TOGGLE ARROW TO VERTICAL CENTER */
body .sidepanel .sidepanel-toggle-container {
  top: 50% !important;
  transform: translateY(-50%) !important;
  z-index: 4000 !important;
  margin: 0 !important;
  /* Reset any potential margins */
  right: 0 !important;
  /* Ensure it sticks to edge */
}

@media (max-width: 1262px) {
  /* 2. PIN TABS TO TOP LEFT (Separated from Arrow) */
  body .sidepanel-tabs-wrapper {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    margin-top: 10px !important;
    z-index: 5000;
    height: auto !important;
  }

  /* 3. RESET CONTENT MARGINS */
  body .sidepanel-tabs-wrapper .sidepanel-tabs,
  body .sidepanel.tabs-left .sidepanel-content-wrapper {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }

  /* 4. STYLE TABS BUTTONS (Tall & Centered) */
  body
    .sidepanel-tabs-wrapper
    .sidepanel-tabs
    .sidepanel-tab
    .sidebar-tab-link {
    height: 50px !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  body
    .sidepanel-tabs-wrapper
    .sidepanel-tabs
    .sidepanel-tab
    .sidebar-tab-link
    i,
  body
    .sidepanel-tabs-wrapper
    .sidepanel-tabs
    .sidepanel-tab
    .sidebar-tab-link
    svg {
    font-size: var(--millenio-font-xl) !important;
  }

  /* 5. FIX LEAFLET CONTROLS (Remove interference from .leaflet-top) */
  body .leaflet-top {
    /* User requested to remove top offset in responsive mode */
    top: 0 !important;
    /* Reset from 8% or conflicting values */
    bottom: auto !important;
  }

  /* 6. FIX LEAFLET LEFT CONTROLS (Prevent shift at small screens) */
  body .leaflet-left {
    left: 0 !important;
    margin-left: 0 !important;
  }
}
