/**
 * BMW Watchability Engine — Front-end Styles
 *
 * @package     BallMyWay
 * @subpackage  Watchability
 * @since       2.0.0
 */

/* ----------------------------------------------------------------
   Must-Watch List  [bmw_must_watch_games]
   ---------------------------------------------------------------- */

.bmw-must-watch-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.bmw-game-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 10px;
    border-radius: 8px;
    background: #f9fafb;
    border-left: 4px solid #d1d5db;
    font-size: 15px;
    line-height: 1.5;
}

.bmw-game-item .bmw-score {
    flex-shrink: 0;
    font-weight: 700;
    font-size: 20px;
    min-width: 44px;
    text-align: center;
    padding-top: 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    /* v2.0.73: tabular numerals — ratings align into a clean column down
       the must-watch list, sharpening the at-a-glance tier comparison. */
    font-variant-numeric: tabular-nums;
}

.bmw-score-label {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9ca3af;
    line-height: 1;
}

.bmw-game-item .bmw-score[data-tier="high"] { color: #15803d; }
.bmw-game-item .bmw-score[data-tier="mid"]  { color: #b45309; }
.bmw-game-item .bmw-score[data-tier="low"]  { color: #6b7280; }

.bmw-game-item:has(.bmw-score[data-tier="high"]) { border-left-color: #16a34a; background: #f0fdf4; }
.bmw-game-item:has(.bmw-score[data-tier="mid"])  { border-left-color: #d97706; background: #fffbeb; }
.bmw-game-item:has(.bmw-score[data-tier="low"])  { border-left-color: #9ca3af; }

.bmw-game-details {
    flex: 1;
    min-width: 0;
}

.bmw-matchup {
    display: block;
    color: #111827;
    font-weight: 500;
    margin-bottom: 2px;
}

.bmw-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.bmw-tier-high .bmw-label,
.bmw-game-item:has([data-tier="high"]) .bmw-label { color: #15803d; }
.bmw-tier-mid  .bmw-label,
.bmw-game-item:has([data-tier="mid"])  .bmw-label { color: #b45309; }
.bmw-tier-low  .bmw-label,
.bmw-game-item:has([data-tier="low"])  .bmw-label { color: #6b7280; }

.bmw-confidence {
    flex-shrink: 0;
    font-size: 11px;
    color: #9ca3af;
    padding-top: 4px;
    white-space: nowrap;
}

/* ----------------------------------------------------------------
   Reason tags — displayed below the matchup line
   ---------------------------------------------------------------- */

.bmw-reason-tags,
.bmw-card-reason-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.bmw-reason-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 20px;
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
    white-space: nowrap;
}

/* Tier-aware tag colouring */
.bmw-game-item:has([data-tier="high"]) .bmw-reason-tag {
    background: #dcfce7;
    color: #14532d;
    border-color: #bbf7d0;
}

.bmw-game-item:has([data-tier="mid"]) .bmw-reason-tag {
    background: #fef3c7;
    color: #78350f;
    border-color: #fde68a;
}

.bmw-no-games {
    color: #6b7280;
    font-style: italic;
}

/* ----------------------------------------------------------------
   Watchability Card  [bmw_watchability_card]
   ---------------------------------------------------------------- */

.bmw-watchability-card {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 18px 26px;
    border-radius: 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    text-align: center;
    min-width: 200px;
}

.bmw-watchability-card.bmw-tier-high { background: #f0fdf4; border-color: #bbf7d0; }
.bmw-watchability-card.bmw-tier-mid  { background: #fffbeb; border-color: #fde68a; }
.bmw-watchability-card.bmw-tier-fan  { background: #fef7ed; border-color: #fed7aa; }
.bmw-watchability-card.bmw-tier-low  { background: #f9fafb; border-color: #e5e7eb; }

.bmw-watchability-card .bmw-card-matchup {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.bmw-watchability-card .bmw-score {
    font-size: 40px;
    font-weight: 800;
    line-height: 1;
    margin: 0;
    /* v2.0.73: tabular numerals keep the rating visually stable across
       values (e.g. 71.1 vs 41.4 render at identical width) — small but
       real differentiation aid when cards sit side by side. */
    font-variant-numeric: tabular-nums;
}

.bmw-tier-high .bmw-score { color: #15803d; }
.bmw-tier-mid  .bmw-score { color: #b45309; }
.bmw-tier-fan  .bmw-score { color: #92400e; }
.bmw-tier-low  .bmw-score { color: #6b7280; }

.bmw-score .bmw-score-denom {
    font-size: 16px;
    font-weight: 400;
    color: #9ca3af;
}

.bmw-watchability-card .bmw-card-label {
    margin: 6px 0 0;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.bmw-tier-high .bmw-card-label { color: #15803d; }
.bmw-tier-mid  .bmw-card-label { color: #b45309; }
.bmw-tier-fan  .bmw-card-label { color: #92400e; }
.bmw-tier-low  .bmw-card-label { color: #6b7280; }

.bmw-watchability-card .bmw-card-reason-tags {
    justify-content: center;
    margin-top: 8px;
}

.bmw-watchability-card .bmw-reason-tag {
    font-size: 10px;
    padding: 2px 7px;
}

.bmw-tier-high .bmw-reason-tag { background: #dcfce7; color: #14532d; border-color: #bbf7d0; }
.bmw-tier-mid  .bmw-reason-tag { background: #fef3c7; color: #78350f; border-color: #fde68a; }
.bmw-tier-fan  .bmw-reason-tag { background: #ffedd5; color: #78350f; border-color: #fed7aa; }

.bmw-watchability-card .bmw-card-confidence {
    margin: 6px 0 0;
    font-size: 11px;
    color: #9ca3af;
}

/* ----------------------------------------------------------------
   Responsive — stack score badge above matchup on narrow screens
   ---------------------------------------------------------------- */

@media (max-width: 480px) {
    .bmw-game-item {
        flex-wrap: wrap;
    }
    .bmw-game-item .bmw-score {
        font-size: 22px;
        min-width: 48px;
    }
    .bmw-confidence {
        width: 100%;
        text-align: right;
    }
    /* v2.0.73: the standalone card was a narrow 200px floating box on
       phones. Full-width with a larger rating makes the score the
       unmistakable focal point on mobile — the most common context for
       a "should I watch tonight?" check. */
    .bmw-watchability-card {
        display: flex;
        width: 100%;
        box-sizing: border-box;
        min-width: 0;
        padding: 20px 16px;
    }
    .bmw-watchability-card .bmw-score {
        font-size: 48px;
    }
    .bmw-watchability-card .bmw-card-label {
        font-size: 13px;
    }
}

/* ----------------------------------------------------------------
   Game meta row — time, venue, broadcast
   ---------------------------------------------------------------- */

.bmw-game-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin-top: 3px;
    font-size: 12px;
    color: #6b7280;
}

.bmw-game-time {
    font-weight: 500;
    color: #374151;
}

.bmw-venue {
    font-style: italic;
}

.bmw-meta-sep {
    color: #d1d5db;
    font-style: normal;
}

/* ----------------------------------------------------------------
   Broadcast network badge  [bmw-broadcast]
   ---------------------------------------------------------------- */

.bmw-broadcast {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    padding: 2px 8px;
    border-radius: 4px;
    background: #0f172a;
    color: #f8fafc;
    margin-top: 5px;
    white-space: nowrap;
}

/* Streaming platforms (Amazon, Peacock) — teal badge to distinguish from national TV */
.bmw-broadcast--streaming {
    background: #0d9488;
    color: #f0fdfa;
}

/* ----------------------------------------------------------------
   v2.0.49 — Form line ("Last 10: LAL 7-3 · BOS 9-1")
   ---------------------------------------------------------------- */

.bmw-form-line {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    font-weight: 500;
    color: #4b5563;
    letter-spacing: 0.01em;
}

.bmw-card-form-line {
    margin: 4px 0 0;
    font-size: 11px;
    font-weight: 500;
    color: #4b5563;
    text-align: center;
}

/* Tier-aware emphasis on the form line. High-tier games get a slight green
   tint so the eye anchors on hot teams; mid-tier gets the warm amber tint. */
.bmw-game-item:has([data-tier="high"]) .bmw-form-line { color: #166534; }
.bmw-game-item:has([data-tier="mid"])  .bmw-form-line { color: #92400e; }
.bmw-tier-high .bmw-card-form-line { color: #166534; }
.bmw-tier-mid  .bmw-card-form-line { color: #92400e; }
.bmw-tier-fan  .bmw-card-form-line { color: #78350f; }

/* ----------------------------------------------------------------
   v2.0.64 — Tier legend + four-tier classification UI
   ----------------------------------------------------------------
   Renders above the must-watch list. Compact, single line on
   desktop; wraps gracefully on narrow viewports without media
   queries thanks to flex-wrap. */

.bmw-tier-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    align-items: center;
    margin: 0 0 14px 0;
    padding: 10px 14px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.4;
}
.bmw-tier-legend-intro {
    font-weight: 600;
    color: #374151;
    margin-right: 4px;
}
.bmw-tier-legend-item {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
}
.bmw-tier-legend-label { font-weight: 600; }
.bmw-tier-legend-range {
    color: #6b7280;
    font-variant-numeric: tabular-nums;
}
.bmw-tier-legend-item[data-tier="high"] .bmw-tier-legend-label { color: #15803d; }
.bmw-tier-legend-item[data-tier="mid"]  .bmw-tier-legend-label { color: #b45309; }
.bmw-tier-legend-item[data-tier="fan"]  .bmw-tier-legend-label { color: #92400e; }
.bmw-tier-legend-item[data-tier="low"]  .bmw-tier-legend-label { color: #6b7280; }

/* "Only If You're a Big Fan" tier — slots between mid (amber, 60s-70s
   games) and low (gray, sub-40 skip-its). Earthy orange-brown distinguishes
   it from mid without colliding with low's washed-out gray. */
.bmw-game-item .bmw-score[data-tier="fan"] { color: #92400e; }
.bmw-game-item:has(.bmw-score[data-tier="fan"]) { border-left-color: #c2854a; background: #fef7ed; }
.bmw-game-item:has([data-tier="fan"]) .bmw-label     { color: #92400e; }
.bmw-game-item:has([data-tier="fan"]) .bmw-form-line { color: #78350f; }
.bmw-game-item:has([data-tier="fan"]) .bmw-reason-tag {
    background: #fef3c7;
    color: #78350f;
}

/* Admin score-table tier badge — small pill, color-coded same as front-end. */
.bmw-admin-tier-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    background: #f3f4f6;
    color: #374151;
}
.bmw-admin-tier-badge[data-tier="high"] { background: #dcfce7; color: #15803d; }
.bmw-admin-tier-badge[data-tier="mid"]  { background: #fef3c7; color: #92400e; }
.bmw-admin-tier-badge[data-tier="fan"]  { background: #ffedd5; color: #9a3412; }
.bmw-admin-tier-badge[data-tier="low"]  { background: #f3f4f6; color: #6b7280; }

/* ----------------------------------------------------------------
   Archive  [bmw_watchability_archive]  (v2.0.74)

   Reuses .bmw-must-watch-list / .bmw-game-item for every row, so all
   tier coloring above (high/mid/fan/low, including :has() rules) applies
   unchanged. Only new rule needed is the per-date heading and a small
   gap between date groups.
   ---------------------------------------------------------------- */

.bmw-archive {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.bmw-archive-date {
    margin: 0 0 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 15px;
    font-weight: 600;
    color: #374151;
}

.bmw-archive-list {
    margin: 0;
}

/* ----------------------------------------------------------------
   Verdict sentence  (v2.0.75)

   One-sentence, visitor-facing "why" beneath the matchup line — list,
   archive, and standalone card. Neutral gray in all tiers so it reads
   as editorial voice rather than competing with the tier palette;
   italic to distinguish prose from the data rows around it.
   ---------------------------------------------------------------- */

.bmw-verdict {
    display: block;
    margin: 2px 0 4px;
    font-size: 14px;
    font-style: italic;
    line-height: 1.5;
    color: #4b5563;
}

.bmw-card-verdict {
    margin: 4px 0 10px;
    font-size: 15px;
    font-style: italic;
    line-height: 1.5;
    color: #4b5563;
}
