/* Events browse bar — unified modern control panel */

.ev-browse-panel {
  position: relative;
  z-index: 6;
  margin-bottom: 14px;
  padding: 12px;
  border-radius: 14px;
  background: linear-gradient(145deg, #ffffff 0%, #f4f7ff 100%);
  border: 1px solid rgba(30, 58, 138, 0.1);
  box-shadow: 0 4px 18px rgba(30, 58, 138, 0.08);
  pointer-events: auto;
  isolation: isolate;
}

.ev-browse-head {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  align-items: stretch;
}
.ev-browse-head .ev-browse-primary {
  display: contents;
  margin-bottom: 0;
}

.ev-browse-primary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

/* Compact refine trigger — filters + search drawer */
.ev-refine-trigger {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  min-width: 52px;
  min-height: 52px;
  padding: 0;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  background: linear-gradient(145deg, #f9a825 0%, #ff6d00 55%, #e65100 100%);
  color: #fff;
  box-shadow:
    0 4px 14px rgba(230, 81, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.35) inset;
  transition: transform 0.15s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  grid-column: 3;
  grid-row: 1;
  align-self: stretch;
}
.ev-refine-trigger-ring {
  position: absolute;
  inset: -3px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(249, 168, 37, 0.5), rgba(30, 58, 138, 0.25));
  opacity: 0;
  z-index: 0;
  transition: opacity 0.25s;
}
.ev-refine-trigger.has-active .ev-refine-trigger-ring {
  opacity: 1;
  animation: ev-refine-pulse 2s ease-in-out infinite;
}
@keyframes ev-refine-pulse {
  0%, 100% { transform: scale(1); opacity: 0.65; }
  50% { transform: scale(1.06); opacity: 1; }
}
.ev-refine-trigger-icon {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}
.ev-refine-trigger-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 2px #e65100, 0 0 10px rgba(255, 255, 255, 0.9);
  z-index: 2;
}
.ev-refine-trigger-dot[hidden] {
  display: none !important;
}
.ev-refine-trigger:hover {
  transform: translateY(-1px);
  box-shadow:
    0 6px 20px rgba(230, 81, 0, 0.42),
    0 0 0 1px rgba(255, 255, 255, 0.45) inset;
}
.ev-refine-trigger.is-open {
  background: linear-gradient(145deg, var(--pn) 0%, #2a4fad 100%);
  box-shadow:
    0 6px 20px rgba(30, 58, 138, 0.32),
    inset 0 0 0 2px rgba(249, 168, 37, 0.5);
}
.ev-refine-trigger.is-open .ev-refine-trigger-icon {
  transform: rotate(90deg);
  transition: transform 0.25s ease;
}
.ev-refine-trigger:focus-visible {
  outline: 2px solid var(--py);
  outline-offset: 3px;
}

.ev-browse-extra {
  display: none;
  flex-direction: column;
  gap: 10px;
  padding-top: 2px;
}
.ev-browse-extra.is-open {
  display: flex;
  animation: ev-browse-extra-in 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.ev-browse-extra[hidden] {
  display: none !important;
}
.ev-browse-extra.is-open[hidden] {
  display: none !important;
}
@keyframes ev-browse-extra-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.ev-browse-extra .ev-tools-bar {
  margin-bottom: 0;
}

.ev-pill {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 10px 12px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.85);
  color: #607D8B;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}
.ev-pill,
.ev-when-btn,
.ev-role-pill {
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.ev-pill > * { pointer-events: none; }
.ev-pill:hover {
  background: #fff;
  border-color: rgba(30, 58, 138, 0.15);
}
.ev-pill.on {
  background: linear-gradient(145deg, var(--pn) 0%, #2a4fad 100%);
  border-color: var(--pn);
  color: #fff;
  box-shadow: 0 6px 20px rgba(30, 58, 138, 0.28);
}
.ev-pill-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(30, 58, 138, 0.08);
  font-size: 18px;
  flex-shrink: 0;
}
.ev-pill.on .ev-pill-icon {
  background: rgba(255, 255, 255, 0.2);
  color: var(--py);
}
.ev-pill-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.ev-pill-label {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}
.ev-pill-count {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.75;
}
.ev-pill.on .ev-pill-count {
  color: rgba(255, 255, 255, 0.9);
}
.ev-pill-alert {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #FF6D00;
  box-shadow: 0 0 0 2px #fff, 0 0 8px rgba(255, 109, 0, 0.6);
}
.ev-pill-alert[hidden] { display: none !important; }

.ev-browse-toolbar {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

/* ── Mobile: compact anchored filter menu ── */
.ev-filter-menu-btn {
  display: none;
  width: 100%;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 14px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #fff 0%, #eef2ff 100%);
  box-shadow:
    0 1px 3px rgba(30, 58, 138, 0.08),
    inset 0 0 0 1px rgba(30, 58, 138, 0.1);
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--pn);
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.ev-filter-menu-btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--pn) 0%, #2a4fad 100%);
  color: var(--py);
  font-size: 17px;
  flex-shrink: 0;
}
.ev-filter-menu-btn-text {
  flex: 1;
  min-width: 0;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ev-filter-menu-btn-chevron {
  flex-shrink: 0;
  font-size: 16px;
  color: #90A4AE;
  transition: transform 0.25s ease;
}
.ev-filter-menu-btn.is-open {
  box-shadow:
    0 4px 16px rgba(30, 58, 138, 0.16),
    inset 0 0 0 2px rgba(249, 168, 37, 0.45);
}
.ev-filter-menu-btn.is-open .ev-filter-menu-btn-chevron {
  transform: rotate(180deg);
  color: var(--pn);
}

.ev-filter-menu-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1335;
  background: rgba(15, 23, 42, 0.32);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.ev-filter-menu-backdrop.open {
  display: block;
}

.ev-filter-menu-popover {
  display: none;
  flex-direction: column;
  gap: 0;
}
.ev-filter-menu-popover-inner {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px;
}
.ev-filter-menu-section-lbl {
  display: block;
  margin-bottom: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #90A4AE;
}
.ev-filter-menu-section[hidden] {
  display: none !important;
}
.ev-filter-menu-section .ev-role-strip {
  flex-wrap: wrap;
  overflow: visible;
}

@media (max-width: 767px) {
  .ev-browse-primary {
    margin-bottom: 8px;
  }
  .ev-browse-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .ev-filter-menu-btn {
    display: flex;
  }
  .ev-filter-menu-popover {
    display: none;
    position: fixed;
    z-index: 1338;
    margin: 0;
    padding: 0;
    border-radius: 16px;
    background: #fff;
    border: 1px solid rgba(30, 58, 138, 0.1);
    box-shadow:
      0 4px 6px rgba(30, 58, 138, 0.06),
      0 20px 48px rgba(30, 58, 138, 0.22);
    transform-origin: top center;
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
    transition:
      opacity 0.22s cubic-bezier(0.22, 1, 0.36, 1),
      transform 0.26s cubic-bezier(0.34, 1.2, 0.64, 1);
  }
  .ev-filter-menu-popover.open {
    display: flex;
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  .ev-filter-menu-popover .ev-when-toggle {
    width: 100%;
    justify-content: stretch;
  }
  .ev-filter-menu-popover .ev-when-btn {
    flex: 1;
    text-align: center;
  }
  .ev-filter-menu-popover .ev-role-strip {
    width: 100%;
  }
}

@media (min-width: 768px) {
  .ev-filter-menu-btn,
  .ev-filter-menu-backdrop {
    display: none !important;
  }
  .ev-filter-menu-popover {
    display: flex !important;
    position: static;
    flex: 1;
    min-width: 0;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    opacity: 1;
    transform: none;
    background: transparent;
    border: none;
    box-shadow: none;
    visibility: visible;
  }
  .ev-filter-menu-popover[hidden] {
    display: flex !important;
  }
  .ev-filter-menu-popover-inner {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 0;
    width: 100%;
  }
  .ev-filter-menu-section {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .ev-filter-menu-section-lbl {
    display: none;
  }
  .ev-filter-menu-section .ev-when-toggle {
    flex-shrink: 0;
  }
  .ev-filter-menu-section .ev-role-strip {
    flex: 1;
    min-width: 0;
  }
}

.ev-when-toggle {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: rgba(30, 58, 138, 0.08);
  flex-shrink: 0;
}
.ev-when-btn {
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  min-height: 36px;
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #607D8B;
  background: transparent;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.ev-when-btn.on {
  background: #fff;
  color: var(--pn);
  box-shadow: 0 2px 8px rgba(30, 58, 138, 0.15);
}
.ev-when-btn:focus-visible {
  outline: 2px solid var(--py);
  outline-offset: 2px;
}

.ev-role-strip {
  display: flex;
  flex: 1;
  min-width: 0;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 2px 0;
  scrollbar-width: none;
}
.ev-role-strip::-webkit-scrollbar { display: none; }
.ev-role-strip[hidden] {
  display: none !important;
}

.ev-role-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  padding: 7px 12px;
  border: none;
  border-radius: 999px;
  background: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: #607D8B;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  transition: background 0.15s, color 0.15s, transform 0.12s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.ev-role-pill > * { pointer-events: none; }
.ev-role-pill i { font-size: 13px; }
.ev-role-pill:hover { color: var(--pn); }
.ev-role-pill.on {
  background: var(--py);
  color: var(--pn);
  box-shadow: 0 2px 10px rgba(249, 168, 37, 0.35);
}
.ev-role-pill:active { transform: scale(0.97); }

/* Section headers in grid */
.ev-section-hd {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 4px;
  padding: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: var(--pn);
}
.ev-section-hd--action {
  margin-top: 4px;
  padding: 10px 12px;
  border-radius: 10px;
  background: linear-gradient(90deg, #fff8e1 0%, #fff 100%);
  border-left: 4px solid #FF9800;
  color: #E65100;
}
.ev-section-hd--action .ev-section-ct {
  background: #FFE0B2;
  color: #E65100;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
}
.ev-section-ct {
  font-size: 11px;
  font-weight: 600;
  color: #90A4AE;
}

.ev-grid-empty {
  display: none;
  position: relative;
  z-index: 2;
  padding: 36px 24px;
  text-align: center;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
  border-radius: 14px;
  border: 1px dashed #B0BEC5;
  margin: 8px 0 12px;
  pointer-events: none;
}
.ev-grid-empty.is-visible,
.ev-grid-empty:not([hidden]) {
  display: block;
}
.ev-empty-icon {
  font-size: 36px;
  color: #90A4AE;
  margin-bottom: 10px;
}
.ev-empty-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--pn);
  margin-bottom: 6px;
}
.ev-empty-sub {
  font-size: 13px;
  line-height: 1.5;
  color: #607D8B;
  margin: 0;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}
.ev-grid.ev-grid--show-empty {
  min-height: 0;
}
.joined-b { background: #E8F5E9 !important; color: #2E7D32 !important; }

