/*
 * profile.css
 * Page-specific styles for the root profile.php (public player profiles page).
 * Self-contained, matching the brand tokens and breadcrumb/footer patterns
 * already established in seasonal.css.
 */

:root {
    --pp-dark: #0a1a17;
    --pp-dark-2: #112922;
    --pp-felt: #0d7a4a;
    --pp-felt-light: #15a060;
    --pp-gold: #d4a843;
    --pp-gold-light: #e6c06a;
    --pp-cream: #f4efe3;
    --pp-cream-dark: #e8dfcd;
    --pp-red: #b71c1c;
    --pp-bg: #f5f3ef;
    --card-shadow: 0 2px 12px rgba(0,0,0,0.06);
    --card-shadow-hover: 0 8px 30px rgba(0,0,0,0.1);
}
* { box-sizing: border-box; }
html, body { overflow-x: hidden; max-width: 100%; }
html { overflow-y: scroll; scrollbar-width: none; -ms-overflow-style: none; }
html::-webkit-scrollbar { display: none; width: 0; background: transparent; }
body {
    font-family: 'Poppins', system-ui, sans-serif;
    color: #222;
    background: var(--pp-bg);
    margin: 0;
    padding-top: 60px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ─── BREADCRUMB HEADER ─── */
.pp-navbar {
    background: var(--pp-dark);
    padding: 12px 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    transition: transform .3s ease;
}
.pp-navbar.nav-hidden { transform: translateY(-100%); }

.breadcrumb-inner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 40px;
}
.breadcrumb-back {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid rgba(244,239,227,0.22);
    background: rgba(244,239,227,0.06);
    color: var(--pp-cream);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all .2s;
}
.breadcrumb-back:hover { border-color: var(--pp-gold); color: var(--pp-gold-light); }
.breadcrumb-title {
    flex: 1;
    min-width: 0;
    margin: 0;
    color: var(--pp-cream);
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.3rem;
    letter-spacing: 0.4px;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#mainContent {
    padding-top: 32px;
    padding-bottom: 40px;
    max-width: 100%;
    padding-left: 40px;
    padding-right: 40px;
    flex: 1 0 auto;
    width: 100%;
}
.footer { flex-shrink: 0; }
.view-detail { display: none; }
.view-list { display: block; }

/* ─── FOOTER ─── */
.footer {
    background: var(--pp-dark);
    color: rgba(244,239,227,0.6);
    padding: 32px 0;
    text-align: center;
}
.footer a { color: rgba(244,239,227,0.6); text-decoration: none; }
.footer a:hover { color: var(--pp-gold); }

/* ─── ROSTER TOOLBAR + SEARCH ─── */
.roster-toolbar { margin-bottom: 22px; }
.roster-search {
    position: relative;
    max-width: 360px;
}
.roster-search i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    font-size: 0.85rem;
}
.roster-search input {
    width: 100%;
    padding: 10px 14px 10px 38px;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
    background: white;
    font-family: 'Poppins', sans-serif;
    font-size: 0.88rem;
    outline: none;
    transition: border-color .2s;
}
.roster-search input:focus { border-color: var(--pp-felt); }

/* ─── PLAYER ROSTER GRID ─── */
.player-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
}
.player-card {
    background: white;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    padding: 24px 18px;
    text-align: center;
    cursor: pointer;
    transition: transform .2s, box-shadow .2s;
}
.player-card:hover { transform: translateY(-4px); box-shadow: var(--card-shadow-hover); }
.player-card-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 14px;
    display: block;
    border: 3px solid var(--pp-cream-dark);
}
.player-card-avatar-fallback {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    margin: 0 auto 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--pp-felt), var(--pp-felt-light));
    color: #fff;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.5rem;
    letter-spacing: 1px;
}
.player-card-name {
    font-weight: 700;
    color: var(--pp-dark);
    font-size: 0.95rem;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.player-card-meta { font-size: 0.7rem; color: #999; margin-bottom: 16px; }
.player-card-stats {
    display: flex;
    justify-content: center;
    gap: 18px;
    padding-top: 14px;
    border-top: 1px solid #f0f0f0;
}
.player-card-stats .pstat { text-align: center; }
.player-card-stats .pstat .n {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.25rem;
    color: var(--pp-felt);
    line-height: 1;
}
.player-card-stats .pstat .l {
    font-size: 0.58rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #aaa;
    margin-top: 3px;
}

/* ─── PLAYER HERO (profile detail) ─── */
.player-hero {
    position: relative;
    background: linear-gradient(160deg, #0a1a17 0%, #0d3d2a 60%, #0f5538 100%);
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 24px;
}
.player-hero-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 32px 40px 26px;
    color: var(--pp-cream);
}
.player-avatar-wrap { flex-shrink: 0; }
.player-hero-avatar {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid rgba(244,239,227,0.25);
    display: block;
}
.player-hero-initials {
    display: none;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    background: rgba(244,239,227,0.1);
    border: 4px solid rgba(244,239,227,0.25);
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2.2rem;
    color: var(--pp-cream);
}
.player-hero.no-avatar .player-hero-avatar { display: none; }
.player-hero.no-avatar .player-hero-initials { display: flex; }
.player-hero-body { min-width: 0; flex: 1; }
.player-hero-badge { display: inline-flex; margin-bottom: 8px; }
.player-hero-name {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    line-height: 1.1;
    margin: 0 0 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.player-hero-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.player-hero-tags .tag {
    background: rgba(244,239,227,0.1);
    border: 1px solid rgba(244,239,227,0.2);
    color: rgba(244,239,227,0.85);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.player-hero-tags .tag i { color: var(--pp-gold-light); }

.card-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 11px;
    border-radius: 20px;
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.card-badge.active { background: rgba(40,167,69,0.92); color: #fff; }
.card-badge.inactive { background: rgba(244,239,227,0.15); color: rgba(244,239,227,0.7); }

.player-hero-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    background: rgba(5,14,12,0.55);
    border-top: 1px solid rgba(244,239,227,0.14);
}
.player-hero-stats .stat {
    text-align: center;
    padding: 16px 8px;
    border-left: 1px solid rgba(244,239,227,0.1);
}
.player-hero-stats .stat:first-child { border-left: none; }
.player-hero-stats .stat .num {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.5rem;
    color: var(--pp-cream);
    line-height: 1;
}
.player-hero-stats .stat .label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(244,239,227,0.55);
    margin-top: 5px;
}

/* ─── PROFILE SECTIONS ─── */
.profile-section {
    background: white;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    padding: 24px;
    margin-bottom: 24px;
}
.section-heading {
    font-family: 'Bebas Neue', sans-serif;
    letter-spacing: 0.5px;
    font-size: 1.15rem;
    color: var(--pp-dark);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-heading i { color: var(--pp-felt); font-size: 0.95rem; }

/* form strip */
.form-strip { display: flex; gap: 8px; flex-wrap: wrap; }
.form-pill {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 0.95rem;
    color: #fff;
}
.form-pill.win { background: #28a745; }
.form-pill.loss { background: #dc3545; }
.form-pill.draw { background: #999; }

/* recent matches list */
.pm-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}
.pm-row:last-child { border-bottom: none; }
.pm-result {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.8rem;
    color: #fff;
    flex-shrink: 0;
}
.pm-result.W { background: #28a745; }
.pm-result.L { background: #dc3545; }
.pm-result.D { background: #999; }
.pm-info { flex: 1; min-width: 0; }
.pm-opponent {
    font-weight: 600;
    color: var(--pp-dark);
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pm-meta { font-size: 0.72rem; color: #999; margin-top: 2px; }
.pm-score {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.15rem;
    color: var(--pp-felt);
    flex-shrink: 0;
}

/* tournament history list */
.th-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid #f0f0f0;
}
.th-row:last-child { border-bottom: none; }
.th-media {
    width: 54px;
    height: 54px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--pp-felt), var(--pp-dark-2));
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(244,239,227,0.3);
}
.th-media img { width: 100%; height: 100%; object-fit: cover; }
.th-info { flex: 1; min-width: 0; }
.th-name {
    font-weight: 600;
    color: var(--pp-dark);
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.th-meta { font-size: 0.72rem; color: #999; margin-top: 2px; }
.th-record { text-align: right; flex-shrink: 0; }
.th-record .wl { font-family: 'Bebas Neue', sans-serif; font-size: 1.1rem; color: var(--pp-felt); }
.th-champion {
    color: var(--pp-gold);
    font-size: 0.64rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 2px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

/* empty / loading states */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: #999;
}
.empty-state i { font-size: 2.4rem; color: #ddd; margin-bottom: 12px; display: block; }
.empty-state h3 { font-size: 1.1rem; color: #666; margin: 0 0 6px; }
.empty-state p { font-size: 0.85rem; margin: 0; }

/* skeleton loading */
.skeleton { background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%); background-size: 200% 100%; animation: pp-shimmer 1.4s infinite; border-radius: 6px; }
@keyframes pp-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-card { height: 190px; }

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
    #mainContent { padding-left: 16px; padding-right: 16px; }
    .roster-search { max-width: 100%; }
    .breadcrumb-inner { padding: 0 16px; }
    .breadcrumb-title { font-size: 1.1rem; }

    .player-hero-inner { flex-direction: column; text-align: center; padding: 28px 20px 20px; }
    .player-hero-tags { justify-content: center; }
    .player-hero-name { -webkit-line-clamp: 3; }
    .player-hero-stats .stat { padding: 12px 4px; }
    .player-hero-stats .stat .num { font-size: 1.25rem; }
    .player-hero-stats .stat .label { font-size: 0.54rem; }

    .profile-section { padding: 18px; }
}

@media (max-width: 576px) {
    .player-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
    .player-card { padding: 18px 12px; }
    .player-hero-avatar, .player-hero-initials { width: 84px; height: 84px; }
    .th-media { width: 44px; height: 44px; }
}
