/**
 * player-injury-common.css
 * Shared styles for player injury/exclusion UI components.
 * Used by: player-props-dfs, next-player-up, matchup (injury adjust)
 */

/* ================================================================
   INJURY STATUS BADGES
   ================================================================ */
.injury-badge {
    display: inline-block;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 20px;
    margin-left: 4px;
    letter-spacing: 0.5px;
    vertical-align: middle;
}
.injury-out { background: #dc3545; opacity: 0.4; }
.injury-doubtful { background: #fd7e14; }
.injury-questionable { background: #0d6efd; }
.injury-probable { background: #198754; }

/* ================================================================
   HEADSHOT INJURY OVERLAY
   ================================================================ */
.headshot-injury-wrap {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
}
.headshot-injury-wrap .headshot-injury-bg {
    position: absolute;
    inset: 0;
    border-radius: 4px;
    z-index: 1;
    pointer-events: none;
}
.headshot-injury-wrap .headshot-injury-bg.injury-bg-out { background: rgba(220, 53, 69, 0.25); }
.headshot-injury-wrap .headshot-injury-bg.injury-bg-doubtful { background: rgba(253, 126, 20, 0.25); }
.headshot-injury-wrap .headshot-injury-bg.injury-bg-questionable { background: rgba(13, 110, 253, 0.25); }
.headshot-injury-wrap .headshot-injury-bg.injury-bg-probable { background: rgba(25, 135, 84, 0.25); }
.headshot-injury-wrap .headshot-injury-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    color: #fff;
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    padding: 1px 0;
    border-radius: 0 0 4px 4px;
    z-index: 2;
}
.headshot-injury-label.injury-label-out { background: #dc3545; }
.headshot-injury-label.injury-label-doubtful { background: #fd7e14; }
.headshot-injury-label.injury-label-questionable { background: #0d6efd; }
.headshot-injury-label.injury-label-probable { background: #198754; }

/* ================================================================
   WITHOUT-PLAYER STRIP (pill strip for toggling players)
   ================================================================ */
.without-player-strip {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding: 6px 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
.without-player-strip::-webkit-scrollbar { height: 4px; }
.without-player-strip::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }
.without-player-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    border: 2px solid transparent;
    transition: opacity 0.2s, border-color 0.2s, background-color 0.2s;
    width: 70px;
    text-align: center;
    position: relative;
    background: #fff;
}
.without-player-item:hover { background: rgba(0, 123, 255, 0.08); }
/* Required state (green) */
.without-player-item.required,
.opp-player-item.opp-required {
    background: rgba(20, 108, 67, 0.08);
    border-color: #146c43;
}
.without-player-item.required .without-player-headshot,
.opp-player-item.opp-required .without-player-headshot {
    box-shadow: 0 0 0 2px #146c43;
}
/* Excluded state (dimmed) */
.without-player-item.excluded {
    background-color: #f0f0f0;
    border-color: transparent;
}
.without-player-item.excluded .without-player-headshot { filter: grayscale(100%); opacity: 0.3; }
.without-player-item.excluded .without-player-name { color: #bbb; }
.without-player-item.excluded .without-player-pos { color: #ccc; }
.without-player-item.excluded .injury-badge { opacity: 1; background: #8b1a2a; }
.without-player-item.excluded .chip-badge { opacity: 1; }
/* Opponent excluded state */
.opp-player-item.opp-excluded {
    background-color: #f0f0f0;
    border-color: transparent;
}
.opp-player-item.opp-excluded .without-player-headshot { filter: grayscale(100%); opacity: 0.3; }
.opp-player-item.opp-excluded .without-player-name { color: #bbb; }
.opp-player-item.opp-excluded .without-player-pos { color: #ccc; }
.opp-player-item.opp-excluded .injury-badge { opacity: 1; background: #8b1a2a; }
.opp-player-item.opp-excluded .chip-badge { opacity: 1; }
/* Select button (appears on hover, centered over headshot) */
.strip-select-btn {
    position: absolute;
    top: 22px;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.55rem;
    font-weight: 700;
    color: #fff;
    background: rgba(108, 117, 125, 0.85);
    padding: 1px 8px;
    border-radius: 8px;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 3;
    cursor: pointer;
    white-space: nowrap;
}
.without-player-item:hover .strip-select-btn { opacity: 1; }
.without-player-headshot {
    width: 44px; height: 44px;
    border-radius: 50%;
    object-fit: cover;
    background: #f0f0f0;
}
.without-player-name {
    font-size: 0.65rem; font-weight: 600; color: #333;
    margin-top: 2px; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; max-width: 68px;
}
.without-player-pos { font-size: 0.58rem; color: #888; }
@media (max-width: 768px) {
    .without-player-item { width: 60px; }
    .without-player-headshot { width: 36px; height: 36px; }
    .without-player-name { font-size: 0.6rem; max-width: 58px; }
    .strip-select-btn { opacity: 0.8; top: 18px; }
}

/* ================================================================
   EXCLUDED / REQUIRED ROW STYLES (table rows in NPU)
   ================================================================ */
.excluded-row {
    background-color: #f0f0f0 !important;
}
.excluded-row td {
    color: #bbb;
}
.excluded-row td.col-player {
    background-color: #f0f0f0 !important;
}
.excluded-row .player-headshot {
    filter: grayscale(100%);
    opacity: 0.3;
}
.excluded-row .player-name { color: #bbb; }
.excluded-row .player-pos { color: #ccc; }
.excluded-row .injury-badge,
.excluded-row .out-badge { color: #fff; }
.excluded-row .injury-out { background: #8b1a2a; opacity: 1; }
.excluded-row td::after {
    content: '';
}
.required-row {
    background-color: rgba(25, 135, 84, 0.08) !important;
    border-left: 3px solid #198754;
}
.required-row td.col-player {
    background-color: rgba(25, 135, 84, 0.08) !important;
}
.required-row .player-headshot {
    box-shadow: 0 0 0 2px #198754;
}

/* ================================================================
   STAT CELL DUAL DISPLAY (baseline + adjusted + delta)
   ================================================================ */
.stat-cell .base-stat {
    color: #aaa;
    text-decoration: line-through;
    font-size: 0.75rem;
    display: block;
    line-height: 1.1;
}
.stat-cell .new-stat {
    font-weight: 700;
    color: #111;
    font-size: 0.85rem;
    display: block;
    line-height: 1.2;
}
.stat-cell .delta {
    font-size: 0.68rem;
    display: block;
    line-height: 1.1;
}
.delta-pos { color: #155724; }
.delta-neg { color: #721c24; }
.delta-zero { color: #999; }
.stat-cell .solo-stat {
    font-weight: 600;
    font-size: 0.85rem;
    color: #333;
}

/* ================================================================
   OUT / IN BADGES
   ================================================================ */
.out-badge {
    display: inline-block;
    background: #8b1a2a;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 20px;
    margin-left: 6px;
    letter-spacing: 0.5px;
}
.in-badge {
    display: inline-block;
    background: #146c43;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 20px;
    margin-left: 6px;
    letter-spacing: 0.5px;
}

/* ================================================================
   CHIP BADGES (compact variant)
   ================================================================ */
.chip-badge {
    display: inline-block;
    color: #fff;
    font-size: 0.5rem;
    font-weight: 700;
    padding: 0 5px;
    border-radius: 10px;
    margin-left: 3px;
    letter-spacing: 0.5px;
    vertical-align: middle;
}
.chip-badge.badge-out { background: #8b1a2a; }
.chip-badge.badge-out-dimmed { background: #dc3545; opacity: 0.4; }
.chip-badge.badge-in { background: #146c43; }

/* ================================================================
   LEGEND BADGES
   ================================================================ */
.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}
.legend-badge {
    display: inline-block;
    color: #fff;
    font-size: 0.55rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 20px;
    letter-spacing: 0.5px;
}
.legend-sep { color: #ccc; }

/* ================================================================
   EXCLUDED SUMMARY BAR
   ================================================================ */
.excluded-summary {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 8px 14px;
    margin-bottom: 12px;
    font-size: 0.85rem;
    display: none;
}
.excluded-summary strong { color: #856404; }

/* ================================================================
   MATCHUP PAGE: INJURY-ADJUST PILL STRIP
   Compact variant — no headshots, just name pills with status color
   ================================================================ */
.injury-pill-strip {
    padding: 8px 0 4px;
}
.injury-pill-strip .team-pills-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #555;
    margin-bottom: 4px;
}
.injury-pill-strip .team-pills-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 8px;
}
.injury-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 14px;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: opacity 0.2s, background-color 0.2s, border-color 0.2s;
    background: #f8f9fa;
    color: #333;
    white-space: nowrap;
}
.injury-pill:hover {
    background: rgba(0, 123, 255, 0.08);
    border-color: #007bff;
}
/* Injury status tints on pills */
.injury-pill.status-out { background: #f8d7da; color: #721c24; }
.injury-pill.status-doubtful { background: #ffe5cc; color: #856404; }
.injury-pill.status-questionable { background: #cce5ff; color: #004085; }
.injury-pill.status-probable { background: #d4edda; color: #155724; }
/* Neutral pill state (grey/faded, no effect on stats) */
.injury-pill.pill-neutral {
    opacity: 0.45;
    background: #e9ecef;
    color: #999;
    border-color: transparent;
}
.injury-pill.pill-neutral:hover {
    opacity: 0.7;
    border-color: #6c757d;
}
/* Excluded / Out pill state (RED) */
.injury-pill.excluded {
    background: #f8d7da;
    color: #721c24;
    border-color: #dc3545;
    border-width: 2px;
    font-weight: 600;
}
.injury-pill.excluded:hover {
    background: #f1b0b7;
    border-color: #bd2130;
}
/* Included / In pill state (GREEN) */
.injury-pill.included {
    background: #d1e7dd;
    color: #0f5132;
    border-color: #198754;
    border-width: 2px;
    font-weight: 600;
}
.injury-pill.included:hover {
    background: #badbcc;
    border-color: #146c43;
}
/* Pill status label */
.injury-pill .pill-status {
    font-size: 0.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.injury-pill .pill-status-neutral {
    text-decoration: line-through;
    opacity: 0.7;
}
.injury-pill .pill-status-out {
    color: #dc3545;
}
.injury-pill .pill-status-in {
    color: #0f5132;
}
/* Low-minutes players (<10 MPG) — greyed out, don't affect stats */
.injury-pill.low-minutes {
    opacity: 0.4;
    background: #e9ecef;
    color: #999;
    border-color: transparent;
    border-width: 1.5px;
}
.injury-pill.low-minutes.excluded {
    background: #f0e0e2;
    color: #b08087;
    border-color: #dca0a6;
}
.injury-pill.low-minutes.included {
    background: #dde9e1;
    color: #7a9a86;
    border-color: #a0c4ad;
}
.injury-pill.low-minutes:hover {
    opacity: 0.6;
    border-color: #adb5bd;
}
.injury-pill .pill-mpg {
    font-size: 0.48rem;
    font-weight: 400;
    color: #aaa;
    margin-left: 1px;
}
/* Game count info bar */
.injury-adjust-info {
    font-size: 0.72rem;
    color: #666;
    padding: 4px 0;
    border-top: 1px solid #eee;
    margin-top: 4px;
}
.injury-adjust-info .games-removed {
    color: #dc3545;
    font-weight: 600;
}
@media (max-width: 768px) {
    .injury-pill {
        font-size: 0.62rem;
        padding: 2px 7px;
    }
}

/* ================================================================
   STATS LOADING OVERLAY
   ================================================================ */
.stats-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    font-size: 1.5rem;
    color: #666;
    border-radius: 4px;
}
