/* ===== filter.css (enkel filter UI + filter drawer) ===== */

/* Losse POI filter menu (indien gebruikt) */
.poi-filter-menu {
    position: absolute;
    top: 20px; left: 20px;
    z-index: 1000;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .poi-category {
    display: flex; align-items: center; cursor: pointer; gap: 10px;
    padding: 8px; border-radius: 10px; transition: background .3s;
  }
  .poi-category:hover { background: #f0f0f0; }
  .poi-category img { width: 24px; height: 24px; }
  .poi-category span { font-size: 14px; color: #333; }
  .poi-category.active { background: #e85c2c; }
  .poi-category.active span { color: #fff; }
  
  /* Wrapper met knop + panel */
  .filterBtnFlex {
    position: absolute;
    z-index: 99999;
    top: 2em; left: 2em;
    display: flex;
    max-width: 80vw; max-height: 100vw;
    margin-bottom: 1em;
    transform: translateX(0);
    transition: transform 0.75s ease;
    will-change: transform;
    pointer-events: none;     /* wrapper niet klikbaar */
  }
  .filterBtnFlex > .filter,
  .filterBtnFlex > .filterToggleBtn { pointer-events: auto; }
  
  .filterBtnFlex.hide-on-mobile {
    transform: translateX(-350%);
    pointer-events: none;
  }
  /* .filterBtnFlex.hidden { display: none !important; } */
  
  /* Het paneel zelf */
  .filter {
    position: relative;
    z-index: 12000;
    background-color: #fff;
    border-radius: 30px;
    font-family: sans-serif;
    display: flex;
    flex-direction: column;
    width: 18em;
    height: min-content;
    max-height: 80vh;
    overflow-y: auto;
    overflow-x: visible;
    /* padding: 0; */
    padding-bottom: 20px;

  }
  .filter::-webkit-scrollbar { width: 0; background: transparent; }
  
  /* Section in het paneel */
  .filterItem {
    background-color: #eec15f;
    color: #fff;
    box-sizing: border-box;
    padding: 1em 2em;
    display: flex; flex-direction: column; gap: 1em;
    flex-wrap: nowrap;
    border-radius: 0;
  }
  .filterItem.collapsed { background-color: #fff; color: #dc592b; }
  .filterItem.collapsed .filterItemFlex { display: none; }
  
  /* Rij in de section */
  .filterItemFlex {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
    gap: 1em;
  }
  
  /* Titel + icoonrij */
  .filterIconFlex {
    display: flex; align-items: center; gap: 1em;
    justify-content: space-between; cursor: pointer;
  }
  .filterIconFlex h3 {
    font-size: 20px; color: #fff; margin: 0;
  }
  .divider {
    width: 100%; height: 2px; background-color: #fff; border-radius: 100px;
  }
  
  /* Iconen */
  .filterIcon {
    width: 1.5em; height: 1.5em;
    filter: invert(1) brightness(37);
    cursor: pointer;
  }
  .arrowIcon {
    width: 20px; height: 20px;
    filter: invert(1) brightness(37);
    rotate: 180deg; transition: rotate .3s ease; display: block;
  }
  
  /* Omklap-states */
  .filterItem.collapsed h3,
  .filterItem.collapsed .arrowIcon { filter: none; color: #eec15f; font-size: 16px; }
  .filterItem.collapsed .filterIcon { filter: invert(0) brightness(1); }
  .filterItem.collapsed .arrowIcon { rotate: 0deg; }
  
  .textFilter { display: block; }
  
  /* Toggle-knop naast het paneel */
  .filterToggleBtn {
    position: absolute;
    display: block;
    border: none;
    width: 20px; height: 20px;
    font-size: 18px;
    z-index: 10000000;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    left: 100%;
    padding: 1em 0;
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
    background-color: #eec15f;
  }
  .filterToggleBtn img {
    width: 15px; height: 15px;
    transform: rotate(-90deg);
    transition: transform .3s;
    filter: invert(1) brightness(37);
    cursor: pointer;
  }
  .filterToggleBtn.btnToggled img { transform: rotate(90deg); }
  
  /* Inputs: radios/checkboxen in filter */
  .filterItemFlex input[type="radio"],
  .filterItemFlex input[type="checkbox"]{
    appearance: none; -webkit-appearance: none; background-color: transparent;
    margin: 0; font: inherit; width: 20px; height: 20px;
    border: 2px solid #fff; border-radius: 50%;
    display: grid; place-content: center; position: relative; flex-shrink: 0;
  }
  .filterItemFlex input[type="radio"]::before,
  .filterItemFlex input[type="checkbox"]::before{
    content:""; width:10px; height:10px; border-radius:50%;
    transform: scale(0); transition: 120ms transform ease-in-out;
    background-color:#fff; box-shadow: none;
  }
  .filterItemFlex input[type="radio"]:checked::before,
  .filterItemFlex input[type="checkbox"]:checked::before{ transform: scale(1); }
  
  .filterItemFlex label {
    font-weight: bold;
    font-size: 16px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    cursor: pointer;
  }
  
  /* Optionele “Stop route” knop-stijl binnen filtercontext */
  .btnStopRoute {
    z-index: 99999;
    display: none;
    background-color: #ffffff;
  }
  
  /* Drawer-variant van de filter (filtersSection) */
  :root{
    /* gebruikt door kleuren in filters drawer; deze variabelen worden al
       gedefinieerd in je routePlanner.css – hier alleen voor fallback indien nodig */
    --rp-primary:#dc592b;
    --rp-bg:#fff;
  }
  .filtersSection{
    width: 30%;
    max-width: calc(100vw - 64px);
    height: 100svh; /* use small viewport height (iOS safe) */
    min-height: 100dvh; /* fallback */
    position: absolute;
    top: 0; right: -30%;
    z-index: 12000;
    display: grid; grid-template-rows: auto 1fr;
    background: var(--rp-bg);
    backdrop-filter: saturate(110%) blur(0px);
    overflow: visible;
    transition: all 0.75s ease;
  }

  .filtersSection:not(.active){
    transition: 0.75s
    linear(
      0,
      0.004,
      0.016,
      0.035,
      0.063,
      0.098,
      0.141 13.6%,
      0.25,
      0.391,
      0.563,
      0.765,
      1,
      0.891 40.9%,
      0.848,
      0.813,
      0.785,
      0.766,
      0.754,
      0.75,
      0.754,
      0.766,
      0.785,
      0.813,
      0.848,
      0.891 68.2%,
      1 72.7%,
      0.973,
      0.953,
      0.941,
      0.938,
      0.941,
      0.953,
      0.973,
      1,
      0.988,
      0.984,
      0.988,
      1
    );
    /* overflow-y: scroll; */
  }
  .filtersSection.active{ right: 0;
     border-left: 3px solid #eec15f;
    z-index: 11111111111; }
  
  .filtersToggleBtn{
    position: absolute;
    left: -37px; top: 180px;
    padding: 1em .5em;
    display: flex; flex-direction: column; gap: 8px;
    align-items: center; justify-content: center;
    border: 0;
    border-top-left-radius: 12px; border-bottom-left-radius: 12px;
    background: #eec15f;
    cursor: pointer;
    isolation: isolate;
    z-index: 99999;
    font-size: larger;
  }
  .filtersToggleBtn img{
    width:14px; height:14px;
    filter: invert(1) brightness(37);
    transform: rotate(90deg);
    transition: transform .25s ease;
  }
  .filtersSection.active .filtersToggleBtn img{ transform: rotate(-90deg); }
  
  #filtersDrawer{ width: 100%; height: 100%; display: grid; grid-template-rows: auto 1fr; }
  #filtersDrawer .rp-header{
    top: 0; z-index: 2;
    background: linear-gradient(180deg,#fff 0%,rgba(255,255,255,.96) 60%,rgba(255,255,255,0) 100%);
    padding: 20px 22px 10px; border-bottom: 1px solid #fff0ea;
  }
  #filtersDrawer .rp-header h2{
    margin: 0;
    font: 700 20px/1.1 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial;
    color: #eec15f;
  }
  #filtersDrawer .filters-body{
    overflow: auto;   /* allow internal scrolling */
    min-height: 0;    /* IMPORTANT in a grid child so it can actually shrink & scroll */
  }
  #filtersPanel.filter{
    width: 100%;
    /* Make the panel itself the scroll container inside the drawer grid */
    overflow: auto;
    max-height: none;         /* no hard cap that chops content below the header */
    min-height: 0;            /* allow the grid child to actually shrink and scroll */
    border-radius: 0;
  }

  #filtersDrawer{
    min-height: 0; /* let grid rows shrink so the body can scroll */
  }
  
  @media (max-width: 768px){
    .filtersSection{
        width: 100dvw;
        max-width: 100dvw;
        right: -100dvw;
    }
    .filter.closed { gap: 0; }
    .filter.closed .filterItem { padding: .5em !important; }
    .filterIconFlex h3 { font-size: 16px; }
    .filter { gap: .2em; width: 15em; }
    .filterBtnFlex{ top: 12px !important; left: 12px !important; }

     .filtersSection{
      /* position: fixed; */
      top: 0;
    } 
    .filtersSection.active{ 
      right: 0;
      transition: all 0.75s ease;
    }
    .filtersToggleBtn{
      top: 170px;
    }
    /* When drawer is open, move the tab inside the panel (same as routePlanner) */
    .filtersSection.active .filtersToggleBtn.open{
      left: 0;
      border-top-left-radius: 0;
      border-bottom-left-radius: 0;
      border-top-right-radius: 10px;
      border-bottom-right-radius: 10px;
      transition: all .3s ease;
      top: 0px;
    }

    /* Hide vertical label text on mobile when the drawer is open (like planner) */
    .filtersSection.active .filtersToggleBtn p{
      display: none;
    }

    /* Prevent the toggle from overlapping the header title */
    #filtersDrawer .rp-header{
      padding-left: 48px;
    }
  }
/* ===== Right-edge color band that switches from orange (above Filters tab)
   to yellow (from Filters tab downward). Uses CSS variables so it follows
   the tab positions on desktop & mobile. ===== */

/* Defaults (desktop) — keep in sync with .filtersToggleBtn { top: 160px } */

.divider{
  width: 100%;
  height: 2px;
  background-color: #eec15f;
  border-radius: 100px;
  display: block;
}


/* On mobile, the Filters tab top is 96px (see media rule below), so update var */


/* === Right edge color band (orange above Filters tab, yellow from Filters tab down) === */
:root{
  --rightband-width: 3px;
  /* Keep in sync with .filtersToggleBtn { top: ... } for desktop */
  --filters-tab-top: 180px;
}

/* Draw a single vertical band with a split at the filters tab top */
.rightEdgeBand{
  position: fixed;
  top: 0;
  right: 0;
  width: var(--rightband-width);
  height: 100dvh;
  z-index: 11000;            /* behind tabs, above map */
  pointer-events: none;
  background:
    linear-gradient(
      to bottom,
      #dc592b 0,
      #dc592b calc(var(--filters-tab-top) - 1px),
      #eec15f calc(var(--filters-tab-top) - 1px),
      #eec15f 100%
    );
}

/* If you change the vertical position of the Filters tab on mobile, update the variable here */
@media (max-width: 768px){
  /* Currently the tab top is also ~160px; change this if your mobile layout moves it */
  :root{ --filters-tab-top: 172px; }
}

/* === Filter search styled like route planner (activities colors) === */
:root{ --fl-primary:#eec15f; --fl-ring: rgba(245,140,42,.22); }

.fl-search-wrap{ padding: 14px 16px 10px; border-bottom: 1px solid #e9d3a3; background:#fff; position: sticky; top: 0; z-index: 3; }
.fl-input-wrap{ position: relative; }
.fl-input{
  width: 100%; box-sizing: border-box; padding: 12px 44px 12px 14px;
  border: 2px solid #e9d3a3; border-radius: 12px; background:#fff; color:#2b2b2b;
  font: 500 16px/1.2 ui-sans-serif, system-ui; outline: none; transition: border-color .15s ease, box-shadow .15s ease;
}
.fl-input::placeholder{ color:#e9d3a3; }
.fl-input:focus{ border-color: var(--fl-primary); background:#fff; }

.fl-clear{
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; border-radius: 8px; border: 2px solid var(--fl-primary);
  background:#fff; color: var(--fl-primary); display:grid; place-items:center; font: 800 14px/1 ui-sans-serif;
  cursor:pointer; padding:0; transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.fl-clear:hover{ background: var(--fl-primary); color:#fff; }

.fl-suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 6px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  padding: 6px;
  display: block;
  z-index: 1000000;
  max-height: 240px;
  overflow: auto;
}
.fl-suggest.open {
  display: block;
}
.fl-suggest-item {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 10px;
  align-items: center;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  font: 600 14px/1.2 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto;
  color: #333;
  transition: background 0.15s, color 0.15s;
}

/* Hover state for suggestion items */
.fl-suggest-item:hover {
  background: #eec15f;
  color: #fff;
}
.fl-input-wrap.rp-suggest-item.active {
  background: #eec15f !important;
}
.fl-suggest-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fl-suggest-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fl-suggest-empty {
  padding: 10px;
  text-align: center;
  color: #777;
  font: 500 13px/1.2 ui-sans-serif, system-ui;
}

/* Zorg dat keyboard-active duidelijk is */
.fl-suggest .fl-suggest-item.active {
  background: #eec15f;
  color: #fff;
}
.fl-suggest-icon.activiteiten {
  background: #f58c2a;
}
.fl-suggest-icon.cultuurSport {
  background: #9747ff;
}
.fl-suggest-icon.events {
  background: #ffcd62;
}
.fl-suggest-icon.geschiedenis {
  background: #2830a8;
}
.fl-suggest-icon.horeca {
  background: #dc592b;
}
.fl-suggest-icon.andere {
  background: #d8129d;
}
.fl-suggest-icon.parking {
  background: #737373;
}
.fl-suggest-icon.ingang {
  background: #b93b3b;
}
.fl-suggest-icon.route {
  background-color: #54af69;
}
.fl-suggest-icon.Douche {
  background: #d8129d;
}
.fl-suggest-icon.EHBO {
  background: #d8129d;
}

/* === Make shared SuggestBox (rp- classes) look like the Filter theme when used in Filters drawer === */
.filtersSection .rp-suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 6px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  padding: 6px;
  display: block;
  z-index: 1000000;
  max-height: 240px;
  overflow: auto;
}
.filtersSection .rp-suggest.open { display: block; }

.filtersSection .rp-suggest-item {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 10px;
  align-items: center;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  font: 600 14px/1.2 ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto;
  color: #333;
  transition: background 0.15s, color 0.15s;
}

/* Hover + keyboard-active use filter yellow */
.filtersSection .rp-suggest-item:hover,
.filtersSection .rp-suggest .rp-suggest-item.active {
  background: rgba(238, 193, 95, 0.22);
}

.filtersSection .rp-suggest-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.filtersSection .rp-suggest-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Keep the same per-type icon backgrounds as elsewhere */
.filtersSection .rp-suggest-icon.activiteiten { background: #f58c2a; }
.filtersSection .rp-suggest-icon.cultuurSport { background: #9747ff; }
.filtersSection .rp-suggest-icon.events { background: #ffcd62; }
.filtersSection .rp-suggest-icon.geschiedenis { background: #2830a8; }
.filtersSection .rp-suggest-icon.horeca { background: #dc592b; }
.filtersSection .rp-suggest-icon.andere { background: #d8129d; }
.filtersSection .rp-suggest-icon.parking { background: #737373; }
.filtersSection .rp-suggest-icon.ingang { background: #b93b3b; }
.filtersSection .rp-suggest-icon.route { background: #54af69; }
.filtersSection .rp-suggest-icon.Douche { background: #d8129d; }
.filtersSection .rp-suggest-icon.EHBO { background: #d8129d; }

.routeResetBtn {
  background: #fff;
  border: none;
  border-radius: 30px;
  padding: 10px 20px;
  font: 600 14px/1.2 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto;
  color: #dc592b;
  cursor: pointer;
}

.routeResetBtn:hover {
  background: #fff0ea;
}

.routeSaveBtn {
  background: #dc592b;
  border: none;
  border-radius: 30px;
  padding: 10px 20px;
  font: 600 14px/1.2 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto;
  color: #fff;
  cursor: pointer;
  margin-left: 0.5em;
}
.routeSaveBtn:hover {
  background: #e85c2c;
}