/* =============================================
   Team Management Page Styles
   Mobile-first design
   ============================================= */

/* Page Layout */
.team-management-page {
    min-height: 100vh;
    padding-bottom: 80px;
    background: var(--background);
}

/* Header */
.builder-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--surface);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 50;
}

.back-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background);
    border-radius: var(--radius);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.25rem;
}

.header-info h1 {
    font-size: 1.125rem;
    margin: 0;
}

/* League Filter */
.league-filter {
    display: flex;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.filter-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition);
}

.filter-tab:hover {
    border-color: var(--text-muted);
}

.filter-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Teams Content */
.teams-content {
    padding: var(--spacing-md);
}

/* Teams List */
.teams-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

/* Team Card - Three Column Layout: Sprite | Content | League Ball */
.team-card {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

/* Left Column: Lead Sprite */
.team-lead-sprite {
    width: 56px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.team-lead-sprite img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border-radius: 50%;
    background: var(--background);
}

/* Center Column: Name row + Buttons row */
.team-card-center {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    justify-content: center;
}

/* Row 1: Team Name */
.team-card-top {
    display: flex;
    align-items: center;
    width: 100%;
    justify-content: center;
}

.team-name {
    font-weight: 600;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    text-align: center;
}

/* Row 2: Rating + Action Buttons */
.team-card-bottom {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    flex-wrap: wrap;
}

/* Rating badge - matches .btn .btn-sm sizing exactly */
.team-rating-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: var(--radius);
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    border: none;
}

.team-rating-badge.rating-high {
    background: #dcfce7;
    color: #166534;
}

.team-rating-badge.rating-mid {
    background: #fef3c7;
    color: #92400e;
}

.team-rating-badge.rating-low {
    background: #fee2e2;
    color: #991b1b;
}

/* Right Column: League Ball */
.team-league-col {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* League Ball Images */
.league-ball-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
}

/* Small league images for filter tabs */
.league-ball-img-sm {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

/* Fallback Pokemon Icon */
.pokemon-icon {
    width: 56px;
    height: 56px;
    background: var(--text-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 600;
}

/* Create Team Section */
.create-team-section {
    padding: var(--spacing-md);
    padding-bottom: calc(var(--spacing-md) + 80px);
}

/* Bottom Nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    padding: var(--spacing-sm) 0;
    padding-bottom: max(var(--spacing-sm), env(safe-area-inset-bottom));
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: var(--spacing-xs) var(--spacing-md);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.75rem;
    transition: color var(--transition);
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-item-icon {
    font-size: 1.25rem;
}

/* Responsive */
@media (min-width: 640px) {
    .team-management-page {
        max-width: 600px;
        margin: 0 auto;
    }
}

@media (max-width: 380px) {
    .team-lead-sprite {
        width: 44px;
    }

    .team-lead-sprite img {
        width: 44px;
        height: 44px;
    }

    .pokemon-icon {
        width: 44px;
        height: 44px;
    }

    .league-ball-img {
        width: 32px;
        height: 32px;
    }

    .team-card-bottom .btn {
        font-size: 0.75rem;
        padding: 4px 8px;
    }

    .team-rating-badge {
        padding: 4px 8px;
        font-size: 0.75rem;
    }
}
