/* AGGRESSIVE SIZE REDUCTION FOR PLAYER PROFILE HERO */

/* Hero section - RELATIVE UNITS ONLY */
.hero-section {
    padding: var(--fs-top-banner-padding-top) 0 0 0 !important;  /* Shared top banner spacing */
    min-height: var(--fs-top-banner-total-height) !important;
    height: var(--fs-top-banner-total-height) !important;
    margin-bottom: 0.25rem !important;  /* Match team-page hero spacing */
    position: relative !important;
    box-sizing: border-box !important;
}

.hero-content {
    gap: 1.5rem !important;
    padding: 0 var(--fs-top-banner-padding-x) !important;
    align-items: flex-end !important;  /* Bottom-align by default to keep image flush */
    min-height: var(--fs-top-banner-content-height) !important;
    height: var(--fs-top-banner-content-height) !important;
    display: flex !important;
}

/* Title row to align name and quick stats on the same y-level */
.player-title-row {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    grid-auto-rows: auto !important;
    align-items: start !important; /* Align tops */
    column-gap: 1.25rem !important;
    row-gap: 0rem !important; /* No extra gap between name and meta */
    width: 100% !important; /* Span full header width */
}

.player-title-row .player-name {
    grid-column: 1 !important;
    grid-row: 1 !important;
    margin: 0 !important;
}

.player-title-row .player-meta-info {
    grid-column: 1 !important;
    grid-row: 2 !important;
    margin-top: 6px !important; /* Bit more spacing below name */
}

.player-title-row .quick-stats {
    grid-column: 2 !important;
    grid-row: 1 / span 2 !important; /* Span both rows */
    align-self: start !important;
    margin-left: 0 !important; /* No auto margin in grid */
}

/* Reduce vertical gap between name and meta line */
/* handled by .player-title-row .player-meta-info below */

/* Player image TRULY FLUSH with bottom - NO PIXELS */
.player-image-container {
    width: var(--fs-top-banner-player-size) !important;
    height: var(--fs-top-banner-player-size) !important;
    max-width: var(--fs-top-banner-player-size) !important;
    max-height: var(--fs-top-banner-player-size) !important;
    margin: 0 !important;  /* No margins at all */
    align-self: flex-end !important;  /* Stick to bottom */
    position: relative !important;
    bottom: 0 !important;  /* Ensure it's at the very bottom */
}

/* Player info header - vertically centered */
.player-info-header {
    align-self: center !important;  /* Center vertically */
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    flex: 1 !important;  /* Take available space */
    /* Center within the full banner (accounts for top padding) */
    transform: translateY(calc(var(--fs-top-banner-padding-top) / -2)) !important;
}

/* Smaller player name and text (scope to hero only so global search cards are unaffected) */
.hero-section .player-name {
    font-size: 2rem !important; /* Larger for prominence */
    line-height: 1.1 !important; /* Tighter to bring meta closer */
}

.player-subtitle {
    font-size: 0.85rem !important;
    margin-top: 0.2rem !important;
}

/* Much smaller stats in hero - centered */
.quick-stats {
    gap: 1rem !important;
    margin-top: 0 !important; /* Avoid extra downward bias */
    align-self: auto !important;  /* Let the title row control alignment */
    padding: 0 !important;
    align-items: center !important; /* Center items horizontally inside the group */
    margin-left: auto !important; /* Anchor the group to the right */
}

/* Mobile: stack name and stats cleanly */
@media (max-width: 768px) {
    .player-title-row {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 0.25rem !important;
    }
}

.hero-section .stat-value {
    font-size: 2.2rem !important; /* Noticeably larger numbers */
}

.hero-section .stat-label {
    font-size: 0.9rem !important; /* Larger labels */
    margin-top: 0 !important;
}

/* Jersey number - RELATIVE UNITS */
.jersey-number {
    width: 2.2rem !important;  /* Relative units */
    height: 2.2rem !important;
    font-size: 0.9rem !important;
    bottom: -0.2rem !important;
    right: -0.2rem !important;
}

/* Ensure bookmark button stays in place */
.bookmark-btn {
    position: absolute !important;
    top: 1rem !important;
    right: 1rem !important;
    z-index: 10 !important;
}

/* Navigation CLOSER to bubble and CENTERED */
.profile-nav {
    padding: 0.5rem 1rem !important; /* Comfortable menu size (do not shrink buttons) */
    margin: 0 auto !important;       /* outer spacing handled by adjacent rules */
    gap: 0.5rem !important;
    display: flex !important;
    align-items: center !important;  /* Center tabs vertically */
    min-height: 3rem !important;  /* Give it height for centering */
    background: #ffffff !important;      /* Ensure visible background */
    border: 1px solid var(--ui-border, #E5E7EB) !important;
    border-radius: 16px !important;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06) !important;
}

/* Explicit adjacent spacing control so gaps are predictable (page-level overrides may refine) */
.hero-section + .profile-nav { margin-top: 4px !important; }
.profile-nav + .tab-content { margin-top: 0 !important; padding-top: 4px !important; }

/* Player page uses the same profile-section spacing rhythm as the team page */
#player-profile {
    gap: var(--home-gap) !important;
}

#player-profile > [data-testid="tabs-menu"] {
    margin-top: 0 !important;
}

#player-profile [data-testid="player-tabs"] {
    margin-top: 0 !important;
    border-radius: 16px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
}

#player-profile [data-testid="player-tabs"]::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 4px !important;
    background: linear-gradient(
        90deg,
        var(--primary-color, var(--team-primary, var(--brand-blue))),
        var(--primary-color, var(--team-primary, var(--brand-blue))),
        var(--primary-color, var(--team-primary, var(--brand-blue)))
    ) !important;
    border-radius: 16px 16px 0 0 !important;
    pointer-events: none !important;
}

/* Nav tabs - RELATIVE UNITS */
.nav-tab {
    padding: 0.75rem 1.25rem !important;
    font-size: 0.85rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 2.5rem !important;
    border-radius: 0.75rem !important;  /* Relative units */
    transition: all 0.3s ease !important;
    background: transparent !important;  /* Remove grey background */
}

/* Active tab - ensure it's centered */
.nav-tab.active {
    background: var(--primary-color) !important;
    color: white !important;
    transform: none !important;  /* Remove any transform that might affect position */
}

/* Align tab content with nav - but allow full width for tables */
.tab-content {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important; /* Let inner tabs set the side padding */
    overflow: hidden !important;
    box-sizing: border-box !important;
}

/* Only constrain width for non-table content */
/* #overview sizing handled in profile-layout-consistent.css */

/* Responsive adjustments - ALL RELATIVE UNITS */
@media (max-width: 768px) {
    .hero-content {
        min-height: var(--fs-top-banner-content-height) !important;
        height: var(--fs-top-banner-content-height) !important;
    }
    
    .player-image-container {
        width: var(--fs-top-banner-player-size) !important;
        height: var(--fs-top-banner-player-size) !important;
        max-width: var(--fs-top-banner-player-size) !important;
        max-height: var(--fs-top-banner-player-size) !important;
    }
    
    .hero-section .player-name {
        font-size: 1.25rem !important;
    }
    
    .hero-content {
        padding: 0 var(--fs-top-banner-padding-x) !important;
    }
    
    .profile-nav {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

@media (max-width: 480px) {
    .hero-content {
        min-height: var(--fs-top-banner-content-height) !important;
        height: var(--fs-top-banner-content-height) !important;
    }
    
    .player-image-container {
        width: var(--fs-top-banner-player-size) !important;
        height: var(--fs-top-banner-player-size) !important;
        max-width: var(--fs-top-banner-player-size) !important;
        max-height: var(--fs-top-banner-player-size) !important;
    }
}

/* Fine-tune spacing handled above; removed duplicate overrides */
