.bhe-widget {
  border: 1px solid #eee;
  border-radius: 16px;
  padding: 18px;
  background: #fff;
  max-width: 100%;
  overflow: hidden;
}

.bhe-header { margin-bottom: 12px; }
.bhe-title { font-size: 20px; font-weight: 700; }
.bhe-subtitle { margin-top: 6px; color: #666; display:flex; gap:12px; flex-wrap:wrap; }
.bhe-team { font-weight: 600; }
.bhe-league { color: #444; }

/* Tabs (Nächste Spiele / Letzte Ergebnisse) – Reiter-Optik */
.bhe-tabs{
  display:flex;
  gap:6px;
  margin: 12px 0 0;
  padding:0;
  background:transparent;
  border-bottom:1px solid #e5e7eb;
  flex-wrap:wrap;
}

.bhe-tab{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  padding:10px 14px;
  font-weight:800;
  text-decoration:none !important;
  line-height:1;
  color:#111 !important;
  background:#f3f4f6 !important;
  border:1px solid #e5e7eb;
  border-bottom:none;
  border-radius:14px 14px 0 0;
  transition: background-color .15s ease, border-color .15s ease;
}

.bhe-tab:hover{
  background:#ededed !important;
}

.bhe-tab--active{
  background:#fff !important;
  border-color:#CA4128;
  color:#111 !important;
  position:relative;
  top:1px; /* visually connects to the panel border */
}

.bhe-tab:focus-visible{
  outline: 3px solid rgba(202,65,40,.35);
  outline-offset: 2px;
}

.bhe-panel { display:none; }
.bhe-panel--active { display:block; }


/* AJAX loading state: gentle overlay + spinner */
@keyframes bheSpin { to { transform: rotate(360deg); } }

.bhe-panel--loading{
  position:relative;
  min-height: 80px;
  pointer-events:none;
}

.bhe-panel--loading > *{
  opacity: .35;
  transition: opacity .18s ease;
}

.bhe-panel--loading:before{
  content:"";
  position:absolute;
  inset:0;
  background: rgba(255,255,255,.55);
  border-radius: 14px;
}

.bhe-panel--loading:after{
  content:"";
  position:absolute;
  top: 14px;
  right: 14px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,.18);
  border-top-color: rgba(202,65,40,.95);
  animation: bheSpin .8s linear infinite;
}


.bhe-table-wrap { overflow-x:auto; }
.bhe-table { width:100%; border-collapse:collapse; }
.bhe-table thead th {
  text-align:left;
  font-weight: 800;
  padding: 10px 8px;
  border-bottom: 1px solid #c84b4b;
}
.bhe-table tbody td {
  padding: 12px 8px;
  border-bottom: 1px solid #eee;
  vertical-align: top;
}

.bhe-col-date { width: 110px; }
.bhe-col-kick, .bhe-col-result { width: 80px; white-space:nowrap; }
.bhe-col-league { width: 260px; }
.bhe-col-venue { width: 170px; }

/* Begegnung / Team-Highlight */
.bhe-matchup{ text-align:center; }
.bhe-matchup .bhe-team{ display:block; }
.bhe-matchup .bhe-sep{ display:block; line-height:1; margin:2px 0; opacity: .75; }
.bhe-team--club{ font-weight:800; color:#CA4128; }

/* Stacked match presentation for "next match" tiles */
.bhe-vs-stack{ text-align:center; line-height:1.25; }
.bhe-vs-sep{ opacity:.7; }

/* Filter + Pagination */
.bhe-filters{
  margin: 6px 0 10px;
}

.bhe-filters__row{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:flex-end;
  width:100%;
}

.bhe-filter{
  display:flex;
  flex-direction:column;
  gap:4px;
  margin:0;
}

.bhe-filter > span{
  font-size:11px;
  color:#777;
  font-weight:600;
  margin:0;
  white-space:nowrap;
}

.bhe-filter select{
  padding:5px 8px;
  border:1px solid #e3e3e3;
  border-radius:10px;
  background:#fff;
  font-size:13px;
  line-height:1.2;
  min-width: 150px;
}

.bhe-filter__btn{
  padding:6px 12px;
  border:1px solid #e3e3e3;
  border-radius:10px;
  background:#f6f6f6;
  color:#222;
  font-weight:600;
  cursor:pointer;
  margin-left:auto;
  white-space:nowrap;
}

.bhe-filter__btn:hover{
  background:#ededed;
}

@media (max-width: 700px){
  .bhe-filters__row{ gap:8px; }
  .bhe-filter select{ min-width: 0; width:100%; }
  .bhe-filter{ flex:1 1 140px; }
  .bhe-filter__btn{ width:100%; margin-left:0; }
}


.bhe-pagination{ display:flex; gap:8px; justify-content:center; align-items:center; margin-top: 12px; flex-wrap:wrap; }
.bhe-page{ display:inline-block; padding:8px 10px; border:1px solid #ddd; border-radius:10px; text-decoration:none; font-weight:800; color:inherit; }
.bhe-page[aria-disabled="true"]{ opacity:.5; pointer-events:none; }
.bhe-page--active{ border-color:#c84b4b; }

/* Responsive Tabelle: auf Mobile als Karten */
@media (max-width: 700px){
  .bhe-table-wrap{ overflow: visible; }
  .bhe-table thead{ display:none; }
  .bhe-table, .bhe-table tbody, .bhe-table tr, .bhe-table td{ display:block; width:100%; }
  .bhe-table tr{ border:1px solid #eee; border-radius: 14px; padding: 12px; margin: 10px 0; }
  .bhe-table tbody td{ border:0; padding: 6px 0; }
  .bhe-table tbody td:before{ content: attr(data-label); display:block; font-size:12px; font-weight:800; color:#666; margin-bottom:2px; }
  .bhe-col-game{ padding-top: 10px; }
}

.bhe-empty { padding: 10px 0; color: #666; }

.bhe-footer { margin-top: 10px; color: #777; font-size: 13px; }

.bhe-tile {
  border: 1px solid #eee;
  border-radius: 16px;
  padding: 16px;
  background: #fff;
}
.bhe-tile__title { font-weight: 800; font-size: 18px; margin-bottom: 8px; }
.bhe-tile__game { font-weight: 700; margin-top: 6px; }
.bhe-tile__league, .bhe-tile__venue { margin-top: 4px; color:#555; }
.bhe-tile__empty { color:#666; }

/* Action links (HHV Spielplan / Tabelle) */
.bhe-col-actions { width: 60px; }
.bhe-action-links {
  display: inline-flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  justify-content: center;
}
.bhe-action-links--tile{
  flex-direction: row;
  gap: 8px;
}
.bhe-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none !important;
  line-height: 1;
  width: 30px;
  height: 30px;
  border: 1px solid #dedede;
  border-radius: 10px;
  background: #f6f6f6;
  color: #4b4b4b;
  opacity: 1;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}
.bhe-icon{
  width: 16px;
  height: 16px;
  fill: currentColor;
  stroke: none;
}
.bhe-action:hover,
.bhe-action:focus {
  background: #fff;
  border-color: #CA4128;
  color: #CA4128;
}

.bhe-action:focus-visible{
  outline: 3px solid rgba(202,65,40,.30);
  outline-offset: 2px;
}

/* Mobile: action icons next to each other */
@media (max-width: 700px){
  .bhe-action-links{ flex-direction: row; gap: 10px; justify-content:flex-start; }
}

/* Tile actions (single match shortcodes) */
.bhe-tile {
  position: relative;
}
.bhe-tile-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  gap: 6px;
}
