import streamlit as st import pandas as pd import plotly.express as px from datetime import datetime # --- 1. DATA STRUCTURE FOR BioDS CONTENT --- SPACE_DATA = { "MilkyWayGalaxy": { "title": "Milky Way Galaxy: Local Celestial Bodies & Stars", "items": [ {"id": "MW_JUPITER", "name": "Jupiter Planet", "color": "0xDDAA00", "detail": "Giant gas planet. Key focus in astrobiology for its moon Europa. Its massive radiation belts make life challenging. Features complex atmospheric biology models.", "health_pct": 85, "moons": 95, "direction": "North-East Ecliptic", "surface": "Gaseous/Icy", "air_index": "N/A (Gas Giant)", "human_like": "None", "perplexity": 0.98}, {"id": "MW_SATURN", "name": "Saturn Moon Titan", "color": "0xAAAAFF", "detail": "Titan has a dense atmosphere and stable liquid methane on its surface. Considered highly promising for exotic life forms, utilizing non-water solvents.", "health_pct": 92, "moons": 0, "direction": "South Celestial Pole", "surface": "Icy/Liquid Methane", "air_index": "High Methane/Nitrogen", "human_like": "Low Probability", "perplexity": 0.95}, {"id": "MW_ORION", "name": "Orion Nebula (M42)", "color": "0xFF5555", "detail": "Massive star formation region, a cosmic lab for pre-biotic chemistry. Intense UV radiation shapes the biology of dust grains and molecular clouds.", "health_pct": 78, "moons": "N/A", "direction": "Galactic Center", "surface": "Gas/Dust Cloud", "air_index": "Molecular Hydrogen", "human_like": "Zero", "perplexity": 0.88}, {"id": "MW_SUN", "name": "The Sun (G2V Star)", "color": "0xFFFF55", "detail": "Our star, the ultimate source of energy for terrestrial life. Its habitable zone is the core region for Earth-based biology. Future research focuses on solar flare resilience.", "health_pct": 99, "moons": "N/A", "direction": "Sol Centerpoint", "surface": "Plasma", "air_index": "Hydrogen/Helium", "human_like": "Zero", "perplexity": 0.99}, {"id": "MW_EARTH", "name": "Earth's Biosphere", "color": "0x00FF00", "detail": "A control point for all space biology: the only known planet to harbor life. Its complex ecosystem is a benchmark for evaluating life signatures elsewhere.", "health_pct": 65, "moons": 1, "direction": "Local Arm Segment", "surface": "Solid/Liquid Water", "air_index": "Excellent (N2/O2)", "human_like": "Benchmark", "perplexity": 0.65}, {"id": "MW_MARS", "name": "Mars Planet (Terraforming)", "color": "0xFF5500", "detail": "A prime target for terraforming and searching for past microbial life. Current biology focuses on permafrost extremophiles and atmospheric oxygenation projects.", "health_pct": 75, "moons": 2, "direction": "Inner Solar System", "surface": "Rocky (Iron Oxide)", "air_index": "High CO2", "human_like": "Low, potential for settlement", "perplexity": 0.70}, {"id": "MW_VENUS", "name": "Venus Atmosphere", "color": "0xFF88CC", "detail": "A highly acidic and hot surface, but the upper atmosphere is temperate. Hypothesized cloud-based extremophile life forms utilizing sulfur compounds are a key research topic.", "health_pct": 55, "moons": 0, "direction": "Inner Solar System", "surface": "Molten/Volcanic", "air_index": "Sulfuric Acid/CO2", "human_like": "Zero", "perplexity": 0.85}, {"id": "MW_URANUS", "name": "Uranus Ice Giant", "color": "0x00AAFF", "detail": "An ice giant with a complex, cold atmosphere. Its unique axial tilt presents challenges for modeling internal heat and potential deep-atmospheric biological zones.", "health_pct": 82, "moons": 27, "direction": "Outer Solar System", "surface": "Gas/Ice", "air_index": "Hydrogen/Helium/Methane", "human_like": "None", "perplexity": 0.90}, {"id": "MW_NEPTUNE", "name": "Neptune Triton Moon", "color": "0x0055FF", "detail": "Neptune's largest moon, Triton, is geologically active with cryovolcanoes. Subsurface liquid nitrogen or water oceans make it a candidate for exotic subsurface life.", "health_pct": 88, "moons": 14, "direction": "Outer Solar System", "surface": "Nitrogen Ice", "air_index": "Trace Nitrogen/Methane", "human_like": "Extremophiles", "perplexity": 0.93}, {"id": "MW_ALPHACEN", "name": "Alpha Centauri A", "color": "0xFFFF00", "detail": "The nearest star system. Centauri A is a G-type star, similar to the Sun, making its habitable zone a high-priority target for exoplanetary exploration.", "health_pct": 94, "moons": "Unknown", "direction": "Proxima Vicinity", "surface": "Plasma", "air_index": "Hydrogen/Helium", "human_like": "Medium Probability", "perplexity": 0.75}, {"id": "MW_BETELG", "name": "Betelgeuse (Red Supergiant)", "color": "0xFF0000", "detail": "A massive, dying star. Its current instability and eventual supernova will sterilize a vast volume of space, but its outer regions currently host dense dust clouds for chemistry.", "health_pct": 20, "moons": "N/A", "direction": "Orion Constellation", "surface": "Supergiant Plasma", "air_index": "Heavy Elements", "human_like": "Zero", "perplexity": 0.99}, {"id": "MW_TRAPPIST", "name": "TRAPPIST-1 System", "color": "0xAA00FF", "detail": "A system of seven Earth-sized planets orbiting an ultra-cool dwarf star. Multiple planets are within the theoretical habitable zone, making it a primary focus for atmospheric analysis.", "health_pct": 85, "moons": "Varies", "direction": "Aquarius Constellation", "surface": "Rocky/Water-World", "air_index": "Complex, analyzing", "human_like": "High Probability", "perplexity": 0.60}, ] }, "AndromedaGalaxy": { "title": "Andromeda Galaxy (M31): Neighboring Mysteries", "items": [ {"id": "AND_CORE", "name": "Andromeda Core Region", "color": "0xFFFFFF", "detail": "A dense, high-metallicity environment with rapid star birth. High stellar density increases the chances of close-proximity gravitational events, impacting planetary stability.", "health_pct": 70, "moons": "Unknown", "direction": "Approaching MW", "surface": "Dense Stellar", "air_index": "Very Low", "human_like": "Very Low", "perplexity": 0.93}, {"id": "AND_HALO", "name": "Dark Matter Halo Density", "color": "0x555555", "detail": "The invisible gravitational structure. Interaction between dark matter and regular matter is theorized to influence planetary thermal gradients and internal heat.", "health_pct": 50, "moons": "N/A", "direction": "Perpendicular Spin", "surface": "Non-Baryonic", "air_index": "Vacuum", "human_like": "Zero", "perplexity": 0.99}, {"id": "AND_CANDIDATE_P", "name": "Candidate Exoplanet System", "color": "0xAAFFFF", "detail": "Hypothetical system in M31's spiral arms. Search for radio signals (SETI) from Andromeda is ongoing, providing key data points for non-local biology.", "health_pct": 88, "moons": 4, "direction": "M31 Outer Arm", "surface": "Rocky/Super-Earth", "air_index": "Argon/CO2", "human_like": "Possible", "perplexity": 0.77}, ] }, "Interstellar": { "title": "Interstellar Medium & Boundary Layers", "items": [ {"id": "INT_OORT", "name": "Oort Cloud", "color": "0x00AAFF", "detail": "The most distant region of our Solar System, a reservoir of comets. Contains pristine biological precursors (ices, hydrocarbons) crucial for studying panspermia theories.", "health_pct": 80, "moons": "N/A", "direction": "Solar System Edge", "surface": "Water Ice/Rock", "air_index": "Vacuum", "human_like": "Zero", "perplexity": 0.96}, {"id": "INT_KUIPER", "name": "Kuiper Belt Objects", "color": "0x55FFAA", "detail": "Region beyond Neptune, home to dwarf planets and small bodies. Its objects (like Pluto) show cryovolcanism, suggesting subsurface oceans—potential habitats for extremophiles.", "health_pct": 90, "moons": "Varies", "direction": "Ecliptic Plane", "surface": "Methane/Nitrogen Ice", "air_index": "Trace Methane", "human_like": "Extremophiles", "perplexity": 0.89}, {"id": "INT_MEDIUM", "name": "Interstellar Medium (ISM)", "color": "0xAA55FF", "detail": "The gas and dust between star systems. Site of complex molecule synthesis, including amino acids, which are then delivered to protoplanetary disks.", "health_pct": 75, "moons": "N/A", "direction": "Between Stars", "surface": "Atomic Gas/Dust", "air_index": "Atomic/Molecular H", "human_like": "Zero", "perplexity": 0.92}, {"id": "INT_HELIO", "name": "Heliopause Boundary", "color": "0xCCCCFF", "detail": "The magnetic boundary where the solar wind meets the interstellar medium. This shield protects the solar system's inner biology from the majority of galactic cosmic rays.", "health_pct": 98, "moons": "N/A", "direction": "Outbound Velocity Vector", "surface": "Plasma/Magnetic Field", "air_index": "Very Low Density", "human_like": "Indirect Shielding", "perplexity": 0.97}, ] }, "OtherGalaxies": { "title": "Other Galaxies: Diverse Cosmic Habitats", "items": [ {"id": "OG_TRIANGULUM", "name": "Triangulum Galaxy (M33)", "color": "0xFF00AA", "detail": "The third largest galaxy in the Local Group. High rate of star formation, leading to a younger population of potentially habitable exoplanets.", "health_pct": 88, "moons": "Unknown", "direction": "Local Group Edge", "surface": "Spiral Arms", "air_index": "High Star Gas", "human_like": "Medium", "perplexity": 0.70}, {"id": "OG_WHIRLPOOL", "name": "Whirlpool Galaxy (M51)", "color": "0xAAFF00", "detail": "A classic interacting spiral galaxy. Merging creates shockwaves and intense compression, triggering stellar explosions that sterilize local star systems.", "health_pct": 68, "moons": "Unknown", "direction": "Interacting", "surface": "Dense Dust", "air_index": "Low", "human_like": "Low", "perplexity": 0.95}, {"id": "OG_CARTWHEEL", "name": "Cartwheel Galaxy", "color": "0x00FFAA", "detail": "A lenticular galaxy that was ringed by a high-speed collision. The expanding ring is a transient region of intense star birth and high-energy events.", "health_pct": 72, "moons": "Unknown", "direction": "Expanding Ring", "surface": "High Energy", "air_index": "Ionized Gas", "human_like": "Very Low", "perplexity": 0.90}, ] }, "BlackHoles": { "title": "Black Holes: Gravity's Biological Frontiers", "items": [ {"id": "BH_SAG_A", "name": "Sagittarius A* (Supermassive)", "color": "0xFF8888", "detail": "The supermassive black hole at the center of our galaxy. Its radiation effects and gravitational influence shape the stellar orbits and dust cloud chemistry nearby.", "health_pct": 40, "moons": "N/A", "direction": "Galactic Center", "surface": "Singularity", "air_index": "Accretion Disk", "human_like": "Zero", "perplexity": 0.99}, {"id": "BH_M87", "name": "M87's Black Hole (Supermassive)", "color": "0xAAAAAA", "detail": "The first black hole imaged. Its massive jets extend for thousands of light-years, impacting the entire M87 cluster's biology by stripping gas from forming galaxies.", "health_pct": 30, "moons": "N/A", "direction": "Active Jetting", "surface": "Event Horizon", "air_index": "Relativistic Plasma", "human_like": "Zero", "perplexity": 0.99}, {"id": "BH_V404CYGNI", "name": "V404 Cygni (Stellar Mass)", "color": "0x00FFFF", "detail": "A highly active stellar-mass black hole in a binary system, known for frequent X-ray flares. The intense burst radiation is highly mutagenic to any biological neighbors.", "health_pct": 55, "moons": "N/A", "direction": "Local Source", "surface": "Binary System", "air_index": "High X-ray Flux", "human_like": "Zero", "perplexity": 0.97}, {"id": "BH_GROJ1655", "name": "GRO J1655-40 (Stellar Mass)", "color": "0xCC00AA", "detail": "An exceptionally fast-spinning black hole. The frame-dragging effect (Lense-Thirring effect) around it creates unique environmental physics that could theoretically affect orbiting matter.", "health_pct": 45, "moons": "N/A", "direction": "Rapid Spin", "surface": "Accretion Disk", "air_index": "X-ray/Gamma", "human_like": "Zero", "perplexity": 0.98}, {"id": "BH_PRIMORDIAL", "name": "Theoretic Primordial BH", "color": "0x333333", "detail": "Hypothesized to have formed in the early universe. Could potentially be a component of dark matter, and their minimal interaction makes them irrelevant to biological systems.", "health_pct": 5, "moons": "N/A", "direction": "Randomized", "surface": "Theoretic", "air_index": "Vacuum", "human_like": "Zero", "perplexity": 1.00}, ] } } # --- 2. PAGE CONFIGURATION --- st.set_page_config(page_title="BioDS - Space Biology Data System", page_icon="🔭", layout="wide") # --- 3. CONSTANTS --- ACCENT_COLOR = "#00CCFF" # --- 4. SESSION STATE INITIALIZATION --- if 'page' not in st.session_state: st.session_state.page = "app" if 'current_section' not in st.session_state: st.session_state.current_section = list(SPACE_DATA.keys())[0] if SPACE_DATA else None if 'selected_item' not in st.session_state: st.session_state.selected_item = None if 'dashboard_section' not in st.session_state: st.session_state.dashboard_section = list(SPACE_DATA.keys())[0] if SPACE_DATA else None # --- 5. NAVIGATION --- def render_navbar(): """Renders the navigation bar.""" st.markdown(f"""