/* Player Selection Overlay */
.playerSelectionOverlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

    .playerSelectionOverlay.active {
        opacity: 1;
        visibility: visible;
    }

/* Player Selection Side Panel */
.playerSelectionPanel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 420px;
    max-width: 90vw;
    background: white;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

    .playerSelectionPanel.active {
        transform: translateX(0);
    }

/* Panel Header */
.playerSelectionHeader {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
    position: relative;
}

.playerSelectionBackBtn {
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    color: #1775FF;
    font-size: 2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border-radius: 50%;
    position: absolute;
    left: 1rem;
}

    .playerSelectionBackBtn:hover {
        background-color: #EBF4FF;
    }

.playerSelectionTitle {
    flex: 1;
    text-align: center;
    font-size: 1.8rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
    padding: 0 60px;
    text-align: left;
}

/* Player List */
.playerSelectionList {
    flex: 1;
    overflow-y: auto;
    background: white;
}

/* Player Row */
.playerRow {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 1.2rem 1.5rem;
    min-height: 56px;
    background: white;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

    .playerRow:hover {
        background-color: #f9fafb;
    }

    .playerRow.selected {
        background-color: #EBF4FF;
        position: relative;
    }

        .playerRow.selected::after {
            content: '\f00c';
            font-family: 'Font Awesome 5 Free';
            font-weight: 900;
            position: absolute;
            right: 1.5rem;
            color: #1775FF;
            font-size: 2rem;
        }

    .playerRow.disabled {
        opacity: 0.5;
        cursor: not-allowed;
        pointer-events: none;
        background-color: #f9fafb;
        position: relative;
    }

        .playerRow.disabled::after {
            content: '\f00c';
            font-family: 'Font Awesome 5 Free';
            font-weight: 900;
            position: absolute;
            right: 1.5rem;
            color: #10b981;
            font-size: 2rem;
        }

/* Player Avatar */
.playerAvatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #BFDBFE;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

    .playerAvatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.playerInitials {
    font-size: 1.6rem;
    font-weight: 600;
    color: #1E40AF;
    text-transform: uppercase;
}

/* Player Info */
.playerInfo {
    flex: 1;
    min-width: 0;
    padding-right: 3rem;
    text-align: left;
}

.playerName {
    font-size: 1.6rem;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.3;
}

.playerMeta,
.playerLocation {
    font-size: 1.4rem;
    color: #6b7280;
    margin-bottom: 0.2rem;
    line-height: 1.3;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .playerSelectionPanel {
        width: 100%;
        max-width: 100vw;
    }

    .playerSelectionTitle {
        font-size: 1.6rem;
        padding: 0 50px;
    }

    .playerName {
        font-size: 1.5rem;
    }

    .playerMeta,
    .playerLocation {
        font-size: 1.3rem;
    }

    .playerMeta {
        font-size: 1.2rem;
    }

    .playerAvatar {
        width: 44px;
        height: 44px;
    }

    .playerInitials {
        font-size: 1.5rem;
    }
}

/* Scrollbar Styling */
.playerSelectionList::-webkit-scrollbar {
    width: 6px;
}

.playerSelectionList::-webkit-scrollbar-track {
    background: #f3f4f6;
}

.playerSelectionList::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

    .playerSelectionList::-webkit-scrollbar-thumb:hover {
        background: #9ca3af;
    }

/* Loading State */
.playerSelectionLoading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 0;
}

/* Empty State */
.playerSelectionEmpty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
}

.playerSelectionEmpty.hidden {
    display: none !important;
}

.playerSelectionEmpty i {
    font-size: 6rem;
    color: #e5e7eb;
    margin-bottom: 1rem;
}

.playerSelectionEmpty p {
    font-size: 1.5rem;
    color: #6b7280;
    margin: 0;
}

/* Players Container */
#playerSelectionContainer {
    /* Container for dynamically inserted player rows */
}

/* Prevent body scroll when panel is open */
body.playerSelectionPanelOpen {
    overflow: hidden !important;
}

.player-selection-search-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 1.25rem;
    outline: none;
    transition: border-color 0.2s;
}

.playerSelectionSearchContainer {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.load-more-player-selection-spinner {
    display: none;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.end-of-player-selection-message {
    display: none;
    text-align: center;
    padding: 1.5rem;
    color: #6b7280;
    font-size: 1.25rem;
}