#bdi-events-map-container {
  margin: 0;
}

/* Sidebar-left + map layout */
.bdi-map-layout {
  display: flex;
  gap: 12px;
  padding-top: 10px;
}

.bdi-map-sidebar {
  width: 240px;
  flex-shrink: 0;
  order: -1;
}

.bdi-map-sidebar h4 {
  font-size: 13px;
  font-weight: 700;
  margin: 12px 0 6px;
  color: #333;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.bdi-map-sidebar h4:first-of-type {
  margin-top: 8px;
}

.bdi-map-main {
  flex: 1;
  min-width: 0;
  max-width: 900px;
}

/* Search bar — compact, inside sidebar */
.bdi-map-search {
  display: flex;
  gap: 4px;
}

.bdi-map-search input[type="text"] {
  flex: 1;
  padding: 6px 10px;
  font-size: 13px;
  border: 1px solid #ccc;
  border-radius: 3px;
  min-width: 0;
}

.bdi-map-search button {
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  border: 1px solid #277cb2;
  border-radius: 3px;
  background: #277cb2;
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
}

.bdi-map-search button:hover {
  background: #1e6a9a;
}

.bdi-map-search #bdi-near-clear {
  background: #f7f7f7;
  color: #333;
  border-color: #ccc;
}

/* Cert filter pills */
.bdi-cert-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.bdi-cert-btn {
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid #ddd;
  border-radius: 2px;
  background: #f7f7f7;
  color: #555;
  cursor: pointer;
}

.bdi-cert-btn:hover {
  background: #e0e0e0;
}

.bdi-cert-btn.active {
  background: #277cb2;
  color: #fff;
  border-color: #277cb2;
}

/* State/country filter pills */
.bdi-state-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.bdi-state-btn {
  padding: 3px 6px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid #ddd;
  border-radius: 2px;
  background: #f7f7f7;
  color: #555;
  cursor: pointer;
  min-width: 30px;
  text-align: center;
}

.bdi-state-btn:hover {
  background: #e0e0e0;
}

.bdi-state-btn.active {
  background: #277cb2;
  color: #fff;
  border-color: #277cb2;
}

.bdi-state-btn.has-events {
  color: #277cb2;
  border-color: #b8d4e8;
  background: #eef5fa;
}

.bdi-state-btn.has-events:hover {
  background: #d6e8f4;
}

.bdi-state-btn.has-events.active {
  background: #277cb2;
  color: #fff;
  border-color: #277cb2;
}

.bdi-state-btn.past-events {
  color: #277cb2;
  background: repeating-linear-gradient(
    135deg,
    #eef5fa,
    #eef5fa 3px,
    #dce9f3 3px,
    #dce9f3 6px
  );
  border-color: #b8d4e8;
}

.bdi-state-btn.past-events:hover {
  background: repeating-linear-gradient(
    135deg,
    #d6e8f4,
    #d6e8f4 3px,
    #c5daea 3px,
    #c5daea 6px
  );
}

.bdi-state-btn.past-events.active {
  background: #277cb2;
  color: #fff;
  border-color: #277cb2;
}

.bdi-state-btn.no-events {
  color: #aaa;
  background: #f9f9f9;
  border-color: #eee;
}

.bdi-state-btn.no-events:hover {
  background: #f0f0f0;
  color: #888;
}

.bdi-country-btn {
  min-width: auto;
  padding: 3px 8px;
}

/* Marker count badge */
.bdi-marker-label {
  background: #1a5a8a;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  display: block;
  margin-top: -6px;
}

/* Map canvas */
#bdi-map-canvas {
  border: 1px solid #ddd;
  border-radius: 4px;
}

/* List header with count + clear */
.bdi-list-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0 4px;
  flex-wrap: wrap;
}

.bdi-events-count {
  font-size: 15px;
  font-weight: 700;
  color: #333;
}

.bdi-clear-filters {
  background: none;
  border: 1px solid #ccc;
  border-radius: 3px;
  padding: 4px 12px;
  font-size: 12px;
  color: #666;
  cursor: pointer;
}

.bdi-clear-filters:hover {
  background: #f0f0f0;
  color: #333;
}

.bdi-list-footer {
  text-align: center;
  padding: 16px 0;
}

/* Empty state */
.bdi-empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #666;
}

.bdi-empty-state p {
  font-size: 16px;
  margin-bottom: 16px;
}

.bdi-empty-clear {
  font-size: 14px;
  padding: 8px 20px;
}

.bdi-empty-or {
  display: block;
  margin: 12px 0;
  font-size: 13px;
  color: #999;
}

.bdi-empty-contact {
  display: inline-block;
  background: #277cb2;
  color: #fff;
  text-decoration: none;
  padding: 10px 24px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
}

.bdi-empty-contact:hover {
  background: #1e6a9a;
  color: #fff;
}

/* Month-grouped list */
.bdi-month-group {
  margin-bottom: 24px;
}

.bdi-month-header {
  font-size: 16px;
  font-weight: 700;
  color: #277cb2;
  border-bottom: 2px solid #277cb2;
  padding-bottom: 6px;
  margin: 16px 0 12px;
}

.bdi-event-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}

.bdi-event-card {
  padding: 12px;
  border: 1px solid #eee;
  border-radius: 4px;
  background: #fafafa;
  position: relative;
  overflow: visible;
}

.bdi-event-card:hover {
  border-color: #277cb2;
}

.bdi-event-card.bdi-bootcamp {
  background: #f0f6fb;
  border-color: #d0e2f0;
}

.bdi-bootcamp-badge,
.bdi-lang-badge {
  position: absolute;
  top: -10px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  line-height: 1.4;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.bdi-bootcamp-badge {
  left: -10px;
  background: #277cb2;
  color: #fff;
}

.bdi-event-card:not(.bdi-bootcamp) .bdi-lang-badge {
  left: -10px;
  background: #b45309;
  color: #fff;
}

.bdi-bootcamp .bdi-lang-badge {
  left: auto;
  right: -10px;
  background: #b45309;
  color: #fff;
}

/* Map popup language tag */
.bdi-info-lang {
  display: inline-block;
  background: #b45309;
  color: #fff !important;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 8px;
  margin-left: 4px;
  vertical-align: middle;
}

.bdi-event-title {
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  color: #277cb2;
  display: block;
  margin-bottom: 3px;
}

.bdi-event-meta {
  font-size: 13px;
  color: #555;
}

.bdi-event-venue {
  font-size: 13px;
  color: #888;
}

/* Google Maps info window chrome overrides */
.gm-style .gm-style-iw-c {
  overflow: visible !important;
}

.gm-style-iw-chr {
  position: absolute !important;
  top: -12px !important;
  right: -12px !important;
  z-index: 10;
  height: auto !important;
  overflow: visible !important;
}

.gm-style-iw-chr button {
  width: 26px !important;
  height: 26px !important;
  background: #fff !important;
  border-radius: 50% !important;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25) !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.gm-style-iw-chr button span {
  margin: 0 !important;
}

/* Info window */
.bdi-info-window {
  font-size: 13px;
  line-height: 1.5;
  max-width: 300px;
  padding-top: 10px;
}

.bdi-info-window a {
  text-decoration: none;
  color: #277cb2;
}

.bdi-info-cluster strong {
  font-size: 14px;
  display: block;
  margin-bottom: 2px;
}

.bdi-info-count {
  font-size: 12px;
  color: #666;
  margin-bottom: 8px;
}

.bdi-info-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 5px 0;
  border-bottom: 1px solid #eee;
}

.bdi-info-item:last-child {
  border-bottom: none;
}

.bdi-info-item a {
  font-size: 13px;
  font-weight: 600;
}

.bdi-info-item span {
  font-size: 11px;
  color: #888;
  white-space: nowrap;
}

.bdi-contact-prompt {
  text-align: center;
  padding: 4px;
}

.bdi-contact-prompt a {
  font-weight: 700;
}

/* Venue embed on single event pages */
.bdi-venue-map {
  border: 1px solid #ddd;
  border-radius: 4px;
  margin: 12px 0;
}

.bdi-no-events {
  color: #666;
  font-style: italic;
  padding: 20px 0;
}

/* Page template overrides */
body.page-template-page-event-map.bdi-map-page .external-div,
body.page-template-page-event-map.bdi-map-page .header-img,
body.page-template-page-event-map.bdi-map-page .single-page-img,
body.page-template-page-event-map.bdi-map-page .external-div .box-image-page img,
body.page-template-page-event-map.bdi-map-page .external-div .featured-image {
  height: 240px !important;
}

body.page-template-page-event-map.bdi-map-page .box-text {
  top: 75% !important;
}

body.page-template-page-event-map.bdi-map-page .box-text h2 {
  font-size: 20px;
}

body.bdi-map-page .container-fluid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Non-public event indicators (admin-only) */
.bdi-non-public {
  opacity: 0.55;
}

.bdi-event-card.bdi-non-public {
  border-style: dashed;
  background: #fefcf3;
}

.bdi-event-card.bdi-non-public:hover {
  opacity: 0.8;
}

.bdi-visibility-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 7px;
  border-radius: 10px;
  line-height: 1.4;
  vertical-align: middle;
}

.bdi-event-card .bdi-visibility-badge {
  position: absolute;
  top: -10px;
  right: 0px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.bdi-vis-draft {
  background: #9ca3af;
  color: #fff;
}

.bdi-vis-pending {
  background: #d97706;
  color: #fff;
}

.bdi-vis-private {
  background: #dc2626;
  color: #fff;
}

.bdi-vis-protected {
  background: #7c3aed;
  color: #fff;
}

/* Info window non-public items */
.bdi-info-item.bdi-non-public {
  opacity: 0.6;
}

.bdi-info-window .bdi-visibility-badge {
  margin-left: 4px;
  font-size: 8px;
  padding: 1px 5px;
}

/* Mobile */
@media (max-width: 768px) {
  .bdi-map-layout {
    flex-direction: column;
  }

  .bdi-map-sidebar {
    width: 100%;
    order: 0;
  }

  .bdi-map-main {
    max-width: 100%;
  }

  .bdi-event-grid {
    grid-template-columns: 1fr;
  }

  body.page-template-page-event-map.bdi-map-page .external-div,
  body.page-template-page-event-map.bdi-map-page .external-div .featured-image {
    height: 120px !important;
  }

  body.page-template-page-event-map.bdi-map-page .box-text {
    top: 50% !important;
  }
}
