/* ---------------------------------------------------------------
   style.css
   All visual design. No logic. Edit this file to change the look.
--------------------------------------------------------------- */

/* --- Tokens --- */
:root {
  color-scheme: light dark;

  --bg:          light-dark(#f5f5f5, #0f0f0f);
  --bg-card:     light-dark(#ffffff, #1a1a1a);
  --bg-filter:   light-dark(#e8e8e8, #222222);
  --border:      light-dark(#e0e0e0, #2a2a2a);
  --text:        light-dark(#111111, #f0f0f0);
  --text-muted:  light-dark(#666666, #888888);
  --accent:      light-dark(#1a6b3a, #3ddc75);
  --accent-text: light-dark(#ffffff, #000000);
  --live:        #e53935;
  --badge-bg:    light-dark(#e8e8e8, #2a2a2a);
  --badge-text:  light-dark(#444444, #cccccc);
  --confirmed:   light-dark(#1a6b3a, #3ddc75);
  --inferred:    light-dark(#888888, #666666);

  --radius:  10px;
  --radius-sm: 6px;
  --gap:     16px;
  --font:    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
}

/* --- Header --- */
header {
  padding: 16px var(--gap);
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}

header h1 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.3px;
}

/* --- Filters --- */
#filters {
  padding: var(--gap);
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  position: sticky;
  top: 0;
  z-index: 10;
}

#league-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.league-btn {
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-filter);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.league-btn.active {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
}

/* --- Team search --- */
#team-filter {
  position: relative;
}

#team-search {
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-filter);
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
}

#team-search:focus {
  border-color: var(--accent);
}

#team-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  list-style: none;
  z-index: 20;
  max-height: 200px;
  overflow-y: auto;
}

#team-suggestions li {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

#team-suggestions li:hover {
  background: var(--bg-filter);
}

#team-suggestions li img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

/* --- Match list --- */
#match-list {
  padding: var(--gap);
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

/* --- Date group --- */
.date-group {}

.date-heading {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  padding: 8px 0 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.date-heading.today {
  color: var(--accent);
}

/* --- Match card --- */
.match-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px var(--gap);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}

.match-card.live {
  border-color: var(--live);
}

/* Teams */
.team {
  display: flex;
  align-items: center;
  gap: 8px;
}

.team.away {
  flex-direction: row-reverse;
  text-align: right;
}

.team img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
}

.team-name {
  font-size: 0.95rem;
  font-weight: 600;
}

/* Centre info */
.match-centre {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 80px;
}

.kickoff-time {
  font-size: 1rem;
  font-weight: 700;
}

.score {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
}

.match-status {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.match-status.live {
  color: var(--live);
  font-weight: 700;
}

/* Match footer */
.match-footer {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.league-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* --- TV badges --- */
.tv-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: 0.3px;
}

.tv-badge.confirmed {
  background: var(--confirmed);
  color: var(--accent-text);
}

.tv-badge.inferred {
  background: var(--badge-bg);
  color: var(--inferred);
  border: 1px solid var(--border);
}

/* --- Loading / empty --- */
#loading {
  text-align: center;
  color: var(--text-muted);
  padding: 40px;
}

.empty {
  text-align: center;
  color: var(--text-muted);
  padding: 40px;
  font-size: 0.9rem;
}

/* --- Desktop --- */
@media (min-width: 600px) {
  header { padding: 20px 24px; }
  header h1 { font-size: 1.4rem; }
  #filters { padding: 16px 24px; flex-direction: row; align-items: center; }
  #team-filter { width: 220px; flex-shrink: 0; }
  .team-name { font-size: 1rem; }
  .match-card { padding: 14px 20px; }
}
