html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
	border: 0;
	font-size: 100%;
	font: inherit;
	vertical-align: middle;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
	display: block;
}
body {
	line-height: 1;
}
ol, ul {
	list-style: none;
}
blockquote, q {
	quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
	content: '';
	content: none;
}
table {
	border-collapse: collapse;
	border-spacing: 0;
}

/* =============================================
   CSS CUSTOM PROPERTIES — LIGHT MODE (default)
   ============================================= */
:root {
  /* Legacy vars */
  --dark-gray: #333;
  --medium-gray: #777;
  --light-gray: #eee;
  --primary-color: #3498db;

  /* Theme vars */
  --bg: #ffffff;
  --surface: #f8f9fa;
  --text: #333333;
  --text-muted: #777777;
  --border: #eeeeee;
  --table-header-bg: #1a3a5c;
  --table-header-text: #ffffff;
  --card-bg: #ffffff;
  --match-neutral: #f0f0f0;
  --match-date-bg: #ffffff;
  --navbar-bg: #ffffff;
  --input-bg: #ffffff;
  --input-text: #333333;
  --link-color: #555555;
}

/* =============================================
   DARK MODE OVERRIDES
   ============================================= */
[data-theme="dark"] {
  --dark-gray: #e0e0e0;
  --medium-gray: #a0a0a0;
  --light-gray: #2a2a4a;
  --bg: #1a1a2e;
  --surface: #16213e;
  --text: #e0e0e0;
  --text-muted: #a0a0a0;
  --border: #2a2a4a;
  --table-header-bg: #0f3460;
  --table-header-text: #e0e0e0;
  --card-bg: #16213e;
  --match-neutral: #2a2a4a;
  --match-date-bg: #1a1a2e;
  --navbar-bg: #1a1a2e;
  --input-bg: #16213e;
  --input-text: #e0e0e0;
  --link-color: #a0a0a0;
}

/* =============================================
   BASE STYLES
   ============================================= */
* {
  font-family: "Roboto", sans-serif;
}

body {
  font-family: "Roboto", sans-serif;
  font-size: 16px;
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  transition: background-color 0.25s ease, color 0.25s ease;
}

.row {
  justify-content: center;
}

.container-fluid {
  width: 98%;
  margin: 0 auto;
}

/* =============================================
   NAVBAR
   ============================================= */
.navbar {
  background-color: var(--navbar-bg);
  border-bottom: 2px solid var(--primary-color);
  transition: background-color 0.25s ease;
}

.navbar-brand {
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.navbar-brand h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.5px;
}

.navbar-toggler {
  border: none;
}

.custom-toggler .navbar-toggler-icon {
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255,255,255, 0.0)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 8h24M4 16h24M4 24h24'/%3E%3C/svg%3E") !important;
  background-color: white !important;
  opacity: 0 !important;
}

#centering-icon .navbar-toggler-icon {
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255,255,255, 0.0)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 8h24M4 16h24M4 24h24'/%3E%3C/svg%3E") !important;
  background-color: white !important;
  opacity: 0 !important;
}

[data-theme="dark"] .navbar-toggler-icon {
  filter: invert(1);
}

.nav-item {
  text-align: end;
}

.nav-link {
  color: var(--text-muted) !important;
}

.nav-link:hover {
  color: var(--primary-color) !important;
}

/* Dark mode toggle button */
.theme-toggle-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.95rem;
  padding: 4px 9px;
  cursor: pointer;
  border-radius: 50%;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
  line-height: 1.5;
}

.theme-toggle-btn:hover {
  background-color: var(--surface);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* =============================================
   TYPOGRAPHY
   ============================================= */
h1, h2, h3, h4, h5, h6 {
  font-family: "Roboto", sans-serif;
  font-weight: bold;
  color: var(--text);
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

p {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 1rem;
}

a {
  color: var(--link-color);
}

a:hover {
  color: var(--primary-color);
}

ul, ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
  list-style-position: inside;
}

ul li, ol li {
  margin-bottom: 0.5rem;
  color: var(--text);
  list-style-type: disc;
}

/* =============================================
   SITE INTRO BLURB (homepage)
   ============================================= */
.site-intro {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 620px;
  margin: 0 auto 6px auto;
  line-height: 1.5;
}

/* =============================================
   PREDICTION / RATINGS TABLES
   ============================================= */
#predictions_table thead th,
#mobile_table thead th {
  background-color: var(--table-header-bg);
  color: var(--table-header-text);
  text-align: center;
}

#club_ratings_table thead th,
#national_ratings_table thead th,
#league_ratings_table thead th {
  background-color: var(--table-header-bg);
  color: var(--table-header-text);
  text-align: center;
}

#predictions_table,
#mobile_table {
  width: 95% !important;
  margin: 0 auto;
}

#predictions_table tbody tr,
#mobile_table tbody tr {
  border-bottom: 1px solid var(--border);
}

#club_ratings_table tbody tr,
#national_ratings_tabletbody tr,
#league_ratings_tabletbody tr {
  border-bottom: 1px solid var(--border);
}

#mobile_table thead th {
  letter-spacing: -0.5px;
}

.left-aligned {
  text-align: left;
}

.center-aligned {
  text-align: center;
}

table.dataTable.stripe > tbody > tr.odd > *,
table.dataTable.display > tbody > tr.odd > * {
  box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, 0.023);
}

table.dataTable.hover > tbody > tr:hover > *,
table.dataTable.display > tbody > tr:hover > * {
  box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, 0.035);
}

/* DataTables dark mode overrides */
[data-theme="dark"] .dataTables_wrapper {
  color: var(--text);
}

[data-theme="dark"] table.dataTable tbody tr {
  background-color: var(--surface) !important;
  color: var(--text) !important;
}

/* Zero-probability cells have no inline bg — let row background show through */
[data-theme="dark"] #predictions_table tbody td,
[data-theme="dark"] #mobile_table tbody td {
  color: var(--text);
}

[data-theme="dark"] table.dataTable.stripe > tbody > tr.odd > *,
[data-theme="dark"] table.dataTable.display > tbody > tr.odd > * {
  box-shadow: inset 0 0 0 9999px rgba(255, 255, 255, 0.04) !important;
}

[data-theme="dark"] table.dataTable.hover > tbody > tr:hover > *,
[data-theme="dark"] table.dataTable.display > tbody > tr:hover > * {
  box-shadow: inset 0 0 0 9999px rgba(255, 255, 255, 0.07) !important;
}

/* Bootstrap table on about page in dark mode */
[data-theme="dark"] .table {
  color: var(--text);
  border-color: var(--border);
}

[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * {
  color: var(--text);
  background-color: rgba(255, 255, 255, 0.04);
}

caption {
  padding-top: 8px;
  padding-bottom: 8px;
  color: var(--text-muted);
  text-align: center;
  font-style: italic;
}

/* =============================================
   ABOUT PAGE TYPOGRAPHY
   ============================================= */
.about-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.about-lead {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text-muted);
  border-left: 3px solid var(--primary-color);
  padding-left: 1rem;
  margin-bottom: 0;
}

article section h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 0.6rem;
  color: var(--text);
}

article section p {
  line-height: 1.75;
  color: var(--text);
}

article section ul {
  line-height: 1.75;
}

/* About page Bootstrap table */
.about-page table {
  width: 100%;
  margin-bottom: 1rem;
  border-collapse: collapse;
}

.about-page th,
.about-page td {
  padding: 0.75rem;
  text-align: left;
  vertical-align: top;
  border-top: 1px solid var(--border);
}

/* =============================================
   COMPETITION DROPDOWN
   ============================================= */
.input-container {
  text-align: center;
  margin-bottom: 10px;
}

.dropdown-margin {
  margin-bottom: 10px;
}

#Competition {
  text-align-last: center;
  background-color: var(--input-bg);
  color: var(--input-text);
  border-color: var(--border);
}

/* =============================================
   VIEW TOGGLE BUTTONS (Table / Matches)
   ============================================= */
.btn-group-container-sw {
  display: flex;
  justify-content: space-around;
}

.btn-group-container-sw .btn {
  margin-bottom: 5px;
}

.custom-button-group {
  max-width: 200px;
  width: 100%;
  margin: 0 auto;
}

.btn-group-container-sw button {
  font-size: 14px;
  padding: 5px 10px;
}

.custom-button-group button {
  font-size: 14px;
  padding: 8px 16px;
  background-color: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.custom-button-group button.active {
  background-color: var(--primary-color);
  color: #fff;
  border: 1px solid var(--primary-color);
}

/* =============================================
   MATCH CARDS
   ============================================= */
#matchSection {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}

div#matches_placeholder,
div#matches_placeholder_future,
div#matches_placeholder_past {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}

.match-box {
  border: none !important;
  width: 250px !important;
  margin: 10px !important;
  display: block !important;
  background-color: var(--card-bg) !important;
  border-radius: 8px !important;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.12) !important;
  animation: slideUp 0.5s ease !important;
}

@keyframes slideUp {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.match-table {
  width: 100%;
  border-collapse: collapse;
}

.match-table td {
  border: 1px solid var(--border);
}

.match-header {
  border: none;
}

.match-header td {
  border: none;
  text-align: center;
  color: var(--text-muted);
}

.match-date {
  text-align: center;
  color: var(--text-muted);
  background-color: var(--match-date-bg);
}

.match-date-col {
  background-color: var(--match-date-bg) !important;
  color: var(--text-muted) !important;
}

.prob {
  text-align: center;
}

.match-green {
  background-color: lightgreen;
  color: #1a1a1a;
}

.match-red {
  background-color: lightcoral;
  color: #1a1a1a;
}

.match-neutral {
  background-color: var(--match-neutral);
}

/* Dark mode match card highlights — readable text on dark backgrounds */
[data-theme="dark"] .match-green,
[data-theme="dark"] .prob.match-green,
[data-theme="dark"] tr.match-green td {
  background-color: #1b4332 !important;
  color: #95d5b2 !important;
}

[data-theme="dark"] .match-red,
[data-theme="dark"] .prob.match-red,
[data-theme="dark"] tr.match-red td {
  background-color: #4a1c1c !important;
  color: #ffb3b3 !important;
}

.match-box .score {
  font-weight: bold;
}

.box-title {
  font-weight: bold;
  font-size: 16px;
}

.box-data {
  font-size: 14px;
}

/* =============================================
   SHOW MORE BUTTONS
   ============================================= */
.show-more-button {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  text-decoration: underline;
  display: block;
  margin: 10px auto;
  text-align: center;
}

.show-more-button:hover {
  color: var(--primary-color);
  text-decoration: none;
}

/* =============================================
   SOCIAL SHARING BUTTONS
   ============================================= */
.social-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
  padding: 10px 0;
  position: relative;
  width: 100%;
}

/* =============================================
   ABOUT PAGE SECTION DIVIDERS
   ============================================= */
article section {
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

article section:last-of-type {
  border-bottom: none;
}

/* =============================================
   FOOTER
   ============================================= */
.divider {
  border-top: 1px solid var(--border);
  margin-top: 20px;
  margin-bottom: 20px;
}

footer p, footer a {
  color: var(--text-muted);
}

/* Bootstrap .text-muted uses !important — override for dark mode */
[data-theme="dark"] footer a,
[data-theme="dark"] footer a.text-muted {
  color: #b0b8c8 !important;
}

footer a:hover,
[data-theme="dark"] footer a:hover {
  color: var(--primary-color) !important;
}

/* =============================================
   DISQUS COMMENTS
   ============================================= */
/* Disqus renders in an iframe — we can't restyle its internals.
   Force a light background so comment text is always readable,
   regardless of our theme or OS prefers-color-scheme. */
#disqus_thread {
  background: #ffffff;
  border-radius: 8px;
  padding: 12px 16px;
  color-scheme: light;
}

/* =============================================
   CALIBRATION PLOTS (about page)
   ============================================= */
/* In dark mode, PNG plots with white/transparent bg become unreadable — add a white container */
[data-theme="dark"] #calibrationPlot img,
[data-theme="dark"] #calibration-Plot img {
  background-color: #ffffff;
  padding: 10px;
  border-radius: 6px;
}

/* =============================================
   HIGHLIGHTS PANEL (homepage)
   ============================================= */
.highlights-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 6px auto 14px auto;
  max-width: 960px;
  padding: 0 8px;
}

.highlight-card {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.85rem;
  line-height: 1.45;
  flex: 1 1 230px;
  max-width: 310px;
}

.highlight-icon {
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.highlight-text {
  color: var(--text);
}

/* =============================================
   MISC / LEGACY
   ============================================= */
.radio-group {
  display: inline-block;
  margin: 10px;
}

.radio-group input {
  display: none;
}

.radio-group label {
  display: inline-block;
  padding: 5px;
  border: 1px solid var(--border);
  cursor: pointer;
}

.radio-group input:checked + label {
  background-color: var(--border);
  color: white;
}

.home-link {
  text-decoration: none;
  color: var(--text);
}

.home-link:hover {
  color: var(--primary-color);
}
