/* ─── MBFF Athlete Profile — HLTV-inspired layout ─── */

.body-profile-page main {
    padding-top: 0;
}

.body-profile-page .mobile-header-spacer {
    margin-bottom: 0 !important;
}

.athlete-profile {
    --ap-bg: #fff;
    --ap-card-bg: #fff;
    --ap-border: var(--vr-gray-150);
    --ap-text: var(--vr-gray-900);
    --ap-text-secondary: var(--vr-gray-500);
    --ap-text-muted: var(--vr-gray-400);
    --ap-header-bg: var(--vr-gray-950);
    --ap-header-text: #fff;
    --ap-header-muted: rgba(255,255,255,0.55);
    --ap-accent: var(--vr-theme-color);
    --ap-tab-active: var(--vr-theme-color);
    --ap-stat-bg: var(--vr-gray-75);
    --ap-gold: #C9A84C;
    --ap-silver: #8B95A5;
    --ap-bronze: #A06830;
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* ─── Header (dark) ─── */
.ap-header {
    background: var(--ap-header-bg);
    color: var(--ap-header-text);
    position: relative;
    overflow: hidden;
}
.ap-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        -45deg,
        rgba(255,255,255,0.025) 0,
        rgba(255,255,255,0.025) 1px,
        transparent 1px,
        transparent 10px
    );
    pointer-events: none;
}

.ap-header-inner {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    position: relative;
    padding: 20px 0 0;
}

.ap-photo-col {
    flex-shrink: 0;
    width: 180px;
    position: relative;
}
.ap-photo {
    width: 180px;
    height: 180px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
    background: var(--vr-gray-800);
}
.ap-athlete-code {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: var(--ap-accent);
    color: #111;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 2px 8px;
    border-radius: 2px;
    line-height: 1.5;
}

.ap-identity {
    flex: 1;
    min-width: 0;
    padding-bottom: 16px;
}
.ap-name {
    font-family: "Noto Sans", var(--vr-font-primary), system-ui, sans-serif;
    font-size: clamp(24px, 4vw, 36px);
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1.1;
    margin: 0 0 4px;
    color: #fff;
    text-transform: uppercase;
}
.ap-club-name {
    font-size: 14px;
    color: var(--ap-header-muted);
    margin: 0 0 14px;
}

/* Meta table (like HLTV info rows) */
.ap-info-table {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 16px;
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 16px;
}
.ap-info-label {
    color: var(--ap-header-muted);
    white-space: nowrap;
}
.ap-info-value {
    color: #fff;
    font-weight: 500;
}
.ap-info-value a {
    color: var(--ap-accent) !important;
    text-decoration: none;
}
.ap-info-value a:hover {
    text-decoration: underline;
}

/* Achievement badges row (like HLTV "Player achievements") */
.ap-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}
.ap-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 3px;
    white-space: nowrap;
    line-height: 1.5;
}
.ap-badge-gold {
    background: var(--ap-gold);
    color: #111;
}
.ap-badge-silver {
    background: var(--ap-silver);
    color: #111;
}
.ap-badge-bronze {
    background: var(--ap-bronze);
    color: #fff;
}
.ap-badge-verified {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
}

/* Social + follow row */
.ap-social-row {
    display: flex;
    align-items: center;
    gap: 8px;
    position: absolute;
    top: 20px;
    right: 0;
}
.ap-social-row .link-social {
    width: 34px;
    height: 34px;
    border-radius: 4px;
    background: rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.7) !important;
    transition: background 0.15s, color 0.15s;
}
.ap-social-row .link-social:hover {
    color: #fff !important;
}
.ap-social-row .link-social svg {
    width: 16px;
    height: 16px;
}

.ap-social-row form {
    display: inline;
}
.ap-follow-btn {
    padding: 6px 16px;
    font-size: 13px;
    border-radius: 4px;
}
.ap-stats-card-spaced {
    margin-bottom: 20px;
}
.ap-about-body {
    padding: 14px 16px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--ap-text-secondary);
}
.ap-post-row {
    gap: 12px;
}
.ap-post-link {
    color: var(--ap-text);
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    flex: 1;
    min-width: 0;
}
.ap-post-date {
    font-weight: 400;
    color: var(--ap-text-muted);
    font-size: 12px;
}
.ap-product-img--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ap-text-muted);
}

/* ─── Tabs (like HLTV tab bar) ─── */
.ap-tabs {
    background: var(--ap-header-bg);
    border-top: 1px solid rgba(255,255,255,0.06);
}
.ap-tabs-inner {
    display: flex;
    gap: 0;
    overflow-x: auto;
}
.ap-tab {
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255,255,255,0.5);
    background: none;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.ap-tab:hover {
    color: rgba(255,255,255,0.85);
}
.ap-tab.active {
    color: #fff;
    border-bottom-color: var(--ap-accent);
}

/* ─── Content area ─── */
.ap-content {
    padding: 28px 0;
}
.ap-panel {
    display: none;
}
.ap-panel.active {
    display: block;
}

/* ─── Stats grid (like HLTV statistics) ─── */
.ap-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
.ap-stats-card {
    background: var(--ap-card-bg);
    border: 1px solid var(--ap-border);
    border-radius: 4px;
    overflow: hidden;
}
.ap-stats-header {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 12px 16px;
    border-bottom: 1px solid var(--ap-border);
    color: var(--ap-text);
}

/* Stat rows */
.ap-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    font-size: 13px;
    border-bottom: 1px solid var(--ap-border);
}
.ap-stat-row:last-child {
    border-bottom: 0;
}
.ap-stat-label {
    color: var(--ap-text-secondary);
}
.ap-stat-value {
    font-weight: 700;
    color: var(--ap-text);
    font-variant-numeric: tabular-nums;
}
.ap-stat-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    margin-left: 16px;
}
.ap-stat-bar-fill {
    flex: 1;
    height: 6px;
    background: var(--ap-stat-bg);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}
.ap-stat-bar-fill span {
    display: block;
    height: 100%;
    background: var(--vr-theme-color);
    border-radius: 3px;
}

/* ─── Competition list (like HLTV matches) ─── */
.ap-comp-list {
    background: var(--ap-card-bg);
    border: 1px solid var(--ap-border);
    border-radius: 4px;
    overflow: hidden;
}
.ap-comp-row {
    display: grid;
    grid-template-columns: 56px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--ap-border);
    transition: background 0.1s;
}
.ap-comp-row:last-child {
    border-bottom: 0;
}
.ap-comp-row:hover {
    background: var(--ap-stat-bg);
}
.ap-comp-place {
    width: 42px;
    height: 42px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Noto Sans", var(--vr-font-primary), system-ui, sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #111;
    flex-shrink: 0;
}
.ap-comp-place.gold { background: linear-gradient(135deg, #C9A84C, #E8D48A); }
.ap-comp-place.silver { background: linear-gradient(135deg, #9BA5B3, #C8CED6); }
.ap-comp-place.bronze { background: linear-gradient(135deg, #A06830, #C8956A); color: #fff; }
.ap-comp-place.other { background: var(--vr-gray-125); color: var(--vr-gray-600); }

.ap-comp-info {
    min-width: 0;
}
.ap-comp-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--ap-text);
    margin: 0;
    line-height: 1.3;
}
.ap-comp-name a {
    color: inherit;
    text-decoration: none;
}
.ap-comp-name a:hover {
    color: var(--vr-theme-color) !important;
}
.ap-comp-cat {
    font-size: 12px;
    color: var(--ap-text-muted);
    margin: 2px 0 0;
}
.ap-comp-meta {
    text-align: right;
    white-space: nowrap;
}
.ap-comp-date {
    font-size: 13px;
    font-weight: 600;
    color: var(--ap-text);
    font-variant-numeric: tabular-nums;
}
.ap-comp-loc {
    font-size: 11px;
    color: var(--ap-text-muted);
    margin-top: 2px;
}

/* ─── Upcoming events ─── */
.ap-upcoming-row {
    display: grid;
    grid-template-columns: 56px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--ap-border);
}
.ap-upcoming-row:last-child {
    border-bottom: 0;
}
.ap-upcoming-date {
    text-align: center;
    flex-shrink: 0;
}
.ap-upcoming-date .month {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--vr-theme-color);
    font-weight: 700;
    line-height: 1;
}
.ap-upcoming-date .day {
    font-family: "Noto Sans", var(--vr-font-primary), system-ui, sans-serif;
    font-size: 26px;
    font-weight: 800;
    line-height: 1.1;
    color: var(--ap-text);
}
.ap-upcoming-status {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.ap-upcoming-status.confirmed {
    background: rgba(34,197,94,0.1);
    color: #16a34a;
}
.ap-upcoming-status.pending {
    background: var(--vr-gray-100);
    color: var(--vr-gray-500);
}

/* ─── Products grid ─── */
.ap-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}
.ap-product-card {
    background: var(--ap-card-bg);
    border: 1px solid var(--ap-border);
    border-radius: 4px;
    overflow: hidden;
    transition: box-shadow 0.15s;
    text-align: center;
}
.ap-product-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.ap-product-img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    background: var(--vr-gray-50);
    padding: 12px;
}
.ap-product-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--ap-text);
    padding: 8px 10px 4px;
    line-height: 1.3;
}
.ap-product-brand {
    font-size: 11px;
    color: var(--ap-text-muted);
    padding: 0 10px 10px;
}

/* ─── Gallery (like HLTV pictures) ─── */
.ap-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 6px;
}
.ap-gallery-item {
    aspect-ratio: 4/3;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}
.ap-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.2s;
}
.ap-gallery-item:hover img {
    transform: scale(1.03);
}
.ap-gallery-item .gallery-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 10px 8px;
    background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
    font-size: 11px;
    color: #fff;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.2s;
}
.ap-gallery-item:hover .gallery-label {
    opacity: 1;
}

/* ─── Section headers ─── */
.ap-section-title {
    font-family: "Noto Sans", var(--vr-font-primary), system-ui, sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ap-text);
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.ap-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--ap-border);
}

/* ─── Followers compact ─── */
.ap-followers-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}
.ap-followers-avatars {
    display: flex;
}
.ap-followers-avatars img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--ap-card-bg);
    margin-left: -8px;
    object-fit: cover;
}
.ap-followers-avatars img:first-child {
    margin-left: 0;
}
.ap-followers-count {
    font-size: 13px;
    color: var(--ap-text-secondary);
}

/* ─── Empty state ─── */
.ap-empty {
    padding: 24px 16px;
    text-align: center;
    font-size: 13px;
    color: var(--ap-text-muted);
}

/* ─── Responsive ─── */
@media (max-width: 991.98px) {
    .ap-stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .ap-header-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0;
        padding: 12px 0 0;
    }
    .ap-photo-col {
        width: 140px;
        line-height: 0;
        margin: 0;
    }
    .ap-photo {
        width: 140px;
        height: 140px;
        margin: 0;
    }
    .ap-identity {
        padding-top: 0;
        padding-bottom: 12px;
    }
    .ap-name {
        margin-top: 0;
    }
    .ap-info-table {
        justify-items: center;
    }
    .ap-badges {
        justify-content: center;
    }
    .ap-social-row {
        position: static;
        justify-content: center;
        margin-bottom: 8px;
    }
    .ap-comp-row {
        grid-template-columns: 40px 1fr;
    }
    .ap-comp-meta {
        grid-column: 1 / -1;
        text-align: left;
    }
    .ap-gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}
