/* ============================================================================
   HOME.CSS - Homepage-specific styles
   ========================================================================= */

/* ============================================================================
   TABLES
   Data tables for comparisons
   ========================================================================= */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead th {
  padding: 0.5rem;
  text-align: left;
  font-weight: 600;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.75rem;
  border-bottom: 1px solid var(--color-slate-200);
}

tbody tr {
  border-bottom: 1px solid var(--color-slate-200);
  transition: background var(--transition-speed);
}

tbody tr:hover {
  background: rgba(248, 250, 252, 0.7);
}

tbody td {
  padding: 0.5rem;
}

/* ============================================================================
   PROSPECT CARDS
   Grid of player prospect cards with hover effects
   ========================================================================= */
.prospects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.prospect-card {
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  outline: 2px solid rgba(99, 102, 241, 0.6);
  transition: transform var(--transition-speed);
}

.prospect-card:hover {
  transform: translateY(-2px);
}

.prospect-image-wrapper {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 4;
}

.prospect-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 25%;
  transition: filter var(--transition-speed);
}

.prospect-card:hover .prospect-image {
  filter: brightness(1.05);
}

/* Badge for riser/faller status */
.prospect-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  font-size: 0.625rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
}

.prospect-badge.riser {
  background: #d1fae5;
  color: #065f46;
}

.prospect-badge.faller {
  background: #ffe4e6;
  color: #9f1239;
}

/* Pixel corner accents on hover */
.prospect-card::before,
.prospect-card::after {
  content: "";
  position: absolute;
  width: 1rem;
  height: 1rem;
  opacity: 0;
  transition: opacity var(--transition-speed);
  z-index: 10;
}

.prospect-card::before {
  top: -0.25rem;
  left: -0.25rem;
  background: linear-gradient(45deg, transparent 50%, var(--color-accent-indigo) 50%);
}

.prospect-card::after {
  bottom: -0.25rem;
  right: -0.25rem;
  background: linear-gradient(225deg, transparent 50%, var(--color-accent-emerald) 50%);
}

.prospect-card:hover::before,
.prospect-card:hover::after {
  opacity: 1;
}

.prospect-info {
  padding: 0.75rem;
}

.prospect-name {
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 0.25rem;
}

.prospect-meta {
  font-size: 0.75rem;
  color: var(--color-slate-500);
  margin-bottom: 0.5rem;
}

/* Stats grid for each prospect */
.prospect-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  font-size: 0.6875rem;
}

.stat-pill {
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  border: 1px solid var(--color-slate-200);
  background: var(--color-slate-50);
  color: var(--color-slate-700);
  text-align: center;
}

.stat-pill .label {
  font-size: 0.625rem;
  color: var(--color-slate-500);
  margin-right: 0.25rem;
}

.stat-pill .value {
  font-weight: 500;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ============================================================================
   TRENDING PLAYERS
   Grid of trending player cards with thumbnails and sparklines
   ========================================================================= */
.trending-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.trending-card {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid var(--color-slate-200);
  background: var(--color-white);
  text-decoration: none;
  color: inherit;
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.trending-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border-color: var(--color-accent-emerald);
}

/* Thumbnail */
.trending-card__thumb {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 20%;
  border: 1px solid var(--color-slate-200);
  background: var(--color-slate-100);
}

.trending-card__thumb--placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--color-slate-500);
}

.trending-card__info {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
  flex: 1;
}

.trending-card__name {
  font-weight: 600;
  font-size: 0.8125rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trending-card__school {
  font-size: 0.6875rem;
  color: var(--color-slate-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Visual wrapper: sparkline + count badge */
.trending-card__visual {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.trending-card__sparkline {
  width: 64px;
  height: 24px;
  display: block;
}

.trending-card__count {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-accent-emerald);
  background: #d1fae5;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
}

/* ============================================================================
   VS ARENA / PLAYER COMPARISON
   Interactive player comparison section with toggles
   ========================================================================= */
.vs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.vs-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.vs-toggles {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Toggle button styles */
.toggle-button {
  height: 2rem;
  padding: 0 0.75rem;
  font-size: 0.75rem;
  border-width: 1px;
  border-style: solid;
  border-radius: 0.375rem;
  background: var(--color-white);
  color: var(--color-slate-700);
  border-color: var(--color-slate-300);
  cursor: pointer;
  transition: all var(--transition-speed);
}

.toggle-button.active {
  background: #eef2ff;
  color: #4338ca;
  border-color: #a5b4fc;
}

.toggle-button:hover:not(.active) {
  background: var(--color-slate-50);
}

/* VS Arena card */
.vs-arena-card {
  position: relative;
}

.vs-content {
  position: relative;
  padding: 1rem;
}

/* Player selectors */
.vs-selectors {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1.5rem;
}

.vs-select {
  width: 100%;
  background: var(--color-white);
  border: 1px solid var(--color-slate-300);
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  cursor: pointer;
}

.vs-badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 0.25rem;
  background: #eef2ff;
  color: var(--color-accent-indigo);
  border: 1px solid #c7d2fe;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Comparison table styles */
.comparison-table {
  overflow-x: auto;
  margin-bottom: 1rem;
}

.comparison-table thead th {
  padding: 0.75rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.75rem;
  color: var(--color-slate-600);
}

.comparison-table tbody td {
  padding: 0.75rem;
}

.comparison-table tbody tr {
  border-bottom: 1px solid var(--color-slate-200);
}

.comparison-table tbody tr:hover {
  background: var(--color-slate-50);
}

.comparison-value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 1rem;
}

.comparison-value.winner {
  font-weight: 800;
}

.comparison-value.winner-a {
  color: #15803d;
  background: #d1fae5;
}

.comparison-value.winner-b {
  color: #4338ca;
  background: #eef2ff;
}

.comparison-value.loser {
  color: var(--color-slate-500);
}

/* Winner declaration banner */
.winner-banner {
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: 0.375rem;
  text-align: center;
  font-family: var(--font-mono);
  font-weight: 700;
}

.winner-banner.winner-a {
  background: #d1fae5;
  color: #15803d;
}

.winner-banner.winner-b {
  background: #eef2ff;
  color: #4338ca;
}

.winner-banner.tie {
  background: var(--color-slate-100);
  color: var(--color-slate-800);
}

/* ============================================================================
   RESPONSIVE DESIGN - HOMEPAGE
   Mobile-first breakpoints for homepage components
   ========================================================================= */
@media (max-width: 1024px) {
  .trending-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .trending-grid {
    grid-template-columns: 1fr;
  }

  .prospects-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }

  .vs-selectors {
    grid-template-columns: 1fr;
  }

  .vs-badge {
    justify-self: center;
  }
}
