import streamlit as st

# Configure Streamlit page
st.set_page_config(
    layout="wide", 
    page_title="Spark NLP Demos App", 
    initial_sidebar_state="auto"
)

# Custom CSS for better styling
st.markdown("""
    <style>
        .main-title {
            font-size: 36px;
            color: #4A90E2;
            font-weight: bold;
            text-align: center;
        }
        .sub-title {
            font-size: 24px;
            color: #333333;
            margin-top: 20px;
        }
        .section {
            background-color: #f9f9f9;
            padding: 15px;
            border-radius: 10px;
            margin-top: 20px;
        }
        .section h2 {
            font-size: 22px;
            color: #4A90E2;
        }
        .section p, .section ul {
            color: #666666;
        }
        .link {
            color: #4A90E2;
            text-decoration: none;
        }
    </style>
""", unsafe_allow_html=True)

# Home page content
st.markdown('<div class="main-title">Spark NLP: State-of-the-Art Natural Language Processing</div>', unsafe_allow_html=True)

st.markdown("""
<div class="section">
    <p>Spark NLP is a state-of-the-art Natural Language Processing library built on top of Apache Spark. It provides performant & accurate NLP annotations for machine learning pipelines that scale in a distributed environment. With 36,000+ pretrained models and pipelines in over 200 languages, Spark NLP supports a wide range of NLP tasks including:</p>
    <ul>
        <li>Tokenization</li>
        <li>Named Entity Recognition</li>
        <li>Sentiment Analysis</li>
        <li>Text Classification</li>
        <li>Machine Translation</li>
        <li>Summarization</li>
        <li>Question Answering</li>
        <li>Text Generation</li>
        <li>Image Classification</li>
        <li>Automatic Speech Recognition</li>
        <li>And many more</li>
    </ul>
</div>
""", unsafe_allow_html=True)

st.markdown('<div class="sub-title">Key Features</div>', unsafe_allow_html=True)

st.markdown("""
<div class="section">
    <ul>
        <li>Integration with popular transformers like BERT, RoBERTa, ALBERT, and more</li>
        <li>Support for Python, R, and JVM (Java, Scala, Kotlin)</li>
        <li>GPU support for accelerated processing</li>
        <li>Easy integration with Spark ML functions</li>
    </ul>
</div>
""", unsafe_allow_html=True)

st.markdown('<div class="sub-title">Community & Support</div>', unsafe_allow_html=True)

st.markdown("""
<div class="section">
    <ul>
        <li><a class="link" href="https://sparknlp.org/" target="_blank">Official Website</a>: Documentation and examples</li>
        <li><a class="link" href="https://join.slack.com/t/spark-nlp/shared_invite/zt-198dipu77-L3UWNe_AJ8xqDk0ivmih5Q" target="_blank">Slack</a>: Live discussion with the community and team</li>
        <li><a class="link" href="https://github.com/JohnSnowLabs/spark-nlp" target="_blank">GitHub</a>: Bug reports, feature requests, and contributions</li>
        <li><a class="link" href="https://medium.com/spark-nlp" target="_blank">Medium</a>: Spark NLP articles</li>
        <li><a class="link" href="https://www.youtube.com/channel/UCmFOjlpYEhxf_wJUDuz6xxQ/videos" target="_blank">YouTube</a>: Video tutorials</li>
    </ul>
</div>
""", unsafe_allow_html=True)

st.markdown('<div class="sub-title">Quick Links</div>', unsafe_allow_html=True)

st.markdown("""
<div class="section">
    <ul>
        <li><a class="link" href="https://sparknlp.org/docs/en/quickstart" target="_blank">Getting Started</a></li>
        <li><a class="link" href="https://nlp.johnsnowlabs.com/models" target="_blank">Pretrained Models</a></li>
        <li><a class="link" href="https://github.com/JohnSnowLabs/spark-nlp/tree/master/examples/python/annotation/text/english" target="_blank">Example Notebooks</a></li>
        <li><a class="link" href="https://sparknlp.org/docs/en/install" target="_blank">Installation Guide</a></li>
    </ul>
</div>
""", unsafe_allow_html=True)