import streamlit as st
import sys, os
sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
st.set_page_config(
page_title="MathMind AI",
page_icon="🧮",
layout="centered",
initial_sidebar_state="auto",
)
from streamlit_app.utils.auth import is_logged_in
from streamlit_app.utils.ui import apply_theme
apply_theme()
# ── Landing page ───────────────────────────────────────────────────────────────
st.markdown("""
🧮 MathMind AI
Your personal AI math tutor for Grades 6 – 12
""", unsafe_allow_html=True)
st.markdown('What you get
', unsafe_allow_html=True)
col1, col2, col3 = st.columns(3)
with col1:
st.markdown(
"""
🧠 Adaptive Explanations
Grade-calibrated, step-by-step answers to any math question.
""",
unsafe_allow_html=True,
)
with col2:
st.markdown(
"""
📝 Mini-Tests
Prove your understanding with 5 questions and instant feedback.
""",
unsafe_allow_html=True,
)
with col3:
st.markdown(
"""
🏆 Badges & Streaks
Earn rewards and track your daily learning consistency.
""",
unsafe_allow_html=True,
)
st.divider()
if is_logged_in():
st.success(f"Welcome back! You're logged in as **{st.session_state.get('user_email', '')}**")
col_a, col_b = st.columns(2)
with col_a:
st.page_link("pages/2_Tutor.py", label="▶️ Start Learning", use_container_width=True)
with col_b:
st.page_link("pages/3_Dashboard.py", label="📊 My Dashboard", use_container_width=True)
else:
st.page_link("pages/1_Login.py", label="🚀 Get Started — Login or Sign Up", use_container_width=True)