:root {
  --primary-color: #e57373;
  --primary-hover: #ef5350;
  --background-color: #1a1a1a;
  --text-color: #f1e9e9;
  --link-color: #f48fb1;
  --link-hover-bg: rgba(244, 143, 177, 0.1);
  --table-header-bg: #2a2a2a;
  --table-row-hover: rgba(255, 255, 255, 0.05);
  --white: #ffffff;
  --table-cell-bg: rgba(255, 255, 255, 0.03);
  --green: #81c784;
  --orange: #ffb74d;
  --red: #ef9a9a;
  --html-back: #0e0e0e;
}

html {
  background-color: var(--html-back);
}
body {
  font-family: "Trebuchet MS", sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  padding: 20px;
  max-width: 900px;
  margin: auto;
}

h1, h2 {
  color: var(--primary-color);
  padding-bottom: 5px;
}

h2,h3 {
  font-size: 22px;
  font-weight: bold;
  margin-top: 20px;
  margin-bottom: 10px;
  padding: 8px 12px;
  background-color: var(--table-row-hover);
  border-left: 4px solid var(--primary-color);
  border-radius: 4px;
}
h3 {
  font-size: 18px !important;
}
.false-header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  width: 100%;
  align-items: center;
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 5px;
}

#all-content-holder {
  position: relative;
}
.left-header {
  position: relative;
  width: 50%;
}
.left-header small{
  position: absolute;
  bottom: 0;
}
.no-wrap {
  white-space: nowrap;
}
.left-header h1 {
  margin-top: 0;
  /* white-space: nowrap; */
}
.no-dates {
  border-bottom: 2px solid var(--primary-color);
}

@media only screen and (max-width: 1000px) {
  td, tr, th {
    font-size: 12px;
  }
  .false-header {
    flex-direction: column;
    gap: 10px;
  }
  .check-league-link {
    padding-left: 0 !important;
  }
  .league-select {
    margin: unset !important;
  }
  .league-info-holder {
    align-items: flex-start !important;
    gap: 10px;
  }
  .left-header,
   .league-info-holder{
    width: 100% !important;
  }
  .left-header h1 {
    font-size: 28px !important;
  }
}

#standings, #results, #upcoming-fixtures {
  overflow: auto;
}

#spinner-holder {
  margin: 10px;
  display: none;
}

.league-select {
  display: flex;
  flex-direction: row;
  align-items: center;
  margin: 15px;
}

.league-info-holder {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  width: 50%;
}

.check-league-link {
  display: none;
  align-items: center;
  gap: 6px;
  font-size: 16px;
  color: var(--link-color);
  text-decoration: none;
  font-weight: 500;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  transition: all 0.2s ease-in-out;
}

#leagueInput {
  padding: 6px 10px;
  font-size: 16px;
  border: 1px solid var(--primary-color);
  border-radius: 4px;
  margin-right: 10px;
  width: 120px;
}

#loadLeagueBtn {
  padding: 6px 12px;
  font-size: 16px;
  background-color: var(--primary-color);
  color: var(--white);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out;
}

#loadLeagueBtn:hover {
  background-color: var(--primary-hover);
}

.check-league-link i {
  font-size: 14px;
  margin-top: 1px;
}

.check-league-link:hover {
  background-color: var(--link-hover-bg);
  border-color: var(--link-color);
  text-decoration: none;
}

label {
  font-weight: bold;
  margin-right: 10px;
}

select {
  padding: 5px;
  font-size: 16px;
  border: 1px solid var(--primary-color);
  border-radius: 4px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 30px;
  background-color: #202020;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  overflow: hidden;
}

th {
  background-color: var(--primary-color);
  color: #fff;
  /* padding: 10px; */
  text-align: left;
  font-weight: 600;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
}

td {
  text-align: left;
  /* padding: 10px; */
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-color);
  background-color: var(--table-cell-bg);
}

tr:hover {
  background-color: var(--table-row-hover);
}

td p, th p {
  padding: 5px 8px;
  border-radius: 6px;
  font-weight: bold;
  width: fit-content;
}
th p {
  margin: 0;
}
.wins p {
  background-color: var(--green);
  color: #1a1a1a;
}
.draws p {
  background-color: var(--orange);
  color: #1a1a1a;
}
.loss p {
  background-color: var(--red);
  color: #1a1a1a;
}

/* POPUP OVERRIDE STYLES */
.popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--background-color);
  padding: 24px;
  border: 1px solid var(--primary-color);
  z-index: 1000;
  max-width: 90%;
  width: 400px;
  color: var(--text-color);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.6);
  border-radius: 8px;
}
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(14, 14, 14, 0.85); /* darker based on your --html-back */
  backdrop-filter: blur(2px);
  z-index: 999;
  display: flex;
  justify-content: center;
  align-items: center;
}

.popup-content h3 {
  margin-top: 0;
  color: var(--primary-color);
  font-size: 20px;
}

.popup button {
  margin-top: 15px;
  padding: 8px 14px;
  background: var(--primary-color);
  color: var(--white);
  border: none;
  cursor: pointer;
  border-radius: 4px;
  font-weight: bold;
}

.popup button:hover {
  background: var(--primary-hover);
}

.popup ul {
  padding-left: 0;
}

.popup ul li {
  list-style: none;
  margin: 4px 0;
  padding: 6px 10px;
  border-radius: 4px;
  font-weight: bold;
}

.hidden {
  display: none;
}

.team-name-clickable {
  cursor: pointer;
  color: var(--link-color);
  text-decoration: underline;
}

#popup-missing-list li {
  margin: 4px 0;
  padding: 4px 8px;
  border-radius: 4px;
  color: white;
  font-weight: bold;
  list-style-type: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
#popup-missing-list li.unplayed {
  background-color: var(--red);
}
#popup-missing-list li.once {
  background-color: var(--orange);
}
#popup-missing-list li.done {
  background-color: var(--green);
}

.match-key {
  margin-top: 16px;
  font-size: 14px;
}

.match-key ul {
  padding-left: 0;
  list-style: none;
  margin: 6px 0 0 0;
}

.match-key li {
  display: flex;
  align-items: center;
  margin: 4px 0;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
}
.dot-green {
  background-color: var(--green);
}
.dot-orange {
  background-color: var(--orange);
}
.dot-red {
  background-color: var(--red);
}
* {
  box-sizing: border-box;
}
.team-row {
  cursor: pointer;
}
.popup-small {
  font-size: 0.7rem;
}
.current-table {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}
.table-tooltip {
  color: white;
  font-size: 0.8rem;
}
.mini-match {
  padding: 5px;
  border-radius: 4px;
  color: black;
  background-color: white;
  display: flex;
}
.mini-matches {
  display: flex;
  flex-direction: row;
  gap: 5px;
}