/* =========================================================
   WCHL SCHEDULES UNIFIED STYLES
   - Hockey Summit-style header/navigation (blue, horizontal, sticky)
   - Legacy admin bar (black, top)
   - Schedule/Standings tables (blue headers, alternating rows)
   ========================================================= */

/* ---- CSS Variables ---- */
:root {
  --wchl-blue: #305088;
  --wchl-blue-dark: #223B69;
  --wchl-teal: #50A8B0;
  --wchl-red: #C00010;
  --wchl-bg: #ffffff;
  --wchl-surface: #f4f7fb;
  --wchl-surface-alt: #eaf0f8;
  --wchl-text: #1f2937;
  --wchl-muted: #6b7280;
  --wchl-border: #cfd8e3;
  --wchl-darkbar: #0b1b33;
  --wchl-darkbar-text: #ffffff;
}

/* ---- Basic Reset ---- */
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: #f4f7fb; /* Light gray background to match table rows */
  color: var(--wchl-text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12pt;
  line-height: 1.35;
  overflow-x: hidden;
}

/* =========================================================
   ADMIN BAR (Top Black Bar - WordPress style)
   Keep this exactly as-is
   ========================================================= */
#wpadminbar {
  background: #23282d !important;
  color: #ffffff !important;
  height: 32px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 99999;
  font-size: 13px;
  line-height: 32px;
}

#wpadminbar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

#wpadminbar li {
  display: inline-block;
  margin: 0;
  padding: 0;
}

#wpadminbar .ab-top-secondary {
  float: right;
}

#wpadminbar a.ab-item {
  color: #ffffff !important;
  text-decoration: none;
  padding: 0 12px;
  display: inline-block;
  height: 32px;
  line-height: 32px;
  font-size: 13px;
}

#wpadminbar a.ab-item:hover {
  background: #32373c !important;
  color: #00b9eb !important;
}

/* Push body content down when admin bar is present */
html {
  margin-top: 32px !important;
}

@media screen and (max-width: 782px) {
  html {
    margin-top: 46px !important;
  }
  #wpadminbar {
    height: 46px;
  }
}

/* =========================================================
   HEADER & NAVIGATION (Hockey Summit Style)
   Blue background, horizontal menu, sticky on scroll
   ========================================================= */
#wchl-header {
  background: linear-gradient(135deg, #305088 0%, #223B69 100%);
  position: sticky;
  top: 0px; /* Below admin bar */
  z-index: 9999;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  margin-bottom: 0; /* Remove extra space */
  width: 100%; /* Full width */
  left: 0;
  right: 0;
}

#wchl-header.scrolled {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.header-container {
  max-width: 1170px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

.header-logo {
  padding: 8px 0;
  display: flex;
  align-items: center;
  gap: 16px; /* Space between logo and text */
}

.header-logo a {
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  line-height: 1;
}

.header-logo img {
  height: 70px;
  width: auto;
  transition: transform 0.3s ease;
  display: block;
}

.header-logo a:hover img {
  transform: scale(1.05);
}

/* League name text next to logo */
.header-logo a span,
.header-logo span {
  color: #ffffff;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
  display: inline-block;
  vertical-align: middle;
}

/* Navigation Menu */
#wchl-nav {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}

.nav-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0;
}

.nav-item {
  margin: 0;
  padding: 0;
}

.nav-link {
  display: block;
  padding: 28px 24px;
  color: #ffffff !important;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  border-bottom: 3px solid transparent;
}

.nav-link:hover,
.nav-link.current {
  background: rgba(255, 255, 255, 0.1);
  border-bottom-color: var(--wchl-teal);
  color: #ffffff !important;
}

/* Mobile Navigation */
@media (max-width: 768px) {
  #wchl-header {
    top: 46px;
  }
  
  .header-container {
    flex-direction: column;
    padding: 12px 20px;
  }
  
  .header-logo img {
    height: 50px;
  }
  
  .nav-menu {
    flex-direction: column;
    width: 100%;
    gap: 0;
  }
  
  .nav-link {
    padding: 14px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
}

/* =========================================================
   CONTAINER & CONTENT
   ========================================================= */
.container {
  max-width: 1170px;
  margin: 0 auto;
  padding: 20px;
  padding-top: 0; /* Remove top padding to eliminate gap */
}

/* =========================================================
   BLACK ADMIN/SEASON TABLES
   These are the <table bgcolor="black"> elements
   ========================================================= */
table[bgcolor="black"] {
  width: 100%;
  border: 0;
  margin: 20px 0;
  background: var(--wchl-darkbar) !important;
}

table[bgcolor="black"] tr.DataSubHeader {
  background: var(--wchl-darkbar) !important;
}

table[bgcolor="black"] tr.DataSubHeader td {
  background: var(--wchl-darkbar) !important;
  color: #ffffff !important;
  padding: 12px 16px !important;
  text-align: center;
  font-size: 18px;
  font-weight: 900;
}

/* Season title row */
table[bgcolor="black"] tr.DataSubHeader td[align="center"] {
  font-size: 20px;
  font-weight: 900;
}

/* Admin menu links row */
table[bgcolor="black"] tr.AdminHDR,
table[bgcolor="black"] tr.AdminHDR td {
  background: var(--wchl-darkbar) !important;
  color: #ffffff !important;
  padding: 12px 16px;
  text-align: center;
}

table[bgcolor="black"] a.mainmenu {
  color: #ffffff !important;
  font-size: 16px !important;
  font-weight: 800 !important;
  text-decoration: none !important;
  padding: 0 8px;
}

table[bgcolor="black"] a.mainmenu:hover {
  color: var(--wchl-teal) !important;
  text-decoration: underline !important;
}

/* =========================================================
   SCHEDULE/STANDINGS TABLES
   Column headers, section headers, data rows
   ========================================================= */

/* Main table column headers (Time, Home, Score, etc.) */
TR.AdminHDR,
TR.DataHDR,
TR.DataHeader {
  background-color: var(--wchl-blue) !important;
  color: #ffffff !important;
  font-size: 18px;
  font-weight: 900;
}

TR.AdminHDR TD,
TR.AdminHDR TH,
TR.DataHDR TD,
TR.DataHDR TH,
TR.DataHeader TD,
TR.DataHeader TH {
  background-color: var(--wchl-blue) !important;
  color: #ffffff !important;
  border-color: var(--wchl-border) !important;
  padding: 10px 8px;
  text-align: center;
}

TR.AdminHDR FONT,
TR.DataHDR FONT,
TR.DataHeader FONT {
  color: #ffffff !important;
  font-weight: 900;
}

/* Links inside AdminHDR (Exhibition, Regular Season, Playoffs, Penalties) */
TR.AdminHDR a {
  color: #ffffff !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  text-decoration: none !important;
}

TR.AdminHDR a:hover {
  color: var(--wchl-teal) !important;
  text-decoration: underline !important;
}

/* Section headers (Regular Season, Friday January 12, etc.) */
TR.DataSubHeader {
  background-color: var(--wchl-blue-dark) !important;
  color: #ffffff !important;
  font-size: 18px;
  font-weight: 900;
}

TR.DataSubHeader TD,
TR.DataSubHeader TH {
  background-color: var(--wchl-blue-dark) !important;
  color: #ffffff !important;
  border-color: var(--wchl-border) !important;
  padding: 8px;
}

/* Links in DataSubHeader (Statistics, Goalies links) */
TR.DataSubHeader a,
TR.DataSubHeader a.NAV {
  color: var(--wchl-teal) !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  text-decoration: none !important;
}

TR.DataSubHeader a:hover,
TR.DataSubHeader a.NAV:hover {
  color: #ffffff !important;
  text-decoration: underline !important;
}

/* Alternating data rows */
TR.Data0 {
  background-color: var(--wchl-surface) !important;
  color: var(--wchl-text) !important;
  font-size: 16px;
}

TR.Data1 {
  background-color: var(--wchl-surface-alt) !important;
  color: var(--wchl-text) !important;
  font-size: 16px;
}

TR.Data0 TD {
  background-color: var(--wchl-surface) !important;
  border-color: var(--wchl-border) !important;
  padding: 8px;
}

TR.Data1 TD {
  background-color: var(--wchl-surface-alt) !important;
  border-color: var(--wchl-border) !important;
  padding: 8px;
}

/* =========================================================
   LINKS IN TABLES
   ========================================================= */
a.links {
  color: var(--wchl-blue);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
}

a.links:hover {
  color: var(--wchl-blue-dark);
  text-decoration: underline;
}

/* =========================================================
   GENERAL TABLE STYLES
   ========================================================= */
table {
  border-collapse: collapse;
  width: 100%;
}

td, th {
  border: 1px solid var(--wchl-border);
  padding: 8px;
  vertical-align: top;
}

/* =========================================================
   SPONSOR LOGO FIX (Standings pages)
   Prevents huge logos from causing overflow
   ========================================================= */
img[align="right"],
img[style*="float:right"],
img[style*="float: right"],
img[style*="FLOAT:RIGHT"],
img[style*="FLOAT: RIGHT"] {
  width: min(240px, 28vw) !important;
  max-width: min(240px, 28vw) !important;
  height: auto !important;
  margin: 10px 0 10px 16px !important;
}

@media (max-width: 900px) {
  img[align="right"],
  img[style*="float:right"],
  img[style*="float: right"],
  img[style*="FLOAT:RIGHT"],
  img[style*="FLOAT: RIGHT"] {
    float: none !important;
    display: block !important;
    margin: 12px auto !important;
    width: min(220px, 80vw) !important;
    max-width: min(220px, 80vw) !important;
  }
}

/* Global image safety */
img {
  max-width: 100%;
  height: auto;
}

/* Division logos in standings */
.DivisionLogo {
  vertical-align: top;
  float: right;
  max-height: 150px;
  max-width: 150px;
  margin-left: 16px;
}

.DivisionLogo img {
  max-height: 150px;
  max-width: 150px;
  height: auto;
  width: auto;
}

/* =========================================================
   NAVIGATION/SCHEDULE CONTROLS
   Week navigation, etc.
   ========================================================= */
table[width="100%"][cellspacing="2"] strong {
  font-size: 18px;
  color: var(--wchl-text);
}

/* =========================================================
   RESPONSIVE TABLES
   ========================================================= */
@media (max-width: 768px) {
  table {
    font-size: 14px;
  }
  
  TR.AdminHDR TD,
  TR.DataHDR TD,
  TR.DataHeader TD,
  TR.DataSubHeader TD {
    font-size: 14px;
    padding: 6px 4px;
  }
  
  TR.Data0 TD,
  TR.Data1 TD {
    font-size: 13px;
    padding: 6px 4px;
  }
}

/* =========================================================
   PRINT STYLES
   ========================================================= */
@media print {
  #wpadminbar,
  #wchl-header {
    display: none !important;
  }
  
  html {
    margin-top: 0 !important;
  }
  
  .container {
    max-width: 100%;
  }
}
