import streamlit as st def feature_card(icon, title, description, link=None): """Display a feature card with icon, title, and description""" st.markdown(f"""
{icon}

{title}

{description}

{f'Learn More →' if link else ''}
""", unsafe_allow_html=True) def job_card(job): """Display a job posting card""" st.markdown(f"""

{job.get('title', 'N/A')}

🏢 {job.get('company', 'N/A')} | 📍 {job.get('location', 'N/A')}

💼 {job.get('job_type', 'N/A')} | 💰 {job.get('salary_range', 'N/A')}

{job.get('description', 'N/A')[:150]}...

Posted: {job.get('posted_date', 'N/A')}
""", unsafe_allow_html=True) def course_card(course): """Display a course card""" st.markdown(f"""

{course.get('title', 'N/A')}

{course.get('level', 'N/A')}

👨‍🏫 {course.get('instructor', 'N/A')} | ⏱️ {course.get('duration', 'N/A')}

{course.get('description', 'N/A')[:120]}...

{'FREE' if course.get('is_free') else f"₹{course.get('price', 0)}"} ⭐ {course.get('rating', 0.0)}
""", unsafe_allow_html=True) def success_story_card(story): """Display a success story card""" st.markdown(f"""

{story.get('name', 'Anonymous')}

{story.get('title', 'N/A')}

"{story.get('story', 'N/A')[:200]}..."

{story.get('category', 'General')} {story.get('date_posted', 'N/A')}
""", unsafe_allow_html=True) def mentor_card(mentor): """Display a mentor profile card""" st.markdown(f"""

{mentor.get('name', 'N/A')}

💼 {mentor.get('expertise', 'N/A')}

{mentor.get('bio', 'N/A')[:150]}...

⭐ {mentor.get('rating', 0.0)} ({mentor.get('total_mentees', 0)} mentees) ✅ {mentor.get('available_slots', 0)} slots
""", unsafe_allow_html=True) def stat_card(icon, number, label, color="#667eea"): """Display a statistics card""" st.markdown(f"""
{icon}
{number}

{label}

""", unsafe_allow_html=True) def emergency_button(service, number, description): """Display an emergency contact button""" if st.button(f"📞 {service}: {number}", key=f"emergency_{service}"): st.markdown(f"""

📞 {service}

{number}

{description}

💡 Tip: Save this number in your phone for quick access

""", unsafe_allow_html=True)