/* Player Statistics Page Styles */

/* Search Container */
.search-container {
    position: relative;
    max-width: 500px;
    margin: 0 auto 40px;
}

.search-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #666;
    border-radius: 8px;
    color: #ffffff;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.search-input::placeholder {
    color: #888;
}

.search-input:focus {
    border-color: #ff8c00;
}

.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.98);
    border: 1px solid rgba(255, 140, 0, 0.3);
    border-radius: 0 0 8px 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.search-dropdown.visible {
    display: block;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 5px;
    color: #ffffff;
    text-decoration: none;
    transition: background 0.2s;
    cursor: pointer;
}

.search-result-item:hover {
    background: rgba(255, 140, 0, 0.15);
}

.search-result-item .player-flag {
    height: 30px;
    width: auto;
    flex-shrink: 0;
}

.search-result-name {
    font-size: 1.2rem;
}

.search-no-results {
    padding: 12px 16px;
    color: #888;
    font-size: 0.9rem;
    text-align: center;
}

/* Stats Table Container */
.stats-table-container {
    background: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    padding: 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    max-height: 540px;
    overflow-y: auto;
}

.stats-table-header {
    display: grid;
    padding: 10px;
    background: rgba(10, 15, 20, 0.97);
    border-bottom: 1px solid rgba(255, 140, 0, 0.3);
    font-size: 0.8rem;
    font-weight: 600;
    color: #cdcdcd;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 1;
}

.stats-table-body {
}

.stats-table-row {
    display: grid;
    padding: 8px 10px;
    align-items: center;
    transition: background 0.2s;
}

.stats-table-row:hover {
    background: rgba(255, 255, 255, 0.08);
}

.stats-table-row:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

/* Row cell styles */
.stats-table-row .cell-player {
    display: flex;
    align-items: center;
    gap: 3px;
    overflow: hidden;
}

.stats-table-row .cell-player .player-flag {
    height: 22px;
    width: auto;
    flex-shrink: 0;
}

.stats-table-row .cell-player-name {
    color: #ffffff;
    font-weight: 600;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stats-table-row .cell-player-link {
    text-decoration: none;
    transition: color 0.2s;
}

.stats-table-row .cell-player-link:hover {
    color: #ff8c00;
}

.stats-table-row .cell-value {
    color: #e0e0e0;
    font-size: 0.9rem;
    text-align: center;
}

.stats-table-row .cell-value-highlight {
    color: #ffb700;
    font-weight: 700;
    font-size: 0.95rem;
    text-align: center;
}

.stats-table-row .cell-value-muted {
    color: #666;
    font-size: 0.85rem;
    text-align: center;
}

/* Grid layouts per table */
.prolific-grid {
    grid-template-columns: 60px 1fr 80px;
    gap: 8px;
}

/* Prolific table column alignment */
.prolific-grid > :nth-child(1) { text-align: center; }
.prolific-grid > :nth-child(2) { text-align: left; }
.prolific-grid > :nth-child(3) { text-align: center; }

.multigame-grid {
    grid-template-columns: 1fr 55px 55px 55px 55px 60px;
    gap: 8px;
}

/* Multi-game table column alignment */
.multigame-grid > :nth-child(1) { text-align: left; }
.multigame-grid > :nth-child(2) { text-align: center; }
.multigame-grid > :nth-child(3) { text-align: center; }
.multigame-grid > :nth-child(4) { text-align: center; }
.multigame-grid > :nth-child(5) { text-align: center; }
.multigame-grid > :nth-child(6) { text-align: center; }

.career-grid {
    grid-template-columns: 1fr 70px 70px 70px 70px;
    gap: 8px;
}

/* career table column alignment */
.career-grid > :nth-child(1) { text-align: left; }
.career-grid > :nth-child(2) { text-align: center; }
.career-grid > :nth-child(3) { text-align: center; }
.career-grid > :nth-child(4) { text-align: center; }
.career-grid > :nth-child(5) { text-align: center; }

.rising-grid {
    grid-template-columns: 1fr 100px 100px;
    gap: 8px;
}

/* Rising stars table column alignment */
.rising-grid > :nth-child(1) { text-align: left; }
.rising-grid > :nth-child(2) { text-align: center; }
.rising-grid > :nth-child(3) { text-align: center; }

.dominant-grid {
    grid-template-columns: 70px 1fr 100px 70px;
    gap: 8px;
}

/* Dominant table column alignment */
.dominant-grid > :nth-child(1) { text-align: center; }
.dominant-grid > :nth-child(2) { text-align: left; }
.dominant-grid > :nth-child(3) { text-align: center; }
.dominant-grid > :nth-child(4) { text-align: center; }

/* Sections inside dual panels should not add bottom margin */
.stats-dual-panel .stats-section {
    margin-bottom: 0;
}

/* Dominant table centered (alone on its row) */
.dominant-table-centered {
    max-width: 600px;
    margin: 0 auto;
}

.dominant-table-centered .stats-table-header {
    padding: 10px;
}

/* Leaderboard section overrides for this page */
.stats-section .leaderboard-list {
    background: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

/* Responsive Design */
@media (max-width: 768px) {
    .page-title {
        font-size: 1.4rem;
    }

    .search-container {
        max-width: 100%;
    }

    .stats-table-header,
    .stats-table-row {
        padding: 8px 10px;
        font-size: 0.8rem;
    }

    .stats-table-row .cell-player-name {
        font-size: 0.8rem;
    }

    .stats-table-row .cell-player .player-flag {
        height: 16px;
    }

    .multigame-grid {
        grid-template-columns: 1fr 45px 45px 45px 45px 50px;
        gap: 4px;
    }

    .career-grid {
        grid-template-columns: 1fr 55px 55px 50px 55px;
        gap: 4px;
    }

    .rising-grid {
        grid-template-columns: 1fr 75px 75px;
        gap: 4px;
    }

    .dominant-grid {
        grid-template-columns: 55px 1fr 80px 55px;
        gap: 4px;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 1.2rem;
    }

    .stats-table-header {
        font-size: 0.7rem;
        padding: 6px 8px;
    }

    .stats-table-row {
        padding: 6px 8px;
        border-left-width: 3px;
    }

    .stats-table-row .cell-player-name {
        font-size: 0.75rem;
    }

    .stats-table-row .cell-value,
    .stats-table-row .cell-value-highlight {
        font-size: 0.8rem;
    }

    .multigame-grid {
        grid-template-columns: 1fr 35px 35px 35px 35px 40px;
    }

    .career-grid {
        grid-template-columns: 1fr 45px 45px 40px 45px;
    }

    .dominant-grid {
        grid-template-columns: 45px 1fr 70px 45px;
    }
}
