/**
 * NFL Lines — shared front-end styles.
 *
 * Design tokens (CSS custom properties) in :root. Every color, spacing, font size,
 * and radius used by the suite goes through a variable here so themeing, dark mode,
 * and one-file-fix-all tweaks are possible without a rebuild.
 *
 * Mobile-first: default styles target phones (0-599px). Tablet (>=600px) and desktop
 * (>=1024px) enhance progressively. Never use max-width negation.
 *
 * Namespace:
 *   .nfl-*      - shared components (this file)
 *   .nfl-tb-*   - Teamball plugin
 *   .nfl-pr-*   - Power Ratings plugin (added in Chat 2)
 */


/* v0.36.2.1a — DB-Disabled Badge */
.nfl-algo-db-pill {
  display: inline-block;
  padding: 1px 7px;
  margin-left: 6px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 3px;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.nfl-algo-db-pill--p { background: #e1ebf5; color: #1a4a7a; }
.nfl-algo-db-pill--n { background: #dff0e2; color: #1a5a3a; }
.nfl-algo-db-disabled-flag {
  display: inline-block;
  padding: 1px 7px;
  margin-left: 6px;
  font-size: 11px;
  font-weight: 600;
  background: #fff4e0;
  color: #b26200;
  border: 1px solid #b26200;
  border-radius: 3px;
  vertical-align: middle;
}
.nfl-algo-db-disabled-banner {
  display: block;
  padding: 8px 12px;
  margin: 8px 0;
  font-size: 13px;
  font-weight: 600;
  background: #fff4e0;
  color: #b26200;
  border: 1.5px solid #b26200;
  border-radius: 4px;
}
.nfl-algo-row--db-disabled { opacity: 0.6; }

/* ============================================================
 * v0.36.2.4 — Drill picker + active picks list + total bar
 * (port of nfl-power-ratings v0.7.5 admin styles, scoped to
 * front-end algorithm builder).
 * ============================================================ */

.nfl-algo-total-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    margin: 12px 0 8px;
    background: #f6f7f7;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    font-size: 13px;
}
.nfl-algo-total-bar__label { font-weight: 600; }
.nfl-algo-total-bar__value {
    font-weight: 700;
    font-size: 16px;
    min-width: 60px;
}
.nfl-algo-total-bar__value.nfl-algo-total-ok { color: #0a7c2f; }
.nfl-algo-total-bar__value.nfl-algo-total-bad { color: #c1272d; }
.nfl-algo-total-bar__remaining {
    flex: 1;
    font-size: 12px;
    color: #666;
}

.nfl-algo-active-picks {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 8px;
}
.nfl-algo-active-picks th,
.nfl-algo-active-picks td {
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
    text-align: left;
    vertical-align: middle;
}
.nfl-algo-active-picks .nfl-algo-no-picks td {
    padding: 24px;
    text-align: center;
    color: #888;
    font-style: italic;
}
.nfl-algo-pick-label { font-weight: 500; }
.nfl-algo-stat-row--just-added {
    background-color: #d4edda !important;
    transition: background-color 0.7s ease-out;
}
.nfl-algo-remove-pick {
    background: transparent;
    border: 0;
    color: #c1272d;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0 4px;
}
.nfl-algo-remove-pick:hover { color: #8a1a1f; }

.nfl-algo-weight-slider {
    width: 100%;
    max-width: 200px;
}

.nfl-algo-add-stat-row {
    margin: 8px 0 0;
    position: relative; /* anchor for popover */
}

/* Drill picker popover */
.nfl-algo-picker-popover {
    position: absolute;
    top: 36px;
    left: 0;
    width: 440px;
    max-height: 520px;
    background: #fff;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    z-index: 100;
    display: flex;
    flex-direction: column;
}
.nfl-algo-picker-popover[hidden] { display: none !important; }

.nfl-algo-picker-popover__header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid #e0e0e0;
    background: #f6f7f7;
    flex-shrink: 0;
}
.nfl-algo-picker-back {
    background: transparent;
    border: 1px solid #c3c4c7;
    border-radius: 3px;
    padding: 2px 8px;
    cursor: pointer;
    font-size: 12px;
    color: #2271b1;
}
.nfl-algo-picker-back:hover { background: #fff; }
.nfl-algo-picker-breadcrumb {
    flex: 1;
    font-weight: 600;
    font-size: 13px;
}
.nfl-algo-picker-year { font-size: 12px; }
.nfl-algo-picker-year select { font-size: 12px; padding: 2px 4px; }
.nfl-algo-picker-close-btn {
    background: transparent;
    border: 0;
    cursor: pointer;
    color: #666;
    font-size: 20px;
    line-height: 1;
    padding: 0 4px;
}
.nfl-algo-picker-close-btn:hover { color: #c1272d; }

.nfl-algo-picker-popover__body {
    overflow-y: auto;
    padding: 4px 0;
    flex: 1;
}

.nfl-algo-pick-section-header {
    padding: 8px 12px 4px;
    font-size: 11px;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.nfl-algo-pick-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: 0;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    font-size: 13px;
    text-align: left;
    line-height: 1.2;
    color: #1d2327;
}
.nfl-algo-pick-row:hover { background: #e7f3ff; }
.nfl-algo-pick-row:last-child { border-bottom: 0; }
.nfl-algo-pick-row--side .nfl-algo-pick-row-label { font-weight: 600; }
.nfl-algo-pick-row--cat .nfl-algo-pick-row-label { font-weight: 500; }
.nfl-algo-pick-row-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nfl-algo-pick-row-id {
    font-family: monospace;
    font-size: 10px;
    color: #888;
    margin-left: 8px;
    flex-shrink: 0;
}
.nfl-algo-pick-row-count {
    font-size: 11px;
    color: #666;
    background: #e0e0e0;
    border-radius: 8px;
    padding: 1px 7px;
    margin-left: 8px;
    flex-shrink: 0;
}
.nfl-algo-pick-row--stat {
    flex-direction: column;
    align-items: flex-start;
}
.nfl-algo-pick-row--stat .nfl-algo-pick-row-label {
    display: block;
    flex: none;
    width: 100%;
}
.nfl-algo-pick-row--stat .nfl-algo-pick-row-id {
    margin-left: 0;
    margin-top: 2px;
}
.nfl-algo-pick-row--just-added {
    background-color: #d4edda !important;
}

.nfl-algo-picker-empty {
    padding: 24px;
    text-align: center;
    color: #888;
    font-style: italic;
    font-size: 13px;
}

.nfl-btn--sm { padding: 4px 10px; font-size: 12px; }

/* =====================================================================
   v0.42.1 — Builder tabbed framework + foundational structural CSS.
   STRUCTURAL only (decision 69: final visual/design-system polish rides
   the v0.38.1 / v0.44–46 front-end arc). Additive; no existing rule edited.
   ===================================================================== */

/* --- Tabbed builder shell --------------------------------------------- */
.nfl-algo-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 16px 0 0;
    border-bottom: 2px solid #d5d8dd;
}
.nfl-algo-tab {
    display: inline-block;
    padding: 8px 16px;
    text-decoration: none;
    color: #4a5160;
    font-weight: 600;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    margin-bottom: -2px;
}
.nfl-algo-tab:hover { background: #f1f3f6; color: #1f2430; }
.nfl-algo-tab--active {
    color: #1f2430;
    background: #fff;
    border-color: #d5d8dd;
    border-bottom: 2px solid #fff;
}
.nfl-algo-tabpanel { padding: 20px 0; }
.nfl-algo-tab-stub {
    padding: 40px 24px;
    color: #6b7280;
    background: #f7f8fa;
    border: 1px dashed #cfd4db;
    border-radius: 8px;
    text-align: center;
}

/* --- Builder chrome (shared; also lifts the /my-algorithms/ list) ------ */
/* v0.46.20 — the cap stays for the builder pages that use this wrapper; the
   COMPARE page opts out below, because it nested a 1200px container inside
   this 1080px one and the inner cap could never be reached. Two caps for one
   box is how a page ends up narrower than its own design says. */
.nfl-algo-wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px 48px; }
.nfl-compare-wrap { max-width: none; padding: 0 20px 48px; }
.nfl-algo-subtitle { font-size: 1.15rem; font-weight: 700; margin: 24px 0 4px; }
.nfl-algo-desc { color: #6b7280; margin: 0 0 12px; }
.nfl-algo-button,
.nfl-btn {
    display: inline-block;
    padding: 7px 14px;
    font: inherit;
    line-height: 1.2;
    color: #1f2430;
    background: #eef0f4;
    border: 1px solid #cfd4db;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
}
.nfl-algo-button:hover,
.nfl-btn:hover { background: #e3e6ec; }
.nfl-algo-button--primary {
    color: #fff;
    background: #2f5fe0;
    border-color: #2f5fe0;
}
.nfl-algo-button--primary:hover { background: #274fbe; }

/* --- /my-algorithms/ Actions collapse (CSS-only; wrapper already exists;
       commerce refs stay in markup, just laid out inline — pulled in .6) - */
.nfl-algo-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.nfl-algo-inline-form { display: inline-flex; margin: 0; }

/* --- Percentile histogram containment (decision 1; cap = 180px tall,
       640px wide; SVG uses preserveAspectRatio="none" so CSS box governs) - */
.nfl-histogram-card { margin: 12px 0 8px; }
.nfl-histogram {
    display: block;
    width: 100%;
    max-width: 640px;
    height: 180px;
}
.nfl-histogram__bar { fill: #2f5fe0; }
.nfl-histogram__axis { stroke: #9aa1ad; stroke-width: 1; }
.nfl-histogram__count,
.nfl-histogram__xtick { fill: #4a5160; font-size: 11px; }
.nfl-histogram-empty { color: #6b7280; font-style: italic; }

/* --- Top nav (site-wide; markup hooks already present, CSS was missing) - */
.nfl-nav__list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 18px;
    list-style: none;
    margin: 10px 0 18px;
    padding: 0 20px;
    align-items: center;
}
.nfl-nav__item { list-style: none; }
.nfl-nav__link {
    text-decoration: none;
    color: #2f5fe0;
    font-weight: 600;
}
.nfl-nav__link:hover { color: #274fbe; text-decoration: underline; }
.nfl-nav__item--active .nfl-nav__link {
    color: #1f2430;
    border-bottom: 2px solid #2f5fe0;
}
.nfl-nav__item--logout .nfl-nav__link { color: #6b7280; }
