/* ============================================================
   SIDEBAR — LOGO + FILTER PANEL
   ============================================================ */
#filters-panel {
  width: 280px;
  padding: 0;
  height: 100dvh;
  height: 100vh; /* fallback for browsers without dvh support */
  overflow-y: auto;
  /* Always reserve the scrollbar's width -- otherwise, with classic
     (non-overlay) scrollbars, expanding/collapsing a filter group toggles
     the scrollbar and shifts every row sideways by its width. */
  scrollbar-gutter: stable;
}

/* Desktop: #sidebar (see base.css) is itself a fixed 100vh flex column, with
   the logo above at its own natural height -- so the panel below fills
   whatever's left instead of also claiming a full 100vh of its own, which
   would push the sidebar's total height past one viewport. */
@media (min-width: 1001px) {
  #filters-panel {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
  }
}

#filters-logo {
  background: #ffffff;
  padding: 16px 18px;
  text-align: center;
}

#filters-logo img {
  width: 100%;
  max-width: 260px;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* Select/Deselect All header row */
.filter-header {
  background: #4f5964;
  padding: 12px 16px;
  color: #ffffff;
  font-weight: 600;
  border-bottom: 1px solid #d0d3d4;
}

.filter-header label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
}

/* Accordion group title row */
.filter-group-title {
  background: #ffffff;
  padding: 14px 16px;
  color: #003c71;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 1px solid #d0d3d4;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Caret follows the brand accordion (.accordion-title::after in the
   Global v4 stylesheets): orange keyboard_arrow_down at 150%, pointing
   down when collapsed and flipped up when expanded. */
.filter-group-title .caret {
  color: #e75d2a;
  font-size: 150%;
  font-weight: 700; /* 700 is requested alongside 400 in index.html */
  transform: rotate(180deg);
  transition: transform 0.2s ease;
}

.filter-group-title.closed .caret {
  transform: none;
}

.filter-items {
  background: #ffffff;
  width: 100%;
}

/* Individual filter row */
.filter-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 16px;
  border-bottom: 1px solid #efefef;
  font-size: 15px;
  color: #003c71;
  background: #ffffff;
}

.filter-item:hover {
  background: #f2f3f4;
}

.filter-item span {
  flex: 1 1 auto;
}

.filter-item input[type="checkbox"] {
  flex: 0 0 auto;
  transform: scale(1.05);
}

/* OTU-branded checkbox style */
.filter-checkbox,
#selectAll {
  appearance: none;
  width: 16px;
  height: 16px;
  border: 2px solid #e75d2a;
  border-radius: 2px;
  cursor: pointer;
  position: relative;
  display: inline-block;
}

.filter-checkbox:checked,
#selectAll:checked {
  background: #e75d2a;
}

.filter-checkbox:checked::after,
#selectAll:checked::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 4px;
  width: 4px;
  height: 8px;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  transform: rotate(45deg);
}

#filters-hamburger {
  display: none;
}


/* ============================================================
   MOBILE (max-width: 1000px)
   Sidebar stacks above calendar; filters hidden behind hamburger.
   ============================================================ */
@media (max-width: 1000px) {
  #sidebar {
    width: 100%;
    max-width: 100%;
    flex: 0 0 auto;
    display: block;
    border-right: none;
  }

  #filters-panel {
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
  }

  #filters-hamburger {
    display: block;
    width: 100%;
    box-sizing: border-box;
    background: #e75d2a;
    color: #ffffff;
    padding: 14px 18px;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    position: sticky;
    top: 0;
    z-index: 999;
  }

  #filters-logo {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Filters panel hidden until hamburger is clicked */
  #filters-panel {
    display: none;
    box-sizing: border-box;
    height: auto;
    position: relative;
    z-index: 998;
  }

  #filters-panel.open {
    display: block;
  }
}
