/* endzonewire.com — shared styles
   Theme: dark by default. Light theme available via the toggle button in
   the header (sets data-theme="light" on <html>). All colors come from CSS
   variables so theme switching is just a variable swap. */

:root {
  /* Dark theme (default) */
  --green:    #4caf50;
  --green-d:  #66bb6a;
  --blue:     #5fa8e0;
  --blue-d:   #7fb8e8;
  --dark:     #f0f4f8;    /* used for heading text */
  --bg:       #0f1419;
  --card:     #1a2129;
  --border:   #2a3340;
  --soft:     #151b22;
  --text:     #d6dce4;
  --muted:    #8a95a3;
  --gold:     #e0c563;
  --red:      #ff6b5e;
  --tag-bg:        #2a3340;
  --tag-team-bg:   #1f3d28;
  --tag-team-fg:   #8edda0;
  --tag-topic-bg:  #1f2e3d;
  --tag-topic-fg:  #92c3ed;
  --tag-injury-bg: #3d1f1f;
  --tag-injury-fg: #ff9385;
  --shadow:        rgba(0,0,0,0.4);
  --th-fg:         #ffffff;
}

:root[data-theme="light"] {
  --green:    #2c7a3f;
  --green-d:  #225e30;
  --blue:     #2c5d8a;
  --blue-d:   #1f4567;
  --dark:     #1a2937;
  --bg:       #f4f7fb;
  --card:     #ffffff;
  --border:   #d9dee5;
  --soft:     #f9fafc;
  --text:     #1f2a36;
  --muted:    #6b7886;
  --gold:     #d4af37;
  --red:      #c0392b;
  --tag-bg:        #eef2f7;
  --tag-team-bg:   #d6e8d8;
  --tag-team-fg:   #225e30;
  --tag-topic-bg:  #e3ecf5;
  --tag-topic-fg:  #1f4567;
  --tag-injury-bg: #fbe1de;
  --tag-injury-fg: #c0392b;
  --shadow:        rgba(0,0,0,0.08);
  --th-fg:         #ffffff;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  margin: 0 auto;
  padding: 16px;
  background: var(--bg);
  color: var(--text);
  max-width: 1100px;
  line-height: 1.45;
}

h1, h2, h3, h4 { color: var(--dark); margin: 0.4em 0; }
h1 { font-size: 1.6em; }
h2 { font-size: 1.2em; margin-top: 22px; }
h3 { font-size: 1.05em; margin-top: 18px; }
h4 { font-size: 0.95em; color: var(--muted); margin-top: 12px; }

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

p { margin: 8px 0; }
.muted { color: var(--muted); font-size: 0.9em; }

/* Header with theme toggle on the right */
.site-header {
  border-bottom: 2px solid var(--green);
  margin-bottom: 10px;
  padding-bottom: 8px;
}
.site-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.site-header h1 a { color: var(--dark); }
.site-header .tagline { color: var(--muted); margin: 0; font-size: 0.95em; }

.theme-toggle {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 1.1em;
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 6px;
}
.theme-toggle:hover { background: var(--soft); }

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 6px 0 18px;
}
.nav-links { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.nav a { font-size: 0.95em; }

/* Toggle pills (also used by trending strip) */
.toggle { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 14px; }
.toggle a {
  padding: 6px 10px;
  background: var(--blue);
  color: white;
  border-radius: 4px;
  white-space: nowrap;
  font-size: 0.9em;
}
.toggle a:hover { background: var(--blue-d); text-decoration: none; }
.toggle a .count {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  background: rgba(255,255,255,0.25);
  border-radius: 10px;
  font-size: 0.85em;
}

/* Article list */
ul.articles { list-style: none; padding: 0; margin: 0; }
.article {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 10px;
  box-shadow: 0 1px 2px var(--shadow);
}
.article-title {
  font-size: 1.05em;
  font-weight: 600;
  color: var(--dark);
  display: inline-block;
  margin-bottom: 4px;
}
.article-title:hover { color: var(--blue); }
.article-meta {
  font-size: 0.85em;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  align-items: center;
  margin-bottom: 6px;
}
.article-meta .source { font-weight: 600; color: var(--green); }
.article-meta .dot { color: var(--border); }
.article-summary { margin: 4px 0 0; font-size: 0.92em; color: var(--text); }
.tags { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 10px;
  background: var(--tag-bg);
  font-size: 0.8em;
  color: var(--dark);
}
.tag-team   { background: var(--tag-team-bg);   color: var(--tag-team-fg); }
.tag-topic  { background: var(--tag-topic-bg);  color: var(--tag-topic-fg); }
.tag-injury { background: var(--tag-injury-bg); color: var(--tag-injury-fg); }

.empty {
  background: var(--card);
  border: 1px dashed var(--border);
  padding: 18px;
  border-radius: 6px;
  color: var(--muted);
  text-align: center;
}

/* Tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--card);
  border-radius: 4px;
  margin: 8px 0;
  box-shadow: 0 1px 3px var(--shadow);
}
table { border-collapse: collapse; width: 100%; min-width: max-content; background: var(--card); }
th, td { border: 1px solid var(--border); padding: 8px 10px; text-align: right; white-space: nowrap; color: var(--text); }
th { background: var(--green); color: var(--th-fg); text-align: center; }
td:first-child, th:first-child { text-align: left; }
tr:nth-child(even) td { background: var(--soft); }
table.cols-text-3 td:nth-child(-n+3),
table.cols-text-3 th:nth-child(-n+3) { text-align: left; }

/* teams.php division grid */
.divisions { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.division {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
}
.division ul { list-style: none; padding-left: 0; margin: 4px 0 0; }
.division li { padding: 3px 0; }
.division .count { color: var(--muted); font-size: 0.85em; }

/* my_players.php roster chip row */
.roster-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 14px; }
.roster-chip {
  display: inline-flex;
  flex-direction: column;
  padding: 4px 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  font-size: 0.85em;
  line-height: 1.2;
  color: var(--text);
}
.roster-chip:hover { background: var(--soft); text-decoration: none; }
.roster-chip .muted { font-size: 0.75em; }

/* health.php */
.health-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin: 10px 0 16px;
}
.health-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  text-align: center;
}
.health-card .big { font-size: 1.6em; font-weight: 700; color: var(--dark); }
.health-card-ok   { border-color: var(--green); }
.health-card-warn { border-color: var(--gold); }
.health-card-err  { border-color: var(--red); }
.health-status-ok      { color: var(--green); font-weight: 600; }
.health-status-flaky   { color: var(--gold); font-weight: 600; }
.health-status-broken  { color: var(--red); font-weight: 700; }
.health-status-off     { color: var(--muted); font-style: italic; }
.error-cell { max-width: 280px; white-space: normal; font-size: 0.85em; color: var(--muted); }

.site-footer {
  margin-top: 32px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85em;
}
