/* =====================================================
   Teams Page - Expandable Team Cards with Players
   ===================================================== */

/* Team Card Container */
.team-card-expandable {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    border: 2px solid transparent;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.team-card-expandable::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--secondary-color) 0%, transparent 100%);
    opacity: 0.1;
    border-radius: 0 15px 0 100%;
}

.team-card-expandable:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(234, 88, 12, 0.15);
    overflow: visible;
}

/* Team Card Header */
.team-card-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.team-logo-container {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.team-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 10px;
}

.team-logo-fallback {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2.5rem;
    box-shadow: 0 5px 15px rgba(234, 88, 12, 0.3);
}

.team-info-header {
    flex: 1;
    min-width: 0;
}

.team-name-header {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.3;
    text-align: left;
}

.team-gender-counts {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.gender-count-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.gender-count-item.men-count {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.gender-count-item.men-count i {
    color: #3b82f6;
}

.gender-count-item.women-count {
    background: rgba(236, 72, 153, 0.1);
    color: #ec4899;
}

.gender-count-item.women-count i {
    color: #ec4899;
}

.team-captain-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 0.3rem;
}

.team-captain-header i {
    color: var(--secondary-color);
}

.captain-photo-header {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--secondary-color);
    box-shadow: 0 2px 8px rgba(234, 88, 12, 0.3);
    flex-shrink: 0;
}

.team-players-count-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.team-players-count {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.team-players-count i {
    color: var(--primary-color);
}

/* Team Card Body */
.team-card-body {
    padding: 1.5rem;
}

/* View Players Button */
.btn-view-players {
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-hover) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(234, 88, 12, 0.3);
}

.btn-view-players:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(234, 88, 12, 0.4);
}

.btn-view-players:active {
    transform: translateY(0);
}

.btn-icon {
    transition: transform 0.3s ease;
}

/* Players List Container */
.players-list-container {
    margin-top: 1rem;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.players-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.player-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    transition: all 0.3s ease;
    min-height: 80px;
    display: flex;
    align-items: center;
}

.player-item:hover {
    background: var(--bg-tertiary);
    border-color: var(--secondary-color);
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.15);
}

.player-item.player-captain {
    background: linear-gradient(135deg, rgba(234, 88, 12, 0.1) 0%, rgba(234, 88, 12, 0.05) 100%);
    border-color: var(--secondary-color);
    border-width: 2px;
}

.player-item.player-captain .player-name-item {
    font-weight: 700;
    color: var(--secondary-color);
}

.player-photo-small {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--secondary-color);
    box-shadow: 0 4px 15px rgba(234, 88, 12, 0.4);
    flex-shrink: 0;
}

/* Captain Player Specific Styling */
.captain-player-item {
    background: var(--bg-secondary);
    border: 2px solid var(--secondary-color);
    box-shadow: 0 5px 15px rgba(234, 88, 12, 0.2);
    padding: 1.25rem 1.5rem;
    min-height: 80px;
}

.captain-player-item .player-photo-small {
    width: 110px;
    height: 110px;
    border: 3px solid var(--secondary-color);
    box-shadow: 0 5px 18px rgba(234, 88, 12, 0.4);
}

.player-photo-placeholder {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2.5rem;
    border: 3px solid var(--secondary-color);
    box-shadow: 0 4px 15px rgba(234, 88, 12, 0.4);
    flex-shrink: 0;
}

.player-info-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    width: 100%;
}

.player-info-left {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.player-name-item {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.15rem;
    text-align: left;
    margin: 0;
}

.captain-player-item .player-name-item {
    color: var(--secondary-color);
    font-weight: 700;
}

.player-role-item {
    background: var(--secondary-light);
    color: var(--secondary-color);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-block;
    width: fit-content;
}

.player-gender-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    width: fit-content;
}

.player-gender-item.men {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.player-gender-item.women {
    background: rgba(236, 72, 153, 0.1);
    color: #ec4899;
}

/* No Players Message */
.no-players-message {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.no-players-message i {
    font-size: 2.5rem;
    color: var(--text-tertiary);
    margin-bottom: 1rem;
    display: block;
}

.no-players-message p {
    font-size: 1rem;
    margin: 0;
}

/* Loading & Error States */
.loading-spinner {
    text-align: center;
    padding: 3rem;
    font-size: 1.5rem;
    color: var(--primary-color);
    grid-column: 1 / -1;
}

.loading-spinner i {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

.error-message {
    text-align: center;
    padding: 3rem;
    font-size: 1.2rem;
    color: var(--danger);
    grid-column: 1 / -1;
}

/* Unsold Players Section */
.unsold-players-section {
    padding: 4rem 0;
    background: var(--bg-secondary);
    margin-top: 3rem;
}

.unsold-section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.unsold-section-title i {
    color: var(--secondary-color);
}

.unsold-section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
}

.unsold-category-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    border: 2px solid transparent;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.unsold-category-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--secondary-color) 0%, transparent 100%);
    opacity: 0.1;
    border-radius: 0 15px 0 100%;
}

.unsold-category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(234, 88, 12, 0.15);
}

.unsold-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-light);
}

.unsold-category-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.unsold-category-count {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-hover) 100%);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(234, 88, 12, 0.3);
}

.unsold-players-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0.75rem;
}

.unsold-player-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.unsold-player-item:hover {
    background: var(--bg-secondary);
    border-color: var(--secondary-color);
    transform: translateX(5px);
}

.unsold-player-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
    flex: 1;
}

.unsold-player-gender {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    flex-shrink: 0;
}

.unsold-player-gender.men {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.unsold-player-gender.women {
    background: rgba(236, 72, 153, 0.1);
    color: #ec4899;
}

/* Responsive Design */
@media (max-width: 768px) {
    .team-card-header {
        flex-direction: column;
        text-align: left;
        gap: 1rem;
    }

    .team-logo-container {
        margin: 0;
    }

    .team-name-header {
        font-size: 1.3rem;
        text-align: left;
    }

    .player-item {
        padding: 1rem;
        min-height: auto;
    }

    .captain-player-item {
        padding: 1.25rem;
        min-height: auto;
    }

    .player-info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .player-info-left {
        width: 100%;
    }

    .player-photo-small,
    .player-photo-placeholder {
        width: 80px;
        height: 80px;
        align-self: flex-end;
    }

    .captain-player-item .player-photo-small {
        width: 90px;
        height: 90px;
    }

    .player-name-item {
        font-size: 1rem;
    }

    .unsold-players-list {
        grid-template-columns: 1fr;
    }

    .unsold-category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .unsold-section-title {
        font-size: 1.5rem;
        flex-direction: column;
        gap: 0.5rem;
    }
}