/* Loading overlay (paired with static/js/site.js) */
.page-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(33, 33, 33, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.page-loading-overlay[hidden] {
  display: none !important;
}

.page-loading-dialog {
  max-width: 380px;
  padding: 1.75rem 1.5rem;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  text-align: center;
}

.page-loading-spinner {
  width: 42px;
  height: 42px;
  margin: 0 auto 1rem;
  border: 4px solid var(--neutral-light, #e8eaee);
  border-top-color: var(--brand-accent, #e76f51);
  border-radius: 50%;
  animation: page-loading-spin 0.75s linear infinite;
}

@keyframes page-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

.page-loading-title {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--brand-dark-blue, #43658b);
}

.page-loading-hint {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--text-secondary, #4a4a4a);
}

body.page-loading-active {
  overflow: hidden;
}

/* Homepage / hub tool cards */
.tool-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin: 1rem auto 0;
  max-width: 720px;
  text-align: left;
  list-style: none;
  padding: 0;
}

.tool-cards li {
  margin: 0;
}

.tool-card {
  display: block;
  height: 100%;
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid #cfd8dc;
  background: linear-gradient(180deg, #fafcfd 0%, #fff 100%);
  color: var(--text-primary, #212121);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  transition:
    border-color 0.2s,
    box-shadow 0.2s,
    transform 0.15s;
}

.tool-card:hover {
  border-color: var(--brand-blue, #4e89ae);
  box-shadow: 0 4px 14px rgba(67, 101, 139, 0.18);
  transform: translateY(-2px);
  color: var(--brand-dark-blue, #43658b);
}

.tool-card-desc {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-secondary, #4a4a4a);
  line-height: 1.35;
}

.home-primary-cta {
  margin-top: 0.5rem;
}

/* Homepage: optimizer stands alone; secondary tools sit below (see index.html). */
.home-lineup-card {
  border: 2px solid var(--brand-blue, #4e89ae);
}

.home-page-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 960px;
}

.home-tools-follow {
  width: 100%;
  max-width: 920px;
  margin: 1.75rem auto 0;
  padding: 0 12px 12px;
  box-sizing: border-box;
}

.home-tools-heading {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary, #4a4a4a);
  margin: 0 0 1rem;
  text-align: center;
}

.tool-cards--featured {
  gap: 18px;
  margin-top: 0;
  max-width: none;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.tool-cards--featured .tool-card {
  padding: 16px 18px;
}

.tool-links-secondary {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.35rem 0.65rem;
  margin-top: 1.35rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e0e6ea;
  font-size: 0.95rem;
  line-height: 1.5;
}

.tool-links-secondary a {
  color: var(--brand-blue, #4e89ae);
  font-weight: 600;
  text-decoration: none;
}

.tool-links-secondary a:hover {
  text-decoration: underline;
}

.tool-links-dot {
  color: #9aa7af;
  user-select: none;
}

@media (max-width: 768px) {
  .tool-cards--featured {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .home-tools-follow {
    margin-top: 1.25rem;
    padding-left: 8px;
    padding-right: 8px;
  }

  .tool-links-secondary {
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 1rem;
  }

  .tool-links-dot {
    display: none;
  }
}
.season-hub-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: stretch;
  max-width: 920px;
  margin: 0 auto;
}

.hub-panel {
  background: #fff;
  border-radius: 8px;
  border: 1px solid #ccc;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.06);
  padding: 1rem 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
}

/* Push the personalize block to the bottom so the panel fills its grid
   cell and the bottom CTAs line up across panels. */
.hub-panel .hub-personalize {
  margin-top: auto;
}

.hub-panel h2 {
  margin-top: 0;
  font-size: 1.25rem;
  color: var(--brand-dark-blue, #43658b);
}

.hub-panel p {
  margin: 0.35rem 0 0.75rem;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--text-secondary, #4a4a4a);
}

.hub-panel-actions {
  margin-top: 1rem;
}

@media (max-width: 768px) {
  /* Tighten the welcome / hub landing pages — they were taking the full
     viewport on phones and looking dominant. Slimmer text + more side
     gutters makes them feel like cards instead of full-bleed walls. */
  .season-hub-grid {
    gap: 0.85rem;
    grid-template-columns: 1fr;
    padding: 0 14px;
    max-width: 100%;
  }

  .hub-panel {
    padding: 0.85rem 1rem 1.1rem;
    border-radius: 10px;
  }

  .hub-panel h2 {
    font-size: 1rem;
    letter-spacing: 0.2px;
    margin-bottom: 0.25rem;
  }

  .hub-panel p {
    font-size: 0.82rem;
    line-height: 1.4;
    margin: 0.25rem 0 0.6rem;
  }

  .hub-panel-actions {
    margin-top: 0.65rem;
  }

  .hub-panel .league-input input[type="text"],
  .hub-panel .league-input input[type="password"] {
    width: 90%;
    font-size: 13px;
  }

  .hub-panel .league-input h4 {
    font-size: 0.8rem;
    margin: 4px 0;
  }

  .hub-panel .platform-logo {
    width: 36px;
    height: 36px;
  }

  .hub-panel .submit-button {
    font-size: 0.85rem;
    padding: 8px 14px;
  }

  a.fake-button {
    font-size: 0.85rem;
    padding: 7px 14px;
  }

  /* The trade-value-chart welcome card was nearly full-bleed and tall.
     Same treatment: shave padding, narrow internal inputs, smaller text. */
  .content > .card,
  .content > .card-sl {
    padding: 0.85rem 1rem 1.1rem;
    width: auto;
    max-width: calc(100% - 28px);
    margin: 0 14px 1.25rem;
  }

  .content > .card .league-input h1,
  .content > .card-sl .league-input h1 {
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
  }

  .content > .card .league-input p,
  .content > .card-sl .league-input p {
    font-size: 0.82rem;
    line-height: 1.4;
    margin-bottom: 0.75rem;
  }
}

.hub-panel-actions .submit-button,
.hub-panel-actions a.fake-button {
  display: inline-block;
  margin-top: 0.35rem;
}

a.fake-button {
  padding: 8px 18px;
  background-color: var(--brand-blue, #4e89ae);
  color: #fff !important;
  border-radius: 6px;
  text-decoration: none !important;
  font-weight: 700;
}

a.fake-button:hover {
  background-color: #3a6f91;
}

/* Results page: compact legend above tables */
.results-legend-compact {
  max-width: 900px;
  margin: 0 auto 1rem;
  padding: 12px 16px;
  background: #f7fafc;
  border: 1px solid #cfd8dc;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.45;
  text-align: left;
}

.results-legend-compact ul {
  margin: 0.35rem 0 0;
  padding-left: 1.2rem;
}

.results-legend-compact strong {
  color: var(--brand-dark-blue, #43658b);
}

.banner-note {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-secondary, #4a4a4a);
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

/* §3a Recent league / username chips */
.recent-leagues-mount {
  margin: 10px 0 12px;
}

.recent-leagues-mount[hidden] {
  display: none !important;
}

.recent-leagues-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  font-size: 13px;
}

.recent-leagues-label {
  color: var(--text-secondary, #4a4a4a);
  font-weight: 600;
}

button.recent-league-chip {
  border: 1px solid #cfd8dc;
  background: #fff;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  color: var(--brand-dark-blue, #43658b);
  font-family: inherit;
}

button.recent-league-chip:hover {
  border-color: var(--brand-blue, #4e89ae);
  background: #f0f7fb;
}

.customize-trade-value-card .recent-leagues-mount {
  margin-top: 0;
  margin-bottom: 10px;
}

/* "Personalize table" mini-form on the season-long welcome hub */
.hub-personalize {
  margin-top: 1.1rem;
  padding-top: 0.9rem;
  border-top: 1px dashed #d0dce8;
}

.hub-personalize-label {
  margin: 0 0 0.5rem !important;
  font-size: 0.85rem !important;
  color: var(--text-secondary, #4a4a4a);
}

#customStatsForm {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

#customStatsForm input[type="text"] {
  width: 100%;
  max-width: 260px;
  padding: 8px 12px;
  font-size: 0.9rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-repeat: no-repeat;
  background-position: 8px center;
  background-size: 18px 18px;
  background-image: url('/static/images/sleeper_logo.jpg');
  padding-left: 32px;
}

.hub-personalize-or {
  margin: 2px 0 !important;
  font-size: 0.82rem !important;
  font-weight: 700;
  color: var(--text-secondary, #4a4a4a);
  letter-spacing: 1px;
}

/* The Personalize button now uses .submit-button as its base so it visually
   matches "Run season-long projections" and the loading-state recovery flow.
   The hub-personalize-btn modifier just trims the size to fit this panel. */
.hub-personalize-btn.submit-button {
  font-size: 0.9rem;
  padding: 8px 18px;
  background-color: var(--brand-dark-blue, #43658b);
  color: #fff;
}

.hub-personalize-btn.submit-button:hover {
  background-color: #324d6b;
}

@media (max-width: 768px) {
  #customStatsForm input[type="text"] {
    font-size: 13px;
    max-width: none;
  }
  .hub-personalize-btn.submit-button {
    width: 100%;
    font-size: 0.85rem;
    padding: 8px 14px;
  }
}

/* ===================================================================
   "More tools for {League}" cross-link strip
   Shared across results, season_long, and rankings pages.
   =================================================================== */
.results-cross-links {
  max-width: 1100px;
  margin: 0 auto 1rem;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid #cfd8dc;
  border-radius: 8px;
  font-size: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}

.results-cross-links-label {
  font-weight: 700;
  color: var(--brand-dark-blue, #43658b);
}

.results-cross-links-label strong {
  color: #000;
}

.results-cross-links a {
  font-weight: 600;
  text-decoration: none;
  color: var(--brand-blue, #4e89ae);
}

.results-cross-links a:hover {
  text-decoration: underline;
}

.results-cross-links a::after { display: none; }

/* Full-width variant used inside season-long containers (which already
   constrain width and center content). Overrides the centered max-width
   default so the strip aligns with sibling cards above/below, and
   forces left-aligned content (parent container uses text-align: center). */
.sl-cross-links {
  max-width: none;
  margin: 16px 0;
  text-align: left;
  justify-content: flex-start;
}

.sl-cross-links-top {
  margin: 0 0 16px;
  max-width: none;
}
