/* ===== Draft Picks page styles (uses the colors defined in style.css) =====
   The Draft Trades page also uses this file for its header, filter and year cards. */

[hidden] { display: none !important; }

/* ----- Header ----- */
.history-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: .75rem 1rem;
  margin-bottom: 1.25rem;
}
.history-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .25rem 1rem;
}
.history-header .page-title { margin: 0; }

/* ----- Team filter ----- */
.team-filter {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--red);
}
.team-filter select {
  min-width: 220px;
  padding: .55rem 2rem .55rem .8rem;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: .95rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
  cursor: pointer;
}
.team-filter select:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 1px;
}
@media (max-width: 600px) {
  .team-filter { width: 100%; }
  .team-filter select { flex: 1; min-width: 0; }
}
.history-summary {
  margin: 0;
  font-weight: 600;
  color: var(--muted);
}

.status {
  margin: 0 0 1rem;
  font-weight: 600;
}
.status:empty { display: none; }
.status.error { color: var(--red); }

/* ----- Year cards ----- */
.year-list {
  display: grid;
  gap: 1rem;
}

.year-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
}
.year-card[open] { border-top: 4px solid var(--red); }

.year-summary {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1rem 1.25rem;
  cursor: pointer;
  list-style: none;
}
.year-summary::-webkit-details-marker { display: none; }
.year-summary:hover .year-title { color: var(--red); }

.year-title {
  font-size: 1.25rem;
  font-weight: 700;
  transition: color .2s;
}

.chevron {
  width: 10px;
  height: 10px;
  margin-left: auto;
  border-right: 2px solid var(--text);
  border-bottom: 2px solid var(--text);
  transform: translateY(-3px) rotate(45deg);
  transition: transform .2s;
}
.year-card[open] .chevron { transform: translateY(2px) rotate(-135deg); }

/* ----- Rounds inside a year ----- */
.year-body { padding: 0 1rem 1rem; }

.round-section + .round-section { margin-top: 1.25rem; }

.round-title {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 0 0 .6rem;
  font-size: .85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--red);
}
/* A thin line running from the round label to the edge of the card */
.round-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ----- Picks inside a round ----- */
.history-picks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: .5rem;
}

.history-row {
  display: grid;
  grid-template-columns: 2.25rem 44px 1fr;
  align-items: center;
  gap: .75rem;
  padding: .6rem .8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
}

.pick-num {
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
}

.team-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

/* Shown if a logo file can't be found */
.logo-fallback {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--black);
  color: var(--white);
  font-size: .8rem;
  font-weight: 700;
}

.pick-info { min-width: 0; }
.team-name {
  font-size: .8rem;
  font-weight: 600;
  color: var(--muted);
}
.player-line { overflow-wrap: anywhere; }
.player-line strong { font-weight: 700; }
.player-meta {
  font-size: .85rem;
  color: var(--muted);
}

.pos-tag {
  display: inline-block;
  margin-right: .35rem;
  padding: .1rem .4rem;
  border-radius: 4px;
  background: var(--black);
  color: var(--white);
  font-size: .7rem;
  font-weight: 700;
  vertical-align: middle;
}

/* ----- Pages of drafts (5 per page) ----- */
.pager {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: 1rem;
  scroll-margin-top: calc(var(--nav-height) + 1rem);
}
.pager:empty { display: none; }
.pager.bottom { margin: 1.25rem 0 0; }
.pager-pages {
  display: flex;
  flex: 1;
  gap: .35rem;
  overflow-x: auto;
  padding: .15rem;
  scrollbar-width: thin;
}
.pager-page,
.pager-arrow {
  flex-shrink: 0;
  padding: .45rem .8rem;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--card);
  font: inherit;
  font-size: .88rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.pager-page:hover,
.pager-arrow:hover:not(:disabled) { border-color: var(--ink); }
.pager-page.active { background: var(--black); border-color: var(--ink); color: var(--white); }
.pager-arrow { border: 2px solid var(--ink); }
.pager-arrow:disabled { opacity: .3; cursor: default; }

@media (max-width: 600px) {
  .pager-arrow span { display: none; }   /* just the arrows on phones */
  .pager-page { padding: .45rem .6rem; font-size: .82rem; }
}

/* Player names open the Player Data page */
.player-link { color: inherit; text-decoration: none; }
.player-link:hover strong { color: var(--red); text-decoration: underline; }

/* Team color on each pick */
.history-row { border-left: 4px solid var(--team, var(--line)); }
.logo-fallback { background: var(--team, var(--black)); color: var(--team-ink, var(--white)); }
a.team-name { display: block; color: inherit; text-decoration: none; }
a.team-name:hover { color: var(--red); text-decoration: underline; }

/* Jump between rounds; stays under the menu bar while scrolling */
.round-jump {
  position: sticky;
  top: var(--nav-height);
  z-index: 4;
  display: flex;
  gap: .35rem;
  margin: 0 -1rem .9rem;
  padding: .5rem 1rem;
  overflow-x: auto;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.round-jump a {
  flex: none;
  padding: .25rem .65rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font-size: .8rem;
  font-weight: 700;
  text-decoration: none;
}
.round-jump a:hover { border-color: var(--red); color: var(--red); }
.round-section { scroll-margin-top: calc(var(--nav-height) + 3.5rem); }

/* Phones: the year buttons scroll sideways; a fade shows there's more */
@media (max-width: 600px) {
  .pager-pages { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  /* compact pick rows */
  .history-row { grid-template-columns: 1.8rem 30px 1fr; gap: .55rem; padding: .45rem .6rem; }
  .history-row .team-logo, .history-row .logo-fallback { width: 30px; height: 30px; font-size: .62rem; }
  .history-row .pick-num { font-size: 1rem; }
  .history-row .team-name { font-size: .72rem; }
  .history-row .player-meta { font-size: .76rem; }
  .history-picks { gap: .35rem; }
}
