/**
 * All of the CSS for your public-facing functionality should be
 * included in this file.
 */

/* =============================================================
   Player Detail View (shared across roster templates)
   ============================================================= */

/* ---- Player detail root — font cascades to all children ---- */
.pp-player-detail {
    font-family: var(--pp-pd-font-family, inherit);
}

/* ---- Loading / error states ---- */
.pp-player-loading,
.pp-player-error {
    padding: 60px 20px;
    text-align: center;
    font-size: 1.1rem;
    color: #555;
}

.pp-loading-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 3px solid #ccc;
    border-top-color: var(--pp-pd-accent, #2a8fa8);
    border-radius: 50%;
    animation: pp-spin 0.7s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes pp-spin {
    to { transform: rotate(360deg); }
}

/* ---- Hero banner ---- */
.pp-player-hero {
    position: relative;
    width: 100%;
    height: 320px;
    background-size: cover;
    background-position: top center;
    overflow: hidden;
}

.pp-player-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.25) 0%,
        rgba(0, 0, 0, 0.65) 100%
    );
}

/* ---- Headshot inset (bottom-left) ---- */
.pp-player-headshot-wrap {
    position: absolute;
    bottom: 0;
    left: 20px;
    width: 130px;
    height: 173px; /* ~3:4 ratio */
    overflow: hidden;
    border: 3px solid #fff;
    background: #d8d8d8;
    z-index: 2;
}

.pp-player-headshot {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
}

/* ---- Player name / number (bottom of hero) ---- */
.pp-player-identity {
    position: absolute;
    bottom: 16px;
    left: 170px;
    right: 16px;
    z-index: 2;
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}

.pp-player-number {
    font-size: 2.8rem;
    font-weight: 900;
    color: #fff;
    line-height: 1;
    opacity: 0.9;
}

.pp-player-name {
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
    text-transform: uppercase;
    line-height: 1.1;
}

.pp-player-pos-badge {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #fff;
    background: var(--pp-pd-accent, #2a8fa8);
    padding: 3px 8px;
    border-radius: 3px;
    white-space: nowrap;
}

/* ---- Body area ---- */
.pp-player-body {
    background: var(--pp-pd-body-bg, #f0f0f0);
    padding: 16px 20px 32px;
}

/* ---- Back link ---- */
.pp-player-back-btn {
    display: inline-block;
    margin-bottom: 16px;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--pp-pd-accent, #2a8fa8);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pp-player-back-btn:hover {
    text-decoration: underline;
}

/* ---- Tab bar ---- */
.pp-player-tabs-bar {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid #ddd;
    margin-bottom: 20px;
}

.pp-player-tab {
    background: none;
    border: none;
    padding: 10px 18px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    color: #666;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
}

.pp-player-tab:hover {
    color: var(--pp-pd-accent, #2a8fa8);
}

.pp-player-tab.pp-tab-active {
    color: var(--pp-pd-accent, #2a8fa8);
    border-bottom-color: var(--pp-pd-accent, #2a8fa8);
}

/* ---- Tab panels ---- */
.pp-player-tab-panel {
    display: none;
}

.pp-player-tab-panel.pp-panel-active {
    display: block;
}

/* ---- Bio grid ---- */
.pp-bio-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    overflow: hidden;
}

.pp-bio-row {
    display: flex;
    flex-direction: column;
    padding: 10px 14px;
    border-bottom: 1px solid #f0f0f0;
}

.pp-bio-row:nth-last-child(-n+2) {
    border-bottom: none;
}

.pp-bio-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--pp-pd-accent, #2a8fa8);
    margin-bottom: 3px;
}

.pp-bio-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a1a1a;
}

@media (max-width: 600px) {
    .pp-bio-grid {
        grid-template-columns: 1fr;
    }
    .pp-bio-row:last-child {
        border-bottom: none;
    }
}

/* ---- Stats ---- */
.pp-stats-wrap {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    padding: 16px;
}

.pp-stats-heading {
    font-size: 1rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--pp-pd-accent, #2a8fa8);
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.pp-stats-table-wrap {
    overflow-x: auto;
}

.pp-player-stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.pp-player-stats-table th {
    padding: 8px 12px;
    text-align: center;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #666;
    border-bottom: 2px solid #e5e5e5;
    white-space: nowrap;
}

.pp-player-stats-table td {
    padding: 10px 12px;
    text-align: center;
    color: #1a1a1a;
    font-weight: 600;
    border-bottom: 1px solid #f0f0f0;
}

/* ---- No-data / placeholder text ---- */
.pp-no-stats,
.pp-coming-soon {
    color: #888;
    font-size: 0.9rem;
    padding: 20px 0;
}

/* ---- Responsive adjustments ---- */
@media (max-width: 600px) {
    .pp-player-hero {
        height: 260px;
    }

    .pp-player-headshot-wrap {
        width: 90px;
        height: 120px;
    }

    .pp-player-identity {
        left: 120px;
        bottom: 12px;
        gap: 8px;
    }

    .pp-player-number {
        font-size: 2rem;
    }

    .pp-player-name {
        font-size: 1.3rem;
    }
}
