﻿/* ============================================================
   Player.css — Player page styles (unified desktop + mobile)
   ============================================================ */

/* --- Loading / Error States --- */
.player-loading {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.player-error {
    text-align: center;
    padding: 60px 20px;
    display: none;
}

    .player-error h4 {
        color: #333;
    }

    .player-error p {
        color: #666;
    }

/* --- Header --- */
.player-header {
    background-color: white;
    padding: 0;
    overflow: hidden;
}

.player-header-gradient {
    padding: 20px 0 0 0;
}

.player-header-content {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
}

.player-header-left {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.player-team-logo {
    border: 3px solid #ccc;
    background-color: white;
    max-height: 100px;
}

.player-sport-logo {
    border: 3px solid #ccc;
    background-color: white;
    max-height: 80px;
}

.player-name {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: #111;
}

.player-jersey-badge {
    display: inline-block;
    background-color: #e7f1ff;
    color: #0d6efd;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    margin-right: 6px;
    vertical-align: middle;
}

.player-subtitle {
    color: #555;
    margin-top: 4px;
    font-size: 0.95rem;
}

.player-back-row {
    text-align: right;
    padding: 10px 0;
}

/* --- Stat Tiles (career + season totals) --- */
.player-stat-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    gap: 8px;
}

.player-stat-tile {
    background-color: #e9ecef;
    border-radius: 6px;
    padding: 10px 4px;
    text-align: center;
    border: 1px solid #dee2e6;
}

    .player-stat-tile .stat-label {
        font-size: 0.7rem;
        color: #888;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-bottom: 2px;
    }

    .player-stat-tile .stat-value {
        font-size: 1.25rem;
        font-weight: 600;
        color: #111;
    }

.player-stat-tile-lg .stat-value {
    font-size: 1.4rem;
}

/* --- Season Card --- */
.player-season-card {
    border: 3px solid #ccc;
    border-radius: 6px;
    background: white;
    margin-bottom: 20px;
    overflow: hidden;
}

.player-season-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    padding: 10px 16px;
    font-weight: 700;
    font-size: 1rem;
    color: white;
    border-radius: 4px 4px 0 0;
    display: flex;
    align-items: center;
}

.player-season-body {
    padding: 16px;
}

.player-section-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #888;
    margin-bottom: 8px;
}

/* --- Game Log Table --- */
.player-game-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

    .player-game-table thead th {
        text-align: center;
        padding: 6px 4px;
        color: #666;
        font-weight: 600;
        font-size: 0.75rem;
        text-transform: uppercase;
        border-bottom: 2px solid #dee2e6;
    }

        .player-game-table thead th:first-child,
        .player-game-table thead th:nth-child(2) {
            text-align: left;
        }

    .player-game-table tbody td {
        padding: 7px 4px;
        text-align: center;
        border-bottom: 1px solid #f0f0f0;
    }

        .player-game-table tbody td:first-child {
            text-align: left;
            color: #888;
            font-size: 0.8rem;
        }

        .player-game-table tbody td:nth-child(2) {
            text-align: left;
        }

    .player-game-table tbody tr:nth-child(even) {
        background-color: cornsilk;
    }

/* --- Result Badges --- */
.result-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.result-win {
    background-color: #d1eddb;
    color: #0f5132;
}

.result-loss {
    background-color: #f8d7da;
    color: #842029;
}

.result-tie {
    background-color: #fff3cd;
    color: #664d03;
}

/* --- Horizontal scroll for wide tables on narrow screens --- */
.table-scroll-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ============================================================
   Responsive — Mobile
   ============================================================ */
@media (max-width: 576px) {
    .player-name {
        font-size: 1.25rem;
    }

    .player-team-logo {
        max-height: 60px;
    }

    .player-sport-logo {
        max-height: 50px;
        display: none;
    }

    .player-stat-tile .stat-value {
        font-size: 1.05rem;
    }

    .player-stat-tile .stat-label {
        font-size: 0.6rem;
    }

    .player-stat-tiles {
        grid-template-columns: repeat(auto-fit, minmax(55px, 1fr));
        gap: 5px;
    }

    .player-stat-tile {
        padding: 6px 2px;
    }

    .player-game-table {
        font-size: 0.75rem;
    }

        .player-game-table thead th {
            font-size: 0.65rem;
            padding: 4px 2px;
        }

        .player-game-table tbody td {
            padding: 5px 2px;
        }

    .player-season-body {
        padding: 10px;
    }

    .player-back-row {
        padding: 6px 0;
    }
}
