/* WAB Watch - Dark Theme Mobile-First (CFBtxt Inspired) */

/* ===== RESET & BASE ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
  line-height: 1.5;
  padding: 12px;
  max-width: 100%;

  /* Dark theme colors - CFBtxt style */
  --bg: #0a0a0a;
  --fg: #f0f0f0;
  --gray: #b0b0b0;
  --border: #444;
  --hover: #1a1a1a;
  --green: #4ade80;
  --blue: #60a5fa;
  --brown: #f59e0b;
  --red: #ef4444;
  --table-header-bg: #1a1a1a;

  background-color: var(--bg);
  color: var(--fg);
}

/* ===== ACCESSIBILITY ===== */
*:focus {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip to main content */
.skip-to-main {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--fg);
  color: var(--bg);
  padding: 8px;
  text-decoration: none;
  z-index: 100;
}

.skip-to-main:focus {
  top: 0;
}

/* ===== HEADER ===== */
.site-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.site-title {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 5px;
}

.site-title a {
  color: var(--fg);
  text-decoration: none;
}

.site-title a:hover,
.site-title a:focus {
  text-decoration: underline;
}

.site-subtitle {
  font-size: 13px;
  color: var(--gray);
  margin-bottom: 8px;
  font-weight: 500;
}

/* ===== NAVIGATION ===== */
.main-nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.main-nav a {
  padding: 5px 0;
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
}

.main-nav a:hover {
  text-decoration: underline;
  color: var(--green);
}

.main-nav a.active {
  color: var(--fg);
  font-weight: bold;
}

/* ===== MAIN CONTENT ===== */
.main-content {
  margin: 12px 0;
}

h2 {
  font-size: 14px;
  font-weight: bold;
  text-transform: uppercase;
  margin: 20px 0 8px 0;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

h3 {
  font-size: 12px;
  font-weight: bold;
  margin: 12px 0 8px 0;
  color: var(--gray);
  text-transform: uppercase;
}

.section-note {
  font-size: 13px;
  color: var(--gray);
  margin-bottom: 15px;
  font-style: italic;
  font-weight: 500;
}

/* ===== LINKS ===== */
a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
}

a:visited {
  color: var(--blue);
}

a:hover,
a:focus {
  color: var(--green);
  text-decoration: underline;
}

/* ===== SEARCH AND FILTER CONTROLS ===== */
.controls-container {
  margin: 20px 0;
  padding: 15px;
  background-color: var(--hover);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.search-box {
  width: 100%;
  max-width: 400px;
  padding: 8px 12px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
  border: 1px solid var(--border);
  background-color: var(--bg);
  color: var(--fg);
  margin-bottom: 10px;
  font-weight: 500;
  height: 36px;
  box-sizing: border-box;
}

.search-box:focus {
  outline: 2px solid var(--blue);
  outline-offset: -1px;
  border-color: var(--blue);
}

/* ===== TABLES ===== */
.table-container {
  overflow-x: auto;
  margin: 20px 0;
  -webkit-overflow-scrolling: touch;
  position: relative;
  background: var(--bg);
  border-radius: 4px;
  border: 1px solid var(--border);
}

.table-scroll-hint {
  text-align: center;
  font-size: 12px;
  color: var(--gray);
  margin-top: 5px;
  display: none;
}

@media (max-width: 768px) {
  .table-scroll-hint {
    display: block;
  }
}

table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px;
}

th,
td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid var(--border);
  font-weight: 500;
}

th {
  font-weight: bold;
  background-color: var(--table-header-bg);
  color: var(--fg);
  position: sticky;
  top: 0;
  z-index: 10;
  font-size: 12px;
  text-transform: uppercase;
}

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

tr:focus-within {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}

/* Table column alignment */
.rank-col,
.wab-col,
.record-col,
.score-col {
  text-align: right;
}

.date-col {
  white-space: nowrap;
}

.team-col,
.matchup-col {
  min-width: 140px;
}

/* Date headers in tables */
.date-header-row td {
  background-color: var(--hover);
  font-weight: bold;
  padding: 10px 12px;
}

/* ===== WAB VALUE STYLING ===== */
.wab-value {
  font-weight: bold;
}

.wab-elite {
  color: #4ade80;
}

.wab-strong {
  color: #86efac;
}

.wab-solid {
  color: #4ade80;
}

.wab-bubble {
  color: var(--gray);
}

.wab-below {
  color: var(--brown);
}

.wab-poor {
  color: var(--red);
}

.wab-na {
  color: #6b7280;
}

/* ===== LOCATION INDICATORS ===== */
.loc-home,
.loc-away,
.loc-neutral {
  font-size: 12px;
  padding: 0 3px;
}

/* ===== RESULT INDICATORS ===== */
.result-win {
  color: var(--green);
  font-weight: bold;
}

.result-loss {
  color: var(--red);
  font-weight: bold;
}

.result-future {
  color: var(--gray);
  font-weight: 600;
}

/* ===== TEAM NAME LINKS ===== */
.team-name {
  font-size: inherit;
  font-weight: bold;
  color: var(--fg);
  text-decoration: none;
}

.team-name:hover {
  color: var(--blue);
  text-decoration: underline;
}

/* Win/Loss row styling */
.win-row {
  background-color: rgba(74, 222, 128, 0.1);
  border-left: 3px solid var(--green);
}

.loss-row {
  background-color: rgba(239, 68, 68, 0.1);
  border-left: 3px solid var(--red);
}

.win-row:hover {
  background-color: rgba(74, 222, 128, 0.2);
}

.loss-row:hover {
  background-color: rgba(239, 68, 68, 0.2);
}

/* ===== TEAM HEADER ===== */
.team-header {
  border: 1px solid var(--border);
  padding: 15px;
  margin-bottom: 20px;
  background-color: var(--hover);
}

.team-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 12px;
  color: var(--gray);
  margin-bottom: 3px;
  font-weight: 500;
}

.stat-value {
  font-size: 16px;
  font-weight: bold;
}

/* Location WAB stats row */
.location-stats {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.location-stats .stat-value {
  font-size: 14px;
}

/* ===== CONFERENCE SUMMARY ===== */
.conference-summary {
  border: 1px solid var(--border);
  padding: 15px;
  margin-bottom: 20px;
  background-color: var(--hover);
}

.conf-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

/* ===== CONFERENCE CARDS ===== */
.conference-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.conference-card {
  border: 1px solid var(--border);
  padding: 15px;
  background-color: var(--hover);
}

.conference-card h3 {
  margin-top: 0;
  margin-bottom: 10px;
}

.conf-card-stats {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  margin-top: 10px;
}

/* ===== FILTER BUTTONS ===== */
.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 15px 0;
}

.filter-btn {
  background-color: var(--bg);
  border: 1px solid var(--border);
  padding: 8px 14px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px;
  cursor: pointer;
  color: var(--fg);
  min-height: 36px;
  min-width: 44px;
  transition: all 0.1s ease;
  font-weight: 600;
}

.filter-btn:hover {
  background-color: var(--hover);
  border-color: var(--blue);
}

.filter-btn:focus {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

.filter-btn.active {
  background-color: var(--hover);
  color: var(--green);
  font-weight: bold;
  border-color: var(--green);
}

/* ===== PAGINATION ===== */
.pagination {
  margin: 20px 0;
  text-align: center;
  font-size: 13px;
}

.pagination-info {
  margin-bottom: 10px;
  color: var(--gray);
  font-weight: 500;
}

.pagination-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pagination-btn {
  background-color: var(--bg);
  border: 1px solid var(--border);
  padding: 8px 14px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px;
  cursor: pointer;
  min-width: 44px;
  min-height: 36px;
  color: var(--fg);
  transition: all 0.1s ease;
  font-weight: 600;
}

.pagination-btn:hover:not(:disabled) {
  background-color: var(--hover);
  border-color: var(--blue);
}

.pagination-btn:focus {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-btn.active {
  background-color: var(--hover);
  color: var(--green);
  font-weight: bold;
  border-color: var(--green);
}

/* ===== NAVIGATION LINKS ===== */
.navigation-links {
  margin: 30px 0;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.navigation-links a {
  font-weight: bold;
}

/* ===== STATS SUMMARY ===== */
.stats-summary {
  margin-top: 20px;
  padding: 15px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--gray);
  font-weight: 500;
}

/* ===== NO GAMES/RESULTS MESSAGE ===== */
.no-games,
.no-results {
  padding: 40px;
  text-align: center;
  color: var(--gray);
  font-style: italic;
  font-weight: 500;
}

/* ===== LEGEND ===== */
.legend {
  margin-top: 30px;
  padding: 15px;
  border: 1px solid var(--border);
  background-color: var(--hover);
  font-size: 13px;
}

.legend h4 {
  margin-top: 0;
  margin-bottom: 10px;
}

.legend ul {
  list-style-position: inside;
  padding-left: 0;
}

.legend li {
  margin: 5px 0;
}

/* ===== ABOUT PAGE ===== */
.about-content {
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.6;
}

.about-section {
  margin: 30px 0;
}

.about-section h3 {
  color: var(--fg);
  margin-bottom: 15px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.about-section ul {
  margin-left: 30px;
  margin-top: 10px;
}

.about-section li {
  margin: 5px 0;
}

.about-section p {
  line-height: 1.6;
  margin-bottom: 15px;
}

/* ===== FOOTER ===== */
.site-footer {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 24px;
  font-size: 12px;
  color: var(--gray);
  text-align: center;
  font-weight: 500;
}

.site-footer p {
  margin: 5px 0;
}

/* ===== TEAM PAGE STYLES ===== */
.quad-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin: 20px 0;
}

.quad-card {
  background: var(--hover);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 15px;
  text-align: center;
}

.quad-label {
  font-weight: bold;
  font-size: 1.2em;
  color: var(--fg);
  margin-bottom: 8px;
}

.quad-record {
  font-size: 1.4em;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--fg);
}

.quad-wab {
  font-size: 1.1em;
}

.wab-summary {
  background-color: var(--hover);
  padding: 12px 16px;
  margin-bottom: 16px;
  border-radius: 4px;
  font-size: 14px;
  text-align: center;
  border: 1px solid var(--border);
  font-weight: 500;
}

.wab-summary strong {
  color: var(--fg);
}

/* ===== ABOUT PAGE ENHANCED STYLES ===== */
.example-box {
  background: var(--hover);
  border-left: 4px solid var(--blue);
  padding: 15px;
  margin: 15px 0;
}

.wab-steps {
  background: var(--hover);
  border-radius: 4px;
  padding: 20px;
  margin: 20px 0;
}

.wab-step {
  margin-bottom: 20px;
}

.wab-step h4 {
  color: var(--red);
  margin-bottom: 10px;
}

.benefits {
  display: grid;
  gap: 15px;
  margin: 20px 0;
}

.benefit-item {
  background: rgba(74, 222, 128, 0.1);
  padding: 12px;
  border-radius: 4px;
  border-left: 3px solid var(--green);
}

.benefit-item::before {
  content: "✓ ";
  color: var(--green);
  font-weight: bold;
}

.resources-list {
  list-style: none;
  padding: 0;
}

.resources-list li {
  margin-bottom: 10px;
}

.resources-list a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
}

.resources-list a:hover {
  color: var(--green);
  text-decoration: underline;
}

/* ===== CONFERENCE PAGE STYLES ===== */
.conf-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.conf-card {
  background: var(--hover);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 20px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.conf-card:hover,
.conf-card:focus-within {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(96, 165, 250, 0.15);
}

.conf-card h3 {
  margin-top: 0;
  margin-bottom: 15px;
}

.conf-card h3 a {
  text-decoration: none;
  color: var(--fg);
  font-weight: bold;
}

.conf-card h3 a:hover,
.conf-card h3 a:focus {
  color: var(--blue);
  text-decoration: underline;
}

.conf-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.conf-stat {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}

.conf-stat:last-child {
  border-bottom: none;
}

.conference-header {
  background: var(--hover);
  padding: 20px;
  border-radius: 4px;
  margin-bottom: 30px;
  border: 1px solid var(--border);
}

.conference-header h2 {
  margin: 0 0 20px 0;
  color: var(--fg);
}

.conference-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
}

.conference-stats .stat-item {
  text-align: center;
}

.conference-stats .stat-label {
  display: block;
  font-size: 0.9em;
  color: var(--gray);
  margin-bottom: 5px;
  font-weight: 500;
}

.conference-stats .stat-value {
  display: block;
  font-size: 1.4em;
  font-weight: 600;
  color: var(--fg);
}

/* ===== MOBILE RESPONSIVE STYLES ===== */
@media (max-width: 768px) {
  body {
    padding: 10px;
    font-size: 13px;
  }

  .site-header {
    padding-bottom: 8px;
    margin-bottom: 12px;
  }

  .site-title {
    font-size: 16px;
  }

  .site-subtitle {
    font-size: 12px;
  }

  h2 {
    font-size: 13px;
  }

  h3 {
    font-size: 12px;
  }

  .main-nav {
    gap: 8px;
  }

  .main-nav a {
    font-size: 13px;
  }

  table {
    font-size: 12px;
  }

  th,
  td {
    padding: 6px 6px;
  }

  th {
    font-size: 11px;
  }

  .team-col,
  .matchup-col {
    min-width: 100px;
  }

  .search-box {
    max-width: 100%;
  }

  .conference-grid {
    grid-template-columns: 1fr;
  }

  .filter-buttons {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 5px;
  }

  .filter-btn {
    flex-shrink: 0;
    min-width: auto;
    padding: 6px 10px;
    min-height: 32px;
  }

  .pagination-buttons {
    gap: 4px;
  }

  .pagination-btn {
    padding: 6px 8px;
    font-size: 12px;
    min-width: 36px;
    min-height: 32px;
  }

  .team-stats,
  .conf-stats,
  .conference-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .stat-label {
    font-size: 11px;
  }

  .stat-value {
    font-size: 14px;
  }

  .quad-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .quad-card {
    padding: 10px;
  }

  .quad-label {
    font-size: 1em;
  }

  .quad-record {
    font-size: 1.1em;
  }

  .team-header {
    padding: 12px;
  }
}

@media (max-width: 480px) {
  body {
    padding: 8px;
    font-size: 12px;
  }

  .site-title {
    font-size: 14px;
  }

  .main-nav {
    gap: 6px;
  }

  .main-nav a {
    font-size: 12px;
    padding: 3px 0;
  }

  table {
    font-size: 11px;
  }

  th,
  td {
    padding: 5px 4px;
  }

  th {
    font-size: 10px;
  }

  .team-stats,
  .location-stats {
    grid-template-columns: repeat(3, 1fr);
  }

  .navigation-links {
    font-size: 12px;
  }

  .navigation-links a {
    display: inline-block;
    margin: 4px 0;
  }
}

/* ===== DESKTOP ENHANCEMENTS ===== */
@media (min-width: 768px) {
  body {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px;
    font-size: 16px;
    line-height: 1.6;
  }

  .site-title {
    font-size: 24px;
  }

  .site-subtitle {
    font-size: 16px;
  }

  h2 {
    font-size: 16px;
  }

  h3 {
    font-size: 14px;
  }

  .main-nav a {
    font-size: 16px;
    margin-right: 4px;
  }

  table {
    font-size: 14px;
  }

  th {
    font-size: 13px;
    padding: 10px 8px;
  }

  td {
    padding: 10px 8px;
  }

  .search-box {
    font-size: 16px;
    height: 40px;
  }

  .filter-btn,
  .pagination-btn {
    font-size: 16px;
    padding: 10px 20px;
    min-height: 40px;
  }
}

/* ===== PRINT STYLES ===== */
@media print {

  .main-nav,
  .filter-buttons,
  .controls-container,
  .pagination,
  .navigation-links,
  .site-footer,
  .table-scroll-hint {
    display: none;
  }

  body {
    max-width: 100%;
    font-size: 10pt;
    background-color: white;
    color: black;
  }

  a {
    color: black;
    text-decoration: none;
  }

  .table-container {
    overflow: visible;
  }

  table {
    min-width: auto;
  }

  .wab-elite,
  .wab-strong,
  .wab-solid,
  .result-win {
    color: #000;
    font-weight: bold;
  }

  .wab-below,
  .wab-poor,
  .result-loss {
    color: #000;
    font-weight: bold;
    text-decoration: underline;
  }
}

/* ===== UTILITY ===== */
.hidden {
  display: none !important;
}