/* ==========================================
   TEAM ROSTER STYLES
   ========================================== */

.roster-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.roster-header {
    text-align: center;
    margin-bottom: 3rem;
}

.team-name-input {
    font-family: 'Tungsten', sans-serif;
    font-size: 3rem;
    font-weight: 700;
    color: var(--accent-red);
    background: transparent;
    border: none;
    border-bottom: 3px solid var(--glass-border);
    text-align: center;
    padding: 0.5rem 1rem;
    width: 100%;
    max-width: 600px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: all 0.3s;
}

.team-name-input:focus {
    outline: none;
    border-bottom-color: var(--accent-red);
    text-shadow: 0 0 10px rgba(255, 70, 85, 0.5);
}

.team-name-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.players-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (min-width: 768px) {
    .players-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1200px) {
    .players-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.player-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.player-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(255, 70, 85, 0.2);
    border-color: rgba(255, 70, 85, 0.5);
}

.player-number {
    font-family: 'Tungsten', sans-serif;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Row that holds the label + remove button for subs */
.player-number-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.player-number-row .player-number {
    margin-bottom: 0;
}

/* Substitute card subtle accent */
.substitute-card {
    border-color: rgba(255, 200, 70, 0.2);
}

.substitute-card .player-number {
    color: rgba(255, 200, 70, 0.8);
}

/* X button to remove a substitute slot */
.remove-sub-btn {
    background: transparent;
    border: 1px solid rgba(255, 70, 85, 0.3);
    border-radius: 50%;
    color: rgba(255, 70, 85, 0.7);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.remove-sub-btn:hover {
    background: rgba(255, 70, 85, 0.15);
    border-color: var(--accent-red);
    color: var(--accent-red);
    transform: scale(1.15);
}

/* Add Substitute card – same sizing as player-card, click to add */
.add-substitute-card {
    border: 2px dashed rgba(255, 255, 255, 0.15);
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.add-substitute-card:hover {
    border-color: rgba(255, 70, 85, 0.6);
    background: rgba(255, 70, 85, 0.05);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(255, 70, 85, 0.15);
}

.add-sub-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    pointer-events: none;
}

.add-sub-icon {
    font-size: 2.5rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.3);
    line-height: 1;
    transition: color 0.3s;
}

.add-sub-label {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.3);
    transition: color 0.3s;
}

.add-substitute-card:hover .add-sub-icon,
.add-substitute-card:hover .add-sub-label {
    color: rgba(255, 70, 85, 0.8);
}

.player-name-input {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    width: 100%;
    margin-bottom: 1rem;
    transition: all 0.3s;
}

.player-name-input:focus {
    outline: none;
    border-color: var(--accent-red);
    background: rgba(0, 0, 0, 0.5);
}

.player-name-input::placeholder {
    color: var(--text-secondary);
}

.agent-pool-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
    display: block;
}

.agent-pool {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    min-height: 60px;
}

.agent-pool-item {
    position: relative;
    width: 50px;
    height: 50px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--glass-border);
    transition: all 0.3s;
    cursor: pointer;
}

.agent-pool-item:hover {
    transform: scale(1.1);
    border-color: var(--accent-red);
    box-shadow: 0 4px 12px rgba(255, 70, 85, 0.4);
}

.agent-pool-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.agent-pool-item .remove-agent {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--accent-red);
    color: white;
    border: none;
    width: 20px;
    height: 20px;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.agent-pool-item:hover .remove-agent {
    opacity: 1;
}

.add-agent-btn {
    width: 50px;
    height: 50px;
    border: 2px dashed var(--glass-border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    font-size: 1.5rem;
    color: var(--text-secondary);
}

.add-agent-btn:hover {
    border-color: var(--accent-red);
    color: var(--accent-red);
    background: rgba(255, 70, 85, 0.1);
    transform: scale(1.05);
}

.add-agent-btn span {
    display: block;
    line-height: 1;
}

.roster-actions {
    text-align: center;
    margin-top: 2rem;
}

/* Agent Selector Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    max-width: 900px;
    width: 90%;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem 2rem 1rem;
    border-bottom: 1px solid var(--glass-border);
    position: relative;
}

.modal-header h2 {
    font-family: 'Tungsten', sans-serif;
    font-size: 2.25rem;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: 0.15em;
    font-weight: 700;
    text-align: center;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    border-radius: 6px;
}

.modal-close:hover {
    background: rgba(255, 70, 85, 0.2);
    color: var(--accent-red);
    transform: scale(1.1);
}

.agent-selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 2rem;
    padding: 2.5rem;
    overflow-y: auto;
    max-height: calc(85vh - 200px);
}

.agent-selector-card {
    aspect-ratio: 3/4;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid var(--glass-border);
    position: relative;
    transition: all 0.3s;
    background: rgba(0, 0, 0, 0.3);
}

.agent-selector-card.selected {
    border-color: var(--accent-red);
    box-shadow: 0 0 20px rgba(255, 70, 85, 0.6);
    transform: scale(0.95);
}

.agent-selector-card.selected::after {
    content: '✓';
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--accent-red);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1rem;
}

.agent-selector-card:hover {
    transform: translateY(-6px);
    border-color: var(--accent-red);
    box-shadow: 0 8px 20px rgba(255, 70, 85, 0.5);
}

.agent-selector-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.agent-selector-card .agent-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.95), rgba(0,0,0,0.7), transparent);
    color: white;
    text-align: center;
    padding: 0.5rem 0.25rem;
    font-size: 0.65rem;
    font-weight: 700; 
    text-transform: uppercase;
    letter-spacing: 0.03em; 
}
