/* ==========================================================================
   Lines — Line combo table styles
   ========================================================================== */

/* Brand color */
:root { --hs-brand-blue: #2c5f8a; }

/* === Data source pills (Option A: muted outlines) === */
.panel-header { position: relative; }
.line-pills {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
    vertical-align: middle;
}
.line-pill {
    font-size: var(--text-2xs);
    font-weight: 700;
    letter-spacing: 0.3px;
    padding: 2px 8px;
    border-radius: 3px;
    text-transform: none;
}

/* ? info button */
.line-info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1.5px solid #bbb;
    background: transparent;
    color: #999;
    font-size: var(--text-micro);
    font-weight: 800;
    cursor: pointer;
    margin-left: 4px;
    vertical-align: middle;
    line-height: 1;
    transition: all 0.15s;
    text-transform: none;
    letter-spacing: 0;
}
.line-info-btn:hover {
    background: #eee;
    color: #666;
}

/* Glossary button */
.line-glossary-btn {
    font-size: var(--text-2xs);
    font-weight: var(--weight-bold);
    font-family: inherit;
    letter-spacing: 0.3px;
    padding: 2px 8px;
    border-radius: 3px;
    border: 1px solid #bbb;
    background: transparent;
    color: #888;
    cursor: pointer;
    margin-left: 4px;
    vertical-align: middle;
    text-transform: none;
    transition: all 0.15s;
}
.line-glossary-btn:hover {
    background: #eee;
    color: #555;
    border-color: #999;
}

/* Info popover card */
.line-info-popover {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: 440px;
    background: #fff;
    border: 1px solid #1a1a1a;
    border-radius: 6px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
    padding: 20px 24px;
    z-index: 20;
    font-size: var(--text-xs);
    line-height: 1.6;
    color: #555;
    white-space: normal;
    word-break: break-word;
    text-transform: none;
    font-weight: normal;
    letter-spacing: 0;
}
.line-info-popover p { margin: 0 0 10px; }
.line-info-popover p:last-child { margin-bottom: 0; }
.line-info-popover strong { color: #1a1a1a; font-weight: var(--weight-black); }

/* Glossary popover */
.line-glossary-popover {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: 520px;
    max-height: 70vh;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #1a1a1a;
    border-radius: 6px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
    padding: 20px 24px;
    z-index: 20;
    white-space: normal;
    text-transform: none;
    font-weight: normal;
    letter-spacing: 0;
}
.line-glossary-section {
    margin-bottom: 16px;
}
.line-glossary-section:last-child {
    margin-bottom: 0;
}
.line-glossary-heading {
    font-size: var(--text-xs);
    font-weight: var(--weight-black);
    color: #1a1a1a;
    letter-spacing: 0.3px;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #eee;
}
.line-glossary-tag {
    font-size: var(--text-3xs);
    font-weight: var(--weight-bold);
    color: #888;
    margin-left: 6px;
}
.line-glossary-list {
    margin: 0;
    padding: 0;
}
.line-glossary-list dt {
    font-size: var(--text-micro);
    font-weight: var(--weight-black);
    color: #333;
    float: left;
    width: 70px;
    clear: left;
    padding: 3px 0;
}
.line-glossary-list dd {
    font-size: var(--text-micro);
    color: #666;
    margin-left: 76px;
    padding: 3px 0;
    line-height: 1.5;
    border-bottom: 1px solid #f5f5f5;
}
.line-glossary-list dd:last-of-type {
    border-bottom: none;
}
.line-glossary-note {
    font-size: var(--text-micro);
    color: #666;
    line-height: 1.5;
    margin: 0;
}

/* Bigger text for lines table */
.table-column .data-table { font-size: var(--text-sm); }
.table-column .data-table th { font-size: var(--text-sm); text-align: center; }

/* Filter toolbar — allow wrapping */
.table-column .filter-toolbar {
    flex-wrap: wrap;
    align-items: flex-end;
    row-gap: 4px;
}

/* Line identity cell */
.line-identity-cell { min-width: 220px; }
.line-identity { display: flex; align-items: center; gap: 6px; }
.line-identity .team-logo { width: 24px; height: 24px; flex-shrink: 0; }
.line-players { display: flex; align-items: center; gap: 3px; font-size: var(--text-sm); white-space: nowrap; }
.line-player-link {
    font-weight: var(--weight-bold);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}
.line-player-link:hover {
    text-decoration: underline;
    color: var(--hs-brand-blue);
}
.line-sep { color: #999; margin: 0 1px; }
.line-players, .line-players * { user-select: text !important; -webkit-user-select: text !important; }
.line-row { cursor: pointer; }

/* Type label */
.col-type { text-align: center; width: 36px; }
.line-type-label { font-size: var(--text-2xs); font-weight: var(--weight-bold); letter-spacing: 0.3px; color: #888; }

.line-col-identity { min-width: 220px; }

/* TOI filter */
.line-toi-filter { display: flex; align-items: center; gap: 4px; font-size: var(--text-xs); }
.line-toi-label { color: #888; font-weight: var(--weight-bold); letter-spacing: 0.5px; white-space: nowrap; }
.line-toi-slider { width: 80px; height: 4px; -webkit-appearance: none; appearance: none; background: #333; border-radius: 2px; outline: none; cursor: pointer; }
.line-toi-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: var(--theme-accent-secondary, #4a7cbf); cursor: pointer; }
.line-toi-input {
    width: 42px;
    padding: 1px 4px;
    font-size: var(--text-xs);
    font-family: inherit;
    font-weight: var(--weight-bold);
    text-align: center;
    border: 1px solid #444;
    border-radius: 3px;
    background: transparent;
    color: inherit;
    -moz-appearance: textfield;
}
.line-toi-input::-webkit-inner-spin-button,
.line-toi-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.line-toi-unit { color: #888; font-size: var(--text-xs); }

/* Column group header text colors */
.line-grp-xg span { color: #444; }
.line-grp-goals span { color: #555; }
.line-grp-corsi span { color: #444; }
.line-grp-fenwick span { color: #555; }
.line-grp-edge span { color: var(--hs-brand-blue); }

/* Group preset row */
.line-groups-row { display: flex; align-items: flex-end; gap: 8px; flex-shrink: 0; }
.line-group-section { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; }
.line-group-section .seg-group { flex-wrap: nowrap; }
.line-group-label { font-size: var(--text-3xs); font-weight: var(--weight-black); letter-spacing: 0.5px; color: #666; text-transform: uppercase; padding-left: 2px; }
.line-group-edge .line-group-label { color: var(--hs-brand-blue); }
.seg-btn-all { font-size: var(--text-2xs); padding: 1px 4px; opacity: 0.7; }
.seg-btn-all.active { opacity: 1; }

/* Percentile quintile coloring */
.line-pctl-q1 { background: rgba(203, 36, 49, 0.15); }
.line-pctl-q2 { background: rgba(203, 36, 49, 0.06); }
.line-pctl-q3 { background: transparent; }
.line-pctl-q4 { background: rgba(34, 134, 58, 0.06); }
.line-pctl-q5 { background: rgba(34, 134, 58, 0.15); }

/* === Inline drawer === */
.line-drawer { padding: 10px 16px 14px; }
.line-drawer-header { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.line-drawer-title { font-weight: var(--weight-black); font-size: var(--text-sm); color: #1a1a1a; }
.line-drawer-subtitle { font-size: var(--text-xs); color: #888; }

.line-drawer-section-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--text-2xs);
    font-weight: var(--weight-black);
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: #666;
    margin-bottom: 6px;
    position: relative;
}

.line-drawer-help-btn {
    margin-left: auto;
    width: 16px;
    height: 16px;
    line-height: 14px;
    font-size: 10px;
}

.line-record-help-btn {
    width: 16px;
    height: 16px;
    line-height: 14px;
    font-size: 10px;
}

.line-drawer-math-popover {
    left: auto;
    right: 0;
    top: calc(100% + 6px);
    transform: none;
    width: min(440px, calc(100vw - 24px));
    max-height: 70vh;
    overflow-y: auto;
    z-index: 20;
}

.line-record-help-popover {
    left: auto;
    right: 24px;
    top: calc(100% + 6px);
    transform: none;
    width: min(460px, calc(100vw - 24px));
    max-height: 70vh;
    overflow-y: auto;
    z-index: 21;
}

.line-context-tag {
    font-size: var(--text-3xs);
    letter-spacing: 0.3px;
    color: #8a8a8a;
}

.line-drawer-empty {
    font-size: var(--text-xs);
    color: #888;
    padding: 8px 0;
}

.line-player-cards-grid {
    display: grid;
    gap: 10px;
}

.line-player-cards-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.line-player-cards-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.line-player-card {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.line-player-card-header {
    padding: 6px 9px;
    background: #dce8f2;
    display: flex;
    align-items: flex-start;
    gap: 7px;
}

.line-player-headshot {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #c8d6e4;
    flex-shrink: 0;
}

.line-player-header-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.line-player-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.line-player-header-text .line-player-link {
    font-size: var(--text-xs);
    font-weight: var(--weight-black);
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.line-player-meta {
    font-size: var(--text-micro);
    line-height: 1.25;
    color: #6d7f91;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.line-player-header-actions {
    margin-top: 2px;
}

.line-player-full-btn {
    border: 1px solid #9bb1c6;
    background: #f5f9fc;
    color: #2f4964;
    border-radius: 4px;
    font-size: 9px;
    line-height: 1;
    letter-spacing: 0.2px;
    font-weight: var(--weight-black);
    padding: 3px 6px;
    cursor: pointer;
}

.line-player-full-btn:hover {
    background: #eaf2f9;
    border-color: #7f9cb9;
}

.line-player-bio {
    color: #7e8790;
}

.line-player-card-body {
    padding: 7px 9px;
    font-variant-numeric: tabular-nums;
}

.line-player-section-title {
    margin-top: 4px;
    margin-bottom: 2px;
    font-size: var(--text-micro);
    font-weight: var(--weight-black);
    letter-spacing: 0.35px;
    text-transform: uppercase;
    color: var(--theme-accent-secondary);
}

.line-player-stat-row {
    display: grid;
    grid-template-columns: 58px 1fr 46px 78px;
    align-items: center;
    gap: 4px;
    padding: 1px 0;
}

.line-player-stat-label {
    font-size: var(--text-micro);
    letter-spacing: 0.25px;
    text-transform: uppercase;
    color: #7e7e7e;
    font-weight: var(--weight-black);
}

.line-player-track {
    height: 4px;
    background: #ececec;
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}

.line-player-fill {
    display: block;
    height: 100%;
    background: #2e6e90;
    border-radius: 2px;
}

.line-player-fill.pctl-q1 { background: #A84848; }
.line-player-fill.pctl-q2 { background: #C08040; }
.line-player-fill.pctl-q3 { background: #2E6E90; }
.line-player-fill.pctl-q4 { background: #2E5E3E; }
.line-player-fill.pctl-na { background: #b8b8b8; }

.line-player-avg-tick {
    position: absolute;
    top: -1px;
    bottom: -1px;
    width: 2px;
    background: #111;
    border-radius: 1px;
    transform: translateX(-1px);
    opacity: 0.7;
}

.line-player-stat-val {
    font-size: var(--text-xs);
    font-weight: var(--weight-black);
    color: #1a1a1a;
    text-align: right;
}

.line-player-rank-pill {
    font-size: 8px;
    line-height: 1.15;
    font-weight: var(--weight-black);
    text-align: center;
    padding: 2px 5px;
    border-radius: 2px;
    border: 1px solid #c5c5c5;
    background: #fafafa;
    color: #555;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
    font-variant-numeric: tabular-nums;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 1px 1px rgba(0, 0, 0, 0.06);
    text-transform: uppercase;
}

.line-player-rank-pill.band-elite {
    background: #0f5d2f;
    border-color: #0a4522;
    color: #ffffff;
}

.line-player-rank-pill.band-strong {
    background: #e4f4e8;
    border-color: #4f9a67;
    color: #24563a;
}

.line-player-rank-pill.band-above-avg {
    background: #e3f0f7;
    border-color: #5f95b7;
    color: #245570;
}

.line-player-rank-pill.band-avg {
    background: #eef1f4;
    border-color: #a9b2ba;
    color: #4f5a63;
}

.line-player-rank-pill.band-below-avg {
    background: #f9efe5;
    border-color: #c99862;
    color: #8a582b;
}

.line-player-rank-pill.band-weak {
    background: #fbe9e8;
    border-color: #cf6f6f;
    color: #8a3131;
}

.line-player-rank-pill.band-na {
    background: #f7f7f7;
    border-color: #dddddd;
    color: #8a8a8a;
}

.line-player-wowy-row {
    display: grid;
    grid-template-columns: 62px 62px 1fr;
    align-items: center;
    gap: 6px;
    padding: 2px 0;
}

.line-player-wowy-val {
    font-size: var(--text-xs);
    font-weight: var(--weight-black);
    color: #1a1a1a;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.line-player-wowy-sub {
    font-size: var(--text-micro);
    color: #7a7a7a;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
