/* =======================================================================
   StatsBet – Stats Today Table Styles (Overrides Avada Defaults)
======================================================================= */

/* General Container */
.statsbet-today-wrapper {
  padding: 0 !important;
  max-width: 100% !important;
  margin: 0 auto !important;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  font-family: 'Segoe UI', sans-serif !important;
}

.statsbet-today-title {
  text-align: center !important;
  font-size: 28px !important;
  font-weight: 700 !important;
  color: #004aad !important;
  margin-bottom: 24px !important;
  letter-spacing: -0.3px !important;
}

/* Table Styling */
.statsbet-today-table {
  width: 100% !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  background-color: transparent !important;
  table-layout: auto !important;
}

.statsbet-today-table thead {
  background-color: #004aad !important;
  color: #ffffff !important;
}

.statsbet-today-table thead tr:hover {
  background-color: #004aad !important;
}

/* Align all cells vertically center (desktop) */
.statsbet-today-table th,
.statsbet-today-table td {
  padding: 16px 20px !important;
  text-align: left !important;
  vertical-align: middle !important; /* Center vertically */
  white-space: nowrap !important;
  border-bottom: 1px solid #e3e3e3 !important;
}

/* Sticky First Column */
.statsbet-today-table th:first-child,
.statsbet-today-table td:first-child {
  position: sticky !important;
  left: 0 !important;
  min-width: 160px !important;
  z-index: 2;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05) !important;
}

.statsbet-today-table th:first-child {
  background-color: #004aad !important;
  color: #ffffff !important;
  border-top-left-radius: 10px !important;
  z-index: 3;
}

.statsbet-today-table td:first-child {
  background-color: #f9f9fb !important;
}

.statsbet-today-table th:last-child {
  border-top-right-radius: 10px !important;
}

.statsbet-today-table tr:last-child td {
  border-bottom: none !important;
}

.statsbet-today-table tbody tr {
  background-color: #f9f9fb !important;
}

.statsbet-today-table tbody tr:hover {
  background-color: #eaf3ff !important;
}

.statsbet-today-table tbody tr:hover td:first-child {
  background-color: #eaf3ff !important;
}

/* Lists and Text Styling */
.statsbet-today-table ul {
  list-style: none !important;
  padding-left: 0 !important;
  margin: 0 !important;
}

.statsbet-today-table li {
  margin-bottom: 6px !important;
  padding: 4px 6px !important;
  background: rgba(255, 204, 0, 0.3) !important; /* Highlight background */
  color: #002f5f !important;
  font-weight: 500 !important;
  line-height: 1.5 !important;
  border-top: 2px solid #f2f3f5 !important;
  border-right: 2px solid #f2f3f5 !important;
  border-bottom: 2px solid #f2f3f5 !important;
  border-left: 4px solid #ffcc00 !important; /* Left highlight border */
  border-radius: 4px !important; /* Rounded corners preserved */
  box-sizing: border-box !important;
}

.statsbet-today-table ul li:last-child {
  margin-bottom: 0 !important;
}

.statsbet-today-table small {
  font-size: 12px !important;
  color: #666 !important;
  display: inline-block;
  margin-top: 4px !important;
}

.statsbet-today-table td strong {
  color: #004aad !important;
}

/* Center "Spiltips" Header Text Vertically */
.statsbet-today-table th:nth-child(5) {
  vertical-align: middle !important;
  padding-top: 16px !important;
  padding-bottom: 16px !important;
  line-height: 1.2 !important;
  text-align: center !important;
}

/* Responsive: Mobile & Tablet */
@media (max-width: 1024px) {
  .statsbet-today-table-wrapper {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .statsbet-today-table {
    display: block !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    width: 100% !important;
    min-width: auto !important; /* Remove min-width for mobile */
  }

  .statsbet-today-table thead {
    display: none !important;
  }

  .statsbet-today-table tbody {
    display: block !important;
  }

  .statsbet-today-table tbody tr {
    display: block !important;
    margin-bottom: 20px !important;
    padding: 12px !important;
    border: 1px solid #ddd !important;
    border-radius: 8px !important;
    background-color: #f9f9fb !important;
  }

  .statsbet-today-table td {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    padding: 10px 0 !important;
    border-bottom: 1px solid #eee !important;
    flex-wrap: wrap !important;
    word-break: break-word !important;
  }

  .statsbet-today-table td::before {
    content: attr(data-label);
    font-weight: 600 !important;
    color: #004aad !important;
    flex: 0 0 45%;
    padding-right: 10px;
    text-align: left !important;
  }

  /* Match Title in Brand Yellow */
  .statsbet-today-table td[data-label="Kamp"] strong {
    color: #ffcc00 !important;
  }

  /* League name and image inline */
  .statsbet-today-table td[data-label="Kamp"] small {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    margin-left: 6px !important;
    color: #ffffff !important; /* keep white on gradient */
  }
  .statsbet-today-table td[data-label="Kamp"] small img {
    max-height: 20px !important;
    width: auto !important;
    vertical-align: middle !important;
    display: inline-block !important;
  }

  .statsbet-today-table td[data-label="Kamp"] {
    display: block !important;
    text-align: center !important;
    font-weight: bold !important;
    font-size: 16px !important;
    border: none !important;
    padding: 12px !important;
    background: linear-gradient(135deg, #004aad 0%, #007bff 100%) !important;
    border-radius: 10px !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15) !important;
    letter-spacing: 0.5px !important;
    margin-bottom: 10px !important;
  }

  .statsbet-today-table td[data-label="Kamp"]::before {
    display: none !important;
  }

  .statsbet-today-table td:last-child {
    border-bottom: none !important;
  }
}

/* League Filter Dropdown Styles */
.statsbet-league-filter {
  position: relative;
  width: 100% !important;
  max-width: 300px !important;
  margin: 0 auto 20px auto !important;
  text-align: center !important;
}

#leagueToggleBtn {
  background: #004aad;
  color: #fff;
  padding: 10px 16px;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.3s, box-shadow 0.3s;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  width: 100% !important;
  box-sizing: border-box !important;
}

#leagueToggleBtn:hover {
  background: #007bff;
}

#leagueDropdown {
  display: none;
  position: absolute;
  width: 100% !important;
  max-width: 300px !important;
  box-sizing: border-box !important;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  box-shadow: 0 8px 12px rgba(0, 0, 0, 0.1);
  z-index: 999;
  margin-top: 8px;
  max-height: 300px;
  overflow-y: auto;
  overflow-x: hidden !important;
  padding: 10px 0;
}

#leagueDropdown li {
  list-style: none;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}

#leagueDropdown li:hover {
  background: #f1f1f1;
  color: #004aad;
}

@media (max-width: 600px) {
  #leagueToggleBtn {
    font-size: 14px;
    padding: 8px 12px;
  }
  #leagueDropdown {
    max-height: 200px;
  }
}

.statsbet-today-table tbody tr.hidden-row {
  display: none !important;
}
