[x-cloak],
.hidden {
  display: none !important;
}

.loader-circle {
  width: 40px;
  height: 40px;
  border: 4px solid #e5e7eb;
  border-top: 4px solid #2D8EFF;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-fade {
  position: relative;
  min-height: 200px;
}

.loading-fade>*:not(.matches-loader-overlay) {
  opacity: 0.4;
  pointer-events: none;
  filter: blur(1px);
}

.matches-loader-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2);
  pointer-events: none;
}

.matches-loader-overlay .loader-circle {
  position: sticky;
  top: 150px;
  /* Stay visible at the top area while scrolling */
}

/* Header */
.matches-header {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.matches-title {
  font-size: 17px;
  font-weight: 700;
  text-align: left;
  margin: 0;
}

/* Buttons */
.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.btn {
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
}

.btn-clear {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  transition: background 0.2s ease;
  color: #232323;
}

.btn-clear:hover {
  background: #3b82f6;
}

/* League Dropdown */
.league-dropdown,
.country-dropdown {
  position: relative;
}

.league-toggle,
.country-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 25px;
  cursor: pointer;
  color: #232323;
  box-shadow: none;
  height: 46px;
}

.league-toggle:hover,
.country-toggle:hover {
  background: #2B8FFF;
  border: 1px solid #2B8FFF;
}

.league-toggle:hover svg path,
.country-toggle:hover svg path {
  fill: #fff;
}

.league-toggle svg,
.country-toggle svg {
  width: 14px;
  position: relative;
  top: 1px;
}

.league-arrow,
.country-arrow {
  width: 18px;
  height: 18px;
  transition: transform 0.2s ease;
}

.league-dropdown.is-open .league-arrow,
.country-dropdown.is-open .country-arrow {
  transform: rotate(180deg);
}

/* Menu */
.league-menu,
.country-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 300px;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, .08);
  display: none;
  z-index: 20;
}

.country-menu label.country-btn,
.league-menu label.league-btn {
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 5px;
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.country-menu label.country-btn:hover,
.league-menu label.league-btn:hover,
.country-menu label.country-btn.checked,
.league-menu label.league-btn.checked {
  background: #2B8FFF;
  color: #fff;
}

.league-dropdown.is-open .league-menu,
.country-dropdown.is-open .country-menu {
  display: block;
}

.league-grid,
.country-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  padding: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.league-grid.single-column,
.country-grid.single-column {
  grid-template-columns: 1fr;
}

.league-item,
.country-item {
  padding: 8px 12px;
  font-size: 14px;
  color: #374151;
  text-decoration: none;
  border-radius: 6px;
}

.league-item:hover,
.country-item:hover {
  background: #f3f4f6;
}

.league-item.is-active,
.country-item.is-active {
  background: #f3f4f6;
  font-weight: 600;
}

/* Filters wrapper */
.filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
}

/* Live button */
.btn-live {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #2563eb;
  color: #2563eb;
  cursor: pointer;
  white-space: nowrap;
  height: 45px;
}

.live-dot {
  width: 12px;
  height: 12px;
  background: #22c55e;
  border-radius: 50%;
}

.live-text {
  font-weight: 500;
  font-size: 14px;
}

/* Right side */
.filters-right {
  display: flex;
  gap: 12px;
  align-items: center;
  flex: 1;
}

/* Search */
.search-box {
  position: relative;
  flex: 1;
}

.search-input {
  width: 100%;
  padding: 10px 40px 10px 16px;
  background: #f3f4f6;
  border: none;
  border-radius: 12px;
  font-size: 14px;
}

.search-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.3);
}

.search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: #9ca3af;
  pointer-events: none;
}

/* Date picker */
.date-trigger {
  position: relative;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.datepicker-input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.home-football-matches-inner1 {
  background: #ffffff;
  border: 1px solid #d1d5db;
  /* gray-300 */
  border-radius: 16px;
  /* rounded-xl */
  margin-bottom: 24px;
  /* mb-6 */

  padding: 23px;

  height: fit-content;
  /* h-fit */
}

.no-live-matches {
  font-size: 18px;
  text-align: center;
  color: red;
}

.matches-list .match-main .match-score .win {
  border: 1px solid #388e3c;
}

button#prev-btn,
button#next-btn,
button#set-date {
  box-shadow: none;
  background: transparent;
}

.all-match-list,
.live-match-list,
.dates-container {
  display: none;
}

.all-match-list.active,
.live-match-list.active {
  display: block;
}

.dates-container.active {
  display: grid;
  grid-auto-flow: column;
  overflow-x: auto;
  overflow-y: hidden;
}

button#filter-live:hover,
button#filter-live:focus,
.league-toggle:focus,
.country-toggle:focus {
  background: transparent;
  color: #3b82f6;
}

.league-toggle:focus svg path,
.country-toggle:focus svg path {
  fill: #3b82f6;
}

button#filter-live.active {
  background: #3b82f6;
  color: #fff;
}

button#filter-live.active span.live-dot {
  box-shadow: 0px 0px 6px #fff;
}

.match-row.live_match .match-time,
.match-row.live_match .match-score {
  border-color: orange;
  color: orange;
}

#home-filter-form {
  flex: 1;
  display: flex;
  gap: 12px;
}

div#dates-list a.active.bg-blue-500 {
  background: #3b82f6;
}

.dates-container.mb-8 {
  margin-bottom: 2rem;
}

details.competition {
  margin-bottom: 20px;
}


.dates-wrapper {
  overflow: hidden;
  flex: 1;
}

.dates-list {
  margin: 0 2px;
  display: grid;
  gap: 1.2rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -ms-overflow-style: none;
  scrollbar-width: none;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}

.dates-list::-webkit-scrollbar {
  display: none;
}

.date-item {
  scroll-snap-align: center;
  flex-shrink: 0;
}

.date-item.active {
  color: #ffffff !important;
}

@media(max-width:600px) {
  .dates-list {
    gap: .9rem;
  }

  .date-item {
    padding: 0.8rem !important;
    font-size: 14px !important;
  }
}


/* =====================
   COMPETITION
===================== */
.competition {
  border: 1px solid #f3f4f6;
  border-radius: 16px;
  overflow: hidden;
}

.competition-header {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  padding: 5px 10px;
  background: #f9fafb;
  cursor: pointer;
  list-style: none;
}

.competition-header::-webkit-details-marker {
  display: none;
}

/* Header left */
.competition-left {
  display: flex;
  gap: 16px;
  align-items: center;
}

.competition-logo {
  width: 25px;
  height: 33px;
  border-radius: 50%;
  object-fit: contain;
}

.competition-title {
  font-size: 14px;
  font-weight: 600;
}

.competition-week {
  font-size: 14px;
  color: #6b7280;
}

/* Header right */
.competition-right {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-left: auto;
  white-space: nowrap;
}

.arrow-icon {
  width: 16px;
  height: 16px;
  color: #6b7280;
  transition: transform 0.2s ease;
}

.competition[open] .arrow-icon {
  transform: rotate(180deg);
}

/* =====================
   MATCH ROW
===================== */
.match-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid #e5e7eb;
  text-decoration: none;
  color: inherit;
  justify-content: center;
  align-items: center;
  text-decoration: none !important;
  color: #232323;
}

a.match-row:hover {
  color: #232323;
}

.match-row:last-child {
  border-bottom: none;
}


.team span {
  font-family: Manrope;
  font-weight: 700;
  font-size: 13px;
  line-height: 100%;
}

/* Time */
.match-time {
  width: 60px;
  height: 60px;
  border: 2px solid #d1d5db;
  border-radius: 12px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  flex-flow: column;
  line-height: normal;
  gap: 2px;
}

/* Main */
.match-main {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  flex: 1;
}

/* Teams */
.match-teams {
  flex: 1;
  display: flex;
  flex-flow: column;
  justify-content: center;
  gap: 11px;
}

.team {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 0;
}

div#dates-list a {
  text-decoration: none;
  border: 1px solid #d1d5db;
  border-radius: 0.75rem;
}

.team img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

/* Score */
.match-score {
  display: grid;
  gap: 8px;
}

.match-score div {
  width: 40px;
  height: 40px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.match-row.live_match .match-score div {
  border-color: orange;
}

/* Odds */
.match-odds {
  width: 220px;
}

.odds-header {
  display: flex;
  font-size: 9px;
  color: #6b7280;
  margin-bottom: 4px;
}

.odds-header span {
  flex: 1;
  text-align: center;
}

.odds-grid {
  display: flex;
  border: 1px solid #d1d5db;
  border-radius: 16px;
  overflow: hidden;
}

.odd {
  flex: 1;
  text-align: center;
}

.odd:not(:last-child) {
  border-right: 1px solid #e5e7eb;
}

.odd-value {
  padding: 1px;
  font-weight: 600;
  border-bottom: 1px solid #e5e7eb;
  font-size: 12px;
}

.odd-bookmaker {
  padding: 8px;
  background: #f3f4f6;
  text-align: center;
  display: flex;
  justify-content: center;
}

.odd-bookmaker img {
  height: 16px;
  border-radius: 10px;
}

.select2-container--default .select2-selection--single {
  background-color: #F5F5FA;
  border: none;
  border-radius: 50px !important;
  padding: 9px 35px 9px 27px !important;
  height: auto !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  font-weight: 400;
  font-size: 14px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  display: none;
}

.select2-container--open .select2-dropdown--below {
  top: -2px;
  border-radius: 5px;
}


@media screen and (max-width: 1180px) {
  .home-football-matches-inner1 {
    padding: 15px;
  }

  .home-football-matches-inner button#filter-live {
    height: 35px;
  }

  .league-toggle,
  .country-toggle {
    height: 35px;
    padding: 8px 14px;
  }

  .select2-container--default .select2-selection--single {
    padding: 0px 22px 0px 14px !important;
    height: 35px !important;
  }

  .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 35px;
  }

  button#set-date svg {
    height: 32px;
    padding: 0 !important;
  }

  button#set-date {
    padding: 0;
  }

}




@media screen and (max-width: 998px) {

  div#dates-list {
    gap: 8px;
  }

  .team span {
    line-height: 16px;
  }


  button#prev-btn,
  button#next-btn {
    height: 36px;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  button#set-date {
    padding: 0;
    position: absolute;
    right: 0;
    top: 0;
  }

  .filters-bar {
    position: relative;
    align-items: flex-start;
    flex-flow: column;
  }


  .filters-right {
    position: unset;
    width: 100%;
  }

  #home-filter-form {
    width: 100%;
    justify-content: space-between;
  }

  .header-actions {
    width: 100%;
  }

  .header-actions {
    justify-content: flex-end;
  }

  .search-box {
    width: 100%;
    flex: auto;
  }

  div#dates-list a {
    padding-top: 6px !important;
    padding-bottom: 6px !important;
  }

  #home-filter-form {
    flex-flow: column;
  }
}

@media screen and (min-width: 768px) and (max-width: 850px),
screen and (max-width: 600px) {

  .match-main {
    justify-content: space-between !important;
    width: 100%;
  }

  .match-row {
    flex-flow: column;
    gap: 8px;
    padding: 12px;
  }

  .match-time {
    width: 100%;
    min-height: 25px;
    height: auto;
    padding: 3px 0;
    border-width: 1px;
    flex-flow: row;
    gap: 6px;
  }

  .match-time:not(.anwp-blinking-text) span:before {
    content: "Match Time: ";
    font-size: 13px;
    font-weight: 500;
  }

  .match-score div {
    height: 30px;
    width: 30px;
  }

  .match-time.anwp-blinking-text {
    flex-flow: nowrap;
    gap: 7px;
  }

  .match-time.anwp-blinking-text span:first-child:before {
    content: "Live: ";
  }

  .match-time.finished span:before {
    content: none;
  }

}



@media screen and (max-width: 460px) {
  .competition-week {
    font-size: 12px;
    color: #6b7280;
  }

  .team {
    gap: 10px;
  }

  .match-main {
    gap: 10px;
  }

  .match-odds {
    display: flex;
    align-items: center;
    width: auto;
    gap: 9px;
  }

  .odds-header {
    flex-flow: column;
    gap: 10px;
    align-items: center;
  }

  .odds-grid {
    flex-flow: column;
  }

  .odd {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    align-items: center;
    background: #f3f4f6;
    padding: 0 7px;
  }

  .odd-bookmaker {
    width: 46px;
    height: auto;
    padding: 6px 0;
    height: 13px;
  }

  .odd-bookmaker img {
    height: auto;
  }

  .odd-value {
    flex: 1;
  }


  .odds-grid .odd:last-child .odd-value {
    border: none;
  }

  .competition-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 15px;
  }

  .match-count {
    font-size: 12px;
  }
}


@media screen and (max-width: 420px) {

  .header-actions {
    justify-content: space-between;
  }

  .country-menu {
    left: 0;
    right: auto;
  }
}

/* Load More button */
.btn-load-more {
  display: inline-block;
  padding: 12px 32px;
  background-color: #1a56db;
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.btn-load-more:hover {
  background-color: #1648c2;
}

.btn-load-more:disabled {
  background-color: #93c5fd;
  cursor: not-allowed;
}


/* Live mode: disable country/league/date controls */
.live-disabled {
  opacity: 0.35;
  pointer-events: none;
  user-select: none;
  transition: opacity 0.2s ease;
}


/* =====================
   RTL & OVERFLOW FIX
===================== */
#home-football-matches {
  overflow-x: hidden;
}

/* RTL: flip prev/next arrow buttons */
[dir="rtl"] button#prev-btn svg,
[dir="rtl"] button#next-btn svg {
  transform: scaleX(-1);
}

/* RTL: fix flatpickr calendar position on mobile */
@media screen and (max-width: 998px) {
  [dir="rtl"] .flatpickr-calendar {
    left: auto !important;
    right: 0 !important;
  }
}

/* RTL: flip absolute-positioned menus */
[dir="rtl"] .country-menu,
[dir="rtl"] .league-menu {
  right: auto;
  left: 0;
}

[dir="rtl"] .search-icon {
  right: auto;
  left: 12px;
}

[dir="rtl"] .search-input {
  padding-right: 16px;
  padding-left: 36px;
}

/* RTL: move Live button to left (end) side */
[dir="rtl"] .btn-live {
  order: 1;
}

/* RTL: mobile column layout fixes */
@media screen and (max-width: 998px) {
  /* Reset Live button order so it stays on top row (like English) */
  [dir="rtl"] .btn-live {
    order: 0;
  }
  /* Calendar on left (end in RTL), opposite side of Live button */
  [dir="rtl"] button#set-date {
    right: auto;
    left: 0;
  }
}

/* RTL: competition-right margin */
[dir="rtl"] .competition-right {
  margin-left: unset;
  margin-right: auto;
}

/* RTL: fix the 420px breakpoint override */
@media screen and (max-width: 420px) {
  [dir="rtl"] .country-menu {
    left: auto;
    right: 0;
  }
}
