/* ============================================
   LEAN EDGE SPORTS — Player Stats Page
   player-stats.css
   ============================================ */

/* --- 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);
}

.early-season-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 13px;
  font-family: 'Barlow', sans-serif;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  white-space: nowrap;
}

.early-season-toggle:hover {
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--white);
}

.early-season-toggle input[type="checkbox"] {
  accent-color: var(--red);
  cursor: pointer;
}

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

.season-badge {
  padding: 9px 14px;
  background: rgba(196, 18, 48, 0.1);
  border: 1px solid rgba(196, 18, 48, 0.25);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  color: #ff6b6b;
  white-space: nowrap;
  letter-spacing: 0.03em;
}

/* --- SEASON NOTICE --- */
.season-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(46, 117, 182, 0.08);
  border: 1px solid rgba(46, 117, 182, 0.2);
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.5;
}

.season-notice .ti-info-circle {
  font-size: 16px;
  color: var(--mid-blue);
  flex-shrink: 0;
  margin-top: 1px;
}

/* --- TEAM 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);
}

/* --- PLAYER CARDS GRID --- */
.player-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 32px;
  align-items: stretch;
}

/* --- INDIVIDUAL PLAYER CARD --- */
.player-card {
  position: relative;
  background: var(--dark-navy);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
  text-decoration: none;
  display: flex;
  flex-direction: column;
}

.card-fav-btn {
  position: absolute;
  top: 18px;
  right: 16px;
  z-index: 5;
  background: rgba(13,24,48,0.6);
  border-radius: 50%;
}

.player-card:hover {
  transform: translateY(-4px);
  border-color: rgba(196, 18, 48, 0.3);
}

/* Split top border */
.card-border-top {
  height: 3px;
  display: flex;
}

.card-border-top .border-left {
  flex: 1;
  background: var(--navy);
}

.card-border-top .border-right {
  flex: 1;
  background: var(--red);
}

/* Inner white border frame */
.card-inner {
  margin: 7px;
  border: 2px solid rgba(255, 255, 255, 0.353);
  border-radius: 8px;
  padding: 12px 10px 10px;
  height: calc(100% - 14px);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

/* Score and position row */
.card-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 8px;
}

.card-score {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 28px;
  font-weight: 900;
  color: var(--white);
  line-height: 1;
}

.card-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.card-position {
  font-size: 11px;
  font-weight: 700;
  color: var(--red);
  letter-spacing: 0.06em;
}

.card-flag {
  width: 25px;
  height: 16px;
  display: block;
  border-radius: 2px;
  margin-left: auto;
}

/* Player silhouette */
.card-silhouette {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(26, 42, 94, 0.5);
  border: 2px solid rgba(196, 18, 48, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
}

.card-silhouette svg {
  width: 42px;
  height: 42px;
}

/* Player name */
.card-name {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--white);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
  white-space: normal;
  line-height: 1.4;
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* White divider */
.card-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.5);
  margin-bottom: 8px;
}

/* Stats grid */
.card-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

.card-stat {
  text-align: center;
}

.stat-val {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--white);
  line-height: 1;
  margin-bottom: 2px;
}

.stat-lbl {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Team name */
.card-team {
  text-align: center;
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: auto;
  padding-top: 8px;
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.3;
}

/* View stats link */
.card-link {
  display: block;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--red);
  text-decoration: none;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  transition: opacity 0.2s;
}

.card-link:hover {
  opacity: 0.75;
}

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

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

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

/* --- STATS KEY SECTION --- */
.stats-key-section {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 8px;
}

.key-toggle {
  width: 100%;
  padding: 14px 20px;
  background: var(--darkest-navy);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-family: 'Barlow', sans-serif;
  font-weight: 500;
  color: var(--grey-font);
  transition: color 0.2s, background 0.2s;
}

.key-toggle:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.03);
}

.key-toggle .ti-help {
  font-size: 15px;
  vertical-align: -2px;
  margin-right: 8px;
  color: var(--red);
}

.key-chevron {
  font-size: 15px;
  transition: transform 0.25s ease;
}

.key-chevron.open {
  transform: rotate(180deg);
}

.stats-key-content {
  padding: 20px 24px 24px;
  background: rgba(13, 24, 48, 0.6);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.key-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px 40px;
}

.key-group-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--red);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.key-item {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.key-abbr {
  font-size: 12px;
  font-weight: 700;
  color: var(--white);
  min-width: 40px;
  flex-shrink: 0;
}

.key-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* --- 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;
  }

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

  .player-cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

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

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

  .player-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================
   PLAYER CARD TIER SYSTEM
   Elite (top 5%) / Excellent (next 20%) /
   Solid (next 25%) / Average (bottom 50%) /
   Early Season (under 20 games played)
============================================ */

/* ---- ELITE — gold ---- */
.player-card.tier-elite {
  background: radial-gradient(ellipse at 50% 30%, rgba(212,175,55,0.08) 0%, #0d1830 60%);
  border-color: rgba(212,175,55,0.2);
}

.player-card.tier-elite .card-border-top .border-left {
  background: #D4AF37;
}

.player-card.tier-elite .card-border-top .border-right {
  background: #B8960C;
}

.player-card.tier-elite .card-inner {
  border-color: rgba(212, 175, 55, 0.65);
}

.player-card.tier-elite .card-score {
  color: #D4AF37;
}

.player-card.tier-elite .card-position {
  color: #D4AF37;
}

.player-card.tier-elite .card-divider {
  background: rgba(212,175,55,0.4);
}

/* ---- EXCELLENT — red ---- */
.player-card.tier-excellent {
  background: radial-gradient(ellipse at 50% 30%, rgba(196,18,48,0.08) 0%, #0d1830 60%);
  border-color: rgba(196,18,48,0.18);
}

.player-card.tier-excellent .card-inner {
  border-color: rgba(196, 18, 48, 0.65);
}

.player-card.tier-excellent .card-score {
  color: rgba(196, 18, 48, 0.9);
}

.player-card.tier-excellent .card-position {
  color: rgba(196, 18, 48, 0.9);
}

/* ---- SOLID — blue ---- */
.player-card.tier-solid {
  background: radial-gradient(ellipse at 50% 30%, rgba(46,117,182,0.07) 0%, #0d1830 60%);
  border-color: rgba(46,117,182,0.18);
}

.player-card.tier-solid .card-inner {
  border-color: rgba(46,117,182,0.65);
}

.player-card.tier-solid .card-divider {
  background: rgba(46,117,182,0.4);
}

.player-card.tier-solid .card-score {
  color: rgba(46, 117, 182, 0.8);
}

.player-card.tier-solid .card-position {
  color: rgba(46, 117, 182, 0.8);
}

/* ---- AVERAGE — plain navy, white border ---- */
.player-card.tier-average {
  background: #0d1830;
}

.player-card.tier-average .card-inner {
  border-color: rgba(255, 255, 255, 0.65);
}

.player-card.tier-average .card-score {
  color: rgba(255, 255, 255, 0.8);
}

.player-card.tier-average .card-position {
  color: rgba(255, 255, 255, 0.8);
}

/* ---- EARLY SEASON — neutral grey ---- */
.player-card.tier-early {
  background: #0d1830;
  border-color: rgba(255, 255, 255, 0.06);
}

.player-card.tier-early .card-inner {
  border-color: rgba(255, 255, 255, 0.3);
}

.player-card.tier-early .card-score {
  color: rgba(255, 255, 255, 0.5);
}

.player-card.tier-early .card-position {
  color: rgba(255, 255, 255, 0.5);
}

/* ============================================
   TIER BADGE
   Now shown on every card, including Average
   and Early Season — no more spacer needed
============================================ */
.card-tier-badge {
  display: inline-block;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  margin: 0 auto 16px;
  text-align: center;
  width: fit-content;
}

.tier-elite .card-tier-badge {
  background: rgba(212,175,55,0.12);
  color: #D4AF37;
  border: 0.5px solid rgba(212,175,55,0.3);
}

.tier-excellent .card-tier-badge {
  background: rgba(196,18,48,0.1);
  color: #df3838;
  border: 0.5px solid rgba(196,18,48,0.4);
}

.tier-solid .card-tier-badge {
  background: rgba(46,117,182,0.15);
  color: #7bb3e8;
  border: 0.5px solid rgba(46,117,182,0.4);
}

.tier-average .card-tier-badge {
  background: rgba(255,255,255,0.05);
  color: rgba(255, 255, 255, 0.9);
  border: 0.5px solid rgba(255,255,255,0.12);
}

.tier-early .card-tier-badge {
  background: rgba(255,255,255,0.05);
  color: rgba(255, 255, 255, 0.50);
  border: 0.5px solid rgba(255,255,255,0.12);
}

/* ============================================
   TREND ARROWS
   Not used on this page currently — the card
   builder keeps cards clean and FUT-style.
   This styling is reused on the individual
   player page where trends have proper room.
============================================ */
.trend {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  margin-left: 2px;
  cursor: default;
}

.trend-up {
  color: #4ade80;
}

.trend-down {
  color: #f87171;
}

.trend-flat {
  color: rgba(255, 255, 255, 0.3);
}

/* ============================================
   SEASON DROPDOWN
   Dark navy theme, including the options list
   that browsers otherwise render with their own
   default white background
============================================ */
.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);
}
.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); }

/* --- TIER PILLS --- */
.tier-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.tier-pill {
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  font-family: 'Barlow', sans-serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.tier-pill:hover { color: var(--white); background: rgba(255,255,255,0.09); }

/* All — active state */
.tier-pill.active { background: rgba(255,255,255,0.12); color: var(--white); border-color: rgba(255,255,255,0.3); }

/* Elite — gold */
.tier-pill-elite { border-color: rgba(212,175,55,0.3); color: #D4AF37; }
.tier-pill-elite:hover { background: rgba(212,175,55,0.12); color: #D4AF37; }
.tier-pill-elite.active { background: rgba(212,175,55,0.18); color: #D4AF37; border-color: rgba(212,175,55,0.6); }

/* Excellent — red */
.tier-pill-excellent { border-color: rgba(196,18,48,0.3); color: #ff6b6b; }
.tier-pill-excellent:hover { background: rgba(196,18,48,0.12); color: #ff6b6b; }
.tier-pill-excellent.active { background: rgba(196,18,48,0.18); color: #ff6b6b; border-color: rgba(196,18,48,0.6); }

/* Solid — blue */
.tier-pill-solid { border-color: rgba(46,117,182,0.3); color: var(--mid-blue); }
.tier-pill-solid:hover { background: rgba(46,117,182,0.12); color: var(--mid-blue); }
.tier-pill-solid.active { background: rgba(46,117,182,0.18); color: var(--mid-blue); border-color: rgba(46,117,182,0.6); }

/* Average — white/grey */
.tier-pill-average { border-color: rgba(255,255,255,0.15); color: var(--grey-font); }
.tier-pill-average:hover { background: rgba(255,255,255,0.08); color: var(--white); }
.tier-pill-average.active { background: rgba(255,255,255,0.1); color: var(--white); border-color: rgba(255,255,255,0.4); }

/* Early Season — muted purple */
.tier-pill-early { border-color: rgba(90,90,106,0.3); color: #8888aa; }
.tier-pill-early:hover { background: rgba(90,90,106,0.12); color: #8888aa; }
.tier-pill-early.active { background: rgba(90,90,106,0.2); color: #aaaacc; border-color: rgba(90,90,106,0.5); }
