/* ═══════════════════════════════════════════════════════════════
   PLAYER PROFILE PAGE
   Redesigned per Figma 40000251:4672 ("Player pr").
   Hero card, competition pill tabs, stat cards, transfer rows.
   ═══════════════════════════════════════════════════════════════ */

/* Page container */
.player-page-container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 24px 15px;
}

/* Main column (Figma layout_3EECEY: column, gap 24px) */
.player-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ═══ Hero Card (Figma 40000345:10287 — radius 14px, h 318px,
      stadium backdrop + dark-purple gradient, padding 20px 48px) ═══ */
.player-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 318px;
    padding: 20px 48px;
    border-radius: var(--border-radius-card);
    /* fill_NN1GFN: gradient over the shared stadium backdrop
       (same imageRef as the app-download banner asset) */
    background-color: #0D001E;
    background-image:
        linear-gradient(90deg, rgba(13, 0, 30, 1) 0%, rgba(13, 0, 30, 0.53) 61%, rgba(13, 0, 30, 1) 100%),
        url('../images/app-banner-bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Decorative blurred light streaks (Figma Vector 1 / Vector 2,
   blur 21.5px — clipped by the hero's overflow) */
.player-hero-glow {
    position: absolute;
    pointer-events: none;
    filter: blur(21.5px);
    z-index: 0;
}

.player-hero-glow--left {
    top: 0;
    left: -209px;
    width: 1112px;
    height: 420px;
    background: linear-gradient(208deg, rgba(217, 217, 217, 0.2) 0%, rgba(255, 255, 255, 0) 66%);
}

.player-hero-glow--right {
    top: 5px;
    left: 175px;
    width: 1217px;
    height: 484px;
    background: linear-gradient(197deg, rgba(217, 217, 217, 0.2) 0%, rgba(255, 255, 255, 0) 51%);
}

.player-hero-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    width: 100%;
}

/* Identity block: avatar + name + team badges
   (Figma 40000345:10377 — column, centered, gap 10px) */
.player-hero-identity {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 10px;
    text-align: center;
}

/* Giant glass shirt number watermark behind the identity
   (Figma 40000358:10466 — ~202px + Glass effect: Light −45°/80%,
   Refraction 80, Depth 23.12, Dispersion 50, Frost 4.62,
   Stroke: Linear inside 1.16px).
   CSS approximation: glass-body gradient fill lit from the top-left
   (135deg = Figma −45°), frost halo + chromatic dispersion fringes +
   depth shadow via drop-shadows, and pseudo-element layers for the
   fading linear stroke and the specular sheen. */
.player-hero-number {
    position: absolute;
    top: -70px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 0;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 202px;
    line-height: 1.5;
    color: transparent;
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.16) 0%,
        rgba(255, 255, 255, 0.06) 40%,
        rgba(255, 255, 255, 0.02) 68%,
        rgba(255, 255, 255, 0.09) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    filter:
        drop-shadow(0 0 5px rgba(255, 255, 255, 0.05))          /* Frost 4.62 */
        drop-shadow(-2px -2px 3px rgba(150, 220, 255, 0.04))    /* Dispersion (cool fringe) */
        drop-shadow(2px 2px 3px rgba(255, 150, 235, 0.04))      /* Dispersion (warm fringe) */
        drop-shadow(10px 12px 23px rgba(13, 0, 30, 0.55));      /* Depth 23.12 */
    pointer-events: none;
    user-select: none;
}

/* Linear inside stroke (1.16px) fading away from the −45° light source */
.player-hero-number::before {
    content: attr(data-number);
    position: absolute;
    inset: 0;
    color: transparent;
    -webkit-text-stroke: 1.16px rgba(255, 255, 255, 0.30);
    -webkit-mask-image: linear-gradient(135deg,
        rgba(0, 0, 0, 1) 0%,
        rgba(0, 0, 0, 0.25) 55%,
        rgba(0, 0, 0, 0.55) 100%);
    mask-image: linear-gradient(135deg,
        rgba(0, 0, 0, 1) 0%,
        rgba(0, 0, 0, 0.25) 55%,
        rgba(0, 0, 0, 0.55) 100%);
}

/* Specular sheen: soft refracted light caught on the lit edge */
.player-hero-number::after {
    content: attr(data-number);
    position: absolute;
    inset: 0;
    color: transparent;
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.28) 0%,
        rgba(255, 255, 255, 0.08) 22%,
        transparent 42%);
    -webkit-background-clip: text;
    background-clip: text;
    filter: blur(1px);
}

.player-hero-avatar {
    position: relative;
    z-index: 1;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
}

/* Montserrat/ExtraBold 18 */
.player-hero-name {
    position: relative;
    z-index: 1;
    margin: 0;
    font-family: var(--font-heading);
    font-size: var(--font-size-lg);
    font-weight: 800;
    line-height: 1.22;
    color: var(--text-white);
}

/* Team badges row (Figma 40000346:10384 — row, centered, gap 10px) */
.player-hero-teams {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.player-hero-team {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.player-hero-team-badge {
    position: relative;
    display: inline-flex;
    width: 26px;
    height: 26px;
    flex-shrink: 0;
}

.player-hero-team-logo {
    width: 26px;
    height: 26px;
    object-fit: contain;
}

/* Shirt-number pill overlapping the badge
   (Figma div.event-time — 16px, #BAE900, radius 88px, 10px bold) */
.player-hero-team-number {
    position: absolute;
    top: -2px;
    right: -6px;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-lime);
    color: var(--accent-purple-dark);
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    border-radius: 50%;
}

/* Montserrat/SemiBold 11 */
.player-hero-team-name {
    font-family: var(--font-heading);
    font-size: var(--font-size-xs);
    font-weight: 600;
    line-height: 1.22;
    color: var(--text-white);
}

a.player-hero-team:hover .player-hero-team-name {
    text-decoration: underline;
}

/* 4px separator dot between club and country (#A59C9F) */
.player-hero-teams-dot {
    width: 4px;
    height: 4px;
    border-radius: 1000px;
    background: var(--text-muted);
    flex-shrink: 0;
}

/* Info strip (Figma 40000346:10422 — row, gap 16px, padding 16px 12px,
   bg #1C1C1C, 1px #2E2E2E border, radius 8px) */
.player-hero-info {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
    padding: 16px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

/* Item columns (Figma layout_73IJ7M — column, gap 8px, ~70px wide) */
.player-hero-info-item {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    min-width: 70px;
    text-align: center;
}

/* style_9CRQYA — 8px/400 label */
.player-hero-info-label {
    font-size: var(--font-size-xs);
    line-height: 1.2;
    color: var(--text-muted);
}

/* Body/Sm: Medium 12 value */
.player-hero-info-value {
    font-size: var(--font-size-sm);
    font-weight: 500;
    line-height: 1.5;
    color: var(--text-primary);
    white-space: nowrap;
}

/* Hairline dividers (Figma Vector 3/4/6 — 1×20px, #4C484A) */
.player-hero-info-sep {
    width: 1px;
    height: 20px;
    background: var(--border-strong);
    flex-shrink: 0;
}

/* ═══ Competition Pill Tabs (Figma 40000358:10468 div.events-filter —
      gap 4px; active pill #6D00CC, inactive 1px #2E2E2E border,
      radius 20px, Montserrat 700/12 — same pattern as .scorers-tab) ═══ */
.player-comp-tabs {
    display: flex;
    align-items: stretch;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
}

.player-comp-tabs::-webkit-scrollbar {
    display: none;
}

.player-comp-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 6px 16px;
    font-family: var(--font-heading);
    font-size: var(--font-size-sm);
    font-weight: 700;
    line-height: 1.22;
    white-space: nowrap;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-pill);
    cursor: pointer;
    transition: var(--transition-fast);
}

.player-comp-tab:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.player-comp-tab.active {
    color: var(--text-white);
    background: var(--accent-purple-dark);
    border-color: var(--accent-purple-dark);
}

.player-comp-tab img {
    width: 15px;
    height: 23px;
    object-fit: contain;
}

/* Stats panes (toggled by player.js) */
.player-stats-pane {
    display: none;
    margin-top: 24px;
}

.player-stats-pane.active {
    display: block;
}

/* ═══ Stat Cards (Figma 40000385:5915 / 40002004:11320 — 5-column wrap
      grid, gap 12px; card: column, gap 16px, padding 16px 12px,
      bg #1C1C1C, 1px #2E2E2E border, radius 8px) ═══ */
.player-stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

.player-stat-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 16px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: var(--transition-fast);
}

.player-stat-card:hover {
    border-color: var(--accent-purple-dark);
    transform: translateY(-2px);
}

/* Icons render at 26×26 (Figma layout_PQ27V5) */
.player-stat-icon {
    width: 26px;
    height: 26px;
    object-fit: contain;
    display: block;
}

.player-stat-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: center;
}

/* style_9CRQYA — 8px/400 label */
.player-stat-label {
    font-size: var(--font-size-xs);
    line-height: 1.2;
    color: var(--text-muted);
}

/* Display/Lg: Bold 18 value */
.player-stat-value {
    font-family: var(--font-heading);
    font-size: var(--font-size-lg);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

/* ═══ Section Titles (Figma 40000385:6187 — 4×18px lime bar, radius 2px,
      gap 8px, Montserrat 800/16) ═══ */
.player-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px;
    font-family: var(--font-heading);
    font-size: var(--font-size-md);
    font-weight: 800;
    line-height: 1.22;
    color: var(--text-primary);
}

.player-section-title-bar {
    width: 4px;
    height: 18px;
    border-radius: 2px;
    background: var(--accent-primary);
    flex-shrink: 0;
}

/* ═══ Transfer Rows (Figma 40000385:5963 — column, gap 16px; row:
      padding 12px, gap 12px, bg #1C1C1C, 1px #2E2E2E, radius 8px) ═══ */
.player-transfers {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.player-transfer-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: var(--transition-fast);
}

.player-transfer-card:hover {
    border-color: var(--accent-purple-dark);
}

/* Date column — fixed 88px (Figma layout_66JL1P), 14px muted */
.player-transfer-date {
    flex: 0 0 88px;
    width: 88px;
    font-size: var(--font-size-base);
    line-height: 1.2;
    color: var(--text-muted);
}

/* Body row: from → arrow → fee pill → arrow → to
   (Figma layout_MNNU35 — space-between) */
.player-transfer-body {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.player-transfer-team {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 36px;
    min-width: 0;
    flex: 1;
}

.player-transfer-team--to {
    justify-content: flex-end;
    text-align: end;
}

.player-transfer-team-name {
    font-size: var(--font-size-sm);
    font-weight: 500;
    line-height: 1.5;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.player-transfer-team-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
}

/* arrow-right-double.svg at 18×18 (Figma layout_P8AJMR) */
.player-transfer-arrow {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    display: block;
}

/* Fee pill (Figma layout_HI95IB — 79px, radius 1000px, bg #2D0054;
   two centered lines "Transfer / €3M" at 12px, lh 1.2) */
.player-transfer-fee {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    flex-shrink: 0;
    min-width: 79px;
    padding: 6px 12px;
    background: var(--bg-footer);
    border-radius: 1000px;
    text-align: center;
}

.player-transfer-fee-type,
.player-transfer-fee-amount {
    font-size: var(--font-size-sm);
    line-height: 1.2;
    color: var(--text-white);
    white-space: nowrap;
}

/* ═══ Career History table (kept from previous design, restyled
      to match the new card language) ═══ */
.player-career-table-wrapper {
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow-x: auto;
}

.player-career-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 550px;
}

.player-career-table th {
    padding: 12px 16px;
    text-align: start;
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.player-career-table td {
    padding: 10px 16px;
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
}

.player-career-table tr:last-child td {
    border-bottom: none;
}

.player-career-table tbody tr:hover td {
    background: var(--accent-primary-subtle);
}

.career-team-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.career-team-cell img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.career-stat-highlight {
    font-weight: 600;
    color: var(--text-primary);
}

/* Career totals row (computed from visible rows) */
.player-career-table tfoot .career-total-row td {
    padding: 12px 16px;
    font-weight: 700;
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

/* Empty states */
.player-empty-note {
    color: var(--text-secondary);
    font-size: var(--font-size-base);
    margin: 0;
}

/* ═══ Responsive ═══ */
@media (max-width: 1199.98px) {
    .player-stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .player-hero-number {
        font-size: 160px;
        top: -56px;
    }
}

@media (max-width: 991.98px) {
    .player-hero {
        padding: 20px 28px;
    }
}

@media (max-width: 767.98px) {
    .player-hero {
        min-height: 0;
        padding: 24px 20px;
    }

    .player-hero-number {
        font-size: 120px;
        top: -42px;
    }

    .player-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Transfer rows: date moves to its own line */
    .player-transfer-card {
        flex-wrap: wrap;
    }

    .player-transfer-date {
        flex-basis: 100%;
    }

    .player-transfer-team-name {
        font-size: var(--font-size-xs);
    }
}

@media (max-width: 575.98px) {
    .player-hero-number {
        font-size: 96px;
        top: -34px;
    }

    .player-hero-avatar {
        width: 76px;
        height: 76px;
    }

    /* Info strip: drop hairlines, tighter rhythm */
    .player-hero-info {
        gap: 12px 20px;
    }

    .player-hero-info-sep {
        display: none;
    }

    .player-transfer-arrow {
        width: 16px;
        height: 16px;
    }

    .player-transfer-fee {
        min-width: 70px;
        padding: 5px 10px;
    }

    .player-career-table th,
    .player-career-table td {
        padding: 8px 10px;
    }
}
