/**
 * Baseball Roster Frontend Styles - Position List View (Dodgers Style)
 * Optimized for Mobile
 */

/* Container */
.roster-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    background: white;
}

/* Main Title */
.roster-main-title {
    font-size: 2.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 40px;
    padding-bottom: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Position Groups */
.position-group {
    margin-bottom: 50px;
}

.position-group-header {
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #6b7280;
    letter-spacing: 0.08em;
    padding: 14px 20px;
    background: #e5e7eb;
    border-radius: 8px 8px 0 0;
    margin-bottom: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.position-group-cards {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Player Cards */
.player-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-top: none;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
    position: relative;
    min-width: 0;
}

.player-card:last-child {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.player-card:hover {
    background-color: #fafafa;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.player-card.inactive-player {
    opacity: 0.75;
    border-left: 4px solid #dc3232;
}

/* Left Side - Photo + Details */
.player-photo-container {
    position: relative;
    flex-shrink: 0;
    margin-right: 20px;
}

.player-photo {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, #9E1B32, #c41e3a);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

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

.jersey-number {
    display: none; /* Hidden - number already shown next to player name */
}

/* Player Info */
.player-info {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
    min-width: 0;
}

.player-details {
    flex: 1;
    min-width: 0;
}

.player-name {
    font-size: 1.375rem;
    font-weight: 700;
    color: #9E1B32;
    margin-bottom: 10px;
    cursor: pointer;
    transition: color 0.2s ease;
    line-height: 1.2;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.player-name:hover {
    color: #7a1426;
}

/* Badges */
.player-badges {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.badge {
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.position-badge {
    background: #dbeafe;
    color: #1e40af;
}

.class-badge {
    background: #fce7f3;
    color: #9f1239;
}

.inactive-badge {
    background: #dc3232 !important;
    color: white !important;
}

/* Stats */
.player-stats {
    display: flex;
    gap: 24px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.stat-group {
    font-size: 0.875rem;
    color: #666;
    white-space: nowrap;
}

.stat-group .label {
    font-weight: 600;
    margin-right: 6px;
    color: #333;
}

/* Right Side - Location + Button */
.player-location {
    text-align: right;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    min-width: 200px;
}

.location-city {
    font-weight: 700;
    font-size: 1.0625rem;
    color: #1f2937;
    margin-bottom: 2px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.location-school {
    font-size: 0.9375rem;
    color: #6b7280;
    margin-bottom: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 10px 24px;
    border-radius: 6px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.btn-primary {
    background: linear-gradient(135deg, #9E1B32, #7a1426);
    color: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(158, 27, 50, 0.3);
    color: white;
    text-decoration: none;
}

/* Bio Modal */
.bio-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 3000;
    backdrop-filter: blur(5px);
}

.bio-modal-content {
    background: white;
    margin: 50px auto;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.bio-header {
    background: linear-gradient(135deg, #9E1B32 0%, #7a1426 100%);
    color: white;
    padding: 25px;
    position: relative;
}

.bio-header-content {
    display: flex;
    gap: 20px;
    align-items: center;
}

.bio-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    border: 3px solid rgba(255,255,255,0.3);
    position: relative;
    flex-shrink: 0;
    overflow: hidden;
}

.bio-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bio-details h2 {
    font-size: 1.8em;
    margin-bottom: 8px;
    font-weight: 800;
}

.bio-badges {
    display: flex;
    gap: 10px;
    margin: 10px 0;
    flex-wrap: wrap;
}

.bio-badge {
    background: rgba(255,255,255,0.2);
    padding: 4px 12px;
    border-radius: 15px;
    font-weight: 600;
    font-size: 0.85em;
    backdrop-filter: blur(10px);
}

.close-bio-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 20px;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.close-bio-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: rotate(90deg);
}

.bio-content {
    padding: 25px;
}

.bio-section {
    margin-bottom: 20px;
}

.bio-section h3 {
    color: #9E1B32;
    font-size: 1.1em;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 15px 0;
}

.stat-card {
    background: #f8f9fa;
    padding: 12px 8px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #e0e0e0;
}

.stat-value {
    font-size: 1.1em;
    font-weight: 700;
    color: #9E1B32;
    margin-bottom: 4px;
    display: block;
}

.stat-name {
    color: #666;
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

/* MOBILE RESPONSIVE - Optimized for phones */
@media (max-width: 768px) {
    .roster-container {
        padding: 15px;
    }
    
    .roster-main-title {
        font-size: 1.75rem;
        margin-bottom: 30px;
        padding-bottom: 15px;
    }
    
    .position-group {
        margin-bottom: 35px;
    }
    
    .position-group-header {
        padding: 12px 16px;
        font-size: 0.75rem;
    }
    
    /* Stack player card vertically on mobile */
    .player-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px 16px;
        gap: 16px;
    }
    
    /* Photo container stays at top */
    .player-photo-container {
        margin-right: 0;
        align-self: flex-start;
    }
    
    .player-photo {
        width: 60px;
        height: 60px;
        font-size: 20px;
    }
    
    .jersey-number {
        min-width: 26px;
        height: 26px;
        font-size: 0.75rem;
        bottom: -4px;
        right: -4px;
    }
    
    /* Info section takes full width */
    .player-info {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .player-details {
        width: 100%;
    }
    
    .player-name {
        font-size: 1.25rem;
    }
    
    .player-badges {
        margin-bottom: 10px;
    }
    
    .player-stats {
        gap: 16px;
        margin-top: 6px;
    }
    
    /* Location section full width, left-aligned on mobile */
    .player-location {
        width: 100%;
        text-align: left;
        align-items: flex-start;
        min-width: 0;
    }
    
    .location-city {
        font-size: 1rem;
    }
    
    .location-school {
        font-size: 0.875rem;
        margin-bottom: 12px;
    }
    
    .action-buttons {
        width: 100%;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Modal adjustments for mobile */
    .bio-modal-content {
        margin: 20px 10px;
        width: calc(100% - 20px);
        max-height: 90vh;
    }
    
    .bio-header {
        padding: 20px;
    }
    
    .bio-header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .bio-photo {
        width: 70px;
        height: 70px;
        font-size: 20px;
    }
    
    .bio-details h2 {
        font-size: 1.5em;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .bio-content {
        padding: 20px 16px;
    }
}

/* Extra small phones */
@media (max-width: 375px) {
    .roster-main-title {
        font-size: 1.5rem;
    }
    
    .player-name {
        font-size: 1.125rem;
    }
    
    .player-stats {
        flex-direction: column;
        gap: 8px;
    }
}