/* Team Selection Modal Styles */

.team-selection-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.team-selection-overlay.show {
    opacity: 1;
}

.team-selection-container {
    background: white;
    border-radius: 16px;
    width: 90vw;
    max-width: 1200px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.team-selection-overlay.show .team-selection-container {
    transform: translateY(0);
}

.team-selection-header {
    background: linear-gradient(135deg, var(--club-primary, #667eea) 0%, var(--club-secondary, #764ba2) 100%);
    color: white;
    padding: 24px 32px;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.team-selection-title h2 {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 600;
}

.team-selection-title p {
    margin: 4px 0;
    opacity: 0.9;
    font-size: 16px;
}

.team-selection-title .game-date {
    font-size: 14px;
    opacity: 0.8;
}

.team-selection-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.team-selection-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.team-selection-body {
    flex: 1;
    padding: 32px;
    overflow: hidden;
}

.selection-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    height: 100%;
}

.players-column,
.team-column {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.players-column h3,
.team-column h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.players-search {
    margin-bottom: 16px;
}

.players-search input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.players-search input:focus {
    outline: none;
    border-color: var(--club-primary, #667eea);
}

.available-players {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    padding-right: 8px;
}

.available-players::-webkit-scrollbar {
    width: 6px;
}

.available-players::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.available-players::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.available-players::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.player-card {
    display: flex;
    align-items: center;
    padding: 12px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: grab;
    transition: all 0.2s ease;
    user-select: none;
}

.player-card:hover {
    border-color: var(--club-primary, #667eea);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.player-card.dragging {
    opacity: 0.5;
    cursor: grabbing;
    transform: rotate(5deg);
}

.player-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
    overflow: hidden;
    background: var(--club-primary, #667eea);
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.player-initials {
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.player-info {
    flex: 1;
}

.player-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
}

.player-details {
    font-size: 12px;
    color: #6c757d;
}

.team-formation {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
}

.position-slot {
    display: flex;
    align-items: center;
    gap: 16px;
}

.position-label {
    width: 80px;
    font-weight: 600;
    color: #333;
    text-align: right;
}

.position-drop-zone {
    flex: 1;
    min-height: 60px;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
}

.position-drop-zone[data-empty="true"] {
    background: #f8f9fa;
}

.position-drop-zone.drag-over {
    border-color: var(--club-primary, #667eea);
    background: rgba(102, 126, 234, 0.1);
    border-style: solid;
}

.empty-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #6c757d;
    font-size: 14px;
}

.empty-slot i {
    font-size: 20px;
    opacity: 0.5;
}

.selected-player-card {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: linear-gradient(135deg, var(--club-primary, #667eea)15, var(--club-secondary, #764ba2)15);
    border-radius: 6px;
    width: 100%;
    position: relative;
}

.selected-player-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 10px;
    overflow: hidden;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.selected-player-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.selected-player-initials {
    color: var(--club-primary, #667eea);
    font-weight: 600;
    font-size: 12px;
}

.selected-player-info {
    flex: 1;
}

.selected-player-name {
    font-weight: 600;
    color: white;
    font-size: 14px;
}

.remove-player-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #dc3545;
    border: none;
    color: white;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.remove-player-btn:hover {
    background: #c82333;
}

.team-stats {
    margin-top: 16px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    text-align: center;
    font-size: 14px;
    color: #6c757d;
}

.team-stats #selectedCount {
    font-weight: 600;
    color: var(--club-primary, #667eea);
}

.team-selection-footer {
    padding: 24px 32px;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-radius: 0 0 16px 16px;
}

.team-selection-footer .btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .team-selection-container {
        width: 95vw;
        max-height: 95vh;
    }
    
    .team-selection-header {
        padding: 20px;
    }
    
    .team-selection-body {
        padding: 20px;
    }
    
    .selection-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .team-selection-footer {
        padding: 20px;
        flex-wrap: wrap;
    }
    
    .team-selection-footer .btn {
        flex: 1;
        min-width: 120px;
    }
    
    .position-slot {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .position-label {
        width: auto;
        text-align: left;
        font-size: 14px;
    }
}

/* Animation for drag feedback */
@keyframes dragPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.position-drop-zone.drag-over {
    animation: dragPulse 0.6s ease-in-out infinite;
}