/* Fantasy Football Projections page styles */

.fantasy { padding: 64px 0; overflow-x: hidden; }
.fantasy-header { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.fantasy-title { margin: 0; }
.fantasy-page-detail { color: var(--color-text-tertiary); font-size: 0.9rem; }

.fantasy-controls { display: grid; grid-template-columns: repeat(4, minmax(140px, 1fr)); gap: 12px; margin-bottom: 20px; }
.control-group { display: flex; flex-direction: column; gap: 6px; }
.control-group.grow { display: none; }
.control-group label { color: var(--color-text-secondary); font-size: 0.85rem; }
.control-group input, .control-group select { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--color-border-light); background: var(--color-surface-primary); color: var(--color-text-primary); }

/* Table wrapper with horizontal scroll only */
.fantasy-table-wrap { 
  width: 100%; 
  max-width: 100%;
  overflow-x: auto; 
  overflow-y: visible; 
  -webkit-overflow-scrolling: touch; 
  border-radius: 16px; 
  border: 1px solid var(--color-border-light); 
  background: var(--color-surface-primary); 
  position: relative;
  overscroll-behavior-x: contain;
}

.fantasy-table { 
  width: 100%; 
  border-collapse: separate; 
  border-spacing: 0; 
  min-width: 1080px; 
  table-layout: fixed;
}

.fantasy-table thead th { 
  position: sticky; 
  top: 0; 
  z-index: 10; 
  background: var(--color-surface-primary); 
  border-bottom: 1px solid var(--color-border-light); 
  padding: 10px 12px; 
  text-align: left; 
  color: var(--color-text-secondary); 
  font-weight: 700; 
  font-size: 0.85rem; 
}

.fantasy-table tbody td { 
  padding: 12px; 
  border-bottom: 1px solid var(--color-border-light); 
  vertical-align: middle; 
}

.fantasy-table tbody tr:hover { background: var(--color-grey-100, #1118270F); }
.fantasy-table .th-rank, .fantasy-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.fantasy-table .th-rank { width: 48px; min-width: 48px; max-width: 48px; }
.fantasy-table tbody td:first-child { width: 48px; min-width: 48px; max-width: 48px; }
.fantasy-table .th-player { width: 180px; min-width: 180px; max-width: 180px; }
.fantasy-table .td-player { width: 180px; min-width: 180px; max-width: 180px; }
.fantasy-table .td-player .name { font-weight: 700; color: var(--color-text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fantasy-table .td-player .meta { color: var(--color-text-tertiary); font-size: 0.8rem; }
.fantasy-table .th-pos, .fantasy-table .th-team, .fantasy-table .th-opp { color: var(--color-text-secondary); white-space: nowrap; }
.fantasy-table .strong { font-weight: 800; color: var(--color-primary); }
.fantasy-empty { text-align: center; color: var(--color-text-secondary); }

/* Explainer content */
.fantasy-explainer { 
  margin-top: 20px; 
  color: var(--color-text-secondary);
}
.fantasy-explainer h2 { 
  margin: 16px 0 8px; 
  font-size: 1.25rem; 
  color: var(--color-text-primary);
}
.fantasy-explainer ul { 
  margin: 8px 0 0 18px; 
}
.fantasy-explainer li { 
  margin: 6px 0; 
}

/* Freeze rank column (first column) */
.fantasy-table thead th:first-child,
.fantasy-table tbody td:first-child {
  position: sticky;
  left: 0;
  z-index: 11;
  background: var(--color-surface-primary);
}

/* Freeze player column (second column) */
.fantasy-table thead th:nth-child(2),
.fantasy-table tbody td:nth-child(2) {
  position: sticky;
  left: 48px;
  z-index: 11;
  background: var(--color-surface-primary);
  box-shadow: 2px 0 4px -2px rgba(0, 0, 0, 0.1);
}

/* Ensure header cells have higher z-index */
.fantasy-table thead th:first-child { z-index: 12; }
.fantasy-table thead th:nth-child(2) { z-index: 12; }

/* Mobile styles */
@media (max-width: 768px) {
  /* Prevent page-level horizontal scrolling on this page */
  html, body { overflow-x: hidden; }
  
  .fantasy { padding: 24px 0; }
  .fantasy-header { margin-bottom: 12px; }
  .fantasy-title { font-size: 1.5rem; }
  /* Add horizontal padding to header and controls */
  .fantasy-header, .fantasy-controls { padding: 0 16px; }
  
  .fantasy-controls { 
    grid-template-columns: 1fr 1fr; 
    gap: 8px;
    margin-bottom: 16px;
  }
  
  .control-group.grow { grid-column: span 2; }
  
  .control-group input, 
  .control-group select { 
    padding: 8px 10px; 
    font-size: 0.9rem;
  }
  
  .fantasy-table-wrap { 
    border-radius: 12px; 
    max-width: 100vw; 
    margin: 0; 
  }
  
  .fantasy-table { 
    min-width: 800px; 
  }
  
  .fantasy-table thead th { 
    font-size: 0.75rem; 
    padding: 8px;
    white-space: nowrap;
  }
  
  .fantasy-table tbody td { 
    padding: 8px; 
    font-size: 0.85rem; 
  }
  
  /* Adjust frozen column widths for mobile */
  .fantasy-table .th-rank,
  .fantasy-table tbody td:first-child { 
    width: 40px; 
    min-width: 40px; 
    max-width: 40px; 
  }
  
  .fantasy-table .th-player,
  .fantasy-table .td-player { 
    width: 140px; 
    min-width: 140px; 
    max-width: 140px; 
  }
  
  /* Update sticky positioning for mobile */
  .fantasy-table thead th:nth-child(2),
  .fantasy-table tbody td:nth-child(2) {
    left: 40px;
  }
  
  .fantasy-table .td-player .name { 
    font-size: 0.85rem;
  }
  
  /* Stat columns on mobile */
  .fantasy-table .th-stat,
  .fantasy-table .num {
    min-width: 50px;
    padding: 8px 6px;
  }
  
  .fantasy-table .th-pos,
  .fantasy-table .th-team,
  .fantasy-table .th-opp {
    min-width: 45px;
  }
  
  .fantasy-table .th-score {
    min-width: 55px;
  }
  
  .fantasy-explainer { 
    padding: 0 16px; 
  }
}


