/* ==========================================================================
   Player Detail — Sidebar detail panel, accordion sections, bio header,
   percentile bars, zone cards, speed/shooting tabs, burst bars, overview
   zones, per-game stats, mini labels, splits
   ========================================================================== */

/* --------------------------------------------------------------------------
   Detail panel
   -------------------------------------------------------------------------- */

.detail-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.detail-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    color: var(--text-muted);
    transition: color 0.1s ease;
}

.detail-close-btn:hover {
    color: var(--theme-accent-secondary);
}

.detail-close-btn .icon {
    width: 12px;
    height: 12px;
}

.detail-body {
    padding: 10px;
}

.detail-headshot {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border: 1px solid var(--theme-border-strong);
    flex-shrink: 0;
}

.detail-player-name {
    font-size: var(--text-xl);
    font-weight: var(--weight-black);
    color: var(--text-main);
}

.detail-player-meta {
    font-size: var(--text-xs);
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 2px;
}

.detail-section {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--theme-border-strong);
}
.detail-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.detail-section-title {
    font-size: var(--text-lg);
    font-weight: var(--weight-black);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-main);
    margin-bottom: 4px;
}

.detail-rank-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3px;
}

.detail-rank-label {
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.detail-rank-value {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-main);
}

.detail-rank-num {
    color: var(--text-muted);
    font-weight: var(--weight-black);
    background: var(--theme-bg-surface, var(--theme-bg-panel));
    border: 1px solid var(--theme-border-strong);
    padding: 1px 5px;
    font-size: var(--text-sm);
}

/* Percentile bar */
.detail-pctl-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 3px;
}

.detail-pctl-track {
    flex: 1;
    height: 4px;
    background: var(--theme-bg-surface);
    border: 1px solid var(--theme-border-strong);
    position: relative;
}

.detail-pctl-fill {
    height: 100%;
    position: relative;
    z-index: 1;
}

/* Quartile color coding */
.detail-pctl-fill.pctl-q1 { background: #A84848; }
.detail-pctl-fill.pctl-q2 { background: #C08040; }
.detail-pctl-fill.pctl-q3 { background: #2E6E90; }
.detail-pctl-fill.pctl-q4 { background: #2E5E3E; }

/* Quartile markers */
.pctl-marker {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(0, 0, 0, 0.15);
    z-index: 2;
}

.pctl-marker-25 { left: 25%; }
.pctl-marker-50 { left: 50%; }
.pctl-marker-75 { left: 75%; }

.detail-pctl-group {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
    min-width: 28px;
}

.detail-pctl-label {
    font-size: var(--text-2xs);
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    line-height: 1;
}

.detail-pctl-text {
    font-size: var(--text-xs);
    color: var(--text-muted);
    font-weight: 700;
    text-align: right;
    line-height: 1;
}

/* Burst text */
.detail-burst-text {
    font-size: var(--text-xs);
    color: var(--text-muted);
    font-weight: 500;
}

.detail-burst-text strong {
    background: var(--theme-bg-surface, var(--theme-bg-panel));
    border: 1px solid var(--theme-border-strong);
    color: var(--theme-accent-secondary);
    padding: 0 4px;
    font-weight: var(--weight-black);
}

/* Zone cards */
.zone-cards {
    display: flex;
    gap: 6px;
    padding: 12px;
    padding-bottom: 12px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--theme-border-strong);
}

.zone-card {
    flex: 1;
    background: var(--theme-bg-surface, var(--theme-bg-panel));
    border: 1px solid var(--theme-border-strong);
    display: flex;
    flex-direction: column;
}

.zone-card-accent {
    height: 3px;
    width: 100%;
}
.zone-card-accent.oz { background: #2E5E3E; }
.zone-card-accent.nz { background: #78909C; }
.zone-card-accent.dz { background: #A84848; }

.zone-card-body {
    padding: 8px 8px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.zone-card-name {
    font-size: var(--text-micro);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.zone-card-name.oz { color: #2E5E3E; }
.zone-card-name.nz { color: #78909C; }
.zone-card-name.dz { color: #A84848; }

.zone-card-pct {
    font-size: var(--text-3xl);
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
    margin-bottom: 4px;
}

.zone-card-pctl {
    font-size: var(--text-micro);
    font-weight: 700;
    padding: 1px 5px;
    background: var(--theme-bg-surface, var(--theme-bg-panel));
    border: 1px solid var(--theme-border-strong);
    text-align: center;
    margin-bottom: 6px;
    color: var(--text-muted);
}
.zone-card-pctl.pctl-q4 { color: #2E5E3E; border-color: #2E5E3E; }
.zone-card-pctl.pctl-q3 { color: #2E6E90; border-color: #2E6E90; }
.zone-card-pctl.pctl-q2 { color: #C08040; border-color: #C08040; }
.zone-card-pctl.pctl-q1 { color: #A84848; border-color: #A84848; }

.zone-card-avg {
    font-size: var(--text-2xs);
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.zone-card-bar-track {
    width: 100%;
    height: 5px;
    background: var(--theme-bg-surface);
    position: relative;
}
.zone-card-bar-fill {
    height: 100%;
}
.zone-card-bar-fill.oz { background: #2E5E3E; }
.zone-card-bar-fill.nz { background: #78909C; }
.zone-card-bar-fill.dz { background: #A84848; }

.zone-card-bar-avg {
    position: absolute;
    top: -2px;
    bottom: -2px;
    width: 2px;
    background: var(--text-main);
    opacity: 0.35;
}

/* Even-strength row */
.zone-ev-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}
.zone-ev-tag {
    font-size: var(--text-2xs);
    font-weight: 800;
    padding: 1px 3px;
    background: var(--theme-bg-surface, var(--theme-bg-panel));
    border: 1px solid var(--theme-border-strong);
    color: var(--text-muted);
}
.zone-ev-label {
    font-size: var(--text-micro);
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    white-space: nowrap;
}
.zone-ev-track {
    flex: 1;
    height: 6px;
    background: var(--theme-bg-surface);
    position: relative;
}
.zone-ev-fill {
    height: 100%;
    background: #2E5E3E;
}
.zone-ev-value {
    font-size: var(--text-xs);
    font-weight: 800;
    color: var(--text-main);
    width: 36px;
    text-align: right;
    flex-shrink: 0;
}

/* OZ Ratio callout */
.zone-ratio-callout {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    margin: 8px 12px 12px;
    background: var(--theme-bg-surface, var(--theme-bg-panel));
    border: 1px solid var(--theme-border-strong);
}
.zone-ratio-value {
    font-size: var(--text-lg-plus);
    font-weight: 800;
    color: #2E5E3E;
}
.zone-ratio-text {
    font-size: var(--text-micro);
    font-weight: 600;
    color: var(--text-muted);
}

/* Traditional stats grid */
.detail-trad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.detail-trad-item {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.detail-trad-label {
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.detail-trad-value {
    font-size: var(--text-lg);
    font-weight: var(--weight-black);
    color: var(--text-main);
}

.detail-trad-value.positive { color: #2E5E3E; }
.detail-trad-value.negative { color: #A84848; }

/* ==========================================================================
   M06 Accordion Detail Panel
   ========================================================================== */
.acc-section {
    border-bottom: 1px solid #D0D0D0;
    border-left: 2px solid #CCC;
}
.acc-section.expanded {
    border-left: 2px solid var(--theme-accent-secondary);
}
.acc-header {
    display: flex;
    align-items: center;
    padding: 7px 10px;
    cursor: pointer;
    background: #ECECEC;
    border: none;
    width: 100%;
    font-family: 'JetBrains Mono', monospace;
    box-shadow: inset 1px 1px 0 rgba(255,255,255,0.7), inset -1px -1px 0 rgba(0,0,0,0.08);
    gap: 8px;
    transition: background 0.1s;
}
.acc-header:hover {
    background: #E0E0E0;
}
.acc-title {
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #1A1A1A;
    flex-shrink: 0;
}
.acc-summary {
    font-size: 9px;
    font-weight: 600;
    color: #666;
    flex: 1;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.acc-chevron {
    flex-shrink: 0;
    width: 0;
    height: 0;
    margin-left: 4px;
}
.acc-chevron.collapsed {
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-left: 5px solid #666;
}
.acc-chevron.open {
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #1A1A1A;
}
.acc-body {
    padding: 8px 10px;
    background: #FFFFFF;
    border-top: 1px solid #D0D0D0;
}

/* --------------------------------------------------------------------------
   Detail player header (moved outside tabs)
   -------------------------------------------------------------------------- */

.detail-player-header {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 14px;
    border-bottom: 1px solid var(--theme-border-strong);
    margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Header stats (GP/G/A/Pts/+/- above tab bar)
   -------------------------------------------------------------------------- */

.detail-header-stats { display: flex; gap: 4px; padding: 8px 14px; border-bottom: 1px solid var(--theme-border-strong); background: var(--theme-bg-surface, var(--theme-bg-panel)); }
.detail-header-stat { flex: 1; background: var(--theme-bg-surface, var(--theme-bg-panel)); border: 1px solid var(--theme-border-strong); padding: 5px 4px; text-align: center; }
.detail-header-stat-value { display: block; font-size: var(--text-lg-plus); font-weight: var(--weight-black); color: var(--text-main); line-height: 1.2; }
.detail-header-stat-label { display: block; font-size: var(--text-micro); font-weight: 700; text-transform: uppercase; color: var(--text-muted); margin-top: 1px; }

/* --------------------------------------------------------------------------
   Shooting tab -- stat boxes
   -------------------------------------------------------------------------- */

.detail-stat-pair {
    display: flex;
    gap: 4px;
}

.detail-stat-box {
    flex: 1;
    background: var(--theme-bg-surface, var(--theme-bg-panel));
    border: 1px solid var(--theme-border-strong);
    padding: 6px 4px;
    text-align: center;
}

.detail-stat-box-value {
    display: block;
    font-size: var(--text-lg-plus);
    font-weight: var(--weight-black);
    color: var(--text-main);
    line-height: 1.2;
}

.detail-stat-box-label {
    display: block;
    font-size: var(--text-micro);
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 2px;
}

.detail-pctl-fill--shot {
    background: var(--theme-accent-secondary);
}

/* --------------------------------------------------------------------------
   Speed tab -- hero number + burst bars
   -------------------------------------------------------------------------- */

.detail-speed-hero {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 4px;
}

.detail-speed-hero-value {
    font-size: var(--text-5xl);
    font-weight: var(--weight-black);
    color: var(--text-main);
    line-height: 1;
}

.detail-speed-hero-unit {
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.detail-hero-avg {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-muted);
    margin-left: 4px;
}
.detail-hero-avg-label {
    font-size: var(--text-2xs);
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.detail-burst-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 3px;
}

.detail-burst-label {
    font-size: var(--text-xs);
    font-weight: 700;
    width: 50px;
    flex-shrink: 0;
    color: var(--text-muted);
}

.detail-burst-bar-track {
    flex: 1;
    height: 6px;
    background: var(--theme-bg-surface);
    position: relative;
}

.detail-burst-bar-fill {
    height: 100%;
}

.detail-burst-bar-fill.burst-above { background: #2E5E3E; }
.detail-burst-bar-fill.burst-below { background: #A84848; }

.detail-burst-count {
    font-size: var(--text-sm);
    font-weight: var(--weight-black);
    width: 36px;
    flex-shrink: 0;
    text-align: right;
    color: var(--text-main);
}

/* (zone-stack removed -- replaced by zone-cards) */

/* Loading state */
.detail-loading {
    text-align: center;
    padding: 24px 12px;
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   No zone data state (improvement 9)
   -------------------------------------------------------------------------- */

.detail-no-data {
    font-size: var(--text-xs);
    color: var(--text-muted);
    font-weight: 600;
    text-align: center;
    padding: 12px 0;
    font-style: italic;
}


/* --------------------------------------------------------------------------
   Overview compact zones (improvement 17)
   -------------------------------------------------------------------------- */

.overview-zone-compact {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    gap: 8px;
}

.overview-zone-compact .oz-val { color: #2E5E3E; }
.overview-zone-compact .nz-val { color: var(--text-muted); }
.overview-zone-compact .dz-val { color: #A84848; }
.overview-zone-compact .zone-sep { color: var(--text-muted); }

/* --------------------------------------------------------------------------
   Per Game stat boxes (improvement 16)
   -------------------------------------------------------------------------- */

.detail-stat-box-value.na { color: var(--text-muted); }

/* --------------------------------------------------------------------------
   Record context line (overlay: game date, opponent, score)
   -------------------------------------------------------------------------- */

.detail-record-context {
    font-size: var(--text-xs);
    font-weight: 500;
    font-style: italic;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.4;
}

/* --------------------------------------------------------------------------
   League average text
   -------------------------------------------------------------------------- */

.detail-league-avg {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 2px;
}

/* --------------------------------------------------------------------------
   Mini label (inline section sub-label)
   -------------------------------------------------------------------------- */

.detail-mini-label {
    font-size: var(--text-micro);
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 6px;
    margin-bottom: 2px;
}

/* --------------------------------------------------------------------------
   League avg marker on percentile track
   -------------------------------------------------------------------------- */

.pctl-league-marker {
    position: absolute;
    top: -2px;
    bottom: -2px;
    width: 2px;
    background: var(--text-main);
    z-index: 3;
}

/* --------------------------------------------------------------------------
   Player splits
   -------------------------------------------------------------------------- */
.splits-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-2xs);
}
.splits-table th {
    background: #f0f0f0;
    font-size: 8px;
    font-weight: 900;
    text-transform: uppercase;
    padding: 4px 6px;
    text-align: right;
    border-bottom: 1px solid #000;
}
.splits-table th:first-child { text-align: left; }
.splits-table td {
    padding: 4px 6px;
    text-align: right;
    font-weight: 700;
    border-bottom: 1px solid #eee;
}
.splits-table td:first-child {
    text-align: left;
    font-weight: 900;
}
.splits-table tr:nth-child(even) { background: #fafafa; }
