/* Trend Sheets (NFL) — extracted styles
   Scope everything under #trend-sheets-container to avoid bleed. */

#trend-sheets-container {
  display: none; /* hidden until user opens Trend Sheets */
}

/* Top bar */
#trend-sheets-container .trend-topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}
#trend-sheets-container .trend-topbar h2 {
  margin: 0 8px 0 0;
}
#trend-sheets-container .trend-topbar-ctas {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

/* Pills */
#trend-sheets-container .pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
  font-size: 12px;
}
#trend-sheets-container .pill-primary {
  background: #1dd8c4;
  color: #042229;
  border-color: rgba(0,0,0,.2);
  font-weight: 600;
}
/* Make selects inside pills blend with theme */
#trend-sheets-container .pill select {
  background: transparent;
  border: none;
  color: inherit;
}

/* Controls panel */
#trend-sheets-container .trend-controls-panel {
  margin-bottom: 16px;
  /* Ensure dropdowns are not clipped by this panel in non-portal mode */
  overflow: visible;
}
#trend-sheets-container .trend-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  overflow: visible;
  justify-content: center;
  padding: 24px 0px 24px 0px;
}

/* Matchups column pill */
#trend-sheets-container .matchups-pill {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}
#trend-sheets-container .matchups-pill .matchups-label {
  opacity: .9;
}

/* Custom dropdown */
#trend-sheets-container .matchups-dropdown {
  position: relative;
  display: inline-block;
  min-width: 0;         
  max-width: none;
}
#trend-sheets-container .matchups-toggle {
  width: auto;
  text-align: left;
  white-space: nowrap;  /* keep label on one line while we size it */
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  color: inherit;
  font-size: 13px;
  line-height: 1.2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  overflow: visible;              /* let the scaled chev breathe */
  --chev-scale: 3;                /* 16px * 3 = ~48px visual */
}
#trend-sheets-container .matchups-dropdown.open .matchups-toggle {
  border-color: rgba(29,216,196,.45);
  background: rgba(29,216,196,.12);
}
#trend-sheets-container .matchups-toggle:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(29,216,196,.35);
}
#trend-sheets-container .matchups-toggle .chev {
  opacity: .9;
  display: inline-block;
  font-size: 16px;                /* small layout box */
  line-height: 1;                 /* no extra vertical space */
  transform: scale(var(--chev-scale));
  transform-origin: center;
  margin-left: 8px;               /* gap from text */
}

/* ─────────────────────────────────────────────────────────────
   DROPDOWN MENU — both in-container and portaled-to-body
   We style it for both locations to keep consistent appearance.
   ───────────────────────────────────────────────────────────── */

#trend-sheets-container .matchups-menu,
#trend-matchups-portal .matchups-menu {
  z-index: 2000; /* overridden by portal container */
  width: 100%;
  min-width: 260px;
  max-width: 360px;
  max-height: 280px;
  overflow: auto;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  background: #051424;
  backdrop-filter: blur(6px);
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  padding: 8px;
  display: none;
}

/* In-container placement (fallback when not using portal) */
#trend-sheets-container .matchups-menu {
  position: absolute;
  left: 0;
  right: auto;
  top: calc(100% + 6px);
}

/* Show when open (both locations) */
#trend-sheets-container .matchups-dropdown.open .matchups-menu,
#trend-sheets-container .matchups-menu[data-open="true"],
#trend-matchups-portal .matchups-menu[data-open="true"] {
  display: block;
}

/* When portaled, we use fixed positioning & a much higher z-index via portal root */
#trend-matchups-portal {
  position: fixed;
  inset: 0;
  z-index: 999999; /* ensure above all app content */
  pointer-events: none; /* clicks go through except on menu */
}
#trend-matchups-portal .matchups-menu {
  position: fixed; /* coords are set inline by JS */
  pointer-events: auto;
}

/* Options / checkboxes */
#trend-sheets-container .matchups-option,
#trend-matchups-portal .matchups-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
}
#trend-sheets-container .matchups-option:hover,
#trend-matchups-portal .matchups-option:hover {
  background: rgba(255,255,255,.06);
}
#trend-sheets-container .matchups-option input[type="checkbox"],
#trend-matchups-portal .matchups-option input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #1dd8c4;
}

#trend-sheets-container .matchups-options,
#trend-matchups-portal .matchups-options {
  display: flex;
  flex-direction: column;
}

#trend-sheets-container .divider,
#trend-matchups-portal .divider {
  height: 1px;
  margin: 6px 4px 4px;
  background: rgba(255,255,255,.10);
  border-radius: 1px;
}

/* List & empty state */
#trend-sheets-container .trend-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
#trend-sheets-container #trend-empty {
  display: none;
  padding: 12px;
  opacity: .8;
}

/* Row layout */
#trend-sheets-container .trend-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 10px;
  border-top: 1px solid rgba(255,255,255,.06);
}
#trend-sheets-container .trend-row:first-child {
  border-top: none;
}

/* Team badge circle */
/* Team badge circle */
#trend-sheets-container .team-badge {
  height: 44px;
  width: 44px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.12);
  /* ⟵ use per-team colors (fallback to old subtle bg) */
  background: linear-gradient(
    135deg,
    var(--badge-from, rgba(255,255,255,.06)),
    var(--badge-to,   rgba(255,255,255,.06))
  );
  font-weight: 800;
}


/* Row main (name + meta) */
#trend-sheets-container .trend-row-main {
  min-width: 0;
  flex: 1;
}
#trend-sheets-container .trend-row-titleline {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: baseline;
}
#trend-sheets-container .trend-row-meta {
  margin-top: 6px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

/* Chips / labels inside rows */
#trend-sheets-container .meta-chip,
.trend-view-btn {
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  font-size: 12px;
}
.trend-view-btn{
  color: #1dd8c4;
}
#trend-sheets-container .label-dim {
  opacity: .75;
}
#trend-sheets-container .label-strong {
  font-weight: 600;
}

/* Row right — hit bar & caption */
#trend-sheets-container .trend-row-right {
  width: 168px;
  flex: 0 0 168px;
}
#trend-sheets-container .trend-row-right .caption {
  text-align: right;
  font-size: 12px;
  opacity: .85;
}
#trend-sheets-container .hitbar {
  margin-top: 6px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.10);
  overflow: hidden;
}
#trend-sheets-container .hitbar > div {
  height: 8px;
  border-radius: 999px;
  background: #1dd8c4;
}

/* Add button on each row */
#trend-sheets-container .add-btn {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid rgba(29,216,196,.35);
  background: rgba(29,216,196,.10);
  font-size: 18px;
  line-height: 1;
  display: grid;
  place-items: center;
}

#trend-sheets-container .add-btn.added,
#trend-sheets-container .add-btn.added:disabled {
  color: #1dd8c4;      
  font-weight: 900;    
  font-size: 22px;    
}

#trend-sheets-button,
#trend-back-button {
  padding: 8px 16px;
  font-size: 24px;
  border:1px solid rgba(34,221,182,.45); 
  color:#071317;
  background-image:linear-gradient(180deg, rgba(124,227,216,.98), rgba(34,221,182,.98));
  box-shadow:0 6px 24px rgba(34,221,182,.25), inset 0 1px 0 rgba(255,255,255,.18);
  opacity: .75;
  font-weight: 500;
  border-radius: 12px;  
  margin-top: 10px;
  margin-bottom: 0px;
}

#trend-back-button {
  display: block;           /* was inline */
  margin-left: auto;        /* center horizontally */
  margin-right: auto;       /* center horizontally */
}

#trend-sheets-container #trend-stat {
  width: auto;   /* Start small; JS sets an explicit px width */
  min-width: 0;
}

/* 1) Remove iOS Safari tap highlight */
@supports (-webkit-touch-callout: none) {
  /* Target just your pill controls + share/build buttons */
  #trend-controls .pill,
  #trend-controls .pill * ,
  #trend-topbar .pill,
  #trend-matchups-button,
  #trend-share-button,
  #trend-build-button,
  #trend-mode-select {
    -webkit-tap-highlight-color: rgba(0,0,0,0);
  }
}

html:not(.kb-nav) #trend-controls .pill select:focus,
html:not(.kb-nav) #trend-controls .pill button:focus,
html:not(.kb-nav) #trend-matchups-button:focus,
html:not(.kb-nav) #trend-share-button:focus,
html:not(.kb-nav) #trend-build-button:focus,
html:not(.kb-nav) #trend-mode-select {
  outline: none !important;
  box-shadow: none !important;
}

html.kb-nav #trend-controls .pill select:focus,
html.kb-nav #trend-controls .pill button:focus,
html.kb-nav #trend-matchups-button:focus,
html.kb-nav #trend-share-button:focus,
html.kb-nav #trend-build-button:focus,
html.kb-nav  #trend-mode-select:focus {
  outline: 2px solid #00D3BD;
  outline-offset: 2px;
}


@media (max-width: 1000px) {

  #trend-sheets-container {
    max-width: 950px;
  }
  #trend-sheets-button,
  #trend-back-button {
    padding: 10px 20px;
    font-size: 32px;
    margin-bottom: 0px;
    margin-top: -100px;
    text-align: center;
  }
  #trend-back-button {
    margin-bottom: 20px;
  }

  #trend-sheets-container .trend-topbar {
    margin-top: 42px;
    padding: 0px 24px 0px 24px;
    font-size: 24px;
  }

  #trend-sheets-container .trend-topbar-ctas {
    gap: 12px;
  }

  #trend-sheets-container #trend-share-button,
  #trend-sheets-container #trend-build-button {
    padding-block: 14px;
    min-height: 48px;
    font-size: 24px;       /* matches your other pills on mobile */
  }

  #trend-sheets-container .pill {
    padding: 10px 24px;
    font-size: 26px;
  }

  #trend-sheets-container .matchups-toggle {
    padding: 8px 12px;
    font-size: 26px;
  }

  #trend-sheets-container .meta-chip {
    padding: 4px 12px;
    font-size: 24px;
  }

  .trend-view-btn {
    padding: 6px 14px;
    font-size: 24px;
    margin-left: 8px;
  }

  #trend-sheets-container .trend-row-right .caption {
    font-size: 24px;
  }

  #trend-sheets-container .add-btn {
    width: 64px;
    height: 56px;
    font-size: 28px;
    margin-left: 8px;
    margin-right: 8px;
  }

  #trend-sheets-container .add-btn.added,
  #trend-sheets-container .add-btn.added:disabled {  
    font-size: 26px;    
  }

  #trend-sheets-container .trend-row-right .caption {
    font-size: 24px;
  }

  #trend-sample,
  #trend-minhits,
  #trend-minodds,
  #trend-stat,
  #trend-pos{
    font-size: 24px;
  }

  #trend-mode-select{
    font-size: 24px;
    font-weight: 700;
  }

  #trend-matchups-button{
    background: transparent !important;
    border: none !important;
    font-size: 26px !important;
    font-weight: 600 !important;
    padding: 2px 4px 6px 4px !important;
  }
  #trend-sheets-container .matchups-toggle { 
    --chev-scale: 3.2; 
  }

  #trend-sheets-container .matchups-toggle .chev {
    margin-left: 4px; 
    margin-top: -8px;              
  }

  #trend-sheets-container .trend-row-main {
    padding: 12px 0px 12px 12px;
  }

  #trend-sheets-container .team-badge {
    height: 76px;
    width: 76px;
    font-size: 26px;
  }

   #trend-sheets-container .trend-row-titleline{
    font-size: 28px;
   }

   #trend-sheets-container .matchups-menu,
   #trend-matchups-portal .matchups-menu {
    min-width: 515px;
    /* max-width: 516px; */
    max-height: 1000px;
    padding: 12px 8px 12px 8px;
    margin-top: 28px;
    margin-left: -180px;
    font-size: 36px;
    border: none;
  }

  #trend-sheets-container .matchups-option input[type="checkbox"],
  #trend-matchups-portal .matchups-option input[type="checkbox"] {
    width: 32px;
    height: 32px;
    margin-left: 12px;
    margin-right: 4px;
  }


}
