/* ============================================
   LEAN EDGE SPORTS — Results Page
   results.css

   Shared layout classes (page-hero, sidebar,
   toolbar) match the same pattern used in
   player-stats.css and team-stats.css, kept
   here per-page following the established
   one-CSS-file-per-page convention.
   ============================================ */

/* --- PAGE HERO --- */
.page-hero {
  padding: 120px 60px 40px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.page-hero h1 {
  font-family: tahoma;
  font-size: 64px;
  font-weight: 900;
  color: var(--white);
  letter-spacing: -1px;
  margin-bottom: 12px;
  line-height: 1;
}

.page-subtitle {
  font-size: 17px;
  color: var(--text-muted);
  max-width: 550px;
  margin: 0 auto;
  line-height: 1.6;
}

/* --- PAGE LAYOUT --- */
.stats-page-layout {
  display: flex;
  min-height: calc(100vh - 300px);
}

/* --- TEAM SIDEBAR --- */
.team-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--darkest-navy);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  overflow-y: auto;
  position: sticky;
  top: 0;
  max-height: 100vh;
}

.sidebar-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 20px 16px 10px;
}

.team-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  cursor: pointer;
  font-size: 13px;
  font-family: 'Barlow', sans-serif;
  color: var(--grey-font);
  text-align: left;
  transition: background 0.15s, color 0.15s;
}

.team-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--white);
}

.team-btn.active {
  background: rgba(196, 18, 48, 0.08);
  border-left: 3px solid var(--red);
  padding-left: 13px;
  color: var(--white);
  font-weight: 600;
}

.team-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* --- MAIN CONTENT AREA --- */
.stats-main {
  flex: 1;
  padding: 24px 32px 60px;
  min-width: 0;
}

/* --- TOOLBAR --- */
.stats-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-wrap .ti-search {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 10px 12px 10px 38px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: var(--white);
  font-size: 14px;
  font-family: 'Barlow', sans-serif;
  transition: border-color 0.2s;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  outline: none;
  border-color: rgba(196, 18, 48, 0.5);
}

.sort-select {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: var(--white);
  font-size: 13px;
  font-family: 'Barlow', sans-serif;
  cursor: pointer;
  transition: border-color 0.2s;
}

.sort-select:focus {
  outline: none;
  border-color: rgba(196, 18, 48, 0.5);
}

.sort-select option {
  background-color: var(--dark-navy);
  color: var(--white);
}

/* --- RESET FILTER BUTTON --- */
.reset-filter-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: rgba(196, 18, 48, 0.1);
  border: 1px solid rgba(196, 18, 48, 0.3);
  border-radius: 10px;
  color: var(--red);
  font-size: 13px;
  font-weight: 600;
  font-family: 'Barlow', sans-serif;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.reset-filter-btn:hover {
  background: rgba(196, 18, 48, 0.2);
  border-color: rgba(196, 18, 48, 0.5);
}

.reset-filter-btn[hidden] {
  display: none;
}

/* --- JUMP TO DATE --- */
.jump-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 0 6px 0 14px;
}

.jump-wrap label {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.jump-date-input {
  background: none;
  border: none;
  color: var(--white);
  font-size: 13px;
  font-family: 'Barlow', sans-serif;
  padding: 10px 4px;
  color-scheme: dark;
}

.jump-date-input:focus {
  outline: none;
}

.jump-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: rgba(196, 18, 48, 0.15);
  border: none;
  border-radius: 7px;
  color: var(--red);
  cursor: pointer;
  transition: background 0.2s;
}

.jump-btn:hover {
  background: rgba(196, 18, 48, 0.3);
}

/* --- TEAM SUMMARY BAR --- */
.team-summary {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  padding: 18px 22px;
  margin-bottom: 20px;
  background: rgba(17, 29, 66, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

.team-summary[hidden] {
  display: none;
}

.summary-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.summary-stat .label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.summary-stat .value {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--white);
}

.summary-stat .value.streak-w {
  color: #4ade80;
}

.summary-stat .value.streak-l {
  color: var(--red);
}

/* --- SEASON DROPDOWN --- */
.season-select {
  font-weight: 600;
  color: #ff6b6b;
  background-color: var(--dark-navy);
  border-color: rgba(196, 18, 48, 0.3);
}

.season-select:focus {
  outline: none;
  border-color: rgba(196, 18, 48, 0.5);
}

.season-select option {
  background-color: var(--dark-navy);
  color: var(--white);
}

/* --- RESULTS HEADING --- */
.team-heading {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 20px;
}

.team-heading h2 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--white);
  margin: 0;
}

.player-count {
  font-size: 13px;
  color: var(--text-muted);
}

/* --- NO RESULTS --- */
.no-results {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.no-results .ti-search-off,
.no-results .ti-trophy-off {
  font-size: 48px;
  display: block;
  margin-bottom: 16px;
  opacity: 0.4;
}

.no-results p {
  font-size: 15px;
}

/* ============================================
   DAY-GROUPED RESULTS LIST
   New for this page — each calendar date with
   games gets its own heading and a stack of
   game rows underneath.
============================================ */

.results-day-group {
  margin-bottom: 28px;
}

.results-day-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.01em;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.day-game-count {
  font-family: 'Barlow', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.results-day-games {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

/* --- INDIVIDUAL GAME ROW --- */
.result-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 10px 16px;
  background: var(--dark-navy);
  border-radius: 8px;
  font-family: 'Barlow', sans-serif;
}

.result-team {
  flex: 1;
  font-size: 13px;
  color: var(--text-muted);
  text-align: left;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.result-team.away {
  text-align: right;
  justify-content: flex-end;
}

.result-team:hover {
  color: var(--white);
  text-decoration: underline;
}

.result-team.win {
  color: var(--white);
  font-weight: 600;
}

.wl-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

.wl-badge.w {
  background: rgba(74, 222, 128, 0.15);
  color: #4ade80;
}

.wl-badge.l {
  background: rgba(196, 18, 48, 0.15);
  color: var(--red);
}

.ot-tag {
  font-size: 10px;
  font-weight: 700;
  color: var(--mid-blue);
  background: rgba(46, 117, 182, 0.15);
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 4px;
  vertical-align: middle;
}

.result-score {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 28px;
  text-align: center;
}

.result-score.win {
  color: var(--white);
}

.result-sep {
  color: var(--text-muted);
  opacity: 0.4;
  font-size: 13px;
}

/* --- MODE TOGGLE --- */
.mode-toggle {
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 16px;
  width: fit-content;
}

.mode-btn {
  padding: 8px 20px;
  border: none;
  border-radius: 7px;
  background: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  font-family: 'Barlow', sans-serif;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.mode-btn:hover {
  color: var(--white);
}

.mode-btn.active {
  background: var(--red);
  color: var(--white);
}

/* ============================================
   PLAYOFF SERIES LAYOUT
============================================ */

.playoff-section-heading {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 28px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.playoff-section-heading:first-child {
  margin-top: 0;
}

.series-block {
  margin-bottom: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  overflow: hidden;
}

.series-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  gap: 12px;
  user-select: none;
}

.series-header:hover {
  background: rgba(255, 255, 255, 0.07);
}

.series-matchup {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--white);
}

.series-result {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.series-result .series-winner {
  color: #4ade80;
}

.series-toggle-icon {
  font-size: 14px;
  color: var(--text-muted);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.series-block.open .series-toggle-icon {
  transform: rotate(180deg);
}

.series-games {
  display: none;
  flex-direction: column;
  gap: 1px;
  padding: 4px 0;
  background: var(--darkest-navy);
}

.series-block.open .series-games {
  display: flex;
}

.playin-notice {
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px 16px 10px;
  font-style: italic;
}

.game-num-badge {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  padding: 1px 5px;
  flex-shrink: 0;
  min-width: 36px;
  text-align: center;
  white-space: nowrap;
}

.game-date {
  font-weight: 400;
  opacity: 0.7;
  margin-left: 4px;
}

/* --- JUMP NOTICE --- */
.jump-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  margin-bottom: 14px;
  background: rgba(46, 117, 182, 0.1);
  border: 1px solid rgba(46, 117, 182, 0.25);
  border-radius: 8px;
  font-size: 13px;
  color: var(--grey-font);
}

.jump-notice-close {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
  flex-shrink: 0;
  transition: color 0.2s;
}

.jump-notice-close:hover {
  color: var(--white);
}

/* --- LOAD MORE --- */
.load-more-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  margin-top: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: var(--grey-font);
  font-size: 13px;
  font-weight: 600;
  font-family: 'Barlow', sans-serif;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.load-more-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--white);
}

.load-more-btn[hidden] {
  display: none;
}

/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
  .team-sidebar {
    width: 180px;
  }

  .stats-main {
    padding: 20px 20px 50px;
  }
}

@media (max-width: 768px) {
  .stats-page-layout {
    flex-direction: column;
  }

  .team-sidebar {
    width: 100%;
    max-height: 200px;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    overflow-x: auto;
    position: static;
  }

  .sidebar-title {
    width: 100%;
    padding: 12px 16px 6px;
  }

  .team-btn {
    border-bottom: none;
    border-right: 1px solid rgba(255, 255, 255, 0.04);
    white-space: nowrap;
    flex-shrink: 0;
  }

  .team-btn.active {
    border-left: none;
    border-bottom: 3px solid var(--red);
    padding-left: 16px;
    padding-bottom: 7px;
  }

  .page-hero {
    padding: 100px 24px 30px;
  }

  .page-hero h1 {
    font-size: 44px;
  }

  .stats-main {
    padding: 16px 16px 40px;
  }

  .result-team {
    font-size: 12px;
  }

  .result-score {
    font-size: 15px;
  }
}

@media (max-width: 480px) {
  .stats-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .sort-select {
    width: 100%;
    text-align: center;
  }

  .jump-wrap {
    justify-content: space-between;
  }

  .team-summary {
    gap: 16px;
    padding: 14px 16px;
  }

  .result-row {
    gap: 8px;
    padding: 10px 12px;
  }

  .results-day-heading {
    flex-wrap: wrap;
  }
}

.standings-team-link,
.result-opp-link,
.card-team-link,
.draft-team-link,
.chc-name-link,
.pp-name.standings-team-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s;
}

.standings-team-link:hover,
.result-opp-link:hover,
.card-team-link:hover,
.draft-team-link:hover,
.pp-name.standings-team-link:hover {
  color: var(--white);
}

.chc-name-link { display: block; }
.chc-name-link:hover .chc-name { color: var(--grey-font); }
